@thibezer/ui-components-kit 2.12.3 → 2.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/canvas.js CHANGED
@@ -1,16 +1,16 @@
1
- var gi = Object.defineProperty;
2
- var vi = (a, t, e) => t in a ? gi(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var f = (a, t, e) => vi(a, typeof t != "symbol" ? t + "" : t, e);
1
+ var vi = Object.defineProperty;
2
+ var yi = (a, t, e) => t in a ? vi(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var f = (a, t, e) => yi(a, typeof t != "symbol" ? t + "" : t, e);
4
4
  /* empty css */
5
5
  import y from "leaflet";
6
- import { e as T, p as V, r as Et, b as kt, a as Zt, o as Xt, c as Je, l as yi } from "./leaflet-PPDKB6Dd.js";
7
- import { f as $r } from "./leaflet-PPDKB6Dd.js";
8
- import { f as Tt, a as Fo } from "./alvo-digitavel-CzCvNVQ3.js";
9
- import { p as bi, c as xi, n as bt, e as Yt, m as Qe, a as Kt, b as it, d as je, f as xt, g as He, h as Oo, i as Ge, j as Pt, k as Pi, l as ot, C as Ue, o as Jt, I as Li, s as mt, q as ct, v as Si, M as Ci, Z as to, r as Mi, t as Ai, u as wi, w as eo, x as oo, A as zi, y as _t, z as ke, B as io, D as Ei, E as ki, F as ao, G as Ii, H as dt, J as ht, K as Lt, L as W, R as We, N as Ti, O as No, P as _i, Q as Di, S as qi, T as $i } from "./motor-CXjQjVba.js";
10
- import { U as Or, V as Nr, W as Rr, X as Br, Y as Vr, _ as jr, $ as Hr, a0 as Gr, a1 as Ur, a2 as Wr, a3 as Zr, a4 as Xr, a5 as Yr, a6 as Kr, a7 as Jr, a8 as Qr, a9 as tc, aa as ec, ab as oc, ac as ic, ad as ac, ae as nc, af as sc, ag as rc, ah as cc, ai as lc, aj as dc, ak as hc, al as uc } from "./motor-CXjQjVba.js";
6
+ import { e as T, p as V, r as Et, b as kt, a as Zt, o as Xt, c as Qe, l as bi } from "./leaflet-PPDKB6Dd.js";
7
+ import { f as Fr } from "./leaflet-PPDKB6Dd.js";
8
+ import { f as Tt, a as Oo } from "./alvo-digitavel-CzCvNVQ3.js";
9
+ import { p as xi, c as Pi, n as bt, e as Yt, m as to, a as Kt, b as it, d as He, f as xt, g as Ge, h as No, i as Ue, j as Pt, k as Li, l as ot, C as We, o as Jt, I as Ci, s as mt, q as ct, v as Si, M as Mi, Z as eo, r as Ai, t as wi, u as zi, w as oo, x as io, A as Ei, y as _t, z as Ie, B as ao, D as ki, E as Ii, F as no, G as Ti, H as dt, J as ht, K as Lt, L as W, R as Ze, N as _i, O as Ro, P as Di, Q as qi, S as $i, T as Fi } from "./motor-CXjQjVba.js";
10
+ import { U as Nr, V as Rr, W as Br, X as Vr, Y as jr, _ as Hr, $ as Gr, a0 as Ur, a1 as Wr, a2 as Zr, a3 as Xr, a4 as Yr, a5 as Kr, a6 as Jr, a7 as Qr, a8 as tc, a9 as ec, aa as oc, ab as ic, ac, ad as nc, ae as sc, af as rc, ag as cc, ah as lc, ai as dc, aj as hc, ak as uc, al as pc } from "./motor-CXjQjVba.js";
11
11
  import { L as Qt } from "./listener-bag-DQgv7OON.js";
12
- import { d as Fi, S as Oi } from "./ssr-safe-5cWfJP-s.js";
13
- const no = {
12
+ import { d as Oi, S as Ni } from "./ssr-safe-5cWfJP-s.js";
13
+ const so = {
14
14
  perimetroWeight: 1,
15
15
  fechamentoWeight: 1,
16
16
  vizinhoWeight: 1,
@@ -39,11 +39,11 @@ const no = {
39
39
  try {
40
40
  const t = typeof localStorage < "u" ? localStorage.getItem("gerencigeo_mapa_config") : null;
41
41
  if (t)
42
- return { ...no, ...JSON.parse(t) };
42
+ return { ...so, ...JSON.parse(t) };
43
43
  } catch (t) {
44
44
  console.error("Erro ao carregar configurações do mapa", t);
45
45
  }
46
- return { ...no };
46
+ return { ...so };
47
47
  }
48
48
  saveConfig(t) {
49
49
  this.config = { ...this.config, ...t }, typeof localStorage < "u" && localStorage.setItem("gerencigeo_mapa_config", JSON.stringify(this.config));
@@ -53,23 +53,23 @@ const no = {
53
53
  }
54
54
  };
55
55
  f(lt, "instance");
56
- let Ie = lt;
57
- const Ze = "sob-demanda", Ni = 700;
56
+ let Te = lt;
57
+ const Xe = "sob-demanda", Ri = 700;
58
58
  function te(a) {
59
59
  const t = typeof a == "string" ? a.trim().toLowerCase() : "";
60
- return t === "automatico" || t === "desligado" || t === "sob-demanda" ? t : Ze;
60
+ return t === "automatico" || t === "desligado" || t === "sob-demanda" ? t : Xe;
61
61
  }
62
62
  const Vt = /* @__PURE__ */ new WeakMap();
63
- function Ri(a) {
63
+ function Bi(a) {
64
64
  const t = a && typeof a == "object" ? a.options : void 0;
65
65
  return !!t && t.closeButton !== void 0 && t.autoPan !== void 0;
66
66
  }
67
- function Xe(a, t) {
67
+ function Ye(a, t) {
68
68
  const e = a ? Vt.get(a) : void 0;
69
69
  return e ? e.liberar(t) : t();
70
70
  }
71
- class Bi {
72
- constructor(t, e = Ze) {
71
+ class Vi {
72
+ constructor(t, e = Xe) {
73
73
  f(this, "liberados", 0);
74
74
  /** Verdadeiro durante o despacho síncrono de um clique no mapa (o Leaflet abre popups dentro dele). */
75
75
  f(this, "emClique", !1);
@@ -87,7 +87,7 @@ class Bi {
87
87
  this.map = t, this.modoAtual = e, this.original = t.addLayer;
88
88
  const o = this;
89
89
  t.addLayer = function(n) {
90
- return Ri(n) ? o.aoAbrir(this, n) : o.original.call(this, n);
90
+ return Bi(n) ? o.aoAbrir(this, n) : o.original.call(this, n);
91
91
  }, this.container = typeof t.getContainer == "function" ? t.getContainer() : null, (i = this.container) == null || i.addEventListener("click", this.marcarClique, !0), Vt.set(t, this);
92
92
  }
93
93
  get modo() {
@@ -125,14 +125,14 @@ class Bi {
125
125
  return (r = e.openPopup) == null ? void 0 : r.call(e, typeof e.getLatLng == "function" || s == null ? void 0 : s.latlng);
126
126
  });
127
127
  };
128
- o = setTimeout(i, Ni), e.on("dblclick", n), this.pendentes.set(e, i);
128
+ o = setTimeout(i, Ri), e.on("dblclick", n), this.pendentes.set(e, i);
129
129
  }
130
130
  cancelarPendentes() {
131
131
  for (const t of [...this.pendentes.values()]) t();
132
132
  this.pendentes.clear();
133
133
  }
134
134
  }
135
- async function Vi(a, t, e, o) {
135
+ async function ji(a, t, e, o) {
136
136
  const i = a.getSize(), n = a.getBounds(), s = n.getSouthWest(), r = n.getNorthEast(), c = `${s.lng},${s.lat},${r.lng},${r.lat}`;
137
137
  let l = 0, d = 0;
138
138
  try {
@@ -159,26 +159,26 @@ async function Vi(a, t, e, o) {
159
159
  Consultando...
160
160
  </div>
161
161
  `);
162
- Xe(a, () => m.openOn(a)), o.currentAbortController && o.currentAbortController.abort(), o.currentAbortController = new AbortController();
162
+ Ye(a, () => m.openOn(a)), o.currentAbortController && o.currentAbortController.abort(), o.currentAbortController = new AbortController();
163
163
  const g = o.currentAbortController.signal, u = setTimeout(() => {
164
164
  o.currentAbortController && o.currentAbortController.abort();
165
165
  }, 8e3);
166
166
  try {
167
167
  const M = typeof window < "u" && (window.location.origin.includes("localhost") || window.location.origin.includes("127.0.0.1") || window.location.origin.includes("[::1]")) ? `${e}/proxy/sigef?url=${encodeURIComponent(h)}` : `${window.location.origin}/api.php?action=proxy_sigef&url=${encodeURIComponent(h)}`, z = await fetch(M, { signal: g });
168
168
  clearTimeout(u);
169
- let S = null;
169
+ let C = null;
170
170
  if (z.ok) {
171
171
  const L = await z.text();
172
172
  try {
173
- S = JSON.parse(L);
173
+ C = JSON.parse(L);
174
174
  } catch {
175
- S = null;
175
+ C = null;
176
176
  }
177
177
  }
178
- if (S && S.features && S.features.length > 0) {
179
- const L = S.features[0], b = L.properties || {}, x = String(L.id || b.parcela_codigo || b.co_parcela || b.id_parcela || ""), P = String(b.nome_area || b.nome_imovel || "Imóvel Sem Nome");
178
+ if (C && C.features && C.features.length > 0) {
179
+ const L = C.features[0], b = L.properties || {}, x = String(L.id || b.parcela_codigo || b.co_parcela || b.id_parcela || ""), P = String(b.nome_area || b.nome_imovel || "Imóvel Sem Nome");
180
180
  if (x) {
181
- const A = encodeURIComponent(x), E = `https://sigef.incra.gov.br/geo/exportar/parcela/shp/${A}/`, C = `https://sigef.incra.gov.br/geo/parcela/detalhe/${A}/`, w = document.createElement("div");
181
+ const A = encodeURIComponent(x), E = `https://sigef.incra.gov.br/geo/exportar/parcela/shp/${A}/`, S = `https://sigef.incra.gov.br/geo/parcela/detalhe/${A}/`, w = document.createElement("div");
182
182
  w.style.cssText = "font-family:var(--ui-fonte-base, sans-serif); color:rgba(255, 255, 255, 0.9); line-height:1.4; min-width:180px;", w.innerHTML = `
183
183
  <div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; padding-bottom:5px; border-bottom:1px solid rgba(255, 255, 255, 0.1);">
184
184
  <span style="font-weight:700; font-size:11px; color:#10b981; text-transform:uppercase; letter-spacing:0.5px;">SIGEF</span>
@@ -199,7 +199,7 @@ async function Vi(a, t, e, o) {
199
199
  <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
200
200
  Importar Confrontante (CSV)
201
201
  </button>
202
- <a href="${C}" target="_blank" rel="noopener noreferrer" style="display:flex; align-items:center; justify-content:center; gap:4px; padding:4px 6px; background:rgba(255, 255, 255, 0.05); border:1px solid rgba(255, 255, 255, 0.1); color:rgba(255, 255, 255, 0.7); font-size:10px; font-weight:600; border-radius:5px; text-decoration:none; cursor:pointer;">
202
+ <a href="${S}" target="_blank" rel="noopener noreferrer" style="display:flex; align-items:center; justify-content:center; gap:4px; padding:4px 6px; background:rgba(255, 255, 255, 0.05); border:1px solid rgba(255, 255, 255, 0.1); color:rgba(255, 255, 255, 0.7); font-size:10px; font-weight:600; border-radius:5px; text-decoration:none; cursor:pointer;">
203
203
  <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
204
204
  Abrir no SIGEF
205
205
  </a>
@@ -239,47 +239,47 @@ async function Vi(a, t, e, o) {
239
239
  p.style.cursor = "";
240
240
  }
241
241
  }
242
- function ji(a, t) {
242
+ function Hi(a, t) {
243
243
  if (!a) return;
244
244
  const e = Math.floor(a.getZoom()), o = Math.max(e, 12), i = Math.min(e + 1, 19), n = t.pad(0.2), s = ["mt0", "mt1", "mt2", "mt3"];
245
245
  let r = 0;
246
246
  const c = 32;
247
247
  for (let l = o; l <= i && r < c; l++) {
248
- const d = n.getNorthWest(), h = n.getSouthEast(), p = so(d.lng, l), m = so(h.lng, l), g = ro(d.lat, l), u = ro(h.lat, l);
248
+ const d = n.getNorthWest(), h = n.getSouthEast(), p = ro(d.lng, l), m = ro(h.lng, l), g = co(d.lat, l), u = co(h.lat, l);
249
249
  for (let v = p; v <= m && r < c; v++)
250
250
  for (let M = g; M <= u && r < c; M++) {
251
- const S = `https://${s[(v + M) % s.length]}.google.com/vt/lyrs=s,h&x=${v}&y=${M}&z=${l}`, L = new Image();
252
- L.src = S, r++;
251
+ const C = `https://${s[(v + M) % s.length]}.google.com/vt/lyrs=s,h&x=${v}&y=${M}&z=${l}`, L = new Image();
252
+ L.src = C, r++;
253
253
  }
254
254
  }
255
255
  }
256
- function so(a, t) {
256
+ function ro(a, t) {
257
257
  return Math.floor((a + 180) / 360 * Math.pow(2, t));
258
258
  }
259
- function ro(a, t) {
259
+ function co(a, t) {
260
260
  const e = a * Math.PI / 180;
261
261
  return Math.floor(
262
262
  (1 - Math.log(Math.tan(e) + 1 / Math.cos(e)) / Math.PI) / 2 * Math.pow(2, t)
263
263
  );
264
264
  }
265
- const Hi = {
265
+ const Gi = {
266
266
  zoomSnap: 0.25,
267
267
  zoomDelta: 0.5,
268
268
  wheelPxPerZoomLevel: 90
269
269
  };
270
- function Gi(a, t) {
270
+ function Ui(a, t) {
271
271
  const e = a;
272
272
  return !e || !t || e._popup !== t ? !1 : (e._popup = null, !0);
273
273
  }
274
- function Ui(a) {
274
+ function Wi(a) {
275
275
  a.on("popupclose", (t) => {
276
- Gi(a, t.popup);
276
+ Ui(a, t.popup);
277
277
  });
278
278
  }
279
- class Wi {
279
+ class Zi {
280
280
  constructor(t) {
281
281
  f(this, "map", null);
282
- f(this, "configManager", Ie.getInstance());
282
+ f(this, "configManager", Te.getInstance());
283
283
  f(this, "config", this.configManager.getConfig());
284
284
  f(this, "apiBaseUrl", "/api");
285
285
  f(this, "bancoPontosGroup", y.layerGroup());
@@ -290,7 +290,7 @@ class Wi {
290
290
  f(this, "sigefState", {});
291
291
  /** Decide quando os popups do mapa abrem (ver `popup_gate.ts`). Existe enquanto houver mapa. */
292
292
  f(this, "popups", null);
293
- f(this, "modoPopups", Ze);
293
+ f(this, "modoPopups", Xe);
294
294
  this.controller = t;
295
295
  }
296
296
  /** Vale já, ou assim que o mapa for criado (o atributo `popups` pode ser lido antes do mapa existir). */
@@ -322,8 +322,8 @@ class Wi {
322
322
  scrollWheelZoom: !0,
323
323
  preferCanvas: this.config.preferCanvas !== void 0 ? this.config.preferCanvas : !0,
324
324
  zoomControl: !1,
325
- ...Hi
326
- }).setView([-23.7661, -53.3204], 14), this.popups = new Bi(this.map, this.modoPopups), this.listenConfigBroadcast(), this.applyMapStyles(), Ui(this.map), !this.map.getPane("sigefPane")) {
325
+ ...Gi
326
+ }).setView([-23.7661, -53.3204], 14), this.popups = new Vi(this.map, this.modoPopups), this.listenConfigBroadcast(), this.applyMapStyles(), Wi(this.map), !this.map.getPane("sigefPane")) {
327
327
  const i = this.map.createPane("sigefPane");
328
328
  i.style.zIndex = "390";
329
329
  }
@@ -363,25 +363,29 @@ class Wi {
363
363
  const t = this.containerElement || document.getElementById("mapa-triagem");
364
364
  t && (t.style.cursor = this.config.crosshair ? "crosshair" : "");
365
365
  }
366
+ fecharBroadcast() {
367
+ if (this.bc) {
368
+ try {
369
+ this.bc.close();
370
+ } catch {
371
+ }
372
+ this.bc = void 0;
373
+ }
374
+ }
366
375
  listenConfigBroadcast() {
367
- if (!(typeof BroadcastChannel > "u"))
376
+ if (!(typeof BroadcastChannel > "u")) {
377
+ this.fecharBroadcast();
368
378
  try {
369
379
  this.bc = new BroadcastChannel("gerencigeo_map_config"), this.bc.onmessage = (t) => {
370
380
  t.data === "RELOAD_REQUIRED" && (this.config = this.configManager.getConfig(), this.applyMapStyles(), window.dispatchEvent(new CustomEvent("gerencigeo:map_config_changed", { detail: this.config })));
371
381
  };
372
382
  } catch {
373
383
  }
384
+ }
374
385
  }
375
386
  destroy() {
376
387
  var t;
377
- if (this.sigefState.currentAbortController && (this.sigefState.currentAbortController.abort(), this.sigefState.currentAbortController = void 0), this.bc) {
378
- try {
379
- this.bc.close();
380
- } catch {
381
- }
382
- this.bc = void 0;
383
- }
384
- if (this.map) {
388
+ if (this.sigefState.currentAbortController && (this.sigefState.currentAbortController.abort(), this.sigefState.currentAbortController = void 0), this.fecharBroadcast(), this.map) {
385
389
  (t = this.popups) == null || t.destruir(), this.popups = null;
386
390
  try {
387
391
  this.map.off(), this.map.remove();
@@ -398,13 +402,13 @@ class Wi {
398
402
  }
399
403
  }
400
404
  preCarregarTilesRegiao(t) {
401
- ji(this.map, t);
405
+ Hi(this.map, t);
402
406
  }
403
407
  async consultarSigef(t) {
404
- this.map && await Vi(this.map, t, this.apiBaseUrl, this.sigefState);
408
+ this.map && await ji(this.map, t, this.apiBaseUrl, this.sigefState);
405
409
  }
406
410
  }
407
- const Zi = [
411
+ const Xi = [
408
412
  "verticesPane",
409
413
  "perimetroPane",
410
414
  "overlayPane",
@@ -415,7 +419,7 @@ const Zi = [
415
419
  "pane-homologados",
416
420
  "pane-homologados-pontos"
417
421
  ];
418
- class Xi {
422
+ class Yi {
419
423
  constructor(t, e, o) {
420
424
  f(this, "map");
421
425
  f(this, "mapContainer");
@@ -430,7 +434,7 @@ class Xi {
430
434
  this.selectionDiv || (this.selectionDiv = document.createElement("div"), this.selectionDiv.className = "cad-selection-box", this.selectionDiv.style.position = "absolute", this.selectionDiv.style.zIndex = "9999", this.selectionDiv.style.pointerEvents = "none", this.selectionDiv.style.display = "none", this.selectionDiv.style.borderRadius = "2px", this.mapContainer.style.position = "relative", this.mapContainer.appendChild(this.selectionDiv));
431
435
  }
432
436
  setPanesPointerEvents(t) {
433
- Zi.forEach((e) => {
437
+ Xi.forEach((e) => {
434
438
  const o = this.map.getPane(e);
435
439
  o && (o.style.pointerEvents = t);
436
440
  });
@@ -445,7 +449,7 @@ class Xi {
445
449
  this.selectionDiv.style.left = `${Math.round(r)}px`, this.selectionDiv.style.top = `${Math.round(c)}px`, this.selectionDiv.style.width = `${Math.round(n)}px`, this.selectionDiv.style.height = `${Math.round(s)}px`, o >= this.selectStartPos.x ? (this.selectionDiv.style.background = "rgba(14, 116, 144, 0.22)", this.selectionDiv.style.border = "1px solid #06b6d4") : (this.selectionDiv.style.background = "rgba(16, 185, 129, 0.22)", this.selectionDiv.style.border = "1px dashed #10b981");
446
450
  }
447
451
  finalizarSelecao(t, e, o) {
448
- var z, S, L, b, x, P, A, E, C;
452
+ var z, C, L, b, x, P, A, E, S;
449
453
  if (!this.isSelecting) return !1;
450
454
  this.isSelecting = !1, this.selectionDiv && (this.selectionDiv.style.display = "none"), this.map.closePopup();
451
455
  try {
@@ -455,7 +459,7 @@ class Xi {
455
459
  const i = this.mapContainer.getBoundingClientRect(), n = t.clientX - i.left, s = t.clientY - i.top, r = this.map.mouseEventToContainerPoint(t), c = Math.abs(n - this.selectStartPos.x), l = Math.abs(s - this.selectStartPos.y);
456
460
  if (c < 4 && l < 4) {
457
461
  const w = t.target;
458
- if (w && ((S = w.classList) != null && S.contains("leaflet-container") || w.id === "mapa-triagem" || (L = w.closest) != null && L.call(w, ".leaflet-pane"))) {
462
+ if (w && ((C = w.classList) != null && C.contains("leaflet-container") || w.id === "mapa-triagem" || (L = w.closest) != null && L.call(w, ".leaflet-pane"))) {
459
463
  const k = ((b = w.closest) == null ? void 0 : b.call(w, ".custom-leaflet-marker")) || ((x = w.closest) == null ? void 0 : x.call(w, ".custom-div-icon")), I = t.ctrlKey || t.metaKey || t.shiftKey;
460
464
  !k && !I && o();
461
465
  }
@@ -469,7 +473,7 @@ class Xi {
469
473
  y2: Math.max(this.selectStartPoint.y, r.y)
470
474
  }, h = r.x >= this.selectStartPoint.x ? "window" : "crossing";
471
475
  (A = (P = this.ctx).selecionarFeicoesNaCaixa) == null || A.call(P, d, h, t.ctrlKey || t.metaKey);
472
- const p = ((E = this.ctx.mapaController) == null ? void 0 : E.getMarkers()) || [], m = ((C = this.ctx.mapaController) == null ? void 0 : C.getVizinhosMarkers()) || [], g = [], u = [], v = !this.ctx.layerManager || this.ctx.layerManager.isLayerActiveAndSelectable("vertices"), M = !this.ctx.layerManager || this.ctx.layerManager.isLayerActiveAndSelectable("vizinhos");
476
+ const p = ((E = this.ctx.mapaController) == null ? void 0 : E.getMarkers()) || [], m = ((S = this.ctx.mapaController) == null ? void 0 : S.getVizinhosMarkers()) || [], g = [], u = [], v = !this.ctx.layerManager || this.ctx.layerManager.isLayerActiveAndSelectable("vertices"), M = !this.ctx.layerManager || this.ctx.layerManager.isLayerActiveAndSelectable("vizinhos");
473
477
  return v && p.forEach((w) => {
474
478
  const k = w.pontoId;
475
479
  if (!k) return;
@@ -496,32 +500,32 @@ class Xi {
496
500
  function gt(a) {
497
501
  return `pane-${a}`;
498
502
  }
499
- const Ro = ["poligono", "linha", "ponto", "texto"];
500
- function Bo(a, t) {
503
+ const Bo = ["poligono", "linha", "ponto", "texto"];
504
+ function Vo(a, t) {
501
505
  return `${gt(a)}-${t}`;
502
506
  }
503
507
  function U(a, t, e) {
504
- const o = a.getPane(gt(t)) ?? a.createPane(gt(t)), i = Bo(t, e);
508
+ const o = a.getPane(gt(t)) ?? a.createPane(gt(t)), i = Vo(t, e);
505
509
  if (!a.getPane(i)) {
506
510
  const n = a.createPane(i, o);
507
- n.style.zIndex = String((Ro.indexOf(e) + 1) * 100);
511
+ n.style.zIndex = String((Bo.indexOf(e) + 1) * 100);
508
512
  }
509
513
  return i;
510
514
  }
511
- const co = "ui-canvas-hit-test-estilo", he = 6, Yi = 4, Ki = 4, Dt = { poligono: 1, linha: 2, ponto: 3, texto: 3 };
512
- function Ji(a) {
515
+ const lo = "ui-canvas-hit-test-estilo", he = 6, Ki = 4, Ji = 4, Dt = { poligono: 1, linha: 2, ponto: 3, texto: 3 };
516
+ function Qi(a) {
513
517
  var i;
514
518
  const t = a.getRootNode(), e = t instanceof ShadowRoot ? t : document.head;
515
- if ((i = e.querySelector) != null && i.call(e, `#${co}`)) return;
519
+ if ((i = e.querySelector) != null && i.call(e, `#${lo}`)) return;
516
520
  const o = document.createElement("style");
517
- o.id = co, o.textContent = ".leaflet-pane > canvas { pointer-events: none !important; }", e.appendChild(o);
521
+ o.id = lo, o.textContent = ".leaflet-pane > canvas { pointer-events: none !important; }", e.appendChild(o);
518
522
  }
519
523
  const ee = /* @__PURE__ */ new WeakMap();
520
- function Vo(a, t, e) {
524
+ function jo(a, t, e) {
521
525
  let o = ee.get(a);
522
526
  o || (o = /* @__PURE__ */ new Map(), ee.set(a, o)), o.set(t, e);
523
527
  }
524
- function jo(a, t, e) {
528
+ function Ho(a, t, e) {
525
529
  const o = ee.get(a);
526
530
  (o == null ? void 0 : o.get(t)) === e && o.delete(t);
527
531
  }
@@ -529,7 +533,7 @@ function ue(a, t) {
529
533
  var e, o;
530
534
  return t + (((e = a.options) == null ? void 0 : e.stroke) === !1 ? 0 : (((o = a.options) == null ? void 0 : o.weight) ?? 0) / 2);
531
535
  }
532
- function Qi(a, t, e) {
536
+ function ta(a, t, e) {
533
537
  let o = 1 / 0;
534
538
  for (const i of a) {
535
539
  for (let n = 1; n < i.length; n++)
@@ -538,40 +542,40 @@ function Qi(a, t, e) {
538
542
  }
539
543
  return o;
540
544
  }
541
- function ta(a) {
545
+ function ea(a) {
542
546
  const t = a._pxBounds;
543
547
  return t ? (t.max.x - t.min.x) * (t.max.y - t.min.y) : 0;
544
548
  }
545
- function ea(a, t, e) {
549
+ function oa(a, t, e) {
546
550
  var o, i, n;
547
551
  if (!((o = a.options) != null && o.interactive)) return null;
548
552
  if (a._point && a._radius !== void 0) {
549
- const s = a._radius, r = a._radiusY ?? a._radius, c = a._point.distanceTo(t), l = (s + r) / 2, d = e === "ponto" ? Yi : ue(a, he);
553
+ const s = a._radius, r = a._radiusY ?? a._radius, c = a._point.distanceTo(t), l = (s + r) / 2, d = e === "ponto" ? Ki : ue(a, he);
550
554
  return a.options.fill !== !1 && e === "poligono" ? c <= l + 1 ? 0 : null : e === "ponto" ? c <= l + d ? c : null : Math.abs(c - l) <= d ? Math.abs(c - l) : null;
551
555
  }
552
556
  if (a._parts) {
553
- const s = a instanceof y.Polygon, r = Qi(a._parts, t, s);
557
+ const s = a instanceof y.Polygon, r = ta(a._parts, t, s);
554
558
  return e === "linha" ? r <= ue(a, he) ? r : null : s && ((i = a._containsPoint) != null && i.call(a, t)) ? 0 : r <= ue(a, he) ? r : null;
555
559
  }
556
560
  return (n = a._containsPoint) != null && n.call(a, t) ? 0 : null;
557
561
  }
558
- function oa(a) {
562
+ function ia(a) {
559
563
  const t = [];
560
564
  for (let e = a._drawFirst; e; e = e.next) t.push(e.layer);
561
565
  return t;
562
566
  }
563
- function Ho(a, t, e) {
567
+ function Go(a, t, e) {
564
568
  var s;
565
569
  const o = a._paneRenderers;
566
570
  if (!o) return [];
567
571
  const i = t.filter((r) => r.visivel && r.interativo && !r.bloqueada).sort((r, c) => c.zIndex - r.zIndex), n = [];
568
572
  for (const r of i) {
569
- for (const l of Ro) {
570
- const d = o[Bo(r.id, l)];
573
+ for (const l of Bo) {
574
+ const d = o[Vo(r.id, l)];
571
575
  if (d)
572
- for (const h of oa(d).reverse()) {
573
- const p = ea(h, e, l);
574
- p !== null && n.push({ camada: r, tipo: l, alvo: h, distancia: p, area: ta(h) });
576
+ for (const h of ia(d).reverse()) {
577
+ const p = oa(h, e, l);
578
+ p !== null && n.push({ camada: r, tipo: l, alvo: h, distancia: p, area: ea(h) });
575
579
  }
576
580
  }
577
581
  const c = (s = ee.get(a)) == null ? void 0 : s.get(r.id);
@@ -584,17 +588,17 @@ function Ho(a, t, e) {
584
588
  }
585
589
  return n.sort((r, c) => Dt[r.tipo] !== Dt[c.tipo] ? Dt[c.tipo] - Dt[r.tipo] : r.camada.zIndex !== c.camada.zIndex ? c.camada.zIndex - r.camada.zIndex : r.tipo === "poligono" && r.area !== c.area ? r.area - c.area : 0);
586
590
  }
587
- const Te = /* @__PURE__ */ new WeakMap();
588
- function ia(a, t, e) {
589
- const o = e.map((s) => s.chave === void 0 ? String(y.Util.stamp(s.alvo)) : `${y.Util.stamp(s.alvo)}:${s.chave}`), i = Te.get(a);
591
+ const _e = /* @__PURE__ */ new WeakMap();
592
+ function aa(a, t, e) {
593
+ const o = e.map((s) => s.chave === void 0 ? String(y.Util.stamp(s.alvo)) : `${y.Util.stamp(s.alvo)}:${s.chave}`), i = _e.get(a);
590
594
  let n = 0;
591
- return i && Math.hypot(i.x - t.x, i.y - t.y) <= Ki && i.ids.length === o.length && i.ids.every((s, r) => s === o[r]) && (n = (i.indice + 1) % e.length), Te.set(a, { x: t.x, y: t.y, ids: o, indice: n }), e[n];
595
+ return i && Math.hypot(i.x - t.x, i.y - t.y) <= Ji && i.ids.length === o.length && i.ids.every((s, r) => s === o[r]) && (n = (i.indice + 1) % e.length), _e.set(a, { x: t.x, y: t.y, ids: o, indice: n }), e[n];
592
596
  }
593
- function aa(a, t, e) {
594
- const o = a.mouseEventToLayerPoint(e), i = Ho(a, t, o);
597
+ function na(a, t, e) {
598
+ const o = a.mouseEventToLayerPoint(e), i = Go(a, t, o);
595
599
  if (i.length === 0)
596
- return Te.delete(a), !1;
597
- const n = ia(a, o, i);
600
+ return _e.delete(a), !1;
601
+ const n = aa(a, o, i);
598
602
  return n.alvo.fire(
599
603
  e.type,
600
604
  {
@@ -607,11 +611,11 @@ function aa(a, t, e) {
607
611
  !0
608
612
  ), !0;
609
613
  }
610
- function Pr(a, t, e) {
611
- return Ho(a, t, a.mouseEventToLayerPoint(e))[0] ?? null;
614
+ function Lr(a, t, e) {
615
+ return Go(a, t, a.mouseEventToLayerPoint(e))[0] ?? null;
612
616
  }
613
- const lo = ".cad-vertex-handle, .cad-vertex-ghost, .cad-bezier-handle, #cm-vertex-edit-hud, #cm-draw-hud";
614
- class na {
617
+ const ho = ".cad-vertex-handle, .cad-vertex-ghost, .cad-bezier-handle, #cm-vertex-edit-hud, #cm-draw-hud";
618
+ class sa {
615
619
  constructor(t) {
616
620
  f(this, "ctx");
617
621
  f(this, "map", null);
@@ -631,7 +635,7 @@ class na {
631
635
  var e, o;
632
636
  if (!(!this.map || !this.mapContainer))
633
637
  if (t.touches.length === 1) {
634
- if ((o = (e = t.target) == null ? void 0 : e.closest) != null && o.call(e, lo)) {
638
+ if ((o = (e = t.target) == null ? void 0 : e.closest) != null && o.call(e, ho)) {
635
639
  this.isTouchPanning = !1;
636
640
  return;
637
641
  }
@@ -657,7 +661,7 @@ class na {
657
661
  });
658
662
  f(this, "handleClick", (t) => {
659
663
  var e, o, i, n, s, r;
660
- !this.map || !this.ctx.layerManager || (o = (e = this.ctx).ferramentaAtiva) != null && o.call(e) || (n = (i = this.ctx).edicaoAtiva) != null && n.call(i) || (r = (s = t.target) == null ? void 0 : s.closest) != null && r.call(s, ".leaflet-marker-icon") || aa(this.map, this.ctx.layerManager.getLayers(), t);
664
+ !this.map || !this.ctx.layerManager || (o = (e = this.ctx).ferramentaAtiva) != null && o.call(e) || (n = (i = this.ctx).edicaoAtiva) != null && n.call(i) || (r = (s = t.target) == null ? void 0 : s.closest) != null && r.call(s, ".leaflet-marker-icon") || na(this.map, this.ctx.layerManager.getLayers(), t);
661
665
  });
662
666
  f(this, "handleMouseDown", (t) => {
663
667
  var e, o, i, n, s, r, c;
@@ -671,7 +675,7 @@ class na {
671
675
  return;
672
676
  }
673
677
  if (t.button === 0) {
674
- if ((o = (e = t.target) == null ? void 0 : e.closest) != null && o.call(e, lo) || (n = (i = this.ctx).ferramentaAtiva) != null && n.call(i) || (r = (s = this.ctx).edicaoAtiva) != null && r.call(s) || (this.selectionHappened = !1, this.ctx.mapaController && this.ctx.mapaController.modoCliqueSequencialAtivo))
678
+ if ((o = (e = t.target) == null ? void 0 : e.closest) != null && o.call(e, ho) || (n = (i = this.ctx).ferramentaAtiva) != null && n.call(i) || (r = (s = this.ctx).edicaoAtiva) != null && r.call(s) || (this.selectionHappened = !1, this.ctx.mapaController && this.ctx.mapaController.modoCliqueSequencialAtivo))
675
679
  return;
676
680
  (c = this.selecaoBox) == null || c.iniciarSelecao(t);
677
681
  }
@@ -713,10 +717,10 @@ class na {
713
717
  };
714
718
  }
715
719
  ativar(t, e) {
716
- this.ctx.mapaController = t, e && (this.ctx.containerHost = e), this.map = t.getMap(), this.map && (this.mapContainer = this.map.getContainer(), this.mapContainer && (this.map.dragging.disable(), this.map.doubleClickZoom.disable(), this.map.boxZoom.disable(), this.selecaoBox = new Xi(this.map, this.mapContainer, this.ctx), Ji(this.mapContainer), this.mapContainer.addEventListener("click", this.handleClick), this.mapContainer.addEventListener("mousedown", this.handleMouseDown), this.mapContainer.addEventListener("mousemove", this.handleMouseMove), window.addEventListener("mouseup", this.handleMouseUp), this.mapContainer.addEventListener("contextmenu", this.handleContextMenu), window.addEventListener("keydown", this.handleKeyDown), this.mapContainer.addEventListener("touchstart", this.handleTouchStart, { passive: !1 }), this.mapContainer.addEventListener("touchmove", this.handleTouchMove, { passive: !1 }), this.mapContainer.addEventListener("touchend", this.handleTouchEnd), this.mapContainer.addEventListener("touchcancel", this.handleTouchEnd)));
720
+ this.mapContainer && this.desativar(), this.ctx.mapaController = t, e && (this.ctx.containerHost = e), this.map = t.getMap(), this.map && (this.mapContainer = this.map.getContainer(), this.mapContainer && (this.map.dragging.disable(), this.map.doubleClickZoom.disable(), this.map.boxZoom.disable(), this.selecaoBox = new Yi(this.map, this.mapContainer, this.ctx), Qi(this.mapContainer), this.mapContainer.addEventListener("click", this.handleClick), this.mapContainer.addEventListener("mousedown", this.handleMouseDown), this.mapContainer.addEventListener("mousemove", this.handleMouseMove), window.addEventListener("mouseup", this.handleMouseUp), this.mapContainer.addEventListener("contextmenu", this.handleContextMenu), window.addEventListener("keydown", this.handleKeyDown), this.mapContainer.addEventListener("touchstart", this.handleTouchStart, { passive: !1 }), this.mapContainer.addEventListener("touchmove", this.handleTouchMove, { passive: !1 }), this.mapContainer.addEventListener("touchend", this.handleTouchEnd), this.mapContainer.addEventListener("touchcancel", this.handleTouchEnd)));
717
721
  }
718
722
  desativar() {
719
- this.mapContainer && (this.mapContainer.removeEventListener("click", this.handleClick), this.mapContainer.removeEventListener("mousedown", this.handleMouseDown), this.mapContainer.removeEventListener("mousemove", this.handleMouseMove), this.mapContainer.removeEventListener("contextmenu", this.handleContextMenu), this.mapContainer.removeEventListener("touchstart", this.handleTouchStart), this.mapContainer.removeEventListener("touchmove", this.handleTouchMove), this.mapContainer.removeEventListener("touchend", this.handleTouchEnd), this.mapContainer.removeEventListener("touchcancel", this.handleTouchEnd)), window.removeEventListener("mouseup", this.handleMouseUp), window.removeEventListener("keydown", this.handleKeyDown), this.cancelarSupressaoClique(), this.selecaoBox && (this.selecaoBox.destruir(), this.selecaoBox = null), this.map && (this.map.dragging.enable(), this.map.doubleClickZoom.enable(), this.map.boxZoom.enable());
723
+ this.mapContainer && (this.mapContainer.removeEventListener("click", this.handleClick), this.mapContainer.removeEventListener("mousedown", this.handleMouseDown), this.mapContainer.removeEventListener("mousemove", this.handleMouseMove), this.mapContainer.removeEventListener("contextmenu", this.handleContextMenu), this.mapContainer.removeEventListener("touchstart", this.handleTouchStart), this.mapContainer.removeEventListener("touchmove", this.handleTouchMove), this.mapContainer.removeEventListener("touchend", this.handleTouchEnd), this.mapContainer.removeEventListener("touchcancel", this.handleTouchEnd)), window.removeEventListener("mouseup", this.handleMouseUp), window.removeEventListener("keydown", this.handleKeyDown), this.cancelarSupressaoClique(), this.selecaoBox && (this.selecaoBox.destruir(), this.selecaoBox = null), this.map && (this.map.dragging.enable(), this.map.doubleClickZoom.enable(), this.map.boxZoom.enable()), this.mapContainer = null, this.isPanning = !1, this.isTouchPanning = !1;
720
724
  }
721
725
  /** Engole o `click` que o navegador dispara logo após soltar o botão de uma seleção por caixa. */
722
726
  suprimirProximoClique() {
@@ -768,7 +772,7 @@ class O {
768
772
  }
769
773
  }
770
774
  f(O, "renderers", /* @__PURE__ */ new Map());
771
- class sa {
775
+ class ra {
772
776
  render(t, e, o) {
773
777
  var c, l, d;
774
778
  const i = ((c = t.dados) == null ? void 0 : c.url) || "https://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}", n = ((l = t.dados) == null ? void 0 : l.subdomains) || ["mt0", "mt1", "mt2", "mt3"], s = ((d = t.dados) == null ? void 0 : d.attribution) || "Google Satélite";
@@ -781,18 +785,19 @@ class sa {
781
785
  updateWhenZooming: !1,
782
786
  updateWhenIdle: !0,
783
787
  className: "smooth-zoom-layer",
784
- opacity: t.opacidade !== void 0 ? t.opacidade : 1,
788
+ opacity: 1,
789
+ // a opacidade da camada é do pane (LayerManager)
785
790
  pane: `pane-${t.id}`
786
791
  });
787
792
  }
788
- update(t, e, o) {
789
- e instanceof y.TileLayer && o.opacidade !== void 0 && e.setOpacity(o.opacidade);
793
+ /** Opacidade, z-index e visibilidade são do pane da camada (LayerManager): nada a atualizar aqui. */
794
+ update() {
790
795
  }
791
796
  destroy(t, e) {
792
797
  e.hasLayer(t) && e.removeLayer(t);
793
798
  }
794
799
  }
795
- class ra {
800
+ class ca {
796
801
  render(t, e, o) {
797
802
  var l, d, h, p;
798
803
  const i = ((l = t.dados) == null ? void 0 : l.url) || "https://acervofundiario.incra.gov.br/i3geo/ogc.php", n = ((d = t.dados) == null ? void 0 : d.layers) || "certificada_sigef_particular_pr", s = ((h = t.dados) == null ? void 0 : h.format) || "image/png", r = ((p = t.dados) == null ? void 0 : p.attribution) || "INCRA/SIGEF";
@@ -807,17 +812,18 @@ class ra {
807
812
  keepBuffer: 8,
808
813
  updateWhenZooming: !1,
809
814
  updateWhenIdle: !0,
810
- opacity: t.opacidade !== void 0 ? t.opacidade : 0.85
815
+ opacity: 1
816
+ // a opacidade da camada é do pane (LayerManager)
811
817
  });
812
818
  }
813
- update(t, e, o) {
814
- e instanceof y.TileLayer.WMS && o.opacidade !== void 0 && e.setOpacity(o.opacidade);
819
+ /** Opacidade, z-index e visibilidade são do pane da camada (LayerManager): nada a atualizar aqui. */
820
+ update() {
815
821
  }
816
822
  destroy(t, e) {
817
823
  e.hasLayer(t) && e.removeLayer(t);
818
824
  }
819
825
  }
820
- function Go(a, t, e) {
826
+ function Uo(a, t, e) {
821
827
  const o = a.estilo.espessuraLinha || e.config.perimetroWeight || 2, i = e.graphicScale.lineScaleMultiplier || 1;
822
828
  if (a.estilo.scaleMode === "world") {
823
829
  const n = a.estilo.dimensaoMetros || 0.3, s = t.getCenter(), r = t.getZoom(), c = 40075016686e-3 * Math.abs(Math.cos(s.lat * Math.PI / 180)) / Math.pow(2, r + 8), l = n / (c > 0 ? c : 1);
@@ -838,9 +844,9 @@ function ut(a, t, e, o, i) {
838
844
  interactive: !1
839
845
  }).addTo(a);
840
846
  }
841
- function ho(a, t, e, o, i) {
842
- var g, u, v, M, z, S, L, b;
843
- const n = a.id === "homologados", s = ((g = a.dados) == null ? void 0 : g.conexoes) ?? (Array.isArray(a.dados) && a.dados.length > 0 && "origemId" in a.dados[0] ? a.dados : null), r = ((u = a.dados) == null ? void 0 : u.segmentos) || o.segmentos || [], c = ((v = a.dados) == null ? void 0 : v.pontos) || (n ? o.bancoPontos || [] : o.pontos) || [], l = Go(a, e, o), d = a.opacidade !== void 0 ? a.opacidade : 1, h = a.interativo && !a.bloqueada, p = [];
847
+ function uo(a, t, e, o, i) {
848
+ var g, u, v, M, z, C, L, b;
849
+ const n = a.id === "homologados", s = ((g = a.dados) == null ? void 0 : g.conexoes) ?? (Array.isArray(a.dados) && a.dados.length > 0 && "origemId" in a.dados[0] ? a.dados : null), r = ((u = a.dados) == null ? void 0 : u.segmentos) || o.segmentos || [], c = ((v = a.dados) == null ? void 0 : v.pontos) || (n ? o.bancoPontos || [] : o.pontos) || [], l = Uo(a, e, o), d = 1, h = a.interativo && !a.bloqueada, p = [];
844
850
  c.forEach((x) => {
845
851
  const P = V(x.lat ?? x.latitude ?? x.y, x.lon ?? x.lng ?? x.longitude ?? x.x);
846
852
  P && p.push({ ...x, lat: P.lat, lon: P.lon });
@@ -859,10 +865,10 @@ function ho(a, t, e, o, i) {
859
865
  };
860
866
  if (s && Array.isArray(s)) {
861
867
  s.forEach((x) => {
862
- var E, C, w, k, I, N, $;
868
+ var E, S, w, k, I, N, $;
863
869
  const P = m(x.origemId), A = m(x.destinoId);
864
870
  if (P && A && P.lat && P.lon && A.lat && A.lon) {
865
- const R = x.tipoLinha === "tracejada" || ((E = x.estilo) == null ? void 0 : E.tipoLinha) === "tracejada", _ = ((C = x.estilo) == null ? void 0 : C.cor) || ((w = x.estilo) == null ? void 0 : w.color) || a.estilo.corPrimaria || "#00f5a0", F = ((k = x.estilo) == null ? void 0 : k.espessura) || ((I = x.estilo) == null ? void 0 : I.weight) || l, D = [[P.lat, P.lon], [A.lat, A.lon]], B = R ? "6, 6" : a.estilo.dashArray;
871
+ const R = x.tipoLinha === "tracejada" || ((E = x.estilo) == null ? void 0 : E.tipoLinha) === "tracejada", _ = ((S = x.estilo) == null ? void 0 : S.cor) || ((w = x.estilo) == null ? void 0 : w.color) || a.estilo.corPrimaria || "#00f5a0", F = ((k = x.estilo) == null ? void 0 : k.espessura) || ((I = x.estilo) == null ? void 0 : I.weight) || l, D = [[P.lat, P.lon], [A.lat, A.lon]], B = R ? "6, 6" : a.estilo.dashArray;
866
872
  ut(t, D, F, i, B);
867
873
  const q = y.polyline(D, {
868
874
  color: _,
@@ -894,8 +900,8 @@ function ho(a, t, e, o, i) {
894
900
  return;
895
901
  }
896
902
  if ((M = a.dados) != null && M.polilinhaSequencial || ((z = a.dados) == null ? void 0 : z.fechar) !== void 0 && p.length >= 2) {
897
- const x = ((S = a.dados) == null ? void 0 : S.chaveGrupo) || o.chaveGrupo, P = Zt(p, x), A = ((L = a.dados) == null ? void 0 : L.fechar) !== !1, E = a.estilo.corPrimaria || "#00f5a0";
898
- Object.entries(P).forEach(([C, w]) => {
903
+ const x = ((C = a.dados) == null ? void 0 : C.chaveGrupo) || o.chaveGrupo, P = Zt(p, x), A = ((L = a.dados) == null ? void 0 : L.fechar) !== !1, E = a.estilo.corPrimaria || "#00f5a0";
904
+ Object.entries(P).forEach(([S, w]) => {
899
905
  const k = Xt(w);
900
906
  if (k.length < 2) return;
901
907
  const I = k.map(($) => [$.lat, $.lon]);
@@ -910,7 +916,7 @@ function ho(a, t, e, o, i) {
910
916
  });
911
917
  if (h && N.bindPopup(`
912
918
  <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3;">
913
- <div style="font-weight:700; font-size:12px; margin-bottom:3px; color:#ffffff;">Polilinha: Grupo ${T(C)}</div>
919
+ <div style="font-weight:700; font-size:12px; margin-bottom:3px; color:#ffffff;">Polilinha: Grupo ${T(S)}</div>
914
920
  <div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">Vértices: ${k.length}</div>
915
921
  </div>
916
922
  `, { className: "compact-popup", maxWidth: 220 }), N.addTo(t), A && I.length >= 3) {
@@ -930,9 +936,9 @@ function ho(a, t, e, o, i) {
930
936
  if (!n && r && r.length > 0)
931
937
  r.forEach((x) => {
932
938
  var E;
933
- const P = p.find((C) => String(C.id) === String(x.ponto_inicio_id)), A = p.find((C) => String(C.id) === String(x.ponto_fim_id));
939
+ const P = p.find((S) => String(S.id) === String(x.ponto_inicio_id)), A = p.find((S) => String(S.id) === String(x.ponto_fim_id));
934
940
  if (P && A && P.lat && P.lon && A.lat && A.lon) {
935
- const C = x.tipo_limite_sigef || x.tipo_limite || "", w = x.metodo_posicionamento_sigef || x.metodo_posicionamento || "", k = C === "LA1" ? "#10b981" : C === "LN1" ? "#3b82f6" : "#00f5a0", I = x.id != null ? x.id : `${x.ponto_inicio_id}-${x.ponto_fim_id}`, N = o.selectedSegmentoId != null && (String(o.selectedSegmentoId) === String(x.id) || String(o.selectedSegmentoId) === String(I)), $ = N ? "#facc15" : a.estilo.corPrimaria || k, R = [[P.lat, P.lon], [A.lat, A.lon]], _ = N ? l + 3 : l, F = C === "LN1" ? "6, 6" : a.estilo.dashArray;
941
+ const S = x.tipo_limite_sigef || x.tipo_limite || "", w = x.metodo_posicionamento_sigef || x.metodo_posicionamento || "", k = S === "LA1" ? "#10b981" : S === "LN1" ? "#3b82f6" : "#00f5a0", I = x.id != null ? x.id : `${x.ponto_inicio_id}-${x.ponto_fim_id}`, N = o.selectedSegmentoId != null && (String(o.selectedSegmentoId) === String(x.id) || String(o.selectedSegmentoId) === String(I)), $ = N ? "#facc15" : a.estilo.corPrimaria || k, R = [[P.lat, P.lon], [A.lat, A.lon]], _ = N ? l + 3 : l, F = S === "LN1" ? "6, 6" : a.estilo.dashArray;
936
942
  ut(t, R, N ? _ + 2 : _, i, F);
937
943
  const D = y.polyline(R, {
938
944
  color: $,
@@ -953,7 +959,7 @@ function ho(a, t, e, o, i) {
953
959
  D.bindPopup(`
954
960
  <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3;">
955
961
  <div style="font-weight:700; font-size:12px; margin-bottom:3px; color:#ffffff;">${T(P.nome_vertice)} ↔ ${T(A.nome_vertice)}</div>
956
- <div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">Limite: ${T(C || "N/A")} · ${T(w || "N/A")}</div>
962
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">Limite: ${T(S || "N/A")} · ${T(w || "N/A")}</div>
957
963
  ${j}
958
964
  </div>
959
965
  `, { className: "compact-popup", maxWidth: 220 }), D.on("popupopen", (G) => {
@@ -970,16 +976,16 @@ function ho(a, t, e, o, i) {
970
976
  else if (p && p.length >= 2) {
971
977
  const x = p.filter(
972
978
  (w) => w.lat && w.lon && w.tipo_ponto !== "B" && w.tipo !== "B" && w.ignorar_poligono !== 1
973
- ), P = ((b = a.dados) == null ? void 0 : b.chaveGrupo) || o.chaveGrupo, A = Zt(x, P), E = a.estilo.corPrimaria || (n ? "#f59e0b" : "#10b981"), C = a.estilo.dashArray || (n ? "6, 8" : void 0);
979
+ ), P = ((b = a.dados) == null ? void 0 : b.chaveGrupo) || o.chaveGrupo, A = Zt(x, P), E = a.estilo.corPrimaria || (n ? "#f59e0b" : "#10b981"), S = a.estilo.dashArray || (n ? "6, 8" : void 0);
974
980
  Object.values(A).forEach((w) => {
975
981
  const k = Xt(w);
976
982
  if (k.length < 2) return;
977
983
  const I = k.map(($) => [$.lat, $.lon]);
978
- if (ut(t, I, l, i, C), y.polyline(I, {
984
+ if (ut(t, I, l, i, S), y.polyline(I, {
979
985
  color: E,
980
986
  weight: l,
981
987
  opacity: d,
982
- dashArray: C,
988
+ dashArray: S,
983
989
  pane: i,
984
990
  interactive: h
985
991
  }).addTo(t), I.length >= 3) {
@@ -996,16 +1002,16 @@ function ho(a, t, e, o, i) {
996
1002
  });
997
1003
  }
998
1004
  }
999
- class ca {
1005
+ class la {
1000
1006
  constructor() {
1001
1007
  f(this, "zoomListenerMap", /* @__PURE__ */ new WeakMap());
1002
1008
  }
1003
1009
  render(t, e, o) {
1004
1010
  const i = y.layerGroup(), n = U(e, t.id, "linha");
1005
- ho(t, i, e, o, n);
1011
+ uo(t, i, e, o, n);
1006
1012
  const s = () => {
1007
1013
  if (t.estilo.scaleMode === "world") {
1008
- const r = Go(t, e, o);
1014
+ const r = Uo(t, e, o);
1009
1015
  i.eachLayer((c) => {
1010
1016
  c.setStyle && c.setStyle({ weight: r });
1011
1017
  });
@@ -1014,23 +1020,23 @@ class ca {
1014
1020
  return e.on("zoomend", s), this.zoomListenerMap.set(i, s), i;
1015
1021
  }
1016
1022
  update(t, e, o, i, n) {
1017
- (o.opacidade !== void 0 || o.estilo !== void 0 || o.dados !== void 0 || o.interativo !== void 0 || o.bloqueada !== void 0) && (e.clearLayers(), ho(t, e, n, i, U(n, t.id, "linha")));
1023
+ (o.opacidade !== void 0 || o.estilo !== void 0 || o.dados !== void 0 || o.interativo !== void 0 || o.bloqueada !== void 0) && (e.clearLayers(), uo(t, e, n, i, U(n, t.id, "linha")));
1018
1024
  }
1019
1025
  destroy(t, e) {
1020
1026
  const o = this.zoomListenerMap.get(t);
1021
1027
  o && (e.off("zoomend", o), this.zoomListenerMap.delete(t)), t.clearLayers(), e.hasLayer(t) && e.removeLayer(t);
1022
1028
  }
1023
1029
  }
1024
- const _e = 300;
1025
- function De(a) {
1026
- return a > _e ? "compacta" : "normal";
1030
+ const De = 300;
1031
+ function qe(a) {
1032
+ return a > De ? "compacta" : "normal";
1027
1033
  }
1028
- function Uo(a, t) {
1029
- if (a <= _e) return 1;
1030
- const e = Math.max(0.7, 1 - 0.3 * Math.log10(a / _e)), o = t >= 18 ? 1 : t >= 16 ? 0.92 : t >= 14 ? 0.82 : 0.72;
1034
+ function Wo(a, t) {
1035
+ if (a <= De) return 1;
1036
+ const e = Math.max(0.7, 1 - 0.3 * Math.log10(a / De)), o = t >= 18 ? 1 : t >= 16 ? 0.92 : t >= 14 ? 0.82 : 0.72;
1031
1037
  return Math.max(0.6, e * o);
1032
1038
  }
1033
- function la(a) {
1039
+ function da(a) {
1034
1040
  if (!a) return "#00f5a0";
1035
1041
  const t = a.trim();
1036
1042
  if (t.startsWith("#") || t.startsWith("rgb") || t.startsWith("hsl") || t.startsWith("var("))
@@ -1053,7 +1059,7 @@ function la(a) {
1053
1059
  if (t.includes(o)) return i;
1054
1060
  return "#00f5a0";
1055
1061
  }
1056
- function uo(a) {
1062
+ function po(a) {
1057
1063
  return a.replace(/[&<>"']/g, (t) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[t]);
1058
1064
  }
1059
1065
  const pe = {
@@ -1064,21 +1070,21 @@ const pe = {
1064
1070
  x: ["M2 2L10 10", "M10 2L2 10"]
1065
1071
  };
1066
1072
  function oe(a, t, e, o = "", i = "", n = !1, s = {}) {
1067
- const r = n || o.includes("ponto-selecionado") || o.includes("cad-marker-selected"), c = s.densidade === "compacta", l = uo(la(e)), d = t + 6, h = r ? `color-mix(in srgb, ${l} 38%, #000000)` : l, p = r ? 1 : c ? 0.72 : 0.9, m = r ? "rgba(255,255,255,0.95)" : c ? "rgba(0,0,0,0.55)" : "rgba(0,0,0,0.7)", g = r ? 1.3 : c ? 0.8 : 1, u = r ? "rgba(255,255,255,0.9)" : "rgba(0,0,0,0.6)", v = (P, A, E, C = "") => `class="${P}" stroke="${A}" stroke-width="${E}" vector-effect="non-scaling-stroke" ${C}`, M = a in pe ? `<polygon points="${pe[a]}" style="fill:${h}" fill-opacity="${p}" stroke-linejoin="round" ${v("cad-pt-contorno", m, g)} />` : a in fe ? fe[a].map(
1073
+ const r = n || o.includes("ponto-selecionado") || o.includes("cad-marker-selected"), c = s.densidade === "compacta", l = po(da(e)), d = t + 6, h = r ? `color-mix(in srgb, ${l} 38%, #000000)` : l, p = r ? 1 : c ? 0.72 : 0.9, m = r ? "rgba(255,255,255,0.95)" : c ? "rgba(0,0,0,0.55)" : "rgba(0,0,0,0.7)", g = r ? 1.3 : c ? 0.8 : 1, u = r ? "rgba(255,255,255,0.9)" : "rgba(0,0,0,0.6)", v = (P, A, E, S = "") => `class="${P}" stroke="${A}" stroke-width="${E}" vector-effect="non-scaling-stroke" ${S}`, M = a in pe ? `<polygon points="${pe[a]}" style="fill:${h}" fill-opacity="${p}" stroke-linejoin="round" ${v("cad-pt-contorno", m, g)} />` : a in fe ? fe[a].map(
1068
1074
  (P) => (
1069
1075
  // Traço = halo escuro (contraste sobre satélite) + traço colorido por cima
1070
1076
  `<path d="${P}" fill="none" stroke-linecap="round" ${v("cad-pt-halo", u, c ? 2.6 : 3.4)} /><path d="${P}" fill="none" stroke-linecap="round" ${v("cad-pt-traco", r ? h : l, c ? 1.3 : 1.8, `stroke-opacity="${r ? 1 : c ? 0.9 : 1}"`)} />`
1071
1077
  )
1072
- ).join("") : a === "square" ? `<rect x="1.2" y="1.2" width="9.6" height="9.6" rx="1.4" style="fill:${h}" fill-opacity="${p}" ${v("cad-pt-contorno", m, g)} />` : `<circle cx="6" cy="6" r="5.2" style="fill:${h}" fill-opacity="${p}" ${v("cad-pt-contorno", m, g)} />`, z = !c && !r && !(a in fe) ? a in pe ? "" : a === "square" ? '<rect x="2.2" y="2.2" width="7.6" height="7.6" rx="0.9" fill="none" stroke="rgba(255,255,255,0.45)" stroke-width="0.8" vector-effect="non-scaling-stroke" />' : '<circle cx="6" cy="6" r="4.3" fill="none" stroke="rgba(255,255,255,0.45)" stroke-width="0.8" vector-effect="non-scaling-stroke" />' : "", S = a === "circle-dot" ? '<circle cx="6" cy="6" r="1.7" fill="#ffffff" stroke="rgba(0,0,0,0.45)" stroke-width="0.6" vector-effect="non-scaling-stroke" />' : "", L = `cad-pt ${c ? "cad-pt-compacto" : ""} ${e} ${o} ${r ? "ponto-selecionado" : ""}`.replace(/\s+/g, " ").trim(), b = t;
1078
+ ).join("") : a === "square" ? `<rect x="1.2" y="1.2" width="9.6" height="9.6" rx="1.4" style="fill:${h}" fill-opacity="${p}" ${v("cad-pt-contorno", m, g)} />` : `<circle cx="6" cy="6" r="5.2" style="fill:${h}" fill-opacity="${p}" ${v("cad-pt-contorno", m, g)} />`, z = !c && !r && !(a in fe) ? a in pe ? "" : a === "square" ? '<rect x="2.2" y="2.2" width="7.6" height="7.6" rx="0.9" fill="none" stroke="rgba(255,255,255,0.45)" stroke-width="0.8" vector-effect="non-scaling-stroke" />' : '<circle cx="6" cy="6" r="4.3" fill="none" stroke="rgba(255,255,255,0.45)" stroke-width="0.8" vector-effect="non-scaling-stroke" />' : "", C = a === "circle-dot" ? '<circle cx="6" cy="6" r="1.7" fill="#ffffff" stroke="rgba(0,0,0,0.45)" stroke-width="0.6" vector-effect="non-scaling-stroke" />' : "", L = `cad-pt ${c ? "cad-pt-compacto" : ""} ${e} ${o} ${r ? "ponto-selecionado" : ""}`.replace(/\s+/g, " ").trim(), b = t;
1073
1079
  return `
1074
- <div ${i ? `id="${uo(i)}"` : ""} class="${L}" style="display:flex; align-items:center; justify-content:center; width:${d}px; height:${d}px; position:relative; pointer-events:auto; background:none !important;">
1080
+ <div ${i ? `id="${po(i)}"` : ""} class="${L}" style="display:flex; align-items:center; justify-content:center; width:${d}px; height:${d}px; position:relative; pointer-events:auto; background:none !important;">
1075
1081
  <svg width="${b}" height="${b}" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" style="overflow:visible; display:block;">
1076
- ${M}${z}${S}
1082
+ ${M}${z}${C}
1077
1083
  </svg>
1078
1084
  </div>
1079
1085
  `;
1080
1086
  }
1081
- class da {
1087
+ class ha {
1082
1088
  constructor() {
1083
1089
  f(this, "zoomListenerMap", /* @__PURE__ */ new WeakMap());
1084
1090
  }
@@ -1089,7 +1095,7 @@ class da {
1089
1095
  i.eachLayer((r) => {
1090
1096
  if (!(r.setIcon && r.baseSize && r.shapeStyle && r.markerBg && r.pontoId !== void 0)) return;
1091
1097
  const c = r.densTotal || 0;
1092
- if (t.estilo.scaleMode !== "world" && De(c) !== "compacta") return;
1098
+ if (t.estilo.scaleMode !== "world" && qe(c) !== "compacta") return;
1093
1099
  const l = this.calculateSize(t, e, o, r.baseSize, c);
1094
1100
  l !== r.tamanhoPx && (r.tamanhoPx = l, r.setIcon(this.criarIcone(t, o, r.shapeStyle, l, r.markerBg, r.pontoId, !!r.isSelected, c)));
1095
1101
  });
@@ -1104,7 +1110,7 @@ class da {
1104
1110
  l,
1105
1111
  `map-marker-${t.id}-${s}`,
1106
1112
  r,
1107
- { densidade: De(c) }
1113
+ { densidade: qe(c) }
1108
1114
  );
1109
1115
  return y.divIcon({
1110
1116
  html: d,
@@ -1118,7 +1124,7 @@ class da {
1118
1124
  const c = t.estilo.dimensaoMetros || 0.25, l = e.getCenter(), d = e.getZoom(), h = 40075016686e-3 * Math.abs(Math.cos(l.lat * Math.PI / 180)) / Math.pow(2, d + 8), p = c / (h > 0 ? h : 1);
1119
1125
  return Math.max(3, Math.round(p * s));
1120
1126
  }
1121
- const r = Uo(n, e.getZoom());
1127
+ const r = Wo(n, e.getZoom());
1122
1128
  return Math.max(r < 1 ? 5 : 4, Math.round(i * s * r));
1123
1129
  }
1124
1130
  rebuildPoints(t, e, o, i, n) {
@@ -1128,17 +1134,17 @@ class da {
1128
1134
  var M;
1129
1135
  const u = g.lat ?? g.latitude, v = g.lon ?? g.lng ?? g.longitude;
1130
1136
  if (u !== void 0 && v !== void 0 && u !== 0 && v !== 0 && !isNaN(Number(u)) && !isNaN(Number(v))) {
1131
- const z = g.tipo_ponto === "B" || g.tipo === "B", S = g.tipo_ponto === "M" || g.tipo === "M";
1137
+ const z = g.tipo_ponto === "B" || g.tipo === "B", C = g.tipo_ponto === "M" || g.tipo === "M";
1132
1138
  let L = t.estilo.estiloMarcador || "x", b = t.estilo.corPrimaria || "bg-mint-vibrant", x = t.estilo.tamanhoMarcador || 7;
1133
- d ? (L = "circle", b = t.estilo.corPrimaria || "#f59e0b", x = 8) : l ? (L = S ? "circle-dot" : t.estilo.estiloMarcador || "cross", b = t.estilo.corPrimaria || "#a855f7", x = S ? 10 : 8) : S ? (b = "#6366f1", L = "circle-dot", x = 10) : z && (b = "#f43f5e", L = "square", x = 9);
1134
- const P = !!(g.selecionado || h.length > 0 && (h.includes(g.id) || h.includes(String(g.id)) || h.includes(Number(g.id)))), A = this.calculateSize(t, o, i, x, p), E = this.criarIcone(t, i, L, A, b, g.id, P, p), C = y.marker([Number(u), Number(v)], {
1139
+ d ? (L = "circle", b = t.estilo.corPrimaria || "#f59e0b", x = 8) : l ? (L = C ? "circle-dot" : t.estilo.estiloMarcador || "cross", b = t.estilo.corPrimaria || "#a855f7", x = C ? 10 : 8) : C ? (b = "#6366f1", L = "circle-dot", x = 10) : z && (b = "#f43f5e", L = "square", x = 9);
1140
+ const P = !!(g.selecionado || h.length > 0 && (h.includes(g.id) || h.includes(String(g.id)) || h.includes(Number(g.id)))), A = this.calculateSize(t, o, i, x, p), E = this.criarIcone(t, i, L, A, b, g.id, P, p), S = y.marker([Number(u), Number(v)], {
1135
1141
  icon: E,
1136
1142
  pane: n,
1137
1143
  interactive: c
1138
1144
  });
1139
- if (P && C.setZIndexOffset(2e3), C.pontoId = g.id, C.layerId = t.id, C.isVizinho = l, C.baseSize = x, C.shapeStyle = L, C.markerBg = b, C.isSelected = P, C.densTotal = p, C.tamanhoPx = A, c) {
1140
- const w = d ? "Vértice Homologado SIGEF" : l ? "Confrontante (Importado)" : S ? "Base Homologada PPP" : z ? "Base de Campo (Translação)" : "Vértice de Perímetro", k = g.acoes || t.acoes || ((M = t.dados) == null ? void 0 : M.acoes) || [], I = Et(k, g.id);
1141
- C.bindPopup(`
1145
+ if (P && S.setZIndexOffset(2e3), S.pontoId = g.id, S.layerId = t.id, S.isVizinho = l, S.baseSize = x, S.shapeStyle = L, S.markerBg = b, S.isSelected = P, S.densTotal = p, S.tamanhoPx = A, c) {
1146
+ const w = d ? "Vértice Homologado SIGEF" : l ? "Confrontante (Importado)" : C ? "Base Homologada PPP" : z ? "Base de Campo (Translação)" : "Vértice de Perímetro", k = g.acoes || t.acoes || ((M = t.dados) == null ? void 0 : M.acoes) || [], I = Et(k, g.id);
1147
+ S.bindPopup(`
1142
1148
  <div style="font-family:var(--ui-fonte-base, sans-serif); color:rgba(255, 255, 255, 0.9); line-height:1.3;">
1143
1149
  <div style="font-weight:700; font-size:13px; margin-bottom:4px; color:#ffffff;">${T(g.nome_vertice || String(g.id))}</div>
1144
1150
  <div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">${T(w)} · ${T(g.tipo_ponto || g.tipo || "Vértice")}</div>
@@ -1148,13 +1154,13 @@ class da {
1148
1154
  `, {
1149
1155
  className: "compact-popup",
1150
1156
  maxWidth: 240
1151
- }), k && k.length > 0 && C.on("popupopen", (N) => {
1152
- kt(N.popup, g, i, C);
1153
- }), C.on("click", () => {
1157
+ }), k && k.length > 0 && S.on("popupopen", (N) => {
1158
+ kt(N.popup, g, i, S);
1159
+ }), S.on("click", () => {
1154
1160
  i.onMarkerClick && i.onMarkerClick(g.id, l, g, { lat: Number(u), lon: Number(v) });
1155
1161
  });
1156
1162
  }
1157
- C.addTo(e);
1163
+ S.addTo(e);
1158
1164
  }
1159
1165
  });
1160
1166
  }
@@ -1166,18 +1172,18 @@ class da {
1166
1172
  o && (e.off("zoomend", o), this.zoomListenerMap.delete(t)), t.clearLayers(), e.hasLayer(t) && e.removeLayer(t);
1167
1173
  }
1168
1174
  }
1169
- class ha {
1175
+ class ua {
1170
1176
  render(t, e, o) {
1171
1177
  const i = y.layerGroup();
1172
1178
  return this.rebuildPolygons(t, i, o, e), i;
1173
1179
  }
1174
1180
  rebuildPolygons(t, e, o, i) {
1175
1181
  var m, g;
1176
- const n = U(i, t.id, "poligono"), s = U(i, t.id, "ponto"), c = (((m = t.dados) == null ? void 0 : m.poligonos) ?? (Array.isArray(t.dados) ? t.dados : null)) || ((g = t.dados) == null ? void 0 : g.confrontantes) || o.confrontantes || [], l = t.interativo && !t.bloqueada, d = t.estilo.corPrimaria || "#a855f7", h = t.estilo.espessuraLinha || 1, p = t.opacidade !== void 0 ? t.opacidade : 0.8;
1182
+ const n = U(i, t.id, "poligono"), s = U(i, t.id, "ponto"), c = (((m = t.dados) == null ? void 0 : m.poligonos) ?? (Array.isArray(t.dados) ? t.dados : null)) || ((g = t.dados) == null ? void 0 : g.confrontantes) || o.confrontantes || [], l = t.interativo && !t.bloqueada, d = t.estilo.corPrimaria || "#a855f7", h = t.estilo.espessuraLinha || 1, p = 1;
1177
1183
  c.forEach((u) => {
1178
- var P, A, E, C, w, k, I, N, $, R;
1184
+ var P, A, E, S, w, k, I, N, $, R;
1179
1185
  if (!u) return;
1180
- const v = ((P = u.estilo) == null ? void 0 : P.cor) || ((A = u.estilo) == null ? void 0 : A.color) || d, M = ((E = u.estilo) == null ? void 0 : E.espessura) || ((C = u.estilo) == null ? void 0 : C.weight) || h, z = ((w = u.estilo) == null ? void 0 : w.opacidade) ?? p, S = ((k = u.estilo) == null ? void 0 : k.fillColor) || v, L = ((I = u.estilo) == null ? void 0 : I.fillOpacity) ?? Math.min(0.14, z * 0.1), b = ((N = u.estilo) == null ? void 0 : N.dashArray) || t.estilo.dashArray || "4, 6";
1186
+ const v = ((P = u.estilo) == null ? void 0 : P.cor) || ((A = u.estilo) == null ? void 0 : A.color) || d, M = ((E = u.estilo) == null ? void 0 : E.espessura) || ((S = u.estilo) == null ? void 0 : S.weight) || h, z = ((w = u.estilo) == null ? void 0 : w.opacidade) ?? p, C = ((k = u.estilo) == null ? void 0 : k.fillColor) || v, L = ((I = u.estilo) == null ? void 0 : I.fillOpacity) ?? Math.min(0.14, z * 0.1), b = ((N = u.estilo) == null ? void 0 : N.dashArray) || t.estilo.dashArray || "4, 6";
1181
1187
  if (u.coordenadas && Array.isArray(u.coordenadas) && u.coordenadas.length >= 3) {
1182
1188
  const _ = Array.isArray(u.coordenadas[0]) && Array.isArray(u.coordenadas[0][0]);
1183
1189
  let F;
@@ -1195,7 +1201,7 @@ class ha {
1195
1201
  weight: M,
1196
1202
  opacity: z,
1197
1203
  dashArray: b,
1198
- fillColor: S,
1204
+ fillColor: C,
1199
1205
  fillOpacity: L,
1200
1206
  lineJoin: "round",
1201
1207
  pane: n,
@@ -1235,7 +1241,7 @@ class ha {
1235
1241
  weight: M,
1236
1242
  opacity: z,
1237
1243
  dashArray: b,
1238
- fillColor: S,
1244
+ fillColor: C,
1239
1245
  fillOpacity: L,
1240
1246
  lineJoin: "round",
1241
1247
  pane: n,
@@ -1306,7 +1312,7 @@ class ha {
1306
1312
  t.clearLayers(), e.hasLayer(t) && e.removeLayer(t);
1307
1313
  }
1308
1314
  }
1309
- class ua {
1315
+ class pa {
1310
1316
  constructor() {
1311
1317
  f(this, "moveListenerMap", /* @__PURE__ */ new WeakMap());
1312
1318
  }
@@ -1316,8 +1322,8 @@ class ua {
1316
1322
  if (e.getZoom() > 20) {
1317
1323
  const c = e.getBounds(), l = c.getSouth(), d = c.getNorth(), h = c.getWest(), p = c.getEast(), m = e.getCenter(), g = 8999e-9, u = Math.cos(m.lat * Math.PI / 180), v = g / (u > 0.1 ? u : 1), M = Math.floor((d - l) / g), z = Math.floor((p - h) / v);
1318
1324
  if (M < 200 && z < 200) {
1319
- const S = Math.ceil(l / g) * g;
1320
- for (let b = S; b <= d; b += g)
1325
+ const C = Math.ceil(l / g) * g;
1326
+ for (let b = C; b <= d; b += g)
1321
1327
  y.polyline([[b, h], [b, p]], {
1322
1328
  color: t.estilo.corPrimaria || "rgba(0, 245, 160, 0.18)",
1323
1329
  weight: t.estilo.espessuraLinha || 0.6,
@@ -1345,7 +1351,7 @@ class ua {
1345
1351
  o && (e.off("zoomend moveend", o), this.moveListenerMap.delete(t)), t.clearLayers(), e.hasLayer(t) && e.removeLayer(t);
1346
1352
  }
1347
1353
  }
1348
- function Wo(a, t) {
1354
+ function Zo(a, t) {
1349
1355
  var s, r;
1350
1356
  const e = a._nosCurva, o = a._renderer, i = a._map;
1351
1357
  if (!e || e.length < 2 || !o || !i) return !1;
@@ -1354,15 +1360,15 @@ function Wo(a, t) {
1354
1360
  if (!o._drawing || !((s = a._parts) != null && s.length)) return !0;
1355
1361
  const c = o._ctx;
1356
1362
  c.beginPath();
1357
- for (const l of bi(e, t)) {
1363
+ for (const l of xi(e, t)) {
1358
1364
  const d = l.pts.map(n);
1359
1365
  l.cmd === "M" ? c.moveTo(d[0].x, d[0].y) : l.cmd === "L" ? c.lineTo(d[0].x, d[0].y) : c.bezierCurveTo(d[0].x, d[0].y, d[1].x, d[1].y, d[2].x, d[2].y);
1360
1366
  }
1361
1367
  return t && c.closePath(), o._fillStroke(c, a), !0;
1362
1368
  }
1363
- return o._setPath ? (o._setPath(a, (r = a._parts) != null && r.length ? xi(e, t, n) : "M0 0"), !0) : !1;
1369
+ return o._setPath ? (o._setPath(a, (r = a._parts) != null && r.length ? Pi(e, t, n) : "M0 0"), !0) : !1;
1364
1370
  }
1365
- class Zo extends y.Polyline {
1371
+ class Xo extends y.Polyline {
1366
1372
  constructor() {
1367
1373
  super(...arguments);
1368
1374
  f(this, "_nosCurva", null);
@@ -1372,10 +1378,10 @@ class Zo extends y.Polyline {
1372
1378
  this._nosCurva = e;
1373
1379
  }
1374
1380
  _updatePath() {
1375
- Wo(this, !1) || y.Polyline.prototype._updatePath.call(this);
1381
+ Zo(this, !1) || y.Polyline.prototype._updatePath.call(this);
1376
1382
  }
1377
1383
  }
1378
- class Xo extends y.Polygon {
1384
+ class Yo extends y.Polygon {
1379
1385
  constructor() {
1380
1386
  super(...arguments);
1381
1387
  f(this, "_nosCurva", null);
@@ -1384,29 +1390,29 @@ class Xo extends y.Polygon {
1384
1390
  this._nosCurva = e;
1385
1391
  }
1386
1392
  _updatePath() {
1387
- Wo(this, !0) || y.Polygon.prototype._updatePath.call(this);
1393
+ Zo(this, !0) || y.Polygon.prototype._updatePath.call(this);
1388
1394
  }
1389
1395
  }
1390
- function Ye(a, t) {
1396
+ function Ke(a, t) {
1391
1397
  const e = bt(a);
1392
1398
  if (!e) return null;
1393
- const o = a.tipo === "Polygon" ? new Xo(a.aneis[0], t) : new Zo(a.coordenadas, t);
1399
+ const o = a.tipo === "Polygon" ? new Yo(a.aneis[0], t) : new Xo(a.coordenadas, t);
1394
1400
  return o.definirCurva(e), o;
1395
1401
  }
1396
- function Yo(a, t) {
1402
+ function Ko(a, t) {
1397
1403
  a.definirCurva(bt(t)), a.setLatLngs(t.tipo === "Polygon" ? t.aneis[0] : t.coordenadas);
1398
1404
  }
1399
1405
  function vt(a) {
1400
- const { lat: t, lng: e } = je(a[0]);
1406
+ const { lat: t, lng: e } = He(a[0]);
1401
1407
  return { lat0: a[0], lon0: a[1], mLat: t, mLng: Math.max(e, 1) };
1402
1408
  }
1403
- function qe(a, t) {
1409
+ function $e(a, t) {
1404
1410
  return [(a[1] - t.lon0) * t.mLng, (a[0] - t.lat0) * t.mLat];
1405
1411
  }
1406
1412
  function yt(a, t) {
1407
1413
  return [t.lat0 + a[1] / t.mLat, t.lon0 + a[0] / t.mLng];
1408
1414
  }
1409
- function Ko(a, t) {
1415
+ function Jo(a, t) {
1410
1416
  const e = (o) => {
1411
1417
  let i = !1;
1412
1418
  for (let n = 0, s = o.length - 1; n < o.length; s = n++) {
@@ -1417,7 +1423,7 @@ function Ko(a, t) {
1417
1423
  };
1418
1424
  return !t[0] || !e(t[0]) ? !1 : !t.slice(1).some(e);
1419
1425
  }
1420
- function Jo(a, t, e, o) {
1426
+ function Qo(a, t, e, o) {
1421
1427
  const i = t[0] - a[0], n = t[1] - a[1], s = o[0] - e[0], r = o[1] - e[1], c = i * r - n * s;
1422
1428
  if (Math.abs(c) < 1e-12) return null;
1423
1429
  const l = ((e[0] - a[0]) * r - (e[1] - a[1]) * s) / c, d = ((e[0] - a[0]) * n - (e[1] - a[1]) * i) / c;
@@ -1431,17 +1437,17 @@ function ie(a) {
1431
1437
  }
1432
1438
  return Math.abs(t) / 2;
1433
1439
  }
1434
- function pa(a, t) {
1440
+ function fa(a, t) {
1435
1441
  if (a.length < 3 || t.length < 2) return null;
1436
- const e = vt(a[0]), o = a.map((s) => qe(s, e)), i = t.map((s) => qe(s, e)), n = Qo(o, i, 0);
1442
+ const e = vt(a[0]), o = a.map((s) => $e(s, e)), i = t.map((s) => $e(s, e)), n = ti(o, i, 0);
1437
1443
  return n && n.length >= 2 ? n.map((s) => s.map((r) => yt(r, e))) : null;
1438
1444
  }
1439
- function Qo(a, t, e) {
1445
+ function ti(a, t, e) {
1440
1446
  if (e > 8) return null;
1441
1447
  const o = a.length, i = [];
1442
1448
  for (let b = 0; b < t.length - 1; b++)
1443
1449
  for (let x = 0; x < o; x++) {
1444
- const P = Jo(t[b], t[b + 1], a[x], a[(x + 1) % o]);
1450
+ const P = Qo(t[b], t[b + 1], a[x], a[(x + 1) % o]);
1445
1451
  P && i.push({
1446
1452
  tLinha: b + P.t,
1447
1453
  tAnel: x + P.u,
@@ -1461,27 +1467,27 @@ function Qo(a, t, e) {
1461
1467
  const v = [d.ponto];
1462
1468
  for (let b = m + 1; b <= p + o; b++) v.push(a[b % o]);
1463
1469
  v.push(l.ponto, ...g);
1464
- const z = ie(a) * 1e-9, S = [u, v].filter((b) => b.length >= 3 && ie(b) > z);
1465
- if (S.length < 2) return null;
1470
+ const z = ie(a) * 1e-9, C = [u, v].filter((b) => b.length >= 3 && ie(b) > z);
1471
+ if (C.length < 2) return null;
1466
1472
  const L = [s.ponto, ...t.slice(Math.floor(s.tLinha) + 1)];
1467
1473
  if (i.length > 2 && L.length >= 2) {
1468
1474
  const b = [];
1469
- for (const x of S) {
1470
- const P = Qo(x, L, e + 1);
1475
+ for (const x of C) {
1476
+ const P = ti(x, L, e + 1);
1471
1477
  P ? b.push(...P) : b.push(x);
1472
1478
  }
1473
1479
  return b;
1474
1480
  }
1475
- return S;
1481
+ return C;
1476
1482
  }
1477
- function St(a, t) {
1478
- return a.map((e) => qe(e, t));
1483
+ function Ct(a, t) {
1484
+ return a.map((e) => $e(e, t));
1479
1485
  }
1480
1486
  const tt = (a, t) => Math.hypot(a[0] - t[0], a[1] - t[1]);
1481
- function fa(a, t = 0) {
1487
+ function ma(a, t = 0) {
1482
1488
  if (a.length === 0 || a.some((n) => n.length < 2)) return null;
1483
- const e = vt(a[0][0]), o = a.slice(1).map((n) => St(n, e));
1484
- let i = St(a[0], e);
1489
+ const e = vt(a[0][0]), o = a.slice(1).map((n) => Ct(n, e));
1490
+ let i = Ct(a[0], e);
1485
1491
  for (; o.length > 0; ) {
1486
1492
  let n = null;
1487
1493
  if (o.forEach((d, h) => {
@@ -1499,20 +1505,20 @@ function fa(a, t = 0) {
1499
1505
  }
1500
1506
  return i.map((n) => yt(n, e));
1501
1507
  }
1502
- function ma(a, t, e, o) {
1503
- const i = Jo(a, t, e, o);
1508
+ function ga(a, t, e, o) {
1509
+ const i = Qo(a, t, e, o);
1504
1510
  return !!i && i.t > 1e-9 && i.t < 1 - 1e-9 && i.u > 1e-9;
1505
1511
  }
1506
- function ga(a, t) {
1512
+ function va(a, t) {
1507
1513
  for (let e = 0; e < a.length; e++)
1508
1514
  for (let o = 0; o < t.length; o++)
1509
- if (ma(a[e], a[(e + 1) % a.length], t[o], t[(o + 1) % t.length])) return !0;
1515
+ if (ga(a[e], a[(e + 1) % a.length], t[o], t[(o + 1) % t.length])) return !0;
1510
1516
  return !1;
1511
1517
  }
1512
- function va(a, t, e = 0) {
1518
+ function ya(a, t, e = 0) {
1513
1519
  if (a.length < 3 || t.length < 3) return null;
1514
- const o = vt(a[0]), i = St(a, o), n = St(t, o);
1515
- if (ga(i, n)) return null;
1520
+ const o = vt(a[0]), i = Ct(a, o), n = Ct(t, o);
1521
+ if (va(i, n)) return null;
1516
1522
  let s = { i: 0, j: 0, d: 1 / 0 };
1517
1523
  for (let d = 0; d < i.length; d++)
1518
1524
  for (let h = 0; h < n.length; h++) {
@@ -1525,11 +1531,11 @@ function va(a, t, e = 0) {
1525
1531
  for (let d = 0; d <= n.length; d++) l.push(n[(c + d) % n.length]);
1526
1532
  return l.map((d) => yt(d, o));
1527
1533
  }
1528
- const po = 16;
1529
- function fo(a, t, e, o) {
1534
+ const fo = 16;
1535
+ function mo(a, t, e, o) {
1530
1536
  const i = [];
1531
- for (let n = 0; n <= po; n++) {
1532
- const s = e + (o - e) * n / po;
1537
+ for (let n = 0; n <= fo; n++) {
1538
+ const s = e + (o - e) * n / fo;
1533
1539
  i.push([a[0] + t * Math.cos(s), a[1] + t * Math.sin(s)]);
1534
1540
  }
1535
1541
  return i;
@@ -1554,7 +1560,7 @@ function me(a, t, e) {
1554
1560
  }
1555
1561
  return i;
1556
1562
  }
1557
- function ya(a) {
1563
+ function ba(a) {
1558
1564
  let t = 0;
1559
1565
  for (let e = 0; e < a.length; e++) {
1560
1566
  const [o, i] = a[e], [n, s] = a[(e + 1) % a.length];
@@ -1562,7 +1568,7 @@ function ya(a) {
1562
1568
  }
1563
1569
  return t > 0;
1564
1570
  }
1565
- function ba(a, t) {
1571
+ function xa(a, t) {
1566
1572
  if (!Number.isFinite(t) || t === 0) return null;
1567
1573
  if (a.tipo === "Point" || a.tipo === "Text" || a.tipo === "Circle") {
1568
1574
  const e = a.tipo === "Circle" ? a.centro : a.coordenada, o = a.tipo === "Circle" ? a.raioMetros + t : t;
@@ -1572,23 +1578,23 @@ function ba(a, t) {
1572
1578
  }
1573
1579
  if (a.tipo === "LineString") {
1574
1580
  if (t < 0 || a.coordenadas.length < 2 || Yt(a)) return null;
1575
- const e = vt(a.coordenadas[0]), o = St(a.coordenadas, e), i = me(o, t, !1), n = me([...o].reverse(), t, !1), s = o[o.length - 1], r = o[0], c = Math.atan2(s[1] - o[o.length - 2][1], s[0] - o[o.length - 2][0]), l = Math.atan2(r[1] - o[1][1], r[0] - o[1][0]), d = fo(s, t, c + Math.PI / 2, c - Math.PI / 2), h = fo(r, t, l + Math.PI / 2, l - Math.PI / 2);
1581
+ const e = vt(a.coordenadas[0]), o = Ct(a.coordenadas, e), i = me(o, t, !1), n = me([...o].reverse(), t, !1), s = o[o.length - 1], r = o[0], c = Math.atan2(s[1] - o[o.length - 2][1], s[0] - o[o.length - 2][0]), l = Math.atan2(r[1] - o[1][1], r[0] - o[1][0]), d = mo(s, t, c + Math.PI / 2, c - Math.PI / 2), h = mo(r, t, l + Math.PI / 2, l - Math.PI / 2);
1576
1582
  return [...i, ...d, ...n, ...h].map((p) => yt(p, e));
1577
1583
  }
1578
1584
  if (a.tipo === "Polygon") {
1579
1585
  const e = a.aneis[0];
1580
1586
  if (!e || e.length < 3) return null;
1581
1587
  const o = vt(e[0]);
1582
- let i = St(e, o);
1583
- ya(i) && (i = [...i].reverse());
1588
+ let i = Ct(e, o);
1589
+ ba(i) && (i = [...i].reverse());
1584
1590
  const s = me(i, -t, !0);
1585
1591
  return s.length < 3 || t < 0 && ie(s) >= ie(i) ? null : s.map((r) => yt(r, o));
1586
1592
  }
1587
1593
  return null;
1588
1594
  }
1589
- function xa(a, t, e) {
1595
+ function Pa(a, t, e) {
1590
1596
  const o = (i) => {
1591
- const n = je(i[0]), s = e / n.lat, r = t / Math.max(n.lng, 1);
1597
+ const n = He(i[0]), s = e / n.lat, r = t / Math.max(n.lng, 1);
1592
1598
  return [i[0] + s, i[1] + r];
1593
1599
  };
1594
1600
  switch (a.tipo) {
@@ -1600,29 +1606,29 @@ function xa(a, t, e) {
1600
1606
  return { ...a, centro: o(a.centro) };
1601
1607
  case "LineString": {
1602
1608
  const i = Kt(it(a).map((n) => n.map(o)));
1603
- return a.curva ? { ...i, curva: Qe(a.curva, o) } : i;
1609
+ return a.curva ? { ...i, curva: to(a.curva, o) } : i;
1604
1610
  }
1605
1611
  case "Polygon": {
1606
1612
  const i = { tipo: "Polygon", aneis: a.aneis.map((n) => n.map(o)) };
1607
- return a.curva ? { ...i, curva: Qe(a.curva, o) } : i;
1613
+ return a.curva ? { ...i, curva: to(a.curva, o) } : i;
1608
1614
  }
1609
1615
  }
1610
1616
  }
1611
- const mo = { m: 1, km: 1e3, ft: 0.3048, mi: 1609.344 }, go = { m2: 1, ha: 1e4, km2: 1e6, ac: 4046.8564224, alqueire: 24200 };
1612
- function Lr(a, t, e) {
1613
- return a * mo[t] / mo[e];
1617
+ const go = { m: 1, km: 1e3, ft: 0.3048, mi: 1609.344 }, vo = { m2: 1, ha: 1e4, km2: 1e6, ac: 4046.8564224, alqueire: 24200 };
1618
+ function Cr(a, t, e) {
1619
+ return a * go[t] / go[e];
1614
1620
  }
1615
1621
  function Sr(a, t, e) {
1616
- return a * go[t] / go[e];
1622
+ return a * vo[t] / vo[e];
1617
1623
  }
1618
- function Cr(a, t, e = 2) {
1624
+ function Mr(a, t, e = 2) {
1619
1625
  const o = t === "lat" ? a < 0 ? "S" : "N" : a < 0 ? "O" : "L", i = Math.abs(a);
1620
1626
  let n = Math.floor(i), s = Math.floor((i - n) * 60), r = Number(((i - n - s / 60) * 3600).toFixed(e));
1621
1627
  r >= 60 && (r = 0, s += 1), s >= 60 && (s = 0, n += 1);
1622
1628
  const c = r.toFixed(e).padStart(e ? e + 3 : 2, "0");
1623
1629
  return `${n}°${String(s).padStart(2, "0")}'${c}"${o}`;
1624
1630
  }
1625
- function Mr(a) {
1631
+ function Ar(a) {
1626
1632
  var p;
1627
1633
  if (typeof a != "string") return null;
1628
1634
  const t = a.trim().toUpperCase().replace(",", "."), e = (p = /[NSLEOW]$/.exec(t)) == null ? void 0 : p[0], o = t.replace(/[NSLEOW]$/, "").trim(), i = o.match(/-?\d+(?:\.\d+)?/g);
@@ -1632,7 +1638,7 @@ function Mr(a) {
1632
1638
  let h = c + l / 60 + d / 3600;
1633
1639
  return (n.startsWith("-") || e === "S" || e === "O" || e === "W") && (h = -h), h;
1634
1640
  }
1635
- function Ar(a, t) {
1641
+ function wr(a, t) {
1636
1642
  return xt(a, t);
1637
1643
  }
1638
1644
  function ge(a, t, e) {
@@ -1644,14 +1650,14 @@ function ge(a, t, e) {
1644
1650
  propriedades: { ...a.propriedades }
1645
1651
  };
1646
1652
  }
1647
- const Pa = 5e3;
1653
+ const La = 5e3;
1648
1654
  function ce(a) {
1649
1655
  return a.tipo === "Polygon" ? 3 : a.tipo === "LineString" ? 2 : 1;
1650
1656
  }
1651
- function vo(a, t = !1) {
1657
+ function yo(a, t = !1) {
1652
1658
  if (a.bloqueada || t) return "bloqueada";
1653
1659
  const e = a.geometria;
1654
- return e.tipo !== "Point" && e.tipo !== "LineString" && e.tipo !== "Polygon" && e.tipo !== "Circle" ? "tipo-nao-suportado" : e.tipo === "Polygon" && e.aneis.length !== 1 ? "poligono-com-furos" : Yt(e) ? "multiparte" : X(e).length > Pa ? "muitos-vertices" : null;
1660
+ return e.tipo !== "Point" && e.tipo !== "LineString" && e.tipo !== "Polygon" && e.tipo !== "Circle" ? "tipo-nao-suportado" : e.tipo === "Polygon" && e.aneis.length !== 1 ? "poligono-com-furos" : Yt(e) ? "multiparte" : X(e).length > La ? "muitos-vertices" : null;
1655
1661
  }
1656
1662
  function X(a) {
1657
1663
  return a.tipo === "Point" ? [a.coordenada] : a.tipo === "LineString" ? a.coordenadas : a.tipo === "Polygon" ? a.aneis[0] ?? [] : [];
@@ -1659,11 +1665,11 @@ function X(a) {
1659
1665
  function le(a, t) {
1660
1666
  return a.tipo === "Point" ? { tipo: "Point", coordenada: t[0] } : a.tipo === "LineString" ? { tipo: "LineString", coordenadas: t } : a.tipo === "Polygon" ? { tipo: "Polygon", aneis: [t] } : a;
1661
1667
  }
1662
- function wr(a, t, e) {
1668
+ function zr(a, t, e) {
1663
1669
  const o = X(a).slice();
1664
1670
  return t < 0 || t >= o.length ? a : (o[t] = e, le(a, o));
1665
1671
  }
1666
- function La(a, t, e) {
1672
+ function Ca(a, t, e) {
1667
1673
  if (a.tipo !== "LineString" && a.tipo !== "Polygon") return a;
1668
1674
  const o = X(a).slice();
1669
1675
  return t < 0 || t >= o.length ? a : (o.splice(t + 1, 0, e), le(a, o));
@@ -1673,10 +1679,10 @@ function Sa(a, t) {
1673
1679
  const e = X(a);
1674
1680
  return t < 0 || t >= e.length || e.length <= ce(a) ? null : le(a, e.filter((o, i) => i !== t));
1675
1681
  }
1676
- function ti(a, t) {
1682
+ function ei(a, t) {
1677
1683
  return [(a[0] + t[0]) / 2, (a[1] + t[1]) / 2];
1678
1684
  }
1679
- function ei(a) {
1685
+ function oi(a) {
1680
1686
  const t = X(a).length, e = [];
1681
1687
  if (a.tipo !== "LineString" && a.tipo !== "Polygon") return e;
1682
1688
  for (let o = 0; o < t - 1; o++) e.push([o, o + 1]);
@@ -1685,37 +1691,37 @@ function ei(a) {
1685
1691
  function K(a) {
1686
1692
  return (a.tipo === "LineString" || a.tipo === "Polygon") && a.curva && a.curva.length >= ce(a) ? a.curva : null;
1687
1693
  }
1688
- const Ca = 0.5;
1689
- function Ma(a, t) {
1690
- return [a[0], a[1] + t / Math.max(je(a[0]).lng, 1)];
1694
+ const Ma = 0.5;
1695
+ function Aa(a, t) {
1696
+ return [a[0], a[1] + t / Math.max(He(a[0]).lng, 1)];
1691
1697
  }
1692
1698
  function pt(a) {
1693
1699
  var t;
1694
- return a.tipo === "Circle" ? [a.centro, Ma(a.centro, a.raioMetros)] : ((t = K(a)) == null ? void 0 : t.map((e) => e.ponto)) ?? X(a);
1700
+ return a.tipo === "Circle" ? [a.centro, Aa(a.centro, a.raioMetros)] : ((t = K(a)) == null ? void 0 : t.map((e) => e.ponto)) ?? X(a);
1695
1701
  }
1696
- function Ct(a, t) {
1702
+ function St(a, t) {
1697
1703
  const e = a.tipo === "Polygon", o = Pt(t, e);
1698
1704
  return e ? { tipo: "Polygon", aneis: [o], curva: t } : { tipo: "LineString", coordenadas: o, curva: t };
1699
1705
  }
1700
- function yo(a, t) {
1706
+ function bo(a, t) {
1701
1707
  if (a.tipo === "Circle")
1702
- return t.length < 2 ? a : { ...a, centro: t[0], raioMetros: Math.max(Ca, xt(t[0], t[1])) };
1708
+ return t.length < 2 ? a : { ...a, centro: t[0], raioMetros: Math.max(Ma, xt(t[0], t[1])) };
1703
1709
  const e = K(a);
1704
1710
  if (!e || e.length !== t.length) return le(a, t);
1705
1711
  const o = e.map((i, n) => {
1706
1712
  const s = t[n][0] - i.ponto[0], r = t[n][1] - i.ponto[1], c = (d) => [d[0] + s, d[1] + r], l = { ponto: t[n] };
1707
1713
  return i.entrada && (l.entrada = c(i.entrada)), i.saida && (l.saida = c(i.saida)), l;
1708
1714
  });
1709
- return Ct(a, o);
1715
+ return St(a, o);
1710
1716
  }
1711
1717
  function ft(a, t, e) {
1712
1718
  return [a[0] + (t[0] - a[0]) * e, a[1] + (t[1] - a[1]) * e];
1713
1719
  }
1714
- function Aa(a, t, e) {
1715
- const [o, i] = He(a, t);
1720
+ function wa(a, t, e) {
1721
+ const [o, i] = Ge(a, t);
1716
1722
  let n = 0.5, s = 1 / 0;
1717
1723
  for (let r = 1; r < 64; r++) {
1718
- const c = r / 64, l = Oo(a.ponto, o, i, t.ponto, c), d = (l[0] - e[0]) ** 2 + (l[1] - e[1]) ** 2;
1724
+ const c = r / 64, l = No(a.ponto, o, i, t.ponto, c), d = (l[0] - e[0]) ** 2 + (l[1] - e[1]) ** 2;
1719
1725
  d < s && (s = d, n = c);
1720
1726
  }
1721
1727
  return n;
@@ -1724,42 +1730,42 @@ function zt(a, t, e) {
1724
1730
  const o = K(a);
1725
1731
  if (!o) {
1726
1732
  const s = X(a);
1727
- return ti(s[t], s[e]);
1733
+ return ei(s[t], s[e]);
1728
1734
  }
1729
- const [i, n] = He(o[t], o[e]);
1730
- return Oo(o[t].ponto, i, n, o[e].ponto, 0.5);
1735
+ const [i, n] = Ge(o[t], o[e]);
1736
+ return No(o[t].ponto, i, n, o[e].ponto, 0.5);
1731
1737
  }
1732
- function oi(a) {
1738
+ function ii(a) {
1733
1739
  const t = K(a);
1734
- if (!t) return ei(a);
1740
+ if (!t) return oi(a);
1735
1741
  const e = [];
1736
1742
  for (let o = 0; o < t.length - 1; o++) e.push([o, o + 1]);
1737
1743
  return a.tipo === "Polygon" && t.length > 2 && e.push([t.length - 1, 0]), e;
1738
1744
  }
1739
- function wa(a, t, e) {
1745
+ function za(a, t, e) {
1740
1746
  const o = K(a);
1741
- if (!o) return La(a, t, e);
1747
+ if (!o) return Ca(a, t, e);
1742
1748
  if (t < 0 || t >= o.length) return a;
1743
1749
  const i = (t + 1) % o.length, n = o[t], s = o[i], r = n.saida === void 0 && s.entrada === void 0;
1744
1750
  let c, l = n, d = s;
1745
1751
  if (r)
1746
1752
  c = { ponto: e };
1747
1753
  else {
1748
- const p = Aa(n, s, e), [m, g] = He(n, s), u = ft(n.ponto, m, p), v = ft(m, g, p), M = ft(g, s.ponto, p), z = ft(u, v, p), S = ft(v, M, p);
1749
- c = { ponto: ft(z, S, p), entrada: z, saida: S }, l = { ...n, saida: u }, d = { ...s, entrada: M };
1754
+ const p = wa(n, s, e), [m, g] = Ge(n, s), u = ft(n.ponto, m, p), v = ft(m, g, p), M = ft(g, s.ponto, p), z = ft(u, v, p), C = ft(v, M, p);
1755
+ c = { ponto: ft(z, C, p), entrada: z, saida: C }, l = { ...n, saida: u }, d = { ...s, entrada: M };
1750
1756
  }
1751
1757
  const h = o.slice();
1752
- return h[t] = l, h[i] = d, h.splice(t + 1, 0, c), Ct(a, h);
1758
+ return h[t] = l, h[i] = d, h.splice(t + 1, 0, c), St(a, h);
1753
1759
  }
1754
- function za(a, t) {
1760
+ function Ea(a, t) {
1755
1761
  const e = K(a);
1756
- return e ? t < 0 || t >= e.length || e.length <= ce(a) ? null : Ct(a, e.filter((o, i) => i !== t)) : Sa(a, t);
1762
+ return e ? t < 0 || t >= e.length || e.length <= ce(a) ? null : St(a, e.filter((o, i) => i !== t)) : Sa(a, t);
1757
1763
  }
1758
1764
  function It(a) {
1759
1765
  return a.tipo !== "LineString" && a.tipo !== "Polygon" ? null : K(a) ?? X(a).map((t) => ({ ponto: [t[0], t[1]] }));
1760
1766
  }
1761
- const Ea = 40;
1762
- function ka(a, t, e) {
1767
+ const ka = 40;
1768
+ function Ia(a, t, e) {
1763
1769
  const o = It(a);
1764
1770
  if (!o || t < 0 || t >= o.length) return null;
1765
1771
  const i = a.tipo === "Polygon", n = o.length, s = e === "saida" ? t < n - 1 ? o[t + 1] : i ? o[0] : null : t > 0 ? o[t - 1] : i ? o[n - 1] : null;
@@ -1767,20 +1773,20 @@ function ka(a, t, e) {
1767
1773
  const r = o[t].ponto;
1768
1774
  return [r[0] + (s.ponto[0] - r[0]) / 3, r[1] + (s.ponto[1] - r[1]) / 3];
1769
1775
  }
1770
- function Ia(a, t, e, o, i = !0) {
1776
+ function Ta(a, t, e, o, i = !0) {
1771
1777
  const n = It(a);
1772
1778
  if (!n || t < 0 || t >= n.length) return a;
1773
1779
  const s = { ...n[t], [e]: o };
1774
- i && (s[e === "saida" ? "entrada" : "saida"] = Ge(s.ponto, o));
1780
+ i && (s[e === "saida" ? "entrada" : "saida"] = Ue(s.ponto, o));
1775
1781
  const r = n.slice();
1776
- return r[t] = s, Ct(a, r);
1782
+ return r[t] = s, St(a, r);
1777
1783
  }
1778
- function Ta(a, t) {
1784
+ function _a(a, t) {
1779
1785
  const e = It(a);
1780
1786
  if (!e || t < 0 || t >= e.length) return a;
1781
1787
  const o = e[t], i = e.slice();
1782
1788
  if (o.entrada || o.saida)
1783
- return i[t] = { ponto: o.ponto }, Ct(a, i);
1789
+ return i[t] = { ponto: o.ponto }, St(a, i);
1784
1790
  const n = a.tipo === "Polygon", s = e.length, r = t > 0 ? e[t - 1] : n ? e[s - 1] : null, c = t < s - 1 ? e[t + 1] : n ? e[0] : null;
1785
1791
  if (!r && !c) return a;
1786
1792
  const l = o.ponto;
@@ -1791,14 +1797,14 @@ function Ta(a, t) {
1791
1797
  const p = (c ?? r).ponto, m = c ? 1 : -1;
1792
1798
  d = (p[0] - l[0]) / 3 * m, h = (p[1] - l[1]) / 3 * m;
1793
1799
  }
1794
- return i[t] = { ponto: l, saida: [l[0] + d, l[1] + h], entrada: [l[0] - d, l[1] - h] }, Ct(a, i);
1800
+ return i[t] = { ponto: l, saida: [l[0] + d, l[1] + h], entrada: [l[0] - d, l[1] - h] }, St(a, i);
1795
1801
  }
1796
- const _a = 6, ve = (a, t) => Math.hypot(a.x - t.x, a.y - t.y);
1797
- function bo(a, t, e) {
1802
+ const Da = 6, ve = (a, t) => Math.hypot(a.x - t.x, a.y - t.y);
1803
+ function xo(a, t, e) {
1798
1804
  const o = e.x - t.x, i = e.y - t.y, n = o * o + i * i, s = n === 0 ? 0 : Math.max(0, Math.min(1, ((a.x - t.x) * o + (a.y - t.y) * i) / n));
1799
1805
  return Math.hypot(a.x - (t.x + s * o), a.y - (t.y + s * i));
1800
1806
  }
1801
- function Da(a, t) {
1807
+ function qa(a, t) {
1802
1808
  const e = a.geometria;
1803
1809
  if (e.tipo !== "Polygon") return 0;
1804
1810
  let o = 1 / 0, i = -1 / 0, n = 1 / 0, s = -1 / 0;
@@ -1808,7 +1814,7 @@ function Da(a, t) {
1808
1814
  }
1809
1815
  return (i - o) * (s - n);
1810
1816
  }
1811
- function de(a, t, e, o = _a) {
1817
+ function de(a, t, e, o = Da) {
1812
1818
  let i = null, n = null, s = null;
1813
1819
  for (const r of t) {
1814
1820
  if (r.excluida || r.oculta) continue;
@@ -1820,7 +1826,7 @@ function de(a, t, e, o = _a) {
1820
1826
  let l = 1 / 0;
1821
1827
  for (const d of it(c)) {
1822
1828
  const h = d.map(e);
1823
- for (let p = 1; p < h.length; p++) l = Math.min(l, bo(a, h[p - 1], h[p]));
1829
+ for (let p = 1; p < h.length; p++) l = Math.min(l, xo(a, h[p - 1], h[p]));
1824
1830
  }
1825
1831
  l <= o && (!n || l < n.d) && (n = { f: r, d: l });
1826
1832
  } else if (c.tipo === "Circle") {
@@ -1832,21 +1838,21 @@ function de(a, t, e, o = _a) {
1832
1838
  } else {
1833
1839
  const l = c.aneis[0].map(e);
1834
1840
  let d = 1 / 0;
1835
- for (const [p, m] of ei(c)) d = Math.min(d, bo(a, l[p], l[m]));
1836
- if (Ko([a.y, a.x], [l.map((p) => [p.y, p.x]), ...c.aneis.slice(1).map((p) => p.map(e).map((m) => [m.y, m.x]))]) || d <= o) {
1837
- const p = Da(r, e);
1841
+ for (const [p, m] of oi(c)) d = Math.min(d, xo(a, l[p], l[m]));
1842
+ if (Jo([a.y, a.x], [l.map((p) => [p.y, p.x]), ...c.aneis.slice(1).map((p) => p.map(e).map((m) => [m.y, m.x]))]) || d <= o) {
1843
+ const p = qa(r, e);
1838
1844
  (!s || p < s.a) && (s = { f: r, a: p });
1839
1845
  }
1840
1846
  }
1841
1847
  }
1842
1848
  return (i == null ? void 0 : i.f) ?? (n == null ? void 0 : n.f) ?? (s == null ? void 0 : s.f) ?? null;
1843
1849
  }
1844
- const $t = 0.1, qa = 2, $a = typeof requestAnimationFrame == "function" ? (a) => {
1850
+ const $t = 0.1, $a = 2, Fa = typeof requestAnimationFrame == "function" ? (a) => {
1845
1851
  requestAnimationFrame(a);
1846
1852
  } : (a) => {
1847
1853
  setTimeout(a, 16);
1848
1854
  };
1849
- class Fa extends y.Layer {
1855
+ class Oa extends y.Layer {
1850
1856
  constructor(e, o) {
1851
1857
  super();
1852
1858
  f(this, "canvas", null);
@@ -1870,7 +1876,7 @@ class Fa extends y.Layer {
1870
1876
  }
1871
1877
  /** Pede um redesenho no próximo quadro (vários pedidos viram um só). */
1872
1878
  solicitarRedesenho() {
1873
- this.agendado || !this.vivo || (this.agendado = !0, $a(() => {
1879
+ this.agendado || !this.vivo || (this.agendado = !0, Fa(() => {
1874
1880
  this.agendado = !1, this.vivo && this.redesenhar();
1875
1881
  }));
1876
1882
  }
@@ -1884,18 +1890,18 @@ class Fa extends y.Layer {
1884
1890
  try {
1885
1891
  const i = e.getSize(), n = Math.ceil(i.x * (1 + 2 * $t)), s = Math.ceil(i.y * (1 + 2 * $t));
1886
1892
  if (!(n > 0 && s > 0)) return;
1887
- const r = Math.min(qa, typeof window < "u" && window.devicePixelRatio || 1), c = e.containerPointToLayerPoint([-i.x * $t, -i.y * $t]).round();
1893
+ const r = Math.min($a, typeof window < "u" && window.devicePixelRatio || 1), c = e.containerPointToLayerPoint([-i.x * $t, -i.y * $t]).round();
1888
1894
  (o.width !== Math.round(n * r) || o.height !== Math.round(s * r)) && (o.width = Math.round(n * r), o.height = Math.round(s * r)), o.style.width = `${n}px`, o.style.height = `${s}px`, y.DomUtil.setPosition(o, c), o.style.display = "";
1889
1895
  const l = o.getContext("2d");
1890
1896
  if (!l) return;
1891
1897
  l.setTransform(r, 0, 0, r, 0, 0), l.clearRect(0, 0, n, s);
1892
1898
  const d = e.getPixelOrigin().add(c);
1893
- this.ultimaPintura = Pi(l, this.obterMarcas(), e.getZoom(), d.x, d.y, n, s);
1899
+ this.ultimaPintura = Li(l, this.obterMarcas(), e.getZoom(), d.x, d.y, n, s);
1894
1900
  } catch {
1895
1901
  }
1896
1902
  }
1897
1903
  }
1898
- const ii = /* @__PURE__ */ new WeakMap(), $e = {
1904
+ const ai = /* @__PURE__ */ new WeakMap(), Fe = {
1899
1905
  tower: '<path d="M12 2 L8 22 M12 2 L16 22 M9.5 12 H14.5 M8.7 17 H15.3 M12 2 L9.5 12 L14.5 12 Z" />',
1900
1906
  tree: '<path d="M12 22 V14 M12 3 L5 14 H19 Z" />',
1901
1907
  warning: '<path d="M12 3 L22 20 H2 Z M12 9 V14 M12 17 V17.5" />',
@@ -1903,7 +1909,7 @@ const ii = /* @__PURE__ */ new WeakMap(), $e = {
1903
1909
  boundary: '<path d="M12 2 L22 12 L12 22 L2 12 Z" />'
1904
1910
  };
1905
1911
  function jt(a, t, e = !1) {
1906
- const o = a.estilo ?? {}, i = o.tamanhoIcone ?? t.tamanhoMarcador, n = typeof i == "number" && Number.isFinite(i) && i > 0 ? i : 22, s = e ? Jt : ot(o.corTraco ?? o.corPreenchimento ?? t.corPrimaria, Ue), r = Number.isFinite(o.rotacaoIcone) ? o.rotacaoIcone : 0, c = $e[o.icone ?? ""] ?? "";
1912
+ const o = a.estilo ?? {}, i = o.tamanhoIcone ?? t.tamanhoMarcador, n = typeof i == "number" && Number.isFinite(i) && i > 0 ? i : 22, s = e ? Jt : ot(o.corTraco ?? o.corPreenchimento ?? t.corPrimaria, We), r = Number.isFinite(o.rotacaoIcone) ? o.rotacaoIcone : 0, c = Fe[o.icone ?? ""] ?? "";
1907
1913
  return y.divIcon({
1908
1914
  className: `custom-leaflet-marker${e ? " cad-feicao-selecionada" : ""}`,
1909
1915
  iconSize: [n, n],
@@ -1927,15 +1933,15 @@ function Ht(a, t, e = !1) {
1927
1933
  html: `<span style="${c}${d}">${T(i)}</span>`
1928
1934
  });
1929
1935
  }
1930
- function ai(a, t) {
1931
- const e = a < 10 ? 30 : a < 100 ? 38 : 46, o = ot(t.corPrimaria, Ue);
1936
+ function ni(a, t) {
1937
+ const e = a < 10 ? 30 : a < 100 ? 38 : 46, o = ot(t.corPrimaria, We);
1932
1938
  return y.divIcon({
1933
1939
  className: "custom-leaflet-marker cad-feicao-cluster",
1934
1940
  iconSize: [e, e],
1935
1941
  html: `<div style="width:${e}px;height:${e}px;border-radius:50%;background:${o};opacity:.9;border:2px solid rgba(255,255,255,.85);display:flex;align-items:center;justify-content:center;color:#fff;font:700 12px sans-serif;text-shadow:0 0 2px #000">${a}</div>`
1936
1942
  });
1937
1943
  }
1938
- function Fe(a, t) {
1944
+ function Oe(a, t) {
1939
1945
  return {
1940
1946
  color: a.cor,
1941
1947
  stroke: a.traco,
@@ -1951,16 +1957,16 @@ function Fe(a, t) {
1951
1957
  interactive: t
1952
1958
  };
1953
1959
  }
1954
- const Oa = 150, Na = 100, ye = 300, be = 0.75, Ra = 20, Ba = 0.3, xe = typeof requestAnimationFrame == "function" ? (a) => {
1960
+ const Na = 150, Ra = 100, ye = 300, be = 0.75, Ba = 20, Va = 0.3, xe = typeof requestAnimationFrame == "function" ? (a) => {
1955
1961
  requestAnimationFrame(a);
1956
1962
  } : (a) => {
1957
1963
  setTimeout(a, 16);
1958
1964
  };
1959
- class Va {
1965
+ class ja {
1960
1966
  constructor() {
1961
1967
  f(this, "estados", /* @__PURE__ */ new WeakMap());
1962
1968
  /** Por definição de camada (uma por componente), para a seleção sobreviver à recriação do grupo. */
1963
- f(this, "selecionadas", ii);
1969
+ f(this, "selecionadas", ai);
1964
1970
  f(this, "tokenLote", /* @__PURE__ */ new WeakMap());
1965
1971
  }
1966
1972
  render(t, e, o) {
@@ -2031,7 +2037,7 @@ class Va {
2031
2037
  map: o,
2032
2038
  context: i,
2033
2039
  loja: /* @__PURE__ */ new Map(),
2034
- indice: new Li(),
2040
+ indice: new Ci(),
2035
2041
  revisao: 0,
2036
2042
  revisaoBase: 0,
2037
2043
  listaSincronizada: null,
@@ -2073,7 +2079,7 @@ class Va {
2073
2079
  h.add(u.id), s.loja.get(u.id) !== u && d.add(u.id);
2074
2080
  const p = [...s.loja.keys()].filter((u) => !h.has(u));
2075
2081
  if (d.size > 0 || p.length > 0) {
2076
- if (s.revisao++, s.revisaoBase++, s.lod.clear(), s.loja.size === 0 || d.size + p.length > l.length * Ba)
2082
+ if (s.revisao++, s.revisaoBase++, s.lod.clear(), s.loja.size === 0 || d.size + p.length > l.length * Va)
2077
2083
  s.indice.construir(l);
2078
2084
  else {
2079
2085
  for (const u of l) d.has(u.id) && s.indice.atualizar(u);
@@ -2134,10 +2140,10 @@ class Va {
2134
2140
  }
2135
2141
  /** Há geometria grande demais para o zoom atual? Só então vale redesenhar ao mudar de zoom. */
2136
2142
  ressimplificar(t, e) {
2137
- return t.zoomDesenho === e || Si(t.feicao.geometria) < Ci ? !1 : e < to || t.zoomDesenho < to;
2143
+ return t.zoomDesenho === e || Si(t.feicao.geometria) < Mi ? !1 : e < eo || t.zoomDesenho < eo;
2138
2144
  }
2139
2145
  paraDesenho(t, e) {
2140
- const o = Mi(t.geometria, e);
2146
+ const o = Ai(t.geometria, e);
2141
2147
  return o === t.geometria ? t : { ...t, geometria: o };
2142
2148
  }
2143
2149
  /** Vai para a tela? Não oculta e visível pela regra oficial × prévia. */
@@ -2171,19 +2177,19 @@ class Va {
2171
2177
  const s = t.lod.get(e.id);
2172
2178
  if (s !== void 0) return s;
2173
2179
  t.avaliacoesLOD++;
2174
- const r = Ai(t.indice.caixaDe(e.id), o);
2180
+ const r = wi(t.indice.caixaDe(e.id), o);
2175
2181
  return t.lod.set(e.id, r), r;
2176
2182
  }
2177
2183
  novaMarca(t, e, o) {
2178
2184
  const i = t.indice.caixaDe(e.id);
2179
2185
  if (!i) return null;
2180
- const n = e.estilo ?? {}, s = ot(n.corPreenchimento ?? n.corTraco ?? t.layerDef.estilo.corPrimaria, Ue);
2186
+ const n = e.estilo ?? {}, s = ot(n.corPreenchimento ?? n.corTraco ?? t.layerDef.estilo.corPrimaria, We);
2181
2187
  return {
2182
2188
  id: e.id,
2183
2189
  lat: (i.minLat + i.maxLat) / 2,
2184
2190
  lon: (i.minLon + i.maxLon) / 2,
2185
2191
  cor: s,
2186
- lado: wi(eo(i, o)),
2192
+ lado: zi(oo(i, o)),
2187
2193
  fonte: e
2188
2194
  };
2189
2195
  }
@@ -2211,7 +2217,7 @@ class Va {
2211
2217
  return;
2212
2218
  }
2213
2219
  if (!t.camadaMarcas) {
2214
- const e = U(t.map, t.layerDef.id, "poligono"), o = new Fa(e, () => t.marcas.values());
2220
+ const e = U(t.map, t.layerDef.id, "poligono"), o = new Oa(e, () => t.marcas.values());
2215
2221
  t.camadaMarcas = o, o.addTo(t.map), o.on("click", (i) => {
2216
2222
  var r, c;
2217
2223
  const { feicaoHit: n, originalEvent: s } = i;
@@ -2220,7 +2226,7 @@ class Va {
2220
2226
  feicao: n,
2221
2227
  aditivo: !!(s && (s.ctrlKey || s.metaKey || s.shiftKey))
2222
2228
  });
2223
- }), t.fonteHit = this.fonteDeMarcas(t, o), Vo(t.map, t.layerDef.id, t.fonteHit);
2229
+ }), t.fonteHit = this.fonteDeMarcas(t, o), jo(t.map, t.layerDef.id, t.fonteHit);
2224
2230
  }
2225
2231
  t.camadaMarcas.solicitarRedesenho();
2226
2232
  }
@@ -2248,11 +2254,11 @@ class Va {
2248
2254
  const u = i.latLngToContainerPoint(g);
2249
2255
  return { x: u.x, y: u.y };
2250
2256
  }, p = i.getZoom(), m = [];
2251
- for (let g = 0; g < Ra && d.length > 0; g++) {
2257
+ for (let g = 0; g < Ba && d.length > 0; g++) {
2252
2258
  const u = de({ x: n.x, y: n.y }, d, h);
2253
2259
  if (!u) break;
2254
2260
  d.splice(d.indexOf(u), 1);
2255
- const v = eo(t.indice.caixaDe(u.id) ?? l, p);
2261
+ const v = oo(t.indice.caixaDe(u.id) ?? l, p);
2256
2262
  m.push({
2257
2263
  feicao: u,
2258
2264
  chave: u.id,
@@ -2266,7 +2272,7 @@ class Va {
2266
2272
  };
2267
2273
  }
2268
2274
  descartarMarcas(t) {
2269
- t.fonteHit && jo(t.map, t.layerDef.id, t.fonteHit), t.fonteHit = null, t.camadaMarcas && (t.map.removeLayer(t.camadaMarcas), t.camadaMarcas = null), t.marcas.clear();
2275
+ t.fonteHit && Ho(t.map, t.layerDef.id, t.fonteHit), t.fonteHit = null, t.camadaMarcas && (t.map.removeLayer(t.camadaMarcas), t.camadaMarcas = null), t.marcas.clear();
2270
2276
  }
2271
2277
  /**
2272
2278
  * Cria a camada Leaflet da feição ou remenda a que existe (e só se algo mudou). `'estilo'` só troca o estilo.
@@ -2317,11 +2323,11 @@ class Va {
2317
2323
  for (const r of t.loja.values()) r.geometria.tipo === "Point" && o(r) && s++;
2318
2324
  t.nPontos = s, t.nPontosRev = t.revisaoBase;
2319
2325
  }
2320
- if (!oo(t.nPontos, e))
2326
+ if (!io(t.nPontos, e))
2321
2327
  return t.agrupador = null, null;
2322
2328
  const i = t.agrupador;
2323
2329
  if (i && i.zoom === e && t.agrupadorRev === t.revisaoBase) return i;
2324
- const n = new zi(e, (s) => t.map.project(y.latLng(s[0], s[1]), e));
2330
+ const n = new Ei(e, (s) => t.map.project(y.latLng(s[0], s[1]), e));
2325
2331
  for (const s of t.loja.values())
2326
2332
  s.geometria.tipo === "Point" && o(s) && n.inserir({ id: s.id, coordenada: s.geometria.coordenada });
2327
2333
  return t.agrupador = n, t.agrupadorRev = t.revisaoBase, n;
@@ -2333,39 +2339,39 @@ class Va {
2333
2339
  e.culling = h !== null;
2334
2340
  const m = p ? e.indice.consultar(p) : r.keys(), g = new Set(m);
2335
2341
  if (c)
2336
- for (const S of c) r.has(S) && g.add(S);
2337
- for (const S of [...g]) {
2338
- const L = r.get(S);
2339
- L && !this.desenhavel(e, L) && g.delete(S);
2342
+ for (const C of c) r.has(C) && g.add(C);
2343
+ for (const C of [...g]) {
2344
+ const L = r.get(C);
2345
+ L && !this.desenhavel(e, L) && g.delete(C);
2340
2346
  }
2341
2347
  const u = /* @__PURE__ */ new Map(), v = l ? this.agrupadorAtivo(e, d) : null;
2342
2348
  if (v || (e.agrupador = null), v) {
2343
2349
  for (const L of [...g]) v.emCluster(L) && g.delete(L);
2344
- const S = /* @__PURE__ */ new Map();
2350
+ const C = /* @__PURE__ */ new Map();
2345
2351
  if (c)
2346
2352
  for (const L of c) {
2347
2353
  const b = v.chaveDoPonto(L), x = b === void 0 || (z = v.celula(b)) == null ? void 0 : z.membros.get(L);
2348
2354
  if (b !== void 0 && x) {
2349
- const P = S.get(b);
2350
- P ? P.push(x) : S.set(b, [x]);
2355
+ const P = C.get(b);
2356
+ P ? P.push(x) : C.set(b, [x]);
2351
2357
  }
2352
2358
  }
2353
2359
  for (const [L, b] of v.celulasAgrupadas()) {
2354
- const x = S.get(L);
2360
+ const x = C.get(L);
2355
2361
  if (x) for (const E of x) g.add(E.id);
2356
2362
  const P = b.membros.size, A = P - ((x == null ? void 0 : x.length) ?? 0);
2357
2363
  if (A === 1)
2358
2364
  for (const E of b.membros.values()) {
2359
2365
  if (c != null && c.has(E.id)) continue;
2360
- const C = e.indice.caixaDe(E.id);
2361
- (!p || C && _t(C, p)) && g.add(E.id);
2366
+ const S = e.indice.caixaDe(E.id);
2367
+ (!p || S && _t(S, p)) && g.add(E.id);
2362
2368
  break;
2363
2369
  }
2364
2370
  if (!(h && !h.contains([b.somaLat / P, b.somaLon / P])) && A >= 2) {
2365
- let E = b.somaLat, C = b.somaLon;
2371
+ let E = b.somaLat, S = b.somaLon;
2366
2372
  if (x) for (const k of x)
2367
- E -= k.coordenada[0], C -= k.coordenada[1];
2368
- const w = [E / A, C / A];
2373
+ E -= k.coordenada[0], S -= k.coordenada[1];
2374
+ const w = [E / A, S / A];
2369
2375
  u.set(L, {
2370
2376
  coordenada: w,
2371
2377
  total: P,
@@ -2375,18 +2381,18 @@ class Va {
2375
2381
  }
2376
2382
  }
2377
2383
  const M = l ? d : -1;
2378
- for (const S of g) {
2379
- const L = r.get(S);
2380
- L && this.colocarFeicao(t, e, L, d, M, !!(c != null && c.has(S)), o || !!(i != null && i.has(S)));
2381
- }
2382
- for (const S of [...e.entradas.keys()])
2383
- g.has(S) && r.has(S) || this.tirarEntrada(t, e, S);
2384
- for (const S of [...e.marcas.keys()])
2385
- (!g.has(S) || !r.has(S)) && e.marcas.delete(S);
2384
+ for (const C of g) {
2385
+ const L = r.get(C);
2386
+ L && this.colocarFeicao(t, e, L, d, M, !!(c != null && c.has(C)), o || !!(i != null && i.has(C)));
2387
+ }
2388
+ for (const C of [...e.entradas.keys()])
2389
+ g.has(C) && r.has(C) || this.tirarEntrada(t, e, C);
2390
+ for (const C of [...e.marcas.keys()])
2391
+ (!g.has(C) || !r.has(C)) && e.marcas.delete(C);
2386
2392
  this.sincronizarMarcas(e);
2387
- for (const [S, L] of u) this.colocarCluster(t, e, S, L);
2388
- for (const S of [...e.clusters.keys()])
2389
- u.has(S) || this.tirarCluster(t, e, S);
2393
+ for (const [C, L] of u) this.colocarCluster(t, e, C, L);
2394
+ for (const C of [...e.clusters.keys()])
2395
+ u.has(C) || this.tirarCluster(t, e, C);
2390
2396
  }
2391
2397
  /**
2392
2398
  * Reconcilia só o que o delta tocou (o custo não depende do tamanho da camada). Cai no reconcile completo quando
@@ -2396,26 +2402,26 @@ class Va {
2396
2402
  this.reconciliarParcialInterno(t, e, o, i, n), this.sincronizarMarcas(e);
2397
2403
  }
2398
2404
  reconciliarParcialInterno(t, e, o, i, n) {
2399
- const { map: s, layerDef: r, loja: c } = e, l = this.estaCarregado(s), d = l ? s.getZoom() : 0, h = l && c.size > ye, p = l && oo(e.nPontos, d), m = e.agrupador;
2405
+ const { map: s, layerDef: r, loja: c } = e, l = this.estaCarregado(s), d = l ? s.getZoom() : 0, h = l && c.size > ye, p = l && io(e.nPontos, d), m = e.agrupador;
2400
2406
  if (n || h !== e.culling || p !== (m !== null) || m !== null && (m.zoom !== d || e.agrupadorRev !== e.revisaoBase)) {
2401
2407
  this.reconciliar(t, e, !1, new Set(o));
2402
2408
  return;
2403
2409
  }
2404
- const g = this.selecionadas.get(r), u = (P) => this.desenhavel(e, P), v = h ? s.getBounds().pad(be) : null, M = v ? this.caixaDe(v) : null, z = l ? d : -1, S = (P, A) => {
2410
+ const g = this.selecionadas.get(r), u = (P) => this.desenhavel(e, P), v = h ? s.getBounds().pad(be) : null, M = v ? this.caixaDe(v) : null, z = l ? d : -1, C = (P, A) => {
2405
2411
  const E = c.get(P);
2406
2412
  if (!E || !u(E)) {
2407
2413
  this.tirarEntrada(t, e, P), e.marcas.delete(P);
2408
2414
  return;
2409
2415
  }
2410
- const C = !!(g != null && g.has(P));
2411
- if (!C && M) {
2416
+ const S = !!(g != null && g.has(P));
2417
+ if (!S && M) {
2412
2418
  const w = e.indice.caixaDe(P);
2413
2419
  if (!w || !_t(w, M)) {
2414
2420
  this.tirarEntrada(t, e, P), e.marcas.delete(P);
2415
2421
  return;
2416
2422
  }
2417
2423
  }
2418
- this.colocarFeicao(t, e, E, d, z, C, A);
2424
+ this.colocarFeicao(t, e, E, d, z, S, A);
2419
2425
  }, L = /* @__PURE__ */ new Set(), b = [];
2420
2426
  for (const P of i) {
2421
2427
  this.tirarEntrada(t, e, P), e.marcas.delete(P);
@@ -2429,28 +2435,28 @@ class Va {
2429
2435
  const E = m == null ? void 0 : m.remover(P);
2430
2436
  E !== void 0 && L.add(E), m && A.geometria.tipo === "Point" && u(A) ? L.add(m.inserir({ id: P, coordenada: A.geometria.coordenada })) : b.push(P);
2431
2437
  }
2432
- for (const P of b) S(P, !0);
2438
+ for (const P of b) C(P, !0);
2433
2439
  if (!m) return;
2434
2440
  const x = new Set(o);
2435
2441
  for (const P of L) {
2436
2442
  const A = m.celula(P);
2437
2443
  if (!A || A.membros.size < 2) {
2438
- if (this.tirarCluster(t, e, P), A) for (const R of A.membros.keys()) S(R, x.has(R));
2444
+ if (this.tirarCluster(t, e, P), A) for (const R of A.membros.keys()) C(R, x.has(R));
2439
2445
  continue;
2440
2446
  }
2441
2447
  const E = A.membros.size;
2442
- let C = A.somaLat, w = A.somaLon, k = 0;
2448
+ let S = A.somaLat, w = A.somaLon, k = 0;
2443
2449
  for (const R of A.membros.values())
2444
- g != null && g.has(R.id) && (k++, C -= R.coordenada[0], w -= R.coordenada[1]);
2450
+ g != null && g.has(R.id) && (k++, S -= R.coordenada[0], w -= R.coordenada[1]);
2445
2451
  const I = E - k;
2446
2452
  for (const R of A.membros.values())
2447
- g != null && g.has(R.id) || I === 1 ? S(R.id, x.has(R.id)) : this.tirarEntrada(t, e, R.id);
2453
+ g != null && g.has(R.id) || I === 1 ? C(R.id, x.has(R.id)) : this.tirarEntrada(t, e, R.id);
2448
2454
  const N = [A.somaLat / E, A.somaLon / E];
2449
2455
  if (v && !v.contains(N) || I < 2) {
2450
2456
  this.tirarCluster(t, e, P);
2451
2457
  continue;
2452
2458
  }
2453
- const $ = [C / I, w / I];
2459
+ const $ = [S / I, w / I];
2454
2460
  this.colocarCluster(t, e, P, {
2455
2461
  coordenada: $,
2456
2462
  total: E,
@@ -2459,7 +2465,7 @@ class Va {
2459
2465
  }
2460
2466
  }
2461
2467
  criarMarcadorCluster(t, e, o, i) {
2462
- const n = ai(e, i.layerDef.estilo), s = y.marker(t, {
2468
+ const n = ni(e, i.layerDef.estilo), s = y.marker(t, {
2463
2469
  icon: n,
2464
2470
  pane: U(i.map, i.layerDef.id, "ponto"),
2465
2471
  keyboard: !1
@@ -2503,29 +2509,29 @@ class Va {
2503
2509
  }
2504
2510
  }
2505
2511
  this.colocarFeicao(t, o, M, d, h, z, "estilo");
2506
- const S = z ? o.entradas.get(v) : void 0;
2507
- S && "bringToFront" in S.layer && S.layer.bringToFront();
2512
+ const C = z ? o.entradas.get(v) : void 0;
2513
+ C && "bringToFront" in C.layer && C.layer.bringToFront();
2508
2514
  }, u = (this.tokenLote.get(t) ?? 0) + 1;
2509
- if (this.tokenLote.set(t, u), s.length <= Oa)
2515
+ if (this.tokenLote.set(t, u), s.length <= Na)
2510
2516
  s.forEach(g);
2511
2517
  else {
2512
2518
  const v = l ? this.caixaDe(r.getBounds()) : null, M = (b) => {
2513
2519
  if (!v) return !0;
2514
2520
  const x = o.indice.caixaDe(b);
2515
2521
  return !x || _t(x, v);
2516
- }, z = s.filter(M), S = s.filter((b) => !M(b));
2522
+ }, z = s.filter(M), C = s.filter((b) => !M(b));
2517
2523
  z.forEach(g);
2518
2524
  const L = () => {
2519
- this.tokenLote.get(t) !== u || !o.vivo || (S.splice(0, Na).forEach(g), S.length > 0 ? xe(L) : this.sincronizarMarcas(o));
2525
+ this.tokenLote.get(t) !== u || !o.vivo || (C.splice(0, Ra).forEach(g), C.length > 0 ? xe(L) : this.sincronizarMarcas(o));
2520
2526
  };
2521
- S.length > 0 && xe(L);
2527
+ C.length > 0 && xe(L);
2522
2528
  }
2523
2529
  m ? this.reconciliar(t, o, !1, null) : this.sincronizarMarcas(o);
2524
2530
  }
2525
2531
  formaDe(t) {
2526
2532
  var o;
2527
2533
  const e = t.geometria;
2528
- return e.tipo === "Point" ? `Point:${(o = t.estilo) != null && o.icone && $e[t.estilo.icone] ? t.estilo.icone : ""}` : bt(e) ? `${e.tipo}:curva` : e.tipo;
2534
+ return e.tipo === "Point" ? `Point:${(o = t.estilo) != null && o.icone && Fe[t.estilo.icone] ? t.estilo.icone : ""}` : bt(e) ? `${e.tipo}:curva` : e.tipo;
2529
2535
  }
2530
2536
  paneDe(t) {
2531
2537
  switch (t.geometria.tipo) {
@@ -2541,11 +2547,11 @@ class Va {
2541
2547
  }
2542
2548
  }
2543
2549
  estiloVetor(t, e, o, i = !1) {
2544
- return Fe(ke(t, e.estilo, i), o);
2550
+ return Oe(Ie(t, e.estilo, i), o);
2545
2551
  }
2546
2552
  criar(t, e, o, i, n) {
2547
2553
  var d;
2548
- const s = U(o, e.id, this.paneDe(t)), r = t.geometria, c = this.estiloVetor(t, e, i, n), l = Ye(r, { ...c, pane: s });
2554
+ const s = U(o, e.id, this.paneDe(t)), r = t.geometria, c = this.estiloVetor(t, e, i, n), l = Ke(r, { ...c, pane: s });
2549
2555
  if (l) return l;
2550
2556
  switch (r.tipo) {
2551
2557
  case "Polygon":
@@ -2556,9 +2562,9 @@ class Va {
2556
2562
  return y.polyline(r.partes && r.partes.length > 1 ? it(r) : r.coordenadas, { ...c, pane: s });
2557
2563
  case "Point": {
2558
2564
  const h = (d = t.estilo) == null ? void 0 : d.icone;
2559
- return h && $e[h] ? y.marker(r.coordenada, { icon: this.iconeSvg(t, e, n), pane: s, interactive: i }) : y.circleMarker(r.coordenada, {
2565
+ return h && Fe[h] ? y.marker(r.coordenada, { icon: this.iconeSvg(t, e, n), pane: s, interactive: i }) : y.circleMarker(r.coordenada, {
2560
2566
  ...c,
2561
- radius: io(t, e.estilo),
2567
+ radius: ao(t, e.estilo),
2562
2568
  pane: s
2563
2569
  });
2564
2570
  }
@@ -2574,7 +2580,7 @@ class Va {
2574
2580
  remendar(t, e, o, i, n) {
2575
2581
  var c, l;
2576
2582
  const s = e.geometria, r = this.estiloVetor(e, o, i, n);
2577
- (t instanceof Zo || t instanceof Xo) && bt(s) ? (Yo(t, s), t.setStyle(r)) : s.tipo === "Polygon" ? (t.setLatLngs(s.aneis.length === 1 ? s.aneis[0] : s.aneis), t.setStyle(r)) : s.tipo === "LineString" ? (t.setLatLngs(s.partes && s.partes.length > 1 ? it(s) : s.coordenadas), t.setStyle(r)) : s.tipo === "Circle" ? (t.setLatLng(s.centro), t.setRadius(s.raioMetros), t.setStyle(r)) : s.tipo === "Point" && t instanceof y.CircleMarker ? (t.setLatLng(s.coordenada), t.setRadius(io(e, o.estilo)), t.setStyle(r)) : t instanceof y.Marker && (t.setLatLng(s.tipo === "Point" || s.tipo === "Text" ? s.coordenada : t.getLatLng()), t.setIcon(s.tipo === "Text" ? this.iconeTexto(e, o, n) : this.iconeSvg(e, o, n)), s.tipo === "Text" && (i && !e.bloqueada ? (c = t.dragging) == null || c.enable() : (l = t.dragging) == null || l.disable())), this.aplicarRotulo(t, e);
2583
+ (t instanceof Xo || t instanceof Yo) && bt(s) ? (Ko(t, s), t.setStyle(r)) : s.tipo === "Polygon" ? (t.setLatLngs(s.aneis.length === 1 ? s.aneis[0] : s.aneis), t.setStyle(r)) : s.tipo === "LineString" ? (t.setLatLngs(s.partes && s.partes.length > 1 ? it(s) : s.coordenadas), t.setStyle(r)) : s.tipo === "Circle" ? (t.setLatLng(s.centro), t.setRadius(s.raioMetros), t.setStyle(r)) : s.tipo === "Point" && t instanceof y.CircleMarker ? (t.setLatLng(s.coordenada), t.setRadius(ao(e, o.estilo)), t.setStyle(r)) : t instanceof y.Marker && (t.setLatLng(s.tipo === "Point" || s.tipo === "Text" ? s.coordenada : t.getLatLng()), t.setIcon(s.tipo === "Text" ? this.iconeTexto(e, o, n) : this.iconeSvg(e, o, n)), s.tipo === "Text" && (i && !e.bloqueada ? (c = t.dragging) == null || c.enable() : (l = t.dragging) == null || l.disable())), this.aplicarRotulo(t, e);
2578
2584
  }
2579
2585
  /** Só o estilo (seleção): sem `setLatLngs`, que reprojetaria e recalcularia limites da forma. */
2580
2586
  restilizar(t, e, o, i, n) {
@@ -2592,7 +2598,7 @@ class Va {
2592
2598
  t.unbindTooltip();
2593
2599
  return;
2594
2600
  }
2595
- const i = Ei(e, o.campoRotulo);
2601
+ const i = ki(e, o.campoRotulo);
2596
2602
  if (!i) {
2597
2603
  t.unbindTooltip();
2598
2604
  return;
@@ -2623,20 +2629,20 @@ class Va {
2623
2629
  });
2624
2630
  }
2625
2631
  }
2626
- const ja = "rgba(255,255,255,0.9)";
2627
- function Ha(a) {
2632
+ const Ha = "rgba(255,255,255,0.9)";
2633
+ function Ga(a) {
2628
2634
  if (!a) return [];
2629
2635
  const t = a.split(/[\s,]+/).map(Number).filter((e) => Number.isFinite(e) && e >= 0);
2630
2636
  return t.length > 0 && t.some((e) => e > 0) ? t.length % 2 === 1 ? [...t, ...t] : t : [];
2631
2637
  }
2632
- const J = (a) => Number.isFinite(a), Ga = /* @__PURE__ */ new Set(["marca", "poligono", "circulo", "linha", "ponto"]);
2633
- function xo(a) {
2638
+ const J = (a) => Number.isFinite(a), Ua = /* @__PURE__ */ new Set(["marca", "poligono", "circulo", "linha", "ponto"]);
2639
+ function Po(a) {
2634
2640
  let t = 0;
2635
2641
  if (a)
2636
- for (const e of a.itens) Ga.has(e.forma) && t++;
2642
+ for (const e of a.itens) Ua.has(e.forma) && t++;
2637
2643
  return t;
2638
2644
  }
2639
- class ni {
2645
+ class si {
2640
2646
  constructor(t) {
2641
2647
  f(this, "destaques", /* @__PURE__ */ new Set());
2642
2648
  f(this, "destruido", !1);
@@ -2753,7 +2759,7 @@ class ni {
2753
2759
  for (const [s, r] of this.agrupar(e)) {
2754
2760
  const c = n && s.preencher && s.opacidadePreenchimento > 0, l = s.traco && s.peso > 0;
2755
2761
  if (!(!c && !l)) {
2756
- c && (t.fillStyle = s.corPreenchimento), l && (t.strokeStyle = s.cor, t.lineWidth = s.peso, t.setLineDash(Ha(s.dash)), t.lineDashOffset = s.deslocamentoDash ?? 0, t.lineCap = s.terminacao ?? "round", t.lineJoin = s.juncao ?? "round"), i.chamadas += 3;
2762
+ c && (t.fillStyle = s.corPreenchimento), l && (t.strokeStyle = s.cor, t.lineWidth = s.peso, t.setLineDash(Ga(s.dash)), t.lineDashOffset = s.deslocamentoDash ?? 0, t.lineCap = s.terminacao ?? "round", t.lineJoin = s.juncao ?? "round"), i.chamadas += 3;
2757
2763
  for (const d of r)
2758
2764
  t.beginPath(), this.caminho(t, d, o), c && (t.globalAlpha = s.opacidadePreenchimento, t.fill(), i.preenchimentos++, i.chamadas++), l && (t.globalAlpha = s.opacidadeTraco ?? 1, t.stroke(), i.tracos++, i.chamadas++);
2759
2765
  }
@@ -2761,10 +2767,10 @@ class ni {
2761
2767
  }
2762
2768
  /** Halo de destaque (hover): traço claro, mais grosso, por baixo do desenho normal. */
2763
2769
  halo(t, e, o, i) {
2764
- t.strokeStyle = ja, t.lineWidth = Math.max(e.estilo.peso, 1) + 4, t.globalAlpha = 0.9, t.setLineDash([]), t.lineCap = "round", t.lineJoin = "round", t.beginPath(), this.caminho(t, e, o), t.stroke(), i.tracos++, i.chamadas += 4;
2770
+ t.strokeStyle = Ha, t.lineWidth = Math.max(e.estilo.peso, 1) + 4, t.globalAlpha = 0.9, t.setLineDash([]), t.lineCap = "round", t.lineJoin = "round", t.beginPath(), this.caminho(t, e, o), t.stroke(), i.tracos++, i.chamadas += 4;
2765
2771
  }
2766
2772
  }
2767
- function Ua(a, t, e, o) {
2773
+ function Wa(a, t, e, o) {
2768
2774
  const i = [], n = Math.abs(e), s = Math.abs(o);
2769
2775
  return n > 0 && i.push({ x: e > 0 ? a - n : 0, y: 0, largura: n, altura: t }), s > 0 && i.push({ x: e > 0 ? 0 : n, y: o > 0 ? t - s : 0, largura: a - n, altura: s }), i;
2770
2776
  }
@@ -2818,7 +2824,7 @@ const re = class re extends y.Canvas {
2818
2824
  let m = null, g = !1;
2819
2825
  if (p && i && i.mundo) {
2820
2826
  const u = r.x - i.mundo.x, v = r.y - i.mundo.y;
2821
- !this.branco && this.itens <= this.limiteRepintar ? g = !0 : Math.abs(u) < d.x && Math.abs(v) < d.y && ((u !== 0 || v !== 0) && !this.branco && (l.save(), l.setTransform(1, 0, 0, 1, 0, 0), l.globalCompositeOperation = "copy", l.drawImage(c, -u * h, -v * h), l.restore()), m = Ua(d.x, d.y, u, v));
2827
+ !this.branco && this.itens <= this.limiteRepintar ? g = !0 : Math.abs(u) < d.x && Math.abs(v) < d.y && ((u !== 0 || v !== 0) && !this.branco && (l.save(), l.setTransform(1, 0, 0, 1, 0, 0), l.globalCompositeOperation = "copy", l.drawImage(c, -u * h, -v * h), l.restore()), m = Wa(d.x, d.y, u, v));
2822
2828
  }
2823
2829
  !m && !g && ((!this.branco || c.width !== h * d.x || c.height !== h * d.y) && (c.width = h * d.x, c.height = h * d.y), this.branco = !0, c.style.width = `${d.x}px`, c.style.height = `${d.y}px`, this.conteudoValido = !1), this.regioesDaVez = m, this.mundoMin = r, l.setTransform(1, 0, 0, 1, 0, 0), this.fire("update");
2824
2830
  }
@@ -2869,23 +2875,23 @@ const re = class re extends y.Canvas {
2869
2875
  */
2870
2876
  f(re, "limiteRepintar", 500);
2871
2877
  let ae = re;
2872
- const Oe = "cad-formas-sobreposicao", Wa = "7000", Ft = 8, Za = 8, Xa = 20, Ne = typeof requestAnimationFrame == "function" ? (a) => {
2878
+ const Ne = "cad-formas-sobreposicao", Za = "7000", Ft = 8, Xa = 8, Ya = 20, Re = typeof requestAnimationFrame == "function" ? (a) => {
2873
2879
  requestAnimationFrame(a);
2874
2880
  } : (a) => {
2875
2881
  setTimeout(a, 16);
2876
- }, Ya = /* @__PURE__ */ new Set(["icone", "texto", "cluster", "rotulo", "curva"]), et = /* @__PURE__ */ new WeakMap();
2882
+ }, Ka = /* @__PURE__ */ new Set(["icone", "texto", "cluster", "rotulo", "curva"]), et = /* @__PURE__ */ new WeakMap();
2877
2883
  function rt(a) {
2878
2884
  return { caixa: a.caixa, zoom: a.zoom, larguraPx: a.larguraPx, alturaPx: a.alturaPx, dpr: a.dpr, origemPx: a.origemPx };
2879
2885
  }
2880
- const Ka = (a) => !!a._loaded;
2881
- function Ja(a) {
2886
+ const Ja = (a) => !!a._loaded;
2887
+ function Qa(a) {
2882
2888
  const t = et.get(a);
2883
2889
  if (t) return t;
2884
2890
  const e = { estados: /* @__PURE__ */ new Set(), quadro: null, agendado: !1, noMapa: !1 };
2885
- return e.pintor = new ni({
2891
+ return e.pintor = new si({
2886
2892
  camada: () => null,
2887
2893
  sobreposicao: () => e.quadro ? { ctx: e.quadro.ctx, largura: e.quadro.larguraPx, altura: e.quadro.alturaPx, dpr: e.quadro.dpr } : null
2888
- }), e.canvas = new ae({ pane: Oe, padding: 0.1 }, (o) => {
2894
+ }), e.canvas = new ae({ pane: Ne, padding: 0.1 }, (o) => {
2889
2895
  e.quadro = o;
2890
2896
  const i = rt(o), n = [];
2891
2897
  for (const s of [...e.estados].sort((r, c) => r.layerDef.zIndex - c.layerDef.zIndex)) {
@@ -2896,41 +2902,41 @@ function Ja(a) {
2896
2902
  return o.branco && n.length === 0 ? !1 : (e.pintor.desenhar({ vista: i, origem: o.origemPx, camadas: n }, i, { alvo: "sobreposicao" }), n.length > 0);
2897
2903
  }), et.set(a, e), e;
2898
2904
  }
2899
- function Qa(a, t) {
2905
+ function tn(a, t) {
2900
2906
  t.noMapa || (t.noMapa = !0, a.whenReady(() => {
2901
- if (!a.getPane(Oe)) {
2902
- const e = a.createPane(Oe);
2903
- e.style.zIndex = Wa, e.style.pointerEvents = "none";
2907
+ if (!a.getPane(Ne)) {
2908
+ const e = a.createPane(Ne);
2909
+ e.style.zIndex = Za, e.style.pointerEvents = "none";
2904
2910
  }
2905
2911
  et.get(a) === t && a.addLayer(t.canvas);
2906
2912
  }));
2907
2913
  }
2908
2914
  function Ot(a) {
2909
- a.agendado || (a.agendado = !0, Ne(() => {
2915
+ a.agendado || (a.agendado = !0, Re(() => {
2910
2916
  a.agendado = !1, a.noMapa && a.canvas.pintar();
2911
2917
  }));
2912
2918
  }
2913
- class tn {
2919
+ class en {
2914
2920
  constructor() {
2915
2921
  f(this, "estados", /* @__PURE__ */ new WeakMap());
2916
2922
  /** Por definição de camada, para a seleção sobreviver à recriação do grupo (ocultar e exibir a camada). */
2917
- f(this, "selecionadas", ii);
2923
+ f(this, "selecionadas", ai);
2918
2924
  }
2919
2925
  // ---------------------------------------------------------------- ILayerRenderer
2920
2926
  render(t, e, o) {
2921
- const i = y.layerGroup(), n = new ki(), s = o.regraVersoes;
2927
+ const i = y.layerGroup(), n = new Ii(), s = o.regraVersoes;
2922
2928
  s && n.definirRegra((d, h) => s.visivel(d, h)), n.definirCamada(this.defMotor(t)), n.definirFeicoes(t.id, this.feicoesDe(t));
2923
2929
  const r = this.selecionadas.get(t);
2924
2930
  r && n.selecionar(t.id, r);
2925
2931
  const c = { layerDef: t, map: e, context: o, grupo: i, motor: n, interativo: t.interativo && !t.bloqueada, quadro: null, dom: /* @__PURE__ */ new Map(), fonteHit: null, agendado: !1, agendadoDom: !1, vivo: !0, ultima: null };
2926
- c.pintor = new ni({
2932
+ c.pintor = new si({
2927
2933
  camada: () => c.quadro ? { ctx: c.quadro.ctx, largura: c.quadro.larguraPx, altura: c.quadro.alturaPx, dpr: c.quadro.dpr } : null,
2928
2934
  sobreposicao: () => null
2929
2935
  }), e.getPane(gt(t.id)) || e.createPane(gt(t.id)), c.base = new ae({ pane: gt(t.id), padding: 0.1, incremental: !0 }, (d) => this.pintarBase(c, d)), this.estados.set(i, c), e.whenReady(() => {
2930
2936
  c.vivo && i.addLayer(c.base);
2931
2937
  });
2932
- const l = Ja(e);
2933
- return l.estados.add(c), Qa(e, l), this.registrarHit(c), i;
2938
+ const l = Qa(e);
2939
+ return l.estados.add(c), tn(e, l), this.registrarHit(c), i;
2934
2940
  }
2935
2941
  update(t, e, o, i, n) {
2936
2942
  var r;
@@ -2953,7 +2959,7 @@ class tn {
2953
2959
  destroy(t, e) {
2954
2960
  const o = t, i = this.estados.get(o);
2955
2961
  if (i) {
2956
- i.vivo = !1, i.fonteHit && jo(i.map, i.layerDef.id, i.fonteHit), i.fonteHit = null;
2962
+ i.vivo = !1, i.fonteHit && Ho(i.map, i.layerDef.id, i.fonteHit), i.fonteHit = null;
2957
2963
  const n = et.get(i.map);
2958
2964
  n && (n.estados.delete(i), Ot(n)), i.pintor.destruir(), i.dom.clear();
2959
2965
  }
@@ -3050,13 +3056,13 @@ class tn {
3050
3056
  return Array.isArray(o) ? o : [];
3051
3057
  }
3052
3058
  pedirBase(t) {
3053
- t.agendado || !t.vivo || (t.agendado = !0, Ne(() => {
3059
+ t.agendado || !t.vivo || (t.agendado = !0, Re(() => {
3054
3060
  t.agendado = !1, t.vivo && t.base.pintar();
3055
3061
  }));
3056
3062
  }
3057
3063
  /** Sincroniza só os marcadores DOM com a vista atual (clusters, ícones, textos, rótulos), sem repintar o canvas. */
3058
3064
  pedirDom(t) {
3059
- t.agendadoDom || !t.vivo || (t.agendadoDom = !0, Ne(() => {
3065
+ t.agendadoDom || !t.vivo || (t.agendadoDom = !0, Re(() => {
3060
3066
  if (t.agendadoDom = !1, !t.vivo) return;
3061
3067
  const e = t.base.quadroAtual();
3062
3068
  if (!e) return;
@@ -3071,7 +3077,7 @@ class tn {
3071
3077
  }
3072
3078
  /** A vista de uma faixa exposta no pan incremental (a origem continua sendo a do canvas inteiro). */
3073
3079
  vistaDaFaixa(t, e) {
3074
- const o = Za, [i, n] = ao(t.origemPx.x + e.x - o, t.origemPx.y + e.y - o, t.zoom), [s, r] = ao(t.origemPx.x + e.x + e.largura + o, t.origemPx.y + e.y + e.altura + o, t.zoom);
3080
+ const o = Xa, [i, n] = no(t.origemPx.x + e.x - o, t.origemPx.y + e.y - o, t.zoom), [s, r] = no(t.origemPx.x + e.x + e.largura + o, t.origemPx.y + e.y + e.altura + o, t.zoom);
3075
3081
  return {
3076
3082
  ...rt(t),
3077
3083
  larguraPx: e.largura,
@@ -3092,13 +3098,13 @@ class tn {
3092
3098
  if (e.regioes) {
3093
3099
  i = 0;
3094
3100
  for (const r of e.regioes) {
3095
- const c = this.vistaDaFaixa(e, r), l = t.motor.listaDesenho(c, { camadas: [o], parte: "canvas" }), d = xo(l.camadas[0]);
3101
+ const c = this.vistaDaFaixa(e, r), l = t.motor.listaDesenho(c, { camadas: [o], parte: "canvas" }), d = Po(l.camadas[0]);
3096
3102
  d !== 0 && (t.pintor.desenhar(l, c, { limpar: !1, recorte: r }), i += d);
3097
3103
  }
3098
3104
  const s = t.motor.listaDesenho(rt(e), { camadas: [o], parte: "dom" }).camadas[0];
3099
3105
  s && this.sincronizarDom(t, s);
3100
3106
  } else {
3101
- const s = rt(e), r = t.motor.listaDesenho(s, { camadas: [o] }), c = r.camadas[0] ?? null, l = xo(c);
3107
+ const s = rt(e), r = t.motor.listaDesenho(s, { camadas: [o] }), c = r.camadas[0] ?? null, l = Po(c);
3102
3108
  c ? l === 0 && e.branco ? i = 0 : (t.pintor.desenhar(r, s), i = l) : i = !e.branco, t.ultima = c, c && this.sincronizarDom(t, c);
3103
3109
  }
3104
3110
  const n = et.get(t.map);
@@ -3118,7 +3124,7 @@ class tn {
3118
3124
  sincronizarDom(t, e) {
3119
3125
  const o = /* @__PURE__ */ new Set();
3120
3126
  for (const i of e.itens) {
3121
- if (!Ya.has(i.forma)) continue;
3127
+ if (!Ka.has(i.forma)) continue;
3122
3128
  const n = `${i.forma}:${i.id}`;
3123
3129
  o.add(n);
3124
3130
  try {
@@ -3171,7 +3177,7 @@ class tn {
3171
3177
  const p = o.total ?? 0, m = `${o.id}:${p}:${o.restantes ?? 0}:${o.coordenada[0].toFixed(7)}:${o.coordenada[1].toFixed(7)}`;
3172
3178
  if ((c == null ? void 0 : c.assinatura) === m) return;
3173
3179
  c && s.removeLayer(c.layer);
3174
- const g = y.marker(o.coordenada, { icon: ai(p, l), pane: U(i, n.id, "ponto"), keyboard: !1 });
3180
+ const g = y.marker(o.coordenada, { icon: ni(p, l), pane: U(i, n.id, "ponto"), keyboard: !1 });
3175
3181
  g.bindTooltip(`${p} feições agrupadas`, { direction: "top" }), g.on("click", () => {
3176
3182
  const u = t.motor.membrosDoCluster(n.id, o.id);
3177
3183
  u.length > 0 && i.fitBounds(y.latLngBounds(u.map((v) => v.coordenada)), { padding: [60, 60], maxZoom: 18 });
@@ -3194,13 +3200,13 @@ class tn {
3194
3200
  return;
3195
3201
  }
3196
3202
  if (o.forma === "curva" && r) {
3197
- const p = r.geometria, m = (u) => Fe(ke(r, l, u), t.interativo);
3203
+ const p = r.geometria, m = (u) => Oe(Ie(r, l, u), t.interativo);
3198
3204
  if (c) {
3199
3205
  const u = c.layer;
3200
- c.fonte !== r ? (Yo(u, p), u.setStyle(m(o.selecionada)), c.fonte = r, c.selecionada = o.selecionada) : c.selecionada !== o.selecionada && (u.setStyle(m(o.selecionada)), c.selecionada = o.selecionada);
3206
+ c.fonte !== r ? (Ko(u, p), u.setStyle(m(o.selecionada)), c.fonte = r, c.selecionada = o.selecionada) : c.selecionada !== o.selecionada && (u.setStyle(m(o.selecionada)), c.selecionada = o.selecionada);
3201
3207
  return;
3202
3208
  }
3203
- const g = Ye(p, { ...m(o.selecionada), pane: U(i, n.id, p.tipo === "Polygon" ? "poligono" : "linha") });
3209
+ const g = Ke(p, { ...m(o.selecionada), pane: U(i, n.id, p.tipo === "Polygon" ? "poligono" : "linha") });
3204
3210
  if (!g || !bt(p)) return;
3205
3211
  g.on("click", (u) => this.acao(t, r, u)), s.addLayer(g), t.dom.set(e, { layer: g, fonte: r, selecionada: o.selecionada, assinatura: "" });
3206
3212
  }
@@ -3218,7 +3224,7 @@ class tn {
3218
3224
  c && c.selecionada !== i && this.trocarIcone(c, o, n, i);
3219
3225
  }
3220
3226
  const s = t.dom.get(`curva:${e}`);
3221
- s && s.selecionada !== i && (s.layer.setStyle(Fe(ke(o, n, i), t.interativo)), s.selecionada = i);
3227
+ s && s.selecionada !== i && (s.layer.setStyle(Oe(Ie(o, n, i), t.interativo)), s.selecionada = i);
3222
3228
  }
3223
3229
  // ---------------------------------------------------------------- hit-test central
3224
3230
  /**
@@ -3231,7 +3237,7 @@ class tn {
3231
3237
  alvo: t.base,
3232
3238
  consultar: (o) => {
3233
3239
  const { map: i, layerDef: n, motor: s } = t;
3234
- if (!t.vivo || !t.interativo || !n.visivel || !Ka(i)) return [];
3240
+ if (!t.vivo || !t.interativo || !n.visivel || !Ja(i)) return [];
3235
3241
  const r = i.layerPointToContainerPoint(o), c = i.containerPointToLatLng([r.x - Ft, r.y + Ft]), l = i.containerPointToLatLng([r.x + Ft, r.y - Ft]), d = {
3236
3242
  minLat: Math.min(c.lat, l.lat),
3237
3243
  maxLat: Math.max(c.lat, l.lat),
@@ -3246,13 +3252,13 @@ class tn {
3246
3252
  const u = i.latLngToContainerPoint(g);
3247
3253
  return { x: u.x, y: u.y };
3248
3254
  }, m = [];
3249
- for (let g = 0; g < Xa && h.length > 0; g++) {
3255
+ for (let g = 0; g < Ya && h.length > 0; g++) {
3250
3256
  const u = de({ x: r.x, y: r.y }, h, p);
3251
3257
  if (!u) break;
3252
3258
  h.splice(h.indexOf(u), 1);
3253
3259
  const v = s.caixaDe(n.id, u.id), M = v ? (() => {
3254
- const z = i.latLngToContainerPoint([v.minLat, v.minLon]), S = i.latLngToContainerPoint([v.maxLat, v.maxLon]);
3255
- return Math.abs(S.x - z.x) * Math.abs(S.y - z.y);
3260
+ const z = i.latLngToContainerPoint([v.minLat, v.minLon]), C = i.latLngToContainerPoint([v.maxLat, v.maxLon]);
3261
+ return Math.abs(C.x - z.x) * Math.abs(C.y - z.y);
3256
3262
  })() : 0;
3257
3263
  m.push({
3258
3264
  feicao: u,
@@ -3265,7 +3271,7 @@ class tn {
3265
3271
  return m;
3266
3272
  }
3267
3273
  };
3268
- t.fonteHit = e, Vo(t.map, t.layerDef.id, e), t.base.on("click", (o) => {
3274
+ t.fonteHit = e, jo(t.map, t.layerDef.id, e), t.base.on("click", (o) => {
3269
3275
  var r, c;
3270
3276
  const { feicaoHit: i, originalEvent: n } = o;
3271
3277
  if (!i || !t.vivo) return;
@@ -3281,8 +3287,8 @@ class tn {
3281
3287
  function Gt(a) {
3282
3288
  return String(a ?? "").trim().toLowerCase() === "canvas" ? "canvas" : "leaflet";
3283
3289
  }
3284
- class en {
3285
- constructor(t = new Va(), e = new tn()) {
3290
+ class on {
3291
+ constructor(t = new ja(), e = new en()) {
3286
3292
  f(this, "roteamento", /* @__PURE__ */ new WeakMap());
3287
3293
  this.leaflet = t, this.canvas = e;
3288
3294
  }
@@ -3334,14 +3340,14 @@ class en {
3334
3340
  this.de(t).aplicarSelecao(t, e);
3335
3341
  }
3336
3342
  }
3337
- O.register("tile", new sa());
3338
- O.register("wms", new ra());
3339
- O.register("vetorial-linhas", new ca());
3340
- O.register("vetorial-pontos", new da());
3341
- O.register("vetorial-poligonos", new ha());
3342
- O.register("grid", new ua());
3343
- O.register("feicoes", new en());
3344
- const Po = [
3343
+ O.register("tile", new ra());
3344
+ O.register("wms", new ca());
3345
+ O.register("vetorial-linhas", new la());
3346
+ O.register("vetorial-pontos", new ha());
3347
+ O.register("vetorial-poligonos", new ua());
3348
+ O.register("grid", new pa());
3349
+ O.register("feicoes", new on());
3350
+ const Lo = [
3345
3351
  {
3346
3352
  id: "satelite",
3347
3353
  nome: "Satélite Google Híbrido",
@@ -3465,8 +3471,11 @@ const Po = [
3465
3471
  scaleMode: "screen"
3466
3472
  }
3467
3473
  }
3468
- ], on = /* @__PURE__ */ new Set(["tile", "wms", "grid"]);
3469
- class an {
3474
+ ], an = /* @__PURE__ */ new Set(["tile", "wms", "grid"]);
3475
+ function Pe(a, t) {
3476
+ return typeof a == "number" && Number.isFinite(a) ? Math.max(0, Math.min(1, a)) : t;
3477
+ }
3478
+ class nn {
3470
3479
  constructor(t) {
3471
3480
  f(this, "layers", []);
3472
3481
  f(this, "layerInstances", /* @__PURE__ */ new Map());
@@ -3477,7 +3486,7 @@ class an {
3477
3486
  // cada um mudava o contexto e recriava todas as camadas. Agora as mudanças de contexto do mesmo tick
3478
3487
  // viram um único render (em microtask), antecipado por qualquer leitura/alteração das instâncias.
3479
3488
  f(this, "renderPendente", !1);
3480
- this.layers = (t || Po).map((e) => ({ ...e, estilo: { ...e.estilo } }));
3489
+ this.layers = (t || Lo).map((e) => ({ ...e, estilo: { ...e.estilo } }));
3481
3490
  }
3482
3491
  /**
3483
3492
  * Remove as camadas que o kit traz de fábrica (satélite, SIGEF, homologados, perímetro, vizinhos, vértices, grade).
@@ -3485,7 +3494,7 @@ class an {
3485
3494
  */
3486
3495
  descartarCamadasPadrao() {
3487
3496
  if (this.map) return;
3488
- const t = new Set(Po.map((e) => e.id));
3497
+ const t = new Set(Lo.map((e) => e.id));
3489
3498
  this.layers = this.layers.filter((e) => !t.has(e.id) || e.tipo === "feicoes");
3490
3499
  }
3491
3500
  attachMap(t, e) {
@@ -3495,12 +3504,12 @@ class an {
3495
3504
  this.map && this.layers.forEach((t) => {
3496
3505
  const e = `pane-${t.id}`;
3497
3506
  let o = this.map.getPane(e);
3498
- o || (o = this.map.createPane(e)), o && (o.style.zIndex = String(t.zIndex), o.style.pointerEvents = t.interativo && !t.bloqueada && t.visivel ? "auto" : "none");
3507
+ o || (o = this.map.createPane(e)), o && (o.style.zIndex = String(t.zIndex), o.style.pointerEvents = t.interativo && !t.bloqueada && t.visivel ? "auto" : "none", o.style.opacity = String(Pe(t.opacidade, 1)));
3499
3508
  });
3500
3509
  }
3501
3510
  renderAllLayers(t = !1) {
3502
3511
  this.renderPendente = !1, !(!this.map || !this.context) && (this.layers.forEach((e) => {
3503
- if (!(t && on.has(e.tipo) && e.visivel && this.layerInstances.has(e.id))) {
3512
+ if (!(t && an.has(e.tipo) && e.visivel && this.layerInstances.has(e.id))) {
3504
3513
  if (this.layerInstances.has(e.id)) {
3505
3514
  const o = this.layerInstances.get(e.id), i = O.get(e.tipo);
3506
3515
  i && i.destroy(o, this.map), this.layerInstances.delete(e.id);
@@ -3563,7 +3572,7 @@ class an {
3563
3572
  this.flushRender();
3564
3573
  const o = this.layers.find((n) => n.id === t);
3565
3574
  if (!o) return;
3566
- if (o.opacidade = Math.max(0, Math.min(1, e)), this.map) {
3575
+ if (o.opacidade = Pe(e, o.opacidade), this.map) {
3567
3576
  const n = this.map.getPane(`pane-${t}`);
3568
3577
  n && (n.style.opacity = String(o.opacidade));
3569
3578
  }
@@ -3576,7 +3585,7 @@ class an {
3576
3585
  }
3577
3586
  setLayerZIndex(t, e) {
3578
3587
  const o = this.layers.find((i) => i.id === t);
3579
- if (o) {
3588
+ if (!(!o || !Number.isFinite(e))) {
3580
3589
  if (o.zIndex = e, this.map) {
3581
3590
  const i = this.map.getPane(`pane-${t}`);
3582
3591
  i && (i.style.zIndex = String(e));
@@ -3634,8 +3643,9 @@ class an {
3634
3643
  }
3635
3644
  importState(t) {
3636
3645
  !t || !Array.isArray(t) || (t.forEach((e) => {
3646
+ if (!e) return;
3637
3647
  const o = this.layers.find((i) => i.id === e.id);
3638
- o && (e.visivel !== void 0 && (o.visivel = e.visivel), e.opacidade !== void 0 && (o.opacidade = e.opacidade), e.zIndex !== void 0 && (o.zIndex = e.zIndex), e.bloqueada !== void 0 && (o.bloqueada = e.bloqueada), e.estilo && (o.estilo = { ...o.estilo, ...e.estilo }));
3648
+ o && (e.visivel !== void 0 && (o.visivel = e.visivel), e.opacidade !== void 0 && (o.opacidade = Pe(e.opacidade, o.opacidade)), Number.isFinite(e.zIndex) && (o.zIndex = e.zIndex), e.bloqueada !== void 0 && (o.bloqueada = e.bloqueada), e.estilo && (o.estilo = { ...o.estilo, ...e.estilo }));
3639
3649
  }), this.ensurePanes(), this.renderAllLayers());
3640
3650
  }
3641
3651
  onChange(t) {
@@ -3717,10 +3727,10 @@ class an {
3717
3727
  const i = O.get(o.tipo);
3718
3728
  i && i.destroy(t, this.map);
3719
3729
  }
3720
- }), this.layerInstances.clear()), this.listeners = [];
3730
+ }), this.layerInstances.clear()), this.map = null, this.context = null, this.listeners = [];
3721
3731
  }
3722
3732
  }
3723
- function si(a, t) {
3733
+ function ri(a, t) {
3724
3734
  var s, r;
3725
3735
  if (t == null) return null;
3726
3736
  const e = String(t).trim(), o = (c) => c ? (c.lon = c.lng, c) : null, n = a.getMarkers().find((c) => {
@@ -3774,7 +3784,7 @@ function si(a, t) {
3774
3784
  return o(y.latLng(l / h, d / h));
3775
3785
  }
3776
3786
  if (c.poligono_wkt) {
3777
- const l = Je(c.poligono_wkt);
3787
+ const l = Qe(c.poligono_wkt);
3778
3788
  if (l) return o(y.latLng(l.lat, l.lon));
3779
3789
  }
3780
3790
  }
@@ -3806,7 +3816,7 @@ function si(a, t) {
3806
3816
  const l = c.dados.poligonos.find((d) => String(d.id) === e);
3807
3817
  if (l) {
3808
3818
  if (l.wkt) {
3809
- const d = Je(l.wkt);
3819
+ const d = Qe(l.wkt);
3810
3820
  if (d) return o(y.latLng(d.lat, d.lon));
3811
3821
  }
3812
3822
  if (Array.isArray(l.coordenadas) && l.coordenadas.length > 0) {
@@ -3823,12 +3833,12 @@ function si(a, t) {
3823
3833
  }
3824
3834
  return null;
3825
3835
  }
3826
- function nn(a, t, e, o) {
3836
+ function sn(a, t, e, o) {
3827
3837
  var m, g;
3828
- Re(t, a.getMap());
3838
+ Be(t, a.getMap());
3829
3839
  const i = a.getMap();
3830
3840
  if (!i) return;
3831
- const n = si(a, e);
3841
+ const n = ri(a, e);
3832
3842
  if (!n) {
3833
3843
  console.warn(`[ui-canvas-cad] Elemento com identificador "${e}" não encontrado para destaque.`);
3834
3844
  return;
@@ -3858,13 +3868,13 @@ function nn(a, t, e, o) {
3858
3868
  }), t.destaqueMarker.addTo(i);
3859
3869
  const p = (g = (m = t.destaqueMarker).getElement) == null ? void 0 : g.call(m);
3860
3870
  p && (p.style.pointerEvents = "none"), o != null && o.duracaoMs && o.duracaoMs > 0 && (t.destaqueTimeoutId = window.setTimeout(() => {
3861
- Re(t, i);
3871
+ Be(t, i);
3862
3872
  }, o.duracaoMs));
3863
3873
  }
3864
- function Re(a, t) {
3874
+ function Be(a, t) {
3865
3875
  a.destaqueTimeoutId !== null && (window.clearTimeout(a.destaqueTimeoutId), a.destaqueTimeoutId = null), a.destaqueMarker && (t && t.hasLayer(a.destaqueMarker) ? t.removeLayer(a.destaqueMarker) : typeof a.destaqueMarker.remove == "function" && a.destaqueMarker.remove(), a.destaqueMarker = null);
3866
3876
  }
3867
- function sn(a, t) {
3877
+ function rn(a, t) {
3868
3878
  const e = /* @__PURE__ */ new Map();
3869
3879
  a.forEach((i) => {
3870
3880
  const n = i.lat ?? i.latitude ?? i.y, s = i.lon ?? i.lng ?? i.longitude ?? i.x, r = V(n, s);
@@ -3890,7 +3900,7 @@ function sn(a, t) {
3890
3900
  });
3891
3901
  }), Array.from(o.values()).filter((i) => i.pontos && i.pontos.length > 0 || !!i.poligono_wkt);
3892
3902
  }
3893
- function rn(a, t) {
3903
+ function cn(a, t) {
3894
3904
  const e = /* @__PURE__ */ new Map();
3895
3905
  return t.forEach((o) => {
3896
3906
  o.id !== void 0 && o.id !== null && o.pontos && o.pontos.length > 0 && e.set(o.id, o.pontos);
@@ -3899,7 +3909,7 @@ function rn(a, t) {
3899
3909
  return i !== void 0 && (!o.pontos || o.pontos.length === 0) && e.has(i) ? { ...o, pontos: e.get(i) } : { ...o };
3900
3910
  });
3901
3911
  }
3902
- function cn(a, t, e = !1) {
3912
+ function ln(a, t, e = !1) {
3903
3913
  let o = [...a];
3904
3914
  e && t && t.forEach((n) => {
3905
3915
  n.pontos && o.push(...n.pontos);
@@ -3910,7 +3920,7 @@ function cn(a, t, e = !1) {
3910
3920
  }).filter((n) => n !== null);
3911
3921
  return i.length === 1 ? { single: i[0] } : i.length > 1 ? { bounds: y.latLngBounds(i) } : null;
3912
3922
  }
3913
- function ln(a, t) {
3923
+ function dn(a, t) {
3914
3924
  var n;
3915
3925
  (n = t == null ? void 0 : t.flushRender) == null || n.call(t);
3916
3926
  const e = [], o = /* @__PURE__ */ new Set(), i = (s) => {
@@ -3922,14 +3932,14 @@ function ln(a, t) {
3922
3932
  i(s), typeof s.eachLayer == "function" && s.eachLayer(i);
3923
3933
  }), e;
3924
3934
  }
3925
- function dn(a, t, e = "vertices", o) {
3935
+ function hn(a, t, e = "vertices", o) {
3926
3936
  const i = t || [];
3927
3937
  a.layerManager.getOrCreateLayer(e, "vetorial-pontos", "Pontos / Vértices"), e === "vertices" && (a.context.pontos = i, a.canvasInteracao.ctx.pontosList = i, o && (a.customMarkerClickCallback = (n) => {
3928
3938
  const s = i.find((r) => String(r.id) === String(n)) || { id: n, lat: 0, lon: 0 };
3929
3939
  o(s);
3930
3940
  })), a.layerManager.setLayerData(e, { pontos: i, onClique: o }), a.layerManager.setLayerVisibility(e, !0);
3931
3941
  }
3932
- function hn(a, t, e = "linhas") {
3942
+ function un(a, t, e = "linhas") {
3933
3943
  const o = t || [];
3934
3944
  a.layerManager.getOrCreateLayer(e, "vetorial-linhas", "Conexões / Linhas"), (e === "linhas" || e === "perimetro") && (a.context.segmentos = o.map((i) => ({
3935
3945
  ponto_inicio_id: Number(i.origemId) || 0,
@@ -3937,7 +3947,7 @@ function hn(a, t, e = "linhas") {
3937
3947
  tipo_limite_sigef: i.tipoLinha === "tracejada" ? "LN1" : "LA1"
3938
3948
  }))), a.layerManager.setLayerData(e, { conexoes: o }), a.layerManager.setLayerVisibility(e, !0);
3939
3949
  }
3940
- function un(a, t, e = !0, o = "polilinha", i) {
3950
+ function pn(a, t, e = !0, o = "polilinha", i) {
3941
3951
  const n = t || [];
3942
3952
  a.layerManager.getOrCreateLayer(o, "vetorial-linhas", "Polilinhas"), (o === "polilinha" || o === "perimetro") && (a.context.pontos = n, a.context.segmentos = [], a.canvasInteracao.ctx.pontosList = n);
3943
3953
  const s = i || a.chaveGrupo || a.context.chaveGrupo;
@@ -3948,11 +3958,11 @@ function un(a, t, e = !0, o = "polilinha", i) {
3948
3958
  chaveGrupo: s
3949
3959
  }), a.layerManager.setLayerVisibility(o, !0);
3950
3960
  }
3951
- function pn(a, t, e = "poligonos") {
3961
+ function fn(a, t, e = "poligonos") {
3952
3962
  const o = t || [];
3953
3963
  a.layerManager.getOrCreateLayer(e, "vetorial-poligonos", "Polígonos"), a.layerManager.setLayerData(e, { poligonos: o }), a.layerManager.setLayerVisibility(e, !0);
3954
3964
  }
3955
- function fn(a, t, e) {
3965
+ function mn(a, t, e) {
3956
3966
  const o = t || [];
3957
3967
  if (e != null) {
3958
3968
  const i = e || [];
@@ -3963,7 +3973,7 @@ function fn(a, t, e) {
3963
3973
  ...e != null ? { pontos: a.context.pontos } : {}
3964
3974
  });
3965
3975
  }
3966
- function mn(a, t = !1) {
3976
+ function gn(a, t = !1) {
3967
3977
  a.context.pontos = [], a.context.segmentos = [], a.context.confrontantes = [], a.canvasInteracao.ctx.pontosList = [], a.canvasInteracao.limparSelecao();
3968
3978
  const e = {
3969
3979
  pontos: [],
@@ -3972,28 +3982,28 @@ function mn(a, t = !1) {
3972
3982
  };
3973
3983
  t || (a.context.bancoPontos = [], e.bancoPontos = []), a.layerManager.updateContext(e);
3974
3984
  }
3975
- function Lo(a) {
3985
+ function Co(a) {
3976
3986
  return a != null && !isNaN(Number(a)) && String(a).trim() !== "" ? Number(a) : a;
3977
3987
  }
3978
- function gn(a, t) {
3988
+ function vn(a, t) {
3979
3989
  var r, c;
3980
3990
  const e = a.core.map, o = a.layerManager.getLayerDef(t.layerId), i = t.baseSize || 8, n = ((r = a.context.graphicScale) == null ? void 0 : r.markerScaleMultiplier) || 1;
3981
3991
  if (e && ((c = o == null ? void 0 : o.estilo) == null ? void 0 : c.scaleMode) === "world") {
3982
3992
  const l = o.estilo.dimensaoMetros || 0.25, d = e.getCenter(), h = e.getZoom(), p = 40075016686e-3 * Math.abs(Math.cos(d.lat * Math.PI / 180)) / Math.pow(2, h + 8), m = l / (p > 0 ? p : 1);
3983
3993
  return Math.max(3, Math.round(m * n));
3984
3994
  }
3985
- const s = Uo(t.densTotal || 0, (e == null ? void 0 : e.getZoom()) ?? 18);
3995
+ const s = Wo(t.densTotal || 0, (e == null ? void 0 : e.getZoom()) ?? 18);
3986
3996
  return Math.max(s < 1 ? 5 : 4, Math.round(i * n * s));
3987
3997
  }
3988
- function vn(a, t, e, o, i) {
3989
- const n = gn(a, e), s = a.context.config.enableAnimations ? "cad-pt-anim" : "", r = oe(
3998
+ function yn(a, t, e, o, i) {
3999
+ const n = vn(a, e), s = a.context.config.enableAnimations ? "cad-pt-anim" : "", r = oe(
3990
4000
  e.shapeStyle,
3991
4001
  n,
3992
4002
  e.markerBg,
3993
4003
  s,
3994
4004
  `map-marker-${e.layerId || "pts"}-${o}`,
3995
4005
  i,
3996
- { densidade: De(e.densTotal || 0) }
4006
+ { densidade: qe(e.densTotal || 0) }
3997
4007
  );
3998
4008
  e.tamanhoPx = n, t.setIcon(y.divIcon({
3999
4009
  html: r,
@@ -4001,7 +4011,7 @@ function vn(a, t, e, o, i) {
4001
4011
  iconSize: [n + 6, n + 6]
4002
4012
  }));
4003
4013
  }
4004
- function yn(a) {
4014
+ function bn(a) {
4005
4015
  const t = a.context.selectedPontoIds || [], e = a.canvasInteracao.ctx.selectedVizinhoPontoIds || [], o = /* @__PURE__ */ new Set([
4006
4016
  ...t.map(String),
4007
4017
  ...e.map(String)
@@ -4011,12 +4021,12 @@ function yn(a) {
4011
4021
  if (s == null) continue;
4012
4022
  const r = o.has(String(s));
4013
4023
  if (n.isSelected === r) continue;
4014
- n.isSelected = r, i.setZIndexOffset(r ? 2e3 : 0), n.shapeStyle && n.baseSize && n.markerBg && vn(a, i, n, s, r);
4024
+ n.isSelected = r, i.setZIndexOffset(r ? 2e3 : 0), n.shapeStyle && n.baseSize && n.markerBg && yn(a, i, n, s, r);
4015
4025
  const c = i.getElement();
4016
4026
  c && (r ? c.classList.add("cad-marker-selected", "ponto-selecionado") : c.classList.remove("cad-marker-selected", "ponto-selecionado"));
4017
4027
  }
4018
4028
  }
4019
- class bn {
4029
+ class xn {
4020
4030
  constructor(t) {
4021
4031
  f(this, "core");
4022
4032
  f(this, "layerManager");
@@ -4032,7 +4042,7 @@ class bn {
4032
4042
  destaqueMarker: null,
4033
4043
  destaqueTimeoutId: null
4034
4044
  });
4035
- this.core = new Wi(this), this.layerManager = new an(t), this.canvasInteracao = new na({
4045
+ this.core = new Zi(this), this.layerManager = new nn(t), this.canvasInteracao = new sa({
4036
4046
  mapaController: this,
4037
4047
  layerManager: this.layerManager
4038
4048
  }), this.context = {
@@ -4049,7 +4059,7 @@ class bn {
4049
4059
  },
4050
4060
  onMarkerClick: (e, o) => {
4051
4061
  if (this.modoCliqueSequencialAtivo || this.context.modoSequencial) return;
4052
- const i = Lo(e);
4062
+ const i = Co(e);
4053
4063
  if (this.customMarkerClickCallback)
4054
4064
  try {
4055
4065
  this.customMarkerClickCallback(i, o);
@@ -4097,16 +4107,16 @@ class bn {
4097
4107
  this.context.confrontantes = e, this.layerManager.updateContext({ confrontantes: e });
4098
4108
  }
4099
4109
  plotarPontos(t, e = "vertices", o) {
4100
- dn(this, t, e, o);
4110
+ hn(this, t, e, o);
4101
4111
  }
4102
4112
  plotarConexoes(t, e = "linhas") {
4103
- hn(this, t, e);
4113
+ un(this, t, e);
4104
4114
  }
4105
4115
  plotarPolilinhaSequencial(t, e = !0, o = "polilinha", i) {
4106
- un(this, t, e, o, i);
4116
+ pn(this, t, e, o, i);
4107
4117
  }
4108
4118
  plotarPoligonos(t, e = "poligonos") {
4109
- pn(this, t, e);
4119
+ fn(this, t, e);
4110
4120
  }
4111
4121
  limparCamadas(t) {
4112
4122
  this.layerManager.clearLayers(t), (!t || t.length === 0) && this.canvasInteracao.limparSelecao();
@@ -4128,7 +4138,7 @@ class bn {
4128
4138
  e && (this.customMarkerClickCallback = e), this.setPontos(t || []);
4129
4139
  }
4130
4140
  plotSegmentos(t, e) {
4131
- fn(this, t, e);
4141
+ mn(this, t, e);
4132
4142
  }
4133
4143
  plotPolilinhaTemporaria(t) {
4134
4144
  const e = t || [];
@@ -4139,15 +4149,15 @@ class bn {
4139
4149
  this.setBancoPontos(e), this.layerManager.setLayerVisibility("homologados", !0), this.layerManager.setLayerVisibility("homologados-pontos", !0);
4140
4150
  }
4141
4151
  plotPontosVizinhos(t) {
4142
- const e = sn(t || [], this.context.confrontantes || []);
4152
+ const e = rn(t || [], this.context.confrontantes || []);
4143
4153
  this.setConfrontantes(e), this.layerManager.setLayerVisibility("vizinhos", !0);
4144
4154
  }
4145
4155
  plotPoligonosVizinhos(t) {
4146
- const e = rn(t || [], this.context.confrontantes || []);
4156
+ const e = cn(t || [], this.context.confrontantes || []);
4147
4157
  this.setConfrontantes(e), this.layerManager.setLayerVisibility("vizinhos", !0);
4148
4158
  }
4149
4159
  clearOverlays(t = !1) {
4150
- mn(this, t);
4160
+ gn(this, t);
4151
4161
  }
4152
4162
  setGraphicScale(t) {
4153
4163
  this.layerManager.setGraphicScale(t);
@@ -4163,13 +4173,13 @@ class bn {
4163
4173
  const o = String(t), i = this.getMarkers().find((s) => String(s.pontoId) === o);
4164
4174
  if (i && e !== void 0) {
4165
4175
  const s = this.core.map;
4166
- s.setView(i.getLatLng(), e), Xe(s, () => i.openPopup());
4176
+ s.setView(i.getLatLng(), e), Ye(s, () => i.openPopup());
4167
4177
  }
4168
- const n = Lo(t);
4178
+ const n = Co(t);
4169
4179
  this.canvasInteracao.ctx.selectedPontoIds = [n], this.canvasInteracao.ctx.lastSelectedPontoId = n, this.context.selectedPontoIds = [n], this.atualizarDestaqueMarcadores();
4170
4180
  }
4171
4181
  atualizarDestaqueMarcadores() {
4172
- yn(this);
4182
+ bn(this);
4173
4183
  }
4174
4184
  selectSegmento(t) {
4175
4185
  const e = t != null ? String(t) : null;
@@ -4177,7 +4187,7 @@ class bn {
4177
4187
  }
4178
4188
  fitBounds(t, e = [40, 40], o = !1) {
4179
4189
  if (!this.core.map) return;
4180
- const i = cn(t || this.context.pontos || [], this.context.confrontantes, o);
4190
+ const i = ln(t || this.context.pontos || [], this.context.confrontantes, o);
4181
4191
  if (i) {
4182
4192
  i.single ? this.core.map.setView(i.single, 18) : i.bounds && (this.core.map.fitBounds(i.bounds, { padding: e }), this.core.map.once("moveend", () => {
4183
4193
  this.core.preCarregarTilesRegiao(i.bounds);
@@ -4189,7 +4199,7 @@ class bn {
4189
4199
  }
4190
4200
  }
4191
4201
  getMarkers() {
4192
- return ln(this.core.map, this.layerManager);
4202
+ return dn(this.core.map, this.layerManager);
4193
4203
  }
4194
4204
  getVizinhosMarkers() {
4195
4205
  return this.getMarkers().filter((t) => !!t.isVizinho);
@@ -4198,13 +4208,13 @@ class bn {
4198
4208
  return this.destaqueState.destaqueMarker !== null;
4199
4209
  }
4200
4210
  localizarCoordenadasElemento(t) {
4201
- return si(this, t);
4211
+ return ri(this, t);
4202
4212
  }
4203
4213
  destacarElemento(t, e) {
4204
- nn(this, this.destaqueState, t, e);
4214
+ sn(this, this.destaqueState, t, e);
4205
4215
  }
4206
4216
  limparDestaque() {
4207
- Re(this.destaqueState, this.getMap());
4217
+ Be(this.destaqueState, this.getMap());
4208
4218
  }
4209
4219
  destroy() {
4210
4220
  if (this.limparDestaque(), this.canvasInteracao.desativar(), this.layerManager.destroy(), this.core.destroy(), this.core.map)
@@ -4219,7 +4229,7 @@ class bn {
4219
4229
  return this.core.map;
4220
4230
  }
4221
4231
  }
4222
- function xn(a, t, e, o) {
4232
+ function Pn(a, t, e, o) {
4223
4233
  if (!a) return;
4224
4234
  if (a.querySelectorAll(".layer-item").length === t.length) {
4225
4235
  t.forEach((n) => {
@@ -4299,18 +4309,18 @@ function xn(a, t, e, o) {
4299
4309
  });
4300
4310
  });
4301
4311
  }
4302
- function Pn(a) {
4312
+ function Ln(a) {
4303
4313
  return a.context.selectedPontoIds || a.canvasInteracao.ctx.selectedPontoIds || [];
4304
4314
  }
4305
- function ri(a, t) {
4315
+ function ci(a, t) {
4306
4316
  a.canvasInteracao.ctx.selectedPontoIds = [...t], a.context.selectedPontoIds = [...t];
4307
4317
  }
4308
- function Ke(a) {
4318
+ function Je(a) {
4309
4319
  const t = a;
4310
4320
  return (t == null ? void 0 : t.originalEvent) || t || {};
4311
4321
  }
4312
- function Ln(a) {
4313
- const t = a, e = Ke(a), o = typeof e.composedPath == "function" ? e.composedPath() : [];
4322
+ function Cn(a) {
4323
+ const t = a, e = Je(a), o = typeof e.composedPath == "function" ? e.composedPath() : [];
4314
4324
  return o.length > 0 ? o[0] : e.target || (t == null ? void 0 : t.target) || null;
4315
4325
  }
4316
4326
  function Sn(a, t, e) {
@@ -4322,27 +4332,27 @@ function Sn(a, t, e) {
4322
4332
  x: Math.round(((n = o.containerPoint) == null ? void 0 : n.x) ?? ((s = o.layerPoint) == null ? void 0 : s.x) ?? 0),
4323
4333
  y: Math.round(((r = o.containerPoint) == null ? void 0 : r.y) ?? ((c = o.layerPoint) == null ? void 0 : c.y) ?? 0)
4324
4334
  };
4325
- const i = Ke(a);
4335
+ const i = Je(a);
4326
4336
  return {
4327
4337
  x: Math.round((i.clientX ?? 0) - e.left),
4328
4338
  y: Math.round((i.clientY ?? 0) - e.top)
4329
4339
  };
4330
4340
  }
4331
- function Cn(a, t) {
4341
+ function Mn(a, t) {
4332
4342
  const e = t || (a == null ? void 0 : a.latlng);
4333
4343
  return e && typeof e.lat == "number" ? { lat: e.lat, lng: e.lng ?? e.lon ?? 0 } : null;
4334
4344
  }
4335
- function Mn(a, t, e, o) {
4345
+ function An(a, t, e, o) {
4336
4346
  var g, u;
4337
4347
  if (a.modoSequencial || a.controller.canvasInteracao.selectionHappened || a.controller.canvasInteracao.panHappened || a.mouseMovedSinceDown) return !1;
4338
- const i = Ke(t), n = Ln(t);
4348
+ const i = Je(t), n = Cn(t);
4339
4349
  if (n) {
4340
4350
  const v = '.custom-leaflet-marker, .leaflet-marker-icon, .leaflet-interactive, .compact-popup, .leaflet-popup, .ui-popup-btn, .cad-btn-tool, .qgis-layer-panel, [class*="leaflet-marker"], [class*="leaflet-popup"]';
4341
4351
  if (((g = n.matches) == null ? void 0 : g.call(n, v)) || ((u = n.closest) == null ? void 0 : u.call(n, v))) return !1;
4342
4352
  }
4343
4353
  const s = a.controller.getMap();
4344
4354
  if (!s || !a.mapContainer) return !1;
4345
- const r = Sn(t, o, a.mapContainer.getBoundingClientRect()), l = Cn(t, e) ?? s.containerPointToLatLng(y.point(r.x, r.y)), d = l.lat, h = l.lng, p = a.controller.layerManager ? a.controller.layerManager.getLayers().filter((v) => v.visivel).map((v) => v.id) : [], m = i;
4355
+ const r = Sn(t, o, a.mapContainer.getBoundingClientRect()), l = Mn(t, e) ?? s.containerPointToLatLng(y.point(r.x, r.y)), d = l.lat, h = l.lng, p = a.controller.layerManager ? a.controller.layerManager.getLayers().filter((v) => v.visivel).map((v) => v.id) : [], m = i;
4346
4356
  return a.host.dispatchEvent(new CustomEvent("ui-canvas-clique", {
4347
4357
  detail: {
4348
4358
  coordenadas: {
@@ -4360,7 +4370,7 @@ function Mn(a, t, e, o) {
4360
4370
  composed: !0
4361
4371
  })), !0;
4362
4372
  }
4363
- function An(a, t, e, o) {
4373
+ function wn(a, t, e, o) {
4364
4374
  const i = o || a.obterElementoPorId(e);
4365
4375
  a.host.dispatchEvent(new CustomEvent("ui-acao-popup", {
4366
4376
  detail: {
@@ -4372,7 +4382,7 @@ function An(a, t, e, o) {
4372
4382
  composed: !0
4373
4383
  })), a.fecharPopup();
4374
4384
  }
4375
- function wn(a, t, e, o, i, n, s) {
4385
+ function zn(a, t, e, o, i, n, s) {
4376
4386
  let r = o || a.obterElementoPorId(t), c = i;
4377
4387
  if (!c && r) {
4378
4388
  const l = r, d = l.lat ?? l.latitude ?? 0, h = l.lon ?? l.lng ?? l.longitude ?? 0;
@@ -4413,12 +4423,12 @@ function wn(a, t, e, o, i, n, s) {
4413
4423
  composed: !0
4414
4424
  }));
4415
4425
  }
4416
- function zn(a, t, e, o, i) {
4426
+ function En(a, t, e, o, i) {
4417
4427
  if (a.modoSequencial) {
4418
4428
  a.fecharPopup();
4419
4429
  return;
4420
4430
  }
4421
- if (a.controller.canvasInteracao.ctx.selectedPontoIds = [], a.controller.canvasInteracao.ctx.selectedVizinhoPontoIds = [], a.controller.canvasInteracao.ctx.lastSelectedPontoId = null, ri(a.controller, []), a.controller.atualizarDestaqueMarcadores(), a.controller.selectSegmento(t), i)
4431
+ if (a.controller.canvasInteracao.ctx.selectedPontoIds = [], a.controller.canvasInteracao.ctx.selectedVizinhoPontoIds = [], a.controller.canvasInteracao.ctx.lastSelectedPontoId = null, ci(a.controller, []), a.controller.atualizarDestaqueMarcadores(), a.controller.selectSegmento(t), i)
4422
4432
  try {
4423
4433
  i(t, e);
4424
4434
  } catch (n) {
@@ -4445,7 +4455,7 @@ function zn(a, t, e, o, i) {
4445
4455
  composed: !0
4446
4456
  }));
4447
4457
  }
4448
- function En(a, t) {
4458
+ function kn(a, t) {
4449
4459
  let e = null, o = null, i = 0, n = 0;
4450
4460
  function s() {
4451
4461
  var d;
@@ -4481,7 +4491,7 @@ function En(a, t) {
4481
4491
  invalidateSizeSafely: s
4482
4492
  };
4483
4493
  }
4484
- class kn {
4494
+ class In {
4485
4495
  constructor(t) {
4486
4496
  f(this, "canal", null);
4487
4497
  f(this, "contexto");
@@ -4542,7 +4552,7 @@ class kn {
4542
4552
  }
4543
4553
  }
4544
4554
  }
4545
- class In {
4555
+ class Tn {
4546
4556
  constructor(t) {
4547
4557
  f(this, "contexto");
4548
4558
  f(this, "uiListeners", new Qt());
@@ -4605,7 +4615,7 @@ class In {
4605
4615
  this.uiListeners.cleanup();
4606
4616
  }
4607
4617
  }
4608
- class Tn {
4618
+ class _n {
4609
4619
  constructor(t) {
4610
4620
  f(this, "contexto");
4611
4621
  f(this, "_pontos", []);
@@ -4705,12 +4715,12 @@ class Tn {
4705
4715
  return this.contexto.obterController().getVizinhosMarkers();
4706
4716
  }
4707
4717
  }
4708
- const _n = ':host{display:block;width:100%;height:520px;position:relative;border-radius:var(--ui-raio-lg, 10px);overflow:hidden;box-shadow:0 10px 30px -5px #0009;border:1px solid rgba(255,255,255,.1);background:#080d0a;color:#fff;font-family:var(--ui-fonte-base, "Inter", sans-serif);user-select:none;-webkit-user-select:none}*,*:before,*:after{box-sizing:border-box}.cad-root{position:relative;width:100%;height:100%;display:flex;overflow:hidden}.cad-map-container{width:100%;height:100%;background:#080d0a;z-index:1}.qgis-layer-panel{position:absolute;top:12px;left:12px;z-index:var(--ui-z-workspace-hud, 500);width:290px;max-height:calc(100% - 24px);background:#0a120eeb;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border:1px solid rgba(255,255,255,.15);border-radius:8px;box-shadow:0 20px 40px #000000b3;display:flex;flex-direction:column;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .25s ease;overflow:hidden}.qgis-layer-panel.collapsed{transform:translate(-310px);opacity:0;pointer-events:none}.layer-panel-header{padding:10px 14px;background:#ffffff08;border-bottom:1px solid rgba(255,255,255,.08);display:flex;align-items:center;justify-content:space-between}.layer-panel-title{font-size:12px;font-weight:700;letter-spacing:.5px;color:#00f5a0;display:flex;align-items:center;gap:6px;text-transform:uppercase}.layer-panel-close{background:transparent;border:none;color:#ffffff80;cursor:pointer;padding:2px;border-radius:var(--ui-raio-sm, 4px);display:flex;align-items:center;justify-content:center;transition:all .15s}.layer-panel-close:hover{color:#fff;background:#ffffff1a}.layer-panel-body{padding:8px 10px;overflow-y:auto;display:flex;flex-direction:column;gap:2px;max-height:400px}.layer-panel-body::-webkit-scrollbar{width:5px}.layer-panel-body::-webkit-scrollbar-track{background:transparent}.layer-panel-body::-webkit-scrollbar-thumb{background:#fff3;border-radius:var(--ui-raio-sm, 4px)}.layer-panel-body::-webkit-scrollbar-thumb:hover{background:#00f5a066}.layer-item{background:transparent;border:none;border-bottom:1px solid rgba(255,255,255,.08);border-radius:0;padding:4px;display:flex;flex-direction:column;gap:3px;transition:background .15s ease}.layer-item:last-child{border-bottom:none}.layer-item:hover{background:#ffffff08;border-radius:var(--ui-raio-sm, 4px)}.layer-item-row{display:flex;align-items:center;justify-content:space-between;min-height:18px}.layer-item-label{display:flex;align-items:center;gap:7px;font-size:11px;font-weight:600;line-height:1.2;color:#ffffffe6;cursor:pointer;-webkit-user-select:none;user-select:none}.layer-chk-visibility{-moz-appearance:none;appearance:none;-webkit-appearance:none;width:14px;height:14px;border:1px solid rgba(255,255,255,.4);border-radius:3px;background:#0006;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;position:relative;transition:all .15s ease;flex-shrink:0;margin:0}.layer-chk-visibility:hover{border-color:#00f5a0}.layer-chk-visibility:checked{background:#00f5a0;border-color:#00f5a0}.layer-chk-visibility:checked:after{content:"";width:3.5px;height:7px;border:solid #04150c;border-width:0 1.5px 1.5px 0;transform:rotate(45deg) translateY(-.5px);display:block}.layer-item-actions{display:flex;align-items:center;gap:4px}.btn-layer-action{background:transparent;border:none;color:#fff6;cursor:pointer;padding:2px;border-radius:3px;display:flex;align-items:center;justify-content:center;transition:all .15s}.btn-layer-action:hover{color:#00f5a0;background:#ffffff14}.btn-layer-action.active{color:#f43f5e;background:#f43f5e26}.layer-controls-row{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:9.5px;line-height:1;color:#ffffff80;padding-left:21px}.layer-opacity-slider{flex:1;height:3px;margin:0;border-radius:2px;background:#ffffff26;accent-color:#00f5a0;cursor:pointer}.scale-mode-pill{font-size:8.5px;font-weight:600;padding:1px 6px;border-radius:6px;background:#ffffff0f;color:#ffffffb3;cursor:pointer;border:1px solid rgba(255,255,255,.1);transition:all .15s;line-height:1.2}.scale-mode-pill:hover{border-color:#00f5a0;color:#00f5a0;background:#00f5a01a}:host([sem-painel-camadas]) .qgis-layer-panel,:host([sem-painel-camadas]) #btn-toggle-layers,:host([sem-barra-rapida]) .cad-quick-toolbar{display:none!important}.cad-quick-toolbar{position:absolute;top:12px;right:12px;z-index:var(--ui-z-workspace-hud, 500);display:flex;flex-direction:column;gap:6px;background:#0c1510eb;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border:1px solid rgba(255,255,255,.15);border-radius:8px;padding:5px;box-shadow:0 10px 25px -5px #0009}.cad-btn-tool{background:transparent;border:none;color:#fff9;cursor:pointer;padding:7px;border-radius:5px;display:flex;align-items:center;justify-content:center;transition:all .15s}.cad-btn-tool:hover{background:#ffffff1a;color:#fff}.cad-btn-tool.active{background:#00f5a026;color:#00f5a0;border:1px solid rgba(0,245,160,.3)}.cad-selection-box{pointer-events:none;box-sizing:border-box}.custom-leaflet-marker{cursor:pointer}.custom-leaflet-marker:hover{z-index:1800!important}.custom-leaflet-marker .cad-pt svg{transition:transform .12s ease-out}.custom-leaflet-marker:hover .cad-pt svg{transform:scale(1.3)}.leaflet-popup-content-wrapper{background:#0f1712!important;color:#f8fafc!important;border:1px solid rgba(255,255,255,.15)!important;border-radius:8px!important;box-shadow:0 10px 25px #0009!important;padding:0!important;backdrop-filter:blur(16px)!important;-webkit-backdrop-filter:blur(16px)!important}.leaflet-popup-tip{background:#0f1712!important;border:1px solid rgba(255,255,255,.15)!important;box-shadow:none!important}.leaflet-popup-close-button{color:#fff9!important;padding:6px!important;transition:color .15s ease}.leaflet-popup-close-button:hover{color:#fff!important}.leaflet-popup-content{margin:12px 14px!important;line-height:1.4;font-family:inherit;color:#f8fafc}.compact-popup .leaflet-popup-content{margin:10px 12px!important}.ui-popup-actions-footer{display:flex;gap:6px;margin-top:8px;padding-top:8px;border-top:1px solid rgba(255,255,255,.1);justify-content:flex-end;align-items:center;flex-wrap:wrap}.ui-popup-btn{display:inline-flex;align-items:center;justify-content:center;font-family:inherit;font-size:11px;font-weight:500;padding:4px 9px;border-radius:var(--ui-raio-borda, 6px);cursor:pointer;transition:all .15s ease;border:1px solid transparent;outline:none;line-height:1.25;-webkit-user-select:none;user-select:none}.ui-popup-btn-primary{background:var(--ui-cor-primaria, #00f5a0);color:#080d0a;font-weight:600;border-color:var(--ui-cor-primaria, #00f5a0)}.ui-popup-btn-primary:hover{filter:brightness(1.1);box-shadow:0 0 10px #00f5a059}.ui-popup-btn-secondary{background:#ffffff14;color:#fff;border-color:#ffffff2e}.ui-popup-btn-secondary:hover{background:#ffffff29;border-color:#ffffff4d}.ui-popup-btn-destrutivo{background:#ef444426;color:#f87171;border-color:#ef444459}.ui-popup-btn-destrutivo:hover{background:#ef444440;border-color:#ef444499;color:#fff}@media (max-width: 520px){.qgis-layer-panel{top:8px;left:8px;right:8px;width:auto;max-height:calc(100% - 16px)}.qgis-layer-panel.collapsed{transform:translateY(-115%)}.layer-panel-close{min-width:36px;min-height:36px;font-size:16px}.layer-action-btn{min-width:32px;min-height:32px}}.cad-destaque-marker-container{pointer-events:none!important;background:transparent!important;border:none!important;overflow:visible!important}.cad-destaque-marker-container *{pointer-events:none!important}.cad-pulse-highlight{position:relative;width:52px;height:52px;display:flex;align-items:center;justify-content:center;pointer-events:none!important;user-select:none;-webkit-user-select:none}.cad-pulse-core{position:absolute;width:12px;height:12px;border-radius:50%;background-color:var(--cad-pulse-cor, #00f5a0);border:2px solid #ffffff;box-sizing:border-box;pointer-events:none!important}.cad-pulse-ring{position:absolute;width:100%;height:100%;border-radius:50%;border:2px solid var(--cad-pulse-cor, #00f5a0);background-color:color-mix(in srgb,var(--cad-pulse-cor, #00f5a0) 14%,transparent);box-sizing:border-box;pointer-events:none!important;opacity:0;animation:cad-pulse-ping 1.8s cubic-bezier(0,0,.2,1) infinite}.cad-pulse-ring.ring-2{animation-delay:.9s}@keyframes cad-pulse-ping{0%{transform:scale(.3);opacity:.9}70%{opacity:.35}to{transform:scale(1);opacity:0}}@media (prefers-reduced-motion: reduce){.cad-pulse-ring{animation:none;opacity:.6;transform:scale(.6)}}.cad-marker-selected,.ponto-selecionado{z-index:2000!important}@media (prefers-reduced-motion: reduce){.custom-leaflet-marker .cad-pt svg{transition:none}}.ui-popup-actions-footer{margin-top:8px;padding-top:6px;border-top:1px solid rgba(255,255,255,.12);display:flex;gap:6px;flex-wrap:wrap}.ui-popup-btn{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;font-size:11px;font-weight:600;border-radius:var(--ui-raio-sm, 4px);border:1px solid rgba(255,255,255,.15);background:#ffffff14;color:#fff;cursor:pointer;line-height:1.2;transition:all .15s ease;-webkit-user-select:none;user-select:none}.ui-popup-btn:hover{background:#ffffff2e;border-color:#ffffff4d}.ui-popup-btn-primary{background:#00f5a0;color:#06130b;border-color:#00f5a0}.ui-popup-btn-primary:hover{background:#10ffad;box-shadow:0 0 8px #00f5a066}.ui-popup-btn-danger{background:#f43f5e33;color:#f43f5e;border-color:#f43f5e66}.ui-popup-btn-danger:hover{background:#f43f5e59;color:#fff}.cad-draw-toolbar{right:auto;left:12px;max-height:calc(100% - 24px);overflow-y:auto}.cad-draw-btn{font:600 11px var(--ui-fonte-base, sans-serif);padding:5px 9px;white-space:nowrap;justify-content:flex-start}.cad-ferramenta-ativa .leaflet-marker-icon{pointer-events:none!important}.cad-aviso{position:absolute;top:12px;left:50%;transform:translate(-50%);z-index:calc(var(--ui-z-workspace-hud, 500) + 1);box-sizing:border-box;max-width:min(calc(100% - 200px),460px);padding:8px 14px;border-radius:var(--ui-raio-borda, 6px);border:1px solid var(--ui-cor-aviso, #f59e0b);background:#0c1510f2;color:var(--ui-cor-texto, #ffffff);font:600 12px var(--ui-fonte-base, sans-serif);line-height:1.35;box-shadow:0 10px 25px -5px #0009;pointer-events:none}.cad-aviso[hidden]{display:none}.cad-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}';
4709
- function Dn() {
4718
+ const Dn = ':host{display:block;width:100%;height:520px;position:relative;border-radius:var(--ui-raio-lg, 10px);overflow:hidden;box-shadow:0 10px 30px -5px #0009;border:1px solid rgba(255,255,255,.1);background:#080d0a;color:#fff;font-family:var(--ui-fonte-base, "Inter", sans-serif);user-select:none;-webkit-user-select:none}*,*:before,*:after{box-sizing:border-box}.cad-root{position:relative;width:100%;height:100%;display:flex;overflow:hidden}.cad-map-container{width:100%;height:100%;background:#080d0a;z-index:1}.qgis-layer-panel{position:absolute;top:12px;left:12px;z-index:var(--ui-z-workspace-hud, 500);width:290px;max-height:calc(100% - 24px);background:#0a120eeb;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border:1px solid rgba(255,255,255,.15);border-radius:8px;box-shadow:0 20px 40px #000000b3;display:flex;flex-direction:column;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .25s ease;overflow:hidden}.qgis-layer-panel.collapsed{transform:translate(-310px);opacity:0;pointer-events:none}.layer-panel-header{padding:10px 14px;background:#ffffff08;border-bottom:1px solid rgba(255,255,255,.08);display:flex;align-items:center;justify-content:space-between}.layer-panel-title{font-size:12px;font-weight:700;letter-spacing:.5px;color:#00f5a0;display:flex;align-items:center;gap:6px;text-transform:uppercase}.layer-panel-close{background:transparent;border:none;color:#ffffff80;cursor:pointer;padding:2px;border-radius:var(--ui-raio-sm, 4px);display:flex;align-items:center;justify-content:center;transition:all .15s}.layer-panel-close:hover{color:#fff;background:#ffffff1a}.layer-panel-body{padding:8px 10px;overflow-y:auto;display:flex;flex-direction:column;gap:2px;max-height:400px}.layer-panel-body::-webkit-scrollbar{width:5px}.layer-panel-body::-webkit-scrollbar-track{background:transparent}.layer-panel-body::-webkit-scrollbar-thumb{background:#fff3;border-radius:var(--ui-raio-sm, 4px)}.layer-panel-body::-webkit-scrollbar-thumb:hover{background:#00f5a066}.layer-item{background:transparent;border:none;border-bottom:1px solid rgba(255,255,255,.08);border-radius:0;padding:4px;display:flex;flex-direction:column;gap:3px;transition:background .15s ease}.layer-item:last-child{border-bottom:none}.layer-item:hover{background:#ffffff08;border-radius:var(--ui-raio-sm, 4px)}.layer-item-row{display:flex;align-items:center;justify-content:space-between;min-height:18px}.layer-item-label{display:flex;align-items:center;gap:7px;font-size:11px;font-weight:600;line-height:1.2;color:#ffffffe6;cursor:pointer;-webkit-user-select:none;user-select:none}.layer-chk-visibility{-moz-appearance:none;appearance:none;-webkit-appearance:none;width:14px;height:14px;border:1px solid rgba(255,255,255,.4);border-radius:3px;background:#0006;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;position:relative;transition:all .15s ease;flex-shrink:0;margin:0}.layer-chk-visibility:hover{border-color:#00f5a0}.layer-chk-visibility:checked{background:#00f5a0;border-color:#00f5a0}.layer-chk-visibility:checked:after{content:"";width:3.5px;height:7px;border:solid #04150c;border-width:0 1.5px 1.5px 0;transform:rotate(45deg) translateY(-.5px);display:block}.layer-item-actions{display:flex;align-items:center;gap:4px}.btn-layer-action{background:transparent;border:none;color:#fff6;cursor:pointer;padding:2px;border-radius:3px;display:flex;align-items:center;justify-content:center;transition:all .15s}.btn-layer-action:hover{color:#00f5a0;background:#ffffff14}.btn-layer-action.active{color:#f43f5e;background:#f43f5e26}.layer-controls-row{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:9.5px;line-height:1;color:#ffffff80;padding-left:21px}.layer-opacity-slider{flex:1;height:3px;margin:0;border-radius:2px;background:#ffffff26;accent-color:#00f5a0;cursor:pointer}.scale-mode-pill{font-size:8.5px;font-weight:600;padding:1px 6px;border-radius:6px;background:#ffffff0f;color:#ffffffb3;cursor:pointer;border:1px solid rgba(255,255,255,.1);transition:all .15s;line-height:1.2}.scale-mode-pill:hover{border-color:#00f5a0;color:#00f5a0;background:#00f5a01a}:host([sem-painel-camadas]) .qgis-layer-panel,:host([sem-painel-camadas]) #btn-toggle-layers,:host([sem-barra-rapida]) .cad-quick-toolbar{display:none!important}.cad-quick-toolbar{position:absolute;top:12px;right:12px;z-index:var(--ui-z-workspace-hud, 500);display:flex;flex-direction:column;gap:6px;background:#0c1510eb;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border:1px solid rgba(255,255,255,.15);border-radius:8px;padding:5px;box-shadow:0 10px 25px -5px #0009}.cad-btn-tool{background:transparent;border:none;color:#fff9;cursor:pointer;padding:7px;border-radius:5px;display:flex;align-items:center;justify-content:center;transition:all .15s}.cad-btn-tool:hover{background:#ffffff1a;color:#fff}.cad-btn-tool.active{background:#00f5a026;color:#00f5a0;border:1px solid rgba(0,245,160,.3)}.cad-selection-box{pointer-events:none;box-sizing:border-box}.custom-leaflet-marker{cursor:pointer}.custom-leaflet-marker:hover{z-index:1800!important}.custom-leaflet-marker .cad-pt svg{transition:transform .12s ease-out}.custom-leaflet-marker:hover .cad-pt svg{transform:scale(1.3)}.leaflet-popup-content-wrapper{background:#0f1712!important;color:#f8fafc!important;border:1px solid rgba(255,255,255,.15)!important;border-radius:8px!important;box-shadow:0 10px 25px #0009!important;padding:0!important;backdrop-filter:blur(16px)!important;-webkit-backdrop-filter:blur(16px)!important}.leaflet-popup-tip{background:#0f1712!important;border:1px solid rgba(255,255,255,.15)!important;box-shadow:none!important}.leaflet-popup-close-button{color:#fff9!important;padding:6px!important;transition:color .15s ease}.leaflet-popup-close-button:hover{color:#fff!important}.leaflet-popup-content{margin:12px 14px!important;line-height:1.4;font-family:inherit;color:#f8fafc}.compact-popup .leaflet-popup-content{margin:10px 12px!important}.ui-popup-actions-footer{display:flex;gap:6px;margin-top:8px;padding-top:8px;border-top:1px solid rgba(255,255,255,.1);justify-content:flex-end;align-items:center;flex-wrap:wrap}.ui-popup-btn{display:inline-flex;align-items:center;justify-content:center;font-family:inherit;font-size:11px;font-weight:500;padding:4px 9px;border-radius:var(--ui-raio-borda, 6px);cursor:pointer;transition:all .15s ease;border:1px solid transparent;outline:none;line-height:1.25;-webkit-user-select:none;user-select:none}.ui-popup-btn-primary{background:var(--ui-cor-primaria, #00f5a0);color:#080d0a;font-weight:600;border-color:var(--ui-cor-primaria, #00f5a0)}.ui-popup-btn-primary:hover{filter:brightness(1.1);box-shadow:0 0 10px #00f5a059}.ui-popup-btn-secondary{background:#ffffff14;color:#fff;border-color:#ffffff2e}.ui-popup-btn-secondary:hover{background:#ffffff29;border-color:#ffffff4d}.ui-popup-btn-destrutivo{background:#ef444426;color:#f87171;border-color:#ef444459}.ui-popup-btn-destrutivo:hover{background:#ef444440;border-color:#ef444499;color:#fff}@media (max-width: 520px){.qgis-layer-panel{top:8px;left:8px;right:8px;width:auto;max-height:calc(100% - 16px)}.qgis-layer-panel.collapsed{transform:translateY(-115%)}.layer-panel-close{min-width:36px;min-height:36px;font-size:16px}.layer-action-btn{min-width:32px;min-height:32px}}.cad-destaque-marker-container{pointer-events:none!important;background:transparent!important;border:none!important;overflow:visible!important}.cad-destaque-marker-container *{pointer-events:none!important}.cad-pulse-highlight{position:relative;width:52px;height:52px;display:flex;align-items:center;justify-content:center;pointer-events:none!important;user-select:none;-webkit-user-select:none}.cad-pulse-core{position:absolute;width:12px;height:12px;border-radius:50%;background-color:var(--cad-pulse-cor, #00f5a0);border:2px solid #ffffff;box-sizing:border-box;pointer-events:none!important}.cad-pulse-ring{position:absolute;width:100%;height:100%;border-radius:50%;border:2px solid var(--cad-pulse-cor, #00f5a0);background-color:color-mix(in srgb,var(--cad-pulse-cor, #00f5a0) 14%,transparent);box-sizing:border-box;pointer-events:none!important;opacity:0;animation:cad-pulse-ping 1.8s cubic-bezier(0,0,.2,1) infinite}.cad-pulse-ring.ring-2{animation-delay:.9s}@keyframes cad-pulse-ping{0%{transform:scale(.3);opacity:.9}70%{opacity:.35}to{transform:scale(1);opacity:0}}@media (prefers-reduced-motion: reduce){.cad-pulse-ring{animation:none;opacity:.6;transform:scale(.6)}}.cad-marker-selected,.ponto-selecionado{z-index:2000!important}@media (prefers-reduced-motion: reduce){.custom-leaflet-marker .cad-pt svg{transition:none}}.ui-popup-actions-footer{margin-top:8px;padding-top:6px;border-top:1px solid rgba(255,255,255,.12);display:flex;gap:6px;flex-wrap:wrap}.ui-popup-btn{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;font-size:11px;font-weight:600;border-radius:var(--ui-raio-sm, 4px);border:1px solid rgba(255,255,255,.15);background:#ffffff14;color:#fff;cursor:pointer;line-height:1.2;transition:all .15s ease;-webkit-user-select:none;user-select:none}.ui-popup-btn:hover{background:#ffffff2e;border-color:#ffffff4d}.ui-popup-btn-primary{background:#00f5a0;color:#06130b;border-color:#00f5a0}.ui-popup-btn-primary:hover{background:#10ffad;box-shadow:0 0 8px #00f5a066}.ui-popup-btn-danger{background:#f43f5e33;color:#f43f5e;border-color:#f43f5e66}.ui-popup-btn-danger:hover{background:#f43f5e59;color:#fff}.cad-draw-toolbar{right:auto;left:12px;max-height:calc(100% - 24px);overflow-y:auto}.cad-draw-btn{font:600 11px var(--ui-fonte-base, sans-serif);padding:5px 9px;white-space:nowrap;justify-content:flex-start}.cad-ferramenta-ativa .leaflet-marker-icon{pointer-events:none!important}.cad-aviso{position:absolute;top:12px;left:50%;transform:translate(-50%);z-index:calc(var(--ui-z-workspace-hud, 500) + 1);box-sizing:border-box;max-width:min(calc(100% - 200px),460px);padding:8px 14px;border-radius:var(--ui-raio-borda, 6px);border:1px solid var(--ui-cor-aviso, #f59e0b);background:#0c1510f2;color:var(--ui-cor-texto, #ffffff);font:600 12px var(--ui-fonte-base, sans-serif);line-height:1.35;box-shadow:0 10px 25px -5px #0009;pointer-events:none}.cad-aviso[hidden]{display:none}.cad-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}';
4719
+ function qn() {
4710
4720
  return `
4711
4721
  <style>
4712
- ${yi}
4713
- ${_n}
4722
+ ${bi}
4723
+ ${Dn}
4714
4724
  </style>
4715
4725
  <div class="cad-root" id="cad-root" role="region" aria-label="Mapa CAD">
4716
4726
  <div class="cad-map-container" id="cad-map-container"></div>
@@ -4745,7 +4755,7 @@ function Dn() {
4745
4755
  </div>
4746
4756
  `;
4747
4757
  }
4748
- function qn(a, t, e, o) {
4758
+ function $n(a, t, e, o) {
4749
4759
  if (e !== o) {
4750
4760
  if (t === "sat-opacity") {
4751
4761
  const i = parseFloat(o);
@@ -4773,7 +4783,7 @@ function qn(a, t, e, o) {
4773
4783
  }
4774
4784
  }
4775
4785
  }
4776
- function ci(a) {
4786
+ function li(a) {
4777
4787
  const t = a;
4778
4788
  if (!t || !t._leaflet_id) return !1;
4779
4789
  try {
@@ -4783,9 +4793,9 @@ function ci(a) {
4783
4793
  }
4784
4794
  return !0;
4785
4795
  }
4786
- function $n(a) {
4796
+ function Fn(a) {
4787
4797
  if (!a.mapContainer) return;
4788
- if (a.controller.getMap() || ci(a.mapContainer), a.controller.init(a.mapContainer, a.shadow), a.toolbarPainel.vincularEventos(), a.renderLayersUI(), a.host.hasAttribute("modo-sequencial") && (a.controller.modoCliqueSequencialAtivo = !0, a.controller.context.modoSequencial = !0), a.host.hasAttribute("chave-grupo")) {
4798
+ if (a.controller.getMap() || li(a.mapContainer), a.controller.init(a.mapContainer, a.shadow), a.toolbarPainel.vincularEventos(), a.renderLayersUI(), a.host.hasAttribute("modo-sequencial") && (a.controller.modoCliqueSequencialAtivo = !0, a.controller.context.modoSequencial = !0), a.host.hasAttribute("chave-grupo")) {
4789
4799
  const o = a.host.getAttribute("chave-grupo");
4790
4800
  o && (a.host.chaveGrupo = o);
4791
4801
  }
@@ -4806,7 +4816,7 @@ function $n(a) {
4806
4816
  });
4807
4817
  const t = a.controller.context.onMarkerClick;
4808
4818
  a.controller.context.onMarkerClick = (o, i, n, s) => {
4809
- wn(
4819
+ zn(
4810
4820
  a.obterContextoEventos(),
4811
4821
  o,
4812
4822
  i,
@@ -4816,7 +4826,7 @@ function $n(a) {
4816
4826
  a.colecoesDados.customMarkerClickHandler
4817
4827
  );
4818
4828
  }, a.controller.context.onSegmentoClick = (o, i, n) => {
4819
- zn(
4829
+ En(
4820
4830
  a.obterContextoEventos(),
4821
4831
  o,
4822
4832
  i,
@@ -4832,12 +4842,12 @@ function $n(a) {
4832
4842
  a.invalidateSizeSafely();
4833
4843
  }, 150);
4834
4844
  }
4835
- const Fn = {
4845
+ const On = {
4836
4846
  "sem-camada": "Escolha uma camada de desenho antes de usar esta ferramenta.",
4837
4847
  "camada-invalida": "A camada de desenho não é uma camada de feições.",
4838
4848
  "camada-bloqueada": "A camada de desenho está bloqueada.",
4839
4849
  "geometria-invalida": "Não foi possível criar a figura: a geometria é inválida."
4840
- }, On = {
4850
+ }, Nn = {
4841
4851
  bloqueada: "Esta feição (ou a camada dela) está bloqueada e não pode ser editada.",
4842
4852
  "poligono-com-furos": "Polígono com furos não pode ser editado no mapa.",
4843
4853
  multiparte: "Feição com várias partes não pode ser editada no mapa.",
@@ -4846,16 +4856,16 @@ const Fn = {
4846
4856
  inexistente: "A feição não existe mais.",
4847
4857
  "sem-selecao": "Selecione uma feição para editar os vértices."
4848
4858
  };
4849
- function li(a, t, e) {
4859
+ function di(a, t, e) {
4850
4860
  return typeof t == "string" && Object.prototype.hasOwnProperty.call(a, t) ? a[t] : e;
4851
4861
  }
4852
- function Nn(a) {
4853
- return li(Fn, a, "Não foi possível ativar a ferramenta de desenho.");
4854
- }
4855
4862
  function Rn(a) {
4856
- return li(On, a, "Não foi possível editar os vértices desta feição.");
4863
+ return di(On, a, "Não foi possível ativar a ferramenta de desenho.");
4857
4864
  }
4858
4865
  function Bn(a) {
4866
+ return di(Nn, a, "Não foi possível editar os vértices desta feição.");
4867
+ }
4868
+ function Vn(a) {
4859
4869
  a.querySelectorAll(".cad-quick-toolbar .cad-btn-tool, .layer-panel-close").forEach((t) => {
4860
4870
  const e = t.getAttribute("title");
4861
4871
  e && !t.hasAttribute("aria-label") && t.setAttribute("aria-label", e);
@@ -4865,38 +4875,38 @@ function So(a, t) {
4865
4875
  const e = a.getElementById("btn-toggle-snap");
4866
4876
  e == null || e.classList.toggle("active", t), e == null || e.setAttribute("aria-pressed", String(t));
4867
4877
  }
4868
- function Vn(a) {
4878
+ function jn(a) {
4869
4879
  return a <= 0 ? "Nenhuma feição selecionada" : a === 1 ? "1 feição selecionada" : `${a} feições selecionadas`;
4870
4880
  }
4871
- function jn(a) {
4881
+ function Hn(a) {
4872
4882
  return a ? `Ferramenta ${a} ativa` : "Ferramenta desativada";
4873
4883
  }
4874
- function Pe(a, t) {
4884
+ function Le(a, t) {
4875
4885
  const e = a.getElementById("cad-status");
4876
4886
  e && e.textContent !== t && (e.textContent = t);
4877
4887
  }
4878
- const Hn = 5e3;
4879
- function Gn(a, t, e) {
4888
+ const Gn = 5e3;
4889
+ function Un(a, t, e) {
4880
4890
  const o = a.getElementById("cad-aviso");
4881
4891
  return o ? (e !== void 0 && window.clearTimeout(e), o.textContent = t, o.hidden = !1, window.setTimeout(() => {
4882
4892
  o.hidden = !0, o.textContent = "";
4883
- }, Hn)) : e;
4893
+ }, Gn)) : e;
4884
4894
  }
4885
- function Un(a, t) {
4895
+ function Wn(a, t) {
4886
4896
  let e;
4887
4897
  const o = (c) => (l) => {
4888
4898
  var h;
4889
4899
  if (a.hasAttribute("sem-avisos")) return;
4890
4900
  const d = c((h = l.detail) == null ? void 0 : h.motivo);
4891
- Pe(t, d), e = Gn(t, d, e);
4892
- }, i = o(Nn), n = o(Rn), s = (c) => {
4901
+ Le(t, d), e = Un(t, d, e);
4902
+ }, i = o(Rn), n = o(Bn), s = (c) => {
4893
4903
  var d;
4894
4904
  const l = (d = c.detail) == null ? void 0 : d.feicoes;
4895
- Pe(t, Vn(Array.isArray(l) ? l.length : 0));
4905
+ Le(t, jn(Array.isArray(l) ? l.length : 0));
4896
4906
  }, r = (c) => {
4897
4907
  var d;
4898
4908
  const l = ((d = c.detail) == null ? void 0 : d.ferramenta) ?? null;
4899
- Pe(t, jn(l));
4909
+ Le(t, Hn(l));
4900
4910
  };
4901
4911
  return a.addEventListener("cad-selecao", s), a.addEventListener("cad-ferramenta", r), a.addEventListener("cad-desenho-recusado", i), a.addEventListener("cad-edicao-recusada", n), () => {
4902
4912
  a.removeEventListener("cad-selecao", s), a.removeEventListener("cad-ferramenta", r), a.removeEventListener("cad-desenho-recusado", i), a.removeEventListener("cad-edicao-recusada", n), e !== void 0 && window.clearTimeout(e), e = void 0;
@@ -4916,23 +4926,23 @@ function Z(a, t) {
4916
4926
  const i = V(e, o, t);
4917
4927
  return !i || !Number.isFinite(i.lat) || !Number.isFinite(i.lon) ? null : [i.lat, i.lon];
4918
4928
  }
4919
- function Wn(a, t) {
4929
+ function Zn(a, t) {
4920
4930
  return a[0] === t[0] && a[1] === t[1];
4921
4931
  }
4922
- function di(a, t) {
4932
+ function hi(a, t) {
4923
4933
  const e = a.map((o) => Z(o, t)).filter((o) => o !== null);
4924
- return e.length > 1 && Wn(e[0], e[e.length - 1]) && e.pop(), e.length >= 3 ? e : null;
4934
+ return e.length > 1 && Zn(e[0], e[e.length - 1]) && e.pop(), e.length >= 3 ? e : null;
4925
4935
  }
4926
- function Co(a, t) {
4936
+ function Mo(a, t) {
4927
4937
  const e = a.map((o) => Z(o, t)).filter((o) => o !== null);
4928
4938
  return e.length >= 2 ? e : null;
4929
4939
  }
4930
- function Zn(a, t) {
4940
+ function Xn(a, t) {
4931
4941
  if (!Array.isArray(a) || a.length === 0) return null;
4932
- const o = (Array.isArray(a[0]) && Array.isArray(a[0][0]) ? a : [a]).map((i) => di(i, t));
4942
+ const o = (Array.isArray(a[0]) && Array.isArray(a[0][0]) ? a : [a]).map((i) => hi(i, t));
4933
4943
  return o.some((i) => i === null) ? null : o;
4934
4944
  }
4935
- function zr(a, t) {
4945
+ function Er(a, t) {
4936
4946
  const e = V(a.lat, a.lon);
4937
4947
  return e ? {
4938
4948
  id: String(a.id),
@@ -4941,7 +4951,7 @@ function zr(a, t) {
4941
4951
  propriedades: { ...a }
4942
4952
  } : null;
4943
4953
  }
4944
- function Er(a, t, e) {
4954
+ function kr(a, t, e) {
4945
4955
  const o = t.get(String(a.ponto_inicio_id)), i = t.get(String(a.ponto_fim_id));
4946
4956
  if (!o || !i) return null;
4947
4957
  const n = V(o.lat, o.lon), s = V(i.lat, i.lon);
@@ -4955,14 +4965,14 @@ function Er(a, t, e) {
4955
4965
  propriedades: { ...a }
4956
4966
  };
4957
4967
  }
4958
- function kr(a, t) {
4968
+ function Ir(a, t) {
4959
4969
  if (!a.poligono_wkt) return null;
4960
4970
  const e = /POLYGON\s*\(\s*\(\s*(.*?)\s*\)\s*\)/i.exec(a.poligono_wkt);
4961
4971
  if (!e) return null;
4962
4972
  const o = e[1].split(",").map((n) => {
4963
4973
  const [s, r] = n.trim().split(/\s+/);
4964
4974
  return [r, s];
4965
- }), i = di(o);
4975
+ }), i = hi(o);
4966
4976
  return i ? {
4967
4977
  id: String(a.id ?? a.nome ?? ""),
4968
4978
  camadaId: t,
@@ -4970,8 +4980,8 @@ function kr(a, t) {
4970
4980
  propriedades: { nome: a.nome, nome_propriedade: a.nome_propriedade }
4971
4981
  } : null;
4972
4982
  }
4973
- function Mo(a, t) {
4974
- const e = Ii(a);
4983
+ function Ao(a, t) {
4984
+ const e = Ti(a);
4975
4985
  if (!e) return null;
4976
4986
  const o = [];
4977
4987
  for (const i of e) {
@@ -4982,11 +4992,11 @@ function Mo(a, t) {
4982
4992
  }
4983
4993
  return o;
4984
4994
  }
4985
- const Xn = /* @__PURE__ */ new Set(["Point", "LineString", "Polygon", "Circle", "Text"]);
4986
- function Le(a, t, e) {
4995
+ const Yn = /* @__PURE__ */ new Set(["Point", "LineString", "Polygon", "Circle", "Text"]);
4996
+ function Ce(a, t, e) {
4987
4997
  if (!a || typeof a != "object") return null;
4988
4998
  const o = a, i = o.geometria;
4989
- if (!i || !Xn.has(i.tipo) || o.id === void 0 || o.id === null || o.id === "") return null;
4999
+ if (!i || !Yn.has(i.tipo) || o.id === void 0 || o.id === null || o.id === "") return null;
4990
5000
  let n = null;
4991
5001
  switch (i.tipo) {
4992
5002
  case "Point": {
@@ -5000,21 +5010,21 @@ function Le(a, t, e) {
5000
5010
  break;
5001
5011
  }
5002
5012
  case "LineString": {
5003
- const r = Array.isArray(i.partes) ? i.partes.map((l) => Array.isArray(l) ? Co(l, e) : null).filter((l) => l !== null) : [];
5013
+ const r = Array.isArray(i.partes) ? i.partes.map((l) => Array.isArray(l) ? Mo(l, e) : null).filter((l) => l !== null) : [];
5004
5014
  if (r.length > 0)
5005
5015
  n = Kt(r);
5006
5016
  else {
5007
- const l = Array.isArray(i.coordenadas) ? Co(i.coordenadas, e) : null;
5017
+ const l = Array.isArray(i.coordenadas) ? Mo(i.coordenadas, e) : null;
5008
5018
  l && (n = Kt([l]));
5009
5019
  }
5010
- const c = r.length <= 1 ? Mo(i.curva, e) : null;
5020
+ const c = r.length <= 1 ? Ao(i.curva, e) : null;
5011
5021
  n && n.tipo === "LineString" && c && c.length >= 2 && (n = { tipo: "LineString", coordenadas: Pt(c, !1), curva: c });
5012
5022
  break;
5013
5023
  }
5014
5024
  case "Polygon": {
5015
- const r = Array.isArray(i.aneis) ? Zn(i.aneis, e) : null;
5025
+ const r = Array.isArray(i.aneis) ? Xn(i.aneis, e) : null;
5016
5026
  r && (n = { tipo: "Polygon", aneis: r });
5017
- const c = r && r.length === 1 ? Mo(i.curva, e) : null;
5027
+ const c = r && r.length === 1 ? Ao(i.curva, e) : null;
5018
5028
  n && c && c.length >= 3 && (n = { tipo: "Polygon", aneis: [Pt(c, !0)], curva: c });
5019
5029
  break;
5020
5030
  }
@@ -5037,18 +5047,18 @@ function Le(a, t, e) {
5037
5047
  };
5038
5048
  return o.oculta && (s.oculta = !0), (typeof o.entidadeId == "string" || typeof o.entidadeId == "number") && (s.entidadeId = String(o.entidadeId)), s.status = mt({ ...s, status: o.status }), s;
5039
5049
  }
5040
- const Se = "cad-cursores", Yn = /^#[0-9a-f]{3,8}$/i, Kn = "#94a3b8";
5041
- function Be(a) {
5042
- return typeof a == "string" && Yn.test(a.trim()) ? a.trim() : Kn;
5050
+ const Se = "cad-cursores", Kn = /^#[0-9a-f]{3,8}$/i, Jn = "#94a3b8";
5051
+ function Ve(a) {
5052
+ return typeof a == "string" && Kn.test(a.trim()) ? a.trim() : Jn;
5043
5053
  }
5044
- const Jn = '<svg width="18" height="18" viewBox="0 0 24 24" style="display:block;filter:drop-shadow(0 1px 1px rgba(0,0,0,.6))"><path d="M3 2 L3 19 L8 14.5 L11.5 22 L14.5 20.5 L11 13.5 L18 13 Z" fill="currentColor" stroke="#fff" stroke-width="1.2" stroke-linejoin="round"/></svg>';
5045
- function Ao(a) {
5054
+ const Qn = '<svg width="18" height="18" viewBox="0 0 24 24" style="display:block;filter:drop-shadow(0 1px 1px rgba(0,0,0,.6))"><path d="M3 2 L3 19 L8 14.5 L11.5 22 L14.5 20.5 L11 13.5 L18 13 Z" fill="currentColor" stroke="#fff" stroke-width="1.2" stroke-linejoin="round"/></svg>';
5055
+ function wo(a) {
5046
5056
  const t = document.createElement("div");
5047
- t.style.cssText = `color:${Be(a.cor)};position:relative;pointer-events:none`, t.innerHTML = Jn;
5057
+ t.style.cssText = `color:${Ve(a.cor)};position:relative;pointer-events:none`, t.innerHTML = Qn;
5048
5058
  const e = document.createElement("span");
5049
- return e.textContent = String(a.nome ?? a.id), e.style.cssText = `position:absolute;left:16px;top:14px;white-space:nowrap;font:600 11px sans-serif;color:#fff;background:${Be(a.cor)};padding:1px 5px;border-radius:3px;max-width:160px;overflow:hidden;text-overflow:ellipsis`, t.appendChild(e), y.divIcon({ className: "custom-leaflet-marker cad-cursor-remoto", iconSize: [18, 18], iconAnchor: [3, 2], html: t });
5059
+ return e.textContent = String(a.nome ?? a.id), e.style.cssText = `position:absolute;left:16px;top:14px;white-space:nowrap;font:600 11px sans-serif;color:#fff;background:${Ve(a.cor)};padding:1px 5px;border-radius:3px;max-width:160px;overflow:hidden;text-overflow:ellipsis`, t.appendChild(e), y.divIcon({ className: "custom-leaflet-marker cad-cursor-remoto", iconSize: [18, 18], iconAnchor: [3, 2], html: t });
5050
5060
  }
5051
- class Qn {
5061
+ class ts {
5052
5062
  constructor(t) {
5053
5063
  f(this, "marcadores", /* @__PURE__ */ new Map());
5054
5064
  this.obterMapa = t;
@@ -5059,11 +5069,11 @@ class Qn {
5059
5069
  atualizar(t, e) {
5060
5070
  const o = this.obterMapa();
5061
5071
  if (!o || !t || t.id === void 0 || t.id === null || t.id === "" || !Number.isFinite(e == null ? void 0 : e[0]) || !Number.isFinite(e == null ? void 0 : e[1])) return !1;
5062
- const i = String(t.id), n = `${t.nome ?? ""}\0${Be(t.cor)}`, s = this.marcadores.get(i);
5072
+ const i = String(t.id), n = `${t.nome ?? ""}\0${Ve(t.cor)}`, s = this.marcadores.get(i);
5063
5073
  if (s)
5064
- return s.marker.setLatLng(e), s.assinatura !== n && (s.marker.setIcon(Ao(t)), s.assinatura = n), !0;
5074
+ return s.marker.setLatLng(e), s.assinatura !== n && (s.marker.setIcon(wo(t)), s.assinatura = n), !0;
5065
5075
  o.getPane(Se) || (o.createPane(Se).style.zIndex = "9500");
5066
- const r = y.marker(e, { icon: Ao(t), pane: Se, interactive: !1, keyboard: !1 }).addTo(o);
5076
+ const r = y.marker(e, { icon: wo(t), pane: Se, interactive: !1, keyboard: !1 }).addTo(o);
5067
5077
  return this.marcadores.set(i, { marker: r, assinatura: n }), !0;
5068
5078
  }
5069
5079
  remover(t) {
@@ -5076,7 +5086,7 @@ class Qn {
5076
5086
  }
5077
5087
  }
5078
5088
  const Nt = (a) => `${a.camadaId}\0${a.id}`;
5079
- class ts {
5089
+ class es {
5080
5090
  constructor(t) {
5081
5091
  f(this, "itens", /* @__PURE__ */ new Map());
5082
5092
  this.dep = t;
@@ -5150,13 +5160,13 @@ class ts {
5150
5160
  this.dep.aoSelecionar(o), o.length <= 1 && this.dep.aoSelecionarUma(o[0] ?? null);
5151
5161
  }
5152
5162
  }
5153
- const es = {
5163
+ const os = {
5154
5164
  Point: "Ponto",
5155
5165
  LineString: "Linha",
5156
5166
  Polygon: "Polígono",
5157
5167
  Circle: "Círculo",
5158
5168
  Text: "Texto"
5159
- }, os = /* @__PURE__ */ new Set([
5169
+ }, is = /* @__PURE__ */ new Set([
5160
5170
  "name",
5161
5171
  "nome",
5162
5172
  "category",
@@ -5169,7 +5179,7 @@ const es = {
5169
5179
  "data",
5170
5180
  "created_at",
5171
5181
  "criadoEm"
5172
- ]), wo = 6;
5182
+ ]), zo = 6;
5173
5183
  function Mt(a, t) {
5174
5184
  var e;
5175
5185
  for (const o of t) {
@@ -5178,11 +5188,11 @@ function Mt(a, t) {
5178
5188
  }
5179
5189
  return "";
5180
5190
  }
5181
- function is(a) {
5191
+ function as(a) {
5182
5192
  const t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(a), e = t ? new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3])) : new Date(a);
5183
5193
  return Number.isNaN(e.getTime()) ? a : e.toLocaleDateString("pt-BR");
5184
5194
  }
5185
- function as(a) {
5195
+ function ns(a) {
5186
5196
  const t = typeof a == "object" ? JSON.stringify(a) : String(a);
5187
5197
  return t.length > 80 ? `${t.slice(0, 77)}...` : t;
5188
5198
  }
@@ -5202,7 +5212,7 @@ function ne(a) {
5202
5212
  }
5203
5213
  }
5204
5214
  }
5205
- function ns(a) {
5215
+ function ss(a) {
5206
5216
  const t = a.geometria, e = [], o = dt(t), i = ht(t);
5207
5217
  if (t.tipo === "Polygon")
5208
5218
  e.push(["Área", Lt(o ?? 0)], ["Perímetro", W(i ?? 0)]), e.push(["Vértices", String(t.aneis.reduce((r, c) => r + c.length, 0))]);
@@ -5213,7 +5223,7 @@ function ns(a) {
5213
5223
  const [n, s] = ne(a);
5214
5224
  return e.push(["Coordenadas", `${n.toFixed(6)}, ${s.toFixed(6)}`]), e;
5215
5225
  }
5216
- class ss {
5226
+ class rs {
5217
5227
  constructor(t) {
5218
5228
  f(this, "popup", null);
5219
5229
  f(this, "feicaoAtual", null);
@@ -5253,42 +5263,42 @@ class ss {
5253
5263
  montar(t) {
5254
5264
  var u;
5255
5265
  const e = this.dep.obterCamada(t.camadaId), o = ot(((u = t.estilo) == null ? void 0 : u.corTraco) ?? (e == null ? void 0 : e.estilo.corPrimaria), "#38bdf8"), i = (v, M = "", z) => {
5256
- const S = document.createElement(v);
5257
- return M && (S.style.cssText = M), z !== void 0 && (S.textContent = z), S;
5266
+ const C = document.createElement(v);
5267
+ return M && (C.style.cssText = M), z !== void 0 && (C.textContent = z), C;
5258
5268
  }, n = i("div", "font-family:var(--ui-fonte-base,sans-serif);color:rgba(255,255,255,.9);line-height:1.35;min-width:200px;border-left:3px solid " + o + ";padding-left:8px");
5259
5269
  n.className = "cad-feicao-popup", n.appendChild(i("div", "font-weight:700;font-size:13px;margin-bottom:1px", Mt(t, ["name", "nome"]) || t.id));
5260
- const s = Mt(t, ["category", "categoria"]), r = [es[t.geometria.tipo], (e == null ? void 0 : e.nome) ?? t.camadaId, s].filter(Boolean).join(" · ");
5270
+ const s = Mt(t, ["category", "categoria"]), r = [os[t.geometria.tipo], (e == null ? void 0 : e.nome) ?? t.camadaId, s].filter(Boolean).join(" · ");
5261
5271
  n.appendChild(i("div", "font-size:11px;color:rgba(255,255,255,.6);margin-bottom:4px", r));
5262
5272
  const c = Mt(t, ["description", "descricao"]);
5263
5273
  c && n.appendChild(i("div", "font-size:11px;margin-bottom:4px", c));
5264
5274
  const l = (v) => {
5265
5275
  const M = i("div", "font-size:11px;margin-bottom:4px");
5266
- for (const [z, S] of v) {
5276
+ for (const [z, C] of v) {
5267
5277
  const L = i("div");
5268
- L.appendChild(i("strong", "", `${z}: `)), L.appendChild(document.createTextNode(S)), M.appendChild(L);
5278
+ L.appendChild(i("strong", "", `${z}: `)), L.appendChild(document.createTextNode(C)), M.appendChild(L);
5269
5279
  }
5270
5280
  return M;
5271
5281
  };
5272
- n.appendChild(l(ns(t)));
5273
- const d = Object.entries(t.propriedades ?? {}).filter(([v, M]) => !os.has(v) && M !== void 0 && M !== null && M !== "");
5274
- d.length > 0 && (n.appendChild(l(d.slice(0, wo).map(([v, M]) => [v, as(M)]))), d.length > wo && n.appendChild(i("div", "font-size:10px;color:rgba(255,255,255,.55);margin-bottom:4px", `${d.length} atributos`)));
5282
+ n.appendChild(l(ss(t)));
5283
+ const d = Object.entries(t.propriedades ?? {}).filter(([v, M]) => !is.has(v) && M !== void 0 && M !== null && M !== "");
5284
+ d.length > 0 && (n.appendChild(l(d.slice(0, zo).map(([v, M]) => [v, ns(M)]))), d.length > zo && n.appendChild(i("div", "font-size:10px;color:rgba(255,255,255,.55);margin-bottom:4px", `${d.length} atributos`)));
5275
5285
  const h = Mt(t, ["author", "autor"]), p = Mt(t, ["date", "data", "created_at", "criadoEm"]);
5276
5286
  if (h || p) {
5277
- const v = [h, p ? is(p) : ""].filter(Boolean).join(" · ");
5287
+ const v = [h, p ? as(p) : ""].filter(Boolean).join(" · ");
5278
5288
  n.appendChild(i("div", "font-size:10px;color:rgba(255,255,255,.55);margin-bottom:4px", v));
5279
5289
  }
5280
5290
  const m = i("div", "display:flex;gap:4px;flex-wrap:wrap;margin-top:6px"), g = [["inspecionar", "Inspecionar"], ["zoom", "Zoom"]];
5281
5291
  t.geometria.tipo === "LineString" || t.geometria.tipo === "Polygon" || t.geometria.tipo === "Point" ? g.push(["vertices", "Vértices"]) : t.geometria.tipo === "Circle" && g.push(["vertices", "Editar"]), t.geometria.tipo === "Point" && g.push(["copiar", "Copiar"]);
5282
5292
  for (const [v, M] of g) {
5283
5293
  const z = i("button", "font-size:11px;padding:2px 8px;border-radius:4px;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.08);color:inherit;cursor:pointer", M);
5284
- z.type = "button", z.dataset.acao = v, z.addEventListener("click", (S) => {
5285
- S.stopPropagation(), this.dep.aoAcao(v, this.feicaoAtual ?? t);
5294
+ z.type = "button", z.dataset.acao = v, z.addEventListener("click", (C) => {
5295
+ C.stopPropagation(), this.dep.aoAcao(v, this.feicaoAtual ?? t);
5286
5296
  }), m.appendChild(z);
5287
5297
  }
5288
5298
  return n.appendChild(m), n;
5289
5299
  }
5290
5300
  }
5291
- class rs {
5301
+ class cs {
5292
5302
  constructor(t) {
5293
5303
  f(this, "_ligado", !0);
5294
5304
  f(this, "_altSegurado", !1);
@@ -5345,7 +5355,7 @@ class rs {
5345
5355
  }
5346
5356
  }
5347
5357
  const H = "feicoes";
5348
- class cs {
5358
+ class ls {
5349
5359
  constructor(t) {
5350
5360
  this.p = t;
5351
5361
  }
@@ -5370,7 +5380,7 @@ class cs {
5370
5380
  let c = !1;
5371
5381
  for (const l of r) {
5372
5382
  if (l.geometria.tipo !== "Polygon") continue;
5373
- const d = pa(l.geometria.aneis[0], t);
5383
+ const d = fa(l.geometria.aneis[0], t);
5374
5384
  if (!d) continue;
5375
5385
  this.p.divisaoAtiva() && this.p.estaSelecionada({ camadaId: l.camadaId, id: l.id }) && this.p.encerrarDesenho(), this.p.removerFeicao(l.camadaId, l.id);
5376
5386
  const h = [];
@@ -5390,7 +5400,7 @@ class cs {
5390
5400
  gerarBuffer(t, e, o, i = {}) {
5391
5401
  const n = this.p.buscar(t, e);
5392
5402
  if (!n) return null;
5393
- const s = ba(n.geometria, o);
5403
+ const s = xa(n.geometria, o);
5394
5404
  if (!s) return null;
5395
5405
  const r = i.camadaDestino ?? t, c = this.p.adicionarFeicao(r, {
5396
5406
  id: i.id ?? this.p.idLivre(r, `${e}-buffer`),
@@ -5404,7 +5414,7 @@ class cs {
5404
5414
  duplicarFeicao(t, e, o = {}, i = {}) {
5405
5415
  const n = this.p.buscar(t, e);
5406
5416
  if (!n) return null;
5407
- const s = xa(n.geometria, o.lesteM ?? 0, o.norteM ?? 0), r = this.p.adicionarFeicao(t, ge(n, i.id ?? this.p.idLivre(t, `${e}-copia`), s));
5417
+ const s = Pa(n.geometria, o.lesteM ?? 0, o.norteM ?? 0), r = this.p.adicionarFeicao(t, ge(n, i.id ?? this.p.idLivre(t, `${e}-copia`), s));
5408
5418
  return r && this.p.emitir("cad-feicao-criada", { camadaId: t, feicao: r }), r;
5409
5419
  }
5410
5420
  /**
@@ -5426,12 +5436,12 @@ class cs {
5426
5436
  let l = null;
5427
5437
  if (s.every((h) => h.geometria.tipo === "LineString")) {
5428
5438
  if (s.some((m) => Yt(m.geometria))) return i("multiparte");
5429
- const h = s.map((m) => m.geometria.coordenadas), p = fa(h, c);
5439
+ const h = s.map((m) => m.geometria.coordenadas), p = ma(h, c);
5430
5440
  p && (l = Kt([p]));
5431
5441
  } else if (s.every((h) => h.geometria.tipo === "Polygon" && h.geometria.aneis.length === 1)) {
5432
5442
  let h = s[0].geometria.aneis[0];
5433
5443
  for (const p of s.slice(1))
5434
- h = h ? va(h, p.geometria.aneis[0], c) : null;
5444
+ h = h ? ya(h, p.geometria.aneis[0], c) : null;
5435
5445
  h && (l = { tipo: "Polygon", aneis: [h] });
5436
5446
  } else
5437
5447
  return i("tipos-incompativeis");
@@ -5445,7 +5455,7 @@ class cs {
5445
5455
  return this.p.emitir("cad-feicao-unida", { origens: s, resultado: d }), d;
5446
5456
  }
5447
5457
  }
5448
- class ls {
5458
+ class ds {
5449
5459
  constructor(t, e) {
5450
5460
  f(this, "cacheOficiais", /* @__PURE__ */ new WeakMap());
5451
5461
  this.p = t, this.regra = e;
@@ -5453,7 +5463,7 @@ class ls {
5453
5463
  oficiaisDe(t) {
5454
5464
  const e = this.p.lista(t);
5455
5465
  let o = this.cacheOficiais.get(e);
5456
- return o || (o = We.oficiais(e), this.cacheOficiais.set(e, o)), o;
5466
+ return o || (o = Ze.oficiais(e), this.cacheOficiais.set(e, o)), o;
5457
5467
  }
5458
5468
  /** Aparece segundo a regra de oficial × prévia? */
5459
5469
  visivelPorVersao(t) {
@@ -5505,14 +5515,14 @@ class ls {
5505
5515
  }
5506
5516
  }
5507
5517
  }
5508
- class ds {
5518
+ class hs {
5509
5519
  constructor(t) {
5510
5520
  this.p = t;
5511
5521
  }
5512
5522
  limitesDe(t) {
5513
5523
  let e = 1 / 0, o = 1 / 0, i = -1 / 0, n = -1 / 0;
5514
5524
  for (const s of t) {
5515
- const [[r, c], [l, d]] = Ti(s.geometria);
5525
+ const [[r, c], [l, d]] = _i(s.geometria);
5516
5526
  r < e && (e = r), c < o && (o = c), l > i && (i = l), d > n && (n = d);
5517
5527
  }
5518
5528
  return Number.isFinite(e) ? [[e, o], [i, n]] : null;
@@ -5547,23 +5557,23 @@ class ds {
5547
5557
  return !o || o.tipo !== H ? !1 : (o.visivel || e.setLayerVisibility(t, !0), this.enquadrar(this.p.lista(t).filter((i) => this.p.desenhada(i))));
5548
5558
  }
5549
5559
  }
5550
- const zo = 36, hs = 0.45;
5551
- function us(a, t) {
5560
+ const Eo = 36, us = 0.45;
5561
+ function ps(a, t) {
5552
5562
  const e = Math.abs(t[0] - a[0]), o = Math.abs(t[1] - a[1]);
5553
5563
  if (e === 0 && o === 0) return null;
5554
5564
  const i = [];
5555
- for (let n = 0; n < zo; n++) {
5556
- const s = n * 2 * Math.PI / zo;
5565
+ for (let n = 0; n < Eo; n++) {
5566
+ const s = n * 2 * Math.PI / Eo;
5557
5567
  i.push([a[0] + e * Math.sin(s), a[1] + o * Math.cos(s)]);
5558
5568
  }
5559
5569
  return i;
5560
5570
  }
5561
- function hi(a, t) {
5571
+ function ui(a, t) {
5562
5572
  const e = Math.cos(a[0] * Math.PI / 180) || 1, o = t[0] - a[0], i = (t[1] - a[1]) * e, n = Math.hypot(o, i);
5563
5573
  return n === 0 ? null : { raio: n, inicio: Math.atan2(o, i), cosLat: e };
5564
5574
  }
5565
- function ps(a, t, e = 6) {
5566
- const o = hi(a, t);
5575
+ function fs(a, t, e = 6) {
5576
+ const o = ui(a, t);
5567
5577
  if (!o || e < 3) return null;
5568
5578
  const i = [];
5569
5579
  for (let n = 0; n < e; n++) {
@@ -5572,17 +5582,17 @@ function ps(a, t, e = 6) {
5572
5582
  }
5573
5583
  return i;
5574
5584
  }
5575
- function fs(a, t, e = 5) {
5576
- const o = hi(a, t);
5585
+ function ms(a, t, e = 5) {
5586
+ const o = ui(a, t);
5577
5587
  if (!o || e < 3) return null;
5578
5588
  const i = e * 2, n = [];
5579
5589
  for (let s = 0; s < i; s++) {
5580
- const r = s % 2 === 0 ? o.raio : o.raio * hs, c = o.inicio + s * 2 * Math.PI / i;
5590
+ const r = s % 2 === 0 ? o.raio : o.raio * us, c = o.inicio + s * 2 * Math.PI / i;
5581
5591
  n.push([a[0] + r * Math.sin(c), a[1] + r * Math.cos(c) / o.cosLat]);
5582
5592
  }
5583
5593
  return n;
5584
5594
  }
5585
- const Ve = [
5595
+ const je = [
5586
5596
  "ponto",
5587
5597
  "linha",
5588
5598
  "poligono",
@@ -5598,12 +5608,12 @@ const Ve = [
5598
5608
  "dividir",
5599
5609
  "selecao-laco",
5600
5610
  "conta-gotas"
5601
- ], Ce = 2;
5602
- function ui(a) {
5603
- return typeof a == "string" && Ve.includes(a);
5611
+ ], Me = 2;
5612
+ function pi(a) {
5613
+ return typeof a == "string" && je.includes(a);
5604
5614
  }
5605
5615
  function se(a) {
5606
- return a.entrada ?? (a.alca ? Ge(a.ponto, a.alca) : void 0);
5616
+ return a.entrada ?? (a.alca ? Ue(a.ponto, a.alca) : void 0);
5607
5617
  }
5608
5618
  function Ut(a) {
5609
5619
  return a.map((t) => {
@@ -5611,11 +5621,11 @@ function Ut(a) {
5611
5621
  return t.alca ? (e.saida = t.alca, e.entrada = se(t)) : t.entrada && (e.entrada = t.entrada), e;
5612
5622
  });
5613
5623
  }
5614
- function ms(a) {
5624
+ function gs(a) {
5615
5625
  return Pt(Ut(a), !1);
5616
5626
  }
5617
- function Me(a, t) {
5618
- const e = _i(a);
5627
+ function Ae(a, t) {
5628
+ const e = Di(a);
5619
5629
  if (t) {
5620
5630
  const i = e ? Pt(a, !0) : a.map((n) => n.ponto);
5621
5631
  return e ? { tipo: "Polygon", aneis: [i], curva: a } : { tipo: "Polygon", aneis: [i] };
@@ -5623,12 +5633,12 @@ function Me(a, t) {
5623
5633
  const o = e ? Pt(a, !1) : a.map((i) => i.ponto);
5624
5634
  return e ? { tipo: "LineString", coordenadas: o, curva: a } : { tipo: "LineString", coordenadas: o };
5625
5635
  }
5626
- const gs = (a, t) => a[0] === t[0] && a[1] === t[1], Eo = {
5627
- elipse: us,
5628
- "poligono-regular": (a, t) => ps(a, t, 6),
5629
- estrela: (a, t) => fs(a, t, 5)
5636
+ const vs = (a, t) => a[0] === t[0] && a[1] === t[1], ko = {
5637
+ elipse: ps,
5638
+ "poligono-regular": (a, t) => fs(a, t, 6),
5639
+ estrela: (a, t) => ms(a, t, 5)
5630
5640
  };
5631
- class Ae {
5641
+ class we {
5632
5642
  constructor(t, e = !1) {
5633
5643
  f(this, "pontos", []);
5634
5644
  f(this, "cursor", null);
@@ -5682,14 +5692,14 @@ class Ae {
5682
5692
  return this.pontos.push(t), {};
5683
5693
  {
5684
5694
  const e = xt(this.pontos[0], t);
5685
- return e >= Ce ? { concluida: { tipo: "Circle", centro: this.pontos[0], raioMetros: e } } : { aviso: `Raio mínimo de ${Ce} m: clique mais longe do centro.` };
5695
+ return e >= Me ? { concluida: { tipo: "Circle", centro: this.pontos[0], raioMetros: e } } : { aviso: `Raio mínimo de ${Me} m: clique mais longe do centro.` };
5686
5696
  }
5687
5697
  case "elipse":
5688
5698
  case "poligono-regular":
5689
5699
  case "estrela": {
5690
5700
  if (this.pontos.length === 0)
5691
5701
  return this.pontos.push(t), {};
5692
- const e = Eo[this.ferramenta](this.pontos[0], t);
5702
+ const e = ko[this.ferramenta](this.pontos[0], t);
5693
5703
  return e ? { concluida: { tipo: "Polygon", aneis: [e] } } : { aviso: "Clique num ponto diferente do centro." };
5694
5704
  }
5695
5705
  case "caneta":
@@ -5697,7 +5707,7 @@ class Ae {
5697
5707
  case "conta-gotas":
5698
5708
  return {};
5699
5709
  default:
5700
- return this.pontos.length > 0 && gs(this.pontos[this.pontos.length - 1], t) ? {} : (this.pontos.push(t), {});
5710
+ return this.pontos.length > 0 && vs(this.pontos[this.pontos.length - 1], t) ? {} : (this.pontos.push(t), {});
5701
5711
  }
5702
5712
  }
5703
5713
  /** Caneta: arrastar logo após colocar a âncora define a alça de saída (a de entrada é o espelho). */
@@ -5713,7 +5723,7 @@ class Ae {
5713
5723
  const n = this.ancoras[t];
5714
5724
  if (this.ferramenta !== "caneta" || !n) return;
5715
5725
  if (i) {
5716
- n.alca = e === "saida" ? o : Ge(n.ponto, o), delete n.entrada;
5726
+ n.alca = e === "saida" ? o : Ue(n.ponto, o), delete n.entrada;
5717
5727
  return;
5718
5728
  }
5719
5729
  const s = se(n);
@@ -5726,7 +5736,7 @@ class Ae {
5726
5736
  }
5727
5737
  /** Vértices da linha/anel em construção, incluindo a curva da caneta. */
5728
5738
  vertices() {
5729
- return this.ferramenta === "caneta" ? ms(this.ancoras) : this.pontos;
5739
+ return this.ferramenta === "caneta" ? gs(this.ancoras) : this.pontos;
5730
5740
  }
5731
5741
  retangulo(t, e) {
5732
5742
  return t[0] === e[0] || t[1] === e[1] ? null : { tipo: "Polygon", aneis: [[[t[0], t[1]], [t[0], e[1]], [e[0], e[1]], [e[0], t[1]]]] };
@@ -5740,18 +5750,18 @@ class Ae {
5740
5750
  case "circulo": {
5741
5751
  if (this.pontos.length !== 1 || !t) return null;
5742
5752
  const e = xt(this.pontos[0], t);
5743
- return e >= Ce ? { tipo: "Circle", centro: this.pontos[0], raioMetros: e } : null;
5753
+ return e >= Me ? { tipo: "Circle", centro: this.pontos[0], raioMetros: e } : null;
5744
5754
  }
5745
5755
  case "caneta": {
5746
5756
  if (this.ancoras.length === 0) return null;
5747
5757
  const e = Ut(t ? [...this.ancoras, { ponto: t }] : this.ancoras);
5748
- return e.length < 2 ? null : Me(e, this.ehArea && e.length >= 3);
5758
+ return e.length < 2 ? null : Ae(e, this.ehArea && e.length >= 3);
5749
5759
  }
5750
5760
  case "elipse":
5751
5761
  case "poligono-regular":
5752
5762
  case "estrela": {
5753
5763
  if (this.pontos.length !== 1 || !t) return null;
5754
- const e = Eo[this.ferramenta](this.pontos[0], t);
5764
+ const e = ko[this.ferramenta](this.pontos[0], t);
5755
5765
  return e ? { tipo: "Polygon", aneis: [e] } : null;
5756
5766
  }
5757
5767
  case "ponto":
@@ -5767,42 +5777,42 @@ class Ae {
5767
5777
  /** Fecha uma ferramenta sequencial (Enter ou duplo clique). `null` se ainda não há vértices suficientes. */
5768
5778
  concluir() {
5769
5779
  if (!this.podeConcluir) return null;
5770
- if (this.ferramenta === "caneta") return Me(Ut(this.ancoras), this.ehArea);
5780
+ if (this.ferramenta === "caneta") return Ae(Ut(this.ancoras), this.ehArea);
5771
5781
  const t = this.vertices();
5772
5782
  return this.ehArea ? { tipo: "Polygon", aneis: [t] } : { tipo: "LineString", coordenadas: t };
5773
5783
  }
5774
5784
  /** Fecha em polígono (clique no primeiro vértice). Na caneta vale mesmo sem a opção `fechar`. */
5775
5785
  concluirFechando() {
5776
- return this.fechaNoPrimeiro ? this.ferramenta === "caneta" ? Me(Ut(this.ancoras), !0) : { tipo: "Polygon", aneis: [this.vertices()] } : null;
5786
+ return this.fechaNoPrimeiro ? this.ferramenta === "caneta" ? Ae(Ut(this.ancoras), !0) : { tipo: "Polygon", aneis: [this.vertices()] } : null;
5777
5787
  }
5778
5788
  /** Medida em andamento: comprimento (linha) ou comprimento do contorno (área), em metros. */
5779
5789
  comprimentoMetros() {
5780
5790
  const t = this.cursor && this.nos > 0 ? [...this.vertices(), this.cursor] : this.vertices();
5781
- return No(t, !1);
5791
+ return Ro(t, !1);
5782
5792
  }
5783
5793
  }
5784
- const vs = { topo: 0, base: 16, esquerda: 0, direita: 0 }, ys = 16, bs = 0.92, we = {
5794
+ const ys = { topo: 0, base: 16, esquerda: 0, direita: 0 }, bs = 16, xs = 0.92, ze = {
5785
5795
  topo: "--cad-hud-topo",
5786
5796
  base: "--cad-hud-base",
5787
5797
  esquerda: "--cad-hud-esquerda",
5788
5798
  direita: "--cad-hud-direita"
5789
- }, pi = "position:absolute;box-sizing:border-box;z-index:10000;left:calc(var(--cad-hud-esquerda,0px) + (100% - var(--cad-hud-esquerda,0px) - var(--cad-hud-direita,0px)) / 2);bottom:var(--cad-hud-base,16px);transform:translateX(-50%);width:max-content;max-width:min(92%, calc(100% - var(--cad-hud-esquerda,0px) - var(--cad-hud-direita,0px) - 16px));max-height:calc(100% - var(--cad-hud-topo,0px) - var(--cad-hud-base,16px) - 8px);overflow:hidden;display:flex;flex-wrap:wrap;";
5790
- function Ir(a, t, e = {}) {
5791
- const o = { ...vs, ...e }, i = Math.max(0, a - o.esquerda - o.direita);
5799
+ }, fi = "position:absolute;box-sizing:border-box;z-index:10000;left:calc(var(--cad-hud-esquerda,0px) + (100% - var(--cad-hud-esquerda,0px) - var(--cad-hud-direita,0px)) / 2);bottom:var(--cad-hud-base,16px);transform:translateX(-50%);width:max-content;max-width:min(92%, calc(100% - var(--cad-hud-esquerda,0px) - var(--cad-hud-direita,0px) - 16px));max-height:calc(100% - var(--cad-hud-topo,0px) - var(--cad-hud-base,16px) - 8px);overflow:hidden;display:flex;flex-wrap:wrap;";
5800
+ function Tr(a, t, e = {}) {
5801
+ const o = { ...ys, ...e }, i = Math.max(0, a - o.esquerda - o.direita);
5792
5802
  return {
5793
5803
  centroX: o.esquerda + i / 2,
5794
5804
  base: o.base,
5795
- larguraMax: Math.max(0, Math.min(a * bs, i - ys)),
5805
+ larguraMax: Math.max(0, Math.min(a * xs, i - bs)),
5796
5806
  alturaMax: Math.max(0, t - o.topo - o.base - 8)
5797
5807
  };
5798
5808
  }
5799
- function xs(a, t) {
5800
- for (const e of Object.keys(we)) {
5809
+ function Ps(a, t) {
5810
+ for (const e of Object.keys(ze)) {
5801
5811
  const o = t[e];
5802
- typeof o == "number" && Number.isFinite(o) && o >= 0 ? a.style.setProperty(we[e], `${o}px`) : a.style.removeProperty(we[e]);
5812
+ typeof o == "number" && Number.isFinite(o) && o >= 0 ? a.style.setProperty(ze[e], `${o}px`) : a.style.removeProperty(ze[e]);
5803
5813
  }
5804
5814
  }
5805
- const Ps = "cm-draw-hud", ko = "cad-ferramenta-ativa", Q = "cad-desenho", nt = "#22d3ee", Ls = 4, Ss = 450, Cs = 10, Ms = 8, As = 2500, ws = {
5815
+ const Ls = "cm-draw-hud", Io = "cad-ferramenta-ativa", Q = "cad-desenho", nt = "#22d3ee", Cs = 4, Ss = 450, Ms = 10, As = 8, ws = 2500, zs = {
5806
5816
  ponto: "Ponto",
5807
5817
  linha: "Linha",
5808
5818
  poligono: "Polígono",
@@ -5818,7 +5828,7 @@ const Ps = "cm-draw-hud", ko = "cad-ferramenta-ativa", Q = "cad-desenho", nt = "
5818
5828
  dividir: "Dividir polígono",
5819
5829
  "selecao-laco": "Seleção por laço",
5820
5830
  "conta-gotas": "Conta-gotas"
5821
- }, zs = {
5831
+ }, Es = {
5822
5832
  ponto: "Clique para colocar",
5823
5833
  linha: "Clique nos vértices · Enter ou duplo clique conclui",
5824
5834
  poligono: "Clique nos vértices · Enter ou duplo clique conclui",
@@ -5835,7 +5845,7 @@ const Ps = "cm-draw-hud", ko = "cad-ferramenta-ativa", Q = "cad-desenho", nt = "
5835
5845
  "selecao-laco": "Desenhe o laço · Enter ou 1º ponto fecha e seleciona",
5836
5846
  "conta-gotas": "Clique numa feição para copiar o estilo"
5837
5847
  };
5838
- class Es {
5848
+ class ks {
5839
5849
  constructor(t) {
5840
5850
  f(this, "sessao", null);
5841
5851
  f(this, "fechar", !1);
@@ -5902,7 +5912,7 @@ class Es {
5902
5912
  }
5903
5913
  if (!o)
5904
5914
  if (t.key === "Enter") {
5905
- if (Fo(t)) return;
5915
+ if (Oo(t)) return;
5906
5916
  this.concluir(), t.preventDefault();
5907
5917
  } else (t.key === "Backspace" || (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "z") && (e.desfazer() && this.atualizar(), t.preventDefault());
5908
5918
  });
@@ -5931,9 +5941,9 @@ class Es {
5931
5941
  const o = (s = this.sessao) == null ? void 0 : s.ferramenta;
5932
5942
  this.desligar(), o && this.dep.aoDesativar(o), this.limparMedicao();
5933
5943
  const i = this.dep.map;
5934
- this.fechar = !!e.fechar, this.sessao = new Ae(t, this.fechar), i.getPane(Q) || (i.createPane(Q).style.zIndex = "8500"), this.grupo = y.layerGroup().addTo(i), this.marcas = y.layerGroup().addTo(this.grupo);
5944
+ this.fechar = !!e.fechar, this.sessao = new we(t, this.fechar), i.getPane(Q) || (i.createPane(Q).style.zIndex = "8500"), this.grupo = y.layerGroup().addTo(i), this.marcas = y.layerGroup().addTo(this.grupo);
5935
5945
  const n = i.getContainer();
5936
- n.classList.add(ko), n.style.cursor = t === "conta-gotas" ? "copy" : "crosshair", i.on("click", this.aoClicar), i.on("dblclick", this.aoDuploClique), i.on("mousemove", this.aoMover), i.on("mousedown", this.aoPressionar), window.addEventListener("mouseup", this.aoSoltar), window.addEventListener("keydown", this.aoTecla), this.montarHud(), this.atualizar();
5946
+ n.classList.add(Io), n.style.cursor = t === "conta-gotas" ? "copy" : "crosshair", i.on("click", this.aoClicar), i.on("dblclick", this.aoDuploClique), i.on("mousemove", this.aoMover), i.on("mousedown", this.aoPressionar), window.addEventListener("mouseup", this.aoSoltar), window.addEventListener("keydown", this.aoTecla), this.montarHud(), this.atualizar();
5937
5947
  }
5938
5948
  /** Desliga a ferramenta ativa (idempotente). A medição pronta continua na tela. */
5939
5949
  desativar() {
@@ -5950,7 +5960,7 @@ class Es {
5950
5960
  const t = this.dep.map;
5951
5961
  t.off("click", this.aoClicar), t.off("dblclick", this.aoDuploClique), t.off("mousemove", this.aoMover), t.off("mousedown", this.aoPressionar), window.removeEventListener("mouseup", this.aoSoltar), window.removeEventListener("keydown", this.aoTecla);
5952
5962
  const e = t.getContainer();
5953
- e.classList.remove(ko), e.style.cursor = "", (o = this.grupo) == null || o.remove(), this.grupo = null, this.previa = null, this.marcas = null, this.marcadorSnap = null, this.avisoTimer && clearTimeout(this.avisoTimer), this.avisoTimer = null, (i = this.hud) == null || i.remove(), this.hud = null, this.campoTexto = null, this.sessao = null, this.arrastando = null, this.ultimoClique = null;
5963
+ e.classList.remove(Io), e.style.cursor = "", (o = this.grupo) == null || o.remove(), this.grupo = null, this.previa = null, this.marcas = null, this.marcadorSnap = null, this.avisoTimer && clearTimeout(this.avisoTimer), this.avisoTimer = null, (i = this.hud) == null || i.remove(), this.hud = null, this.campoTexto = null, this.sessao = null, this.arrastando = null, this.ultimoClique = null;
5954
5964
  }
5955
5965
  // ---- entrada ----
5956
5966
  coordenada(t) {
@@ -5961,7 +5971,7 @@ class Es {
5961
5971
  return o ? (this.mostrarSnap(o.coordenada), o.coordenada) : (this.esconderSnap(), e);
5962
5972
  }
5963
5973
  repetido(t) {
5964
- const e = this.ultimoClique, o = Date.now(), i = t.containerPoint, n = !!e && Math.hypot(e.x - i.x, e.y - i.y) <= Ls && o - e.t <= Ss;
5974
+ const e = this.ultimoClique, o = Date.now(), i = t.containerPoint, n = !!e && Math.hypot(e.x - i.x, e.y - i.y) <= Cs && o - e.t <= Ss;
5965
5975
  return this.ultimoClique = { x: i.x, y: i.y, t: o }, n;
5966
5976
  }
5967
5977
  /** Com 3+ vértices, um clique perto do primeiro fecha a figura em polígono. */
@@ -5969,7 +5979,7 @@ class Es {
5969
5979
  const e = this.sessao, o = e == null ? void 0 : e.primeiro;
5970
5980
  if (!e || !o || !e.fechaNoPrimeiro) return !1;
5971
5981
  const i = this.dep.map.latLngToContainerPoint(o);
5972
- if (Math.hypot(i.x - t.containerPoint.x, i.y - t.containerPoint.y) > Cs) return !1;
5982
+ if (Math.hypot(i.x - t.containerPoint.x, i.y - t.containerPoint.y) > Ms) return !1;
5973
5983
  const n = e.concluirFechando();
5974
5984
  return n && this.finalizar(n), !!n;
5975
5985
  }
@@ -5979,7 +5989,7 @@ class Es {
5979
5989
  if (!e) return null;
5980
5990
  const o = this.dep.map, i = (n) => {
5981
5991
  const s = o.latLngToContainerPoint(n);
5982
- return Math.hypot(s.x - t.containerPoint.x, s.y - t.containerPoint.y) <= Ms;
5992
+ return Math.hypot(s.x - t.containerPoint.x, s.y - t.containerPoint.y) <= As;
5983
5993
  };
5984
5994
  for (let n = e.ancoras.length - 1; n >= 0; n--) {
5985
5995
  const s = e.ancoras[n];
@@ -6005,7 +6015,7 @@ class Es {
6005
6015
  const e = (o = this.hud) == null ? void 0 : o.querySelector('[data-campo="aviso"]');
6006
6016
  e && (e.textContent = t, this.avisoTimer && clearTimeout(this.avisoTimer), this.avisoTimer = setTimeout(() => {
6007
6017
  e.textContent = "", this.avisoTimer = null;
6008
- }, As));
6018
+ }, ws));
6009
6019
  }
6010
6020
  /**
6011
6021
  * Botão direito com a ferramenta ativa: conclui se já dá figura; senão desfaz o último vértice;
@@ -6024,11 +6034,11 @@ class Es {
6024
6034
  reiniciar() {
6025
6035
  var e;
6026
6036
  const t = (e = this.sessao) == null ? void 0 : e.ferramenta;
6027
- t && (this.sessao = new Ae(t, this.fechar), this.ultimoClique = null, this.arrastando = null, this.atualizar());
6037
+ t && (this.sessao = new we(t, this.fechar), this.ultimoClique = null, this.arrastando = null, this.atualizar());
6028
6038
  }
6029
6039
  finalizar(t) {
6030
6040
  const e = this.sessao.ferramenta, o = e === "medir-distancia" || e === "medir-area" ? this.mostrarMedicao(t, e) : null;
6031
- this.sessao = new Ae(e, this.fechar), this.ultimoClique = null, this.atualizar(), o && this.dep.aoMedir(o), this.dep.aoGeometria(e, t);
6041
+ this.sessao = new we(e, this.fechar), this.ultimoClique = null, this.atualizar(), o && this.dep.aoMedir(o), this.dep.aoGeometria(e, t);
6032
6042
  }
6033
6043
  // ---- texto ----
6034
6044
  pedirTexto(t) {
@@ -6076,7 +6086,7 @@ class Es {
6076
6086
  fillColor: nt,
6077
6087
  fillOpacity: 0.15,
6078
6088
  interactive: !1
6079
- }, i = Ye(t, o);
6089
+ }, i = Ke(t, o);
6080
6090
  if (i) return i;
6081
6091
  if (t.tipo === "Polygon") return y.polygon(t.aneis, o);
6082
6092
  if (t.tipo === "Circle") return y.circle(t.centro, { ...o, radius: t.raioMetros });
@@ -6106,7 +6116,7 @@ class Es {
6106
6116
  const c = {
6107
6117
  tipo: e === "medir-area" ? "area" : "distancia",
6108
6118
  pontos: i,
6109
- comprimentoM: No(i, !1)
6119
+ comprimentoM: Ro(i, !1)
6110
6120
  };
6111
6121
  if (t.tipo === "Polygon")
6112
6122
  c.areaM2 = dt(t) ?? 0, c.perimetroM = ht(t) ?? 0;
@@ -6138,14 +6148,14 @@ class Es {
6138
6148
  const t = this.sessao;
6139
6149
  if (!t) return;
6140
6150
  const e = document.createElement("div");
6141
- e.id = Ps, e.style.cssText = pi + "gap:10px;align-items:center;padding:6px 12px;border-radius:8px;background:rgba(15,23,42,.92);color:#fff;font:12px var(--ui-fonte-base,sans-serif);border:1px solid rgba(255,255,255,.2);pointer-events:auto";
6151
+ e.id = Ls, e.style.cssText = fi + "gap:10px;align-items:center;padding:6px 12px;border-radius:8px;background:rgba(15,23,42,.92);color:#fff;font:12px var(--ui-fonte-base,sans-serif);border:1px solid rgba(255,255,255,.2);pointer-events:auto";
6142
6152
  const o = (c) => {
6143
6153
  const l = document.createElement("span");
6144
6154
  return l.dataset.campo = c, l;
6145
6155
  }, i = document.createElement("strong");
6146
- i.textContent = ws[t.ferramenta];
6156
+ i.textContent = zs[t.ferramenta];
6147
6157
  const n = o("dica");
6148
- n.style.opacity = ".7", n.textContent = zs[t.ferramenta];
6158
+ n.style.opacity = ".7", n.textContent = Es[t.ferramenta];
6149
6159
  const s = (c, l, d = !1) => {
6150
6160
  const h = document.createElement("button");
6151
6161
  return h.type = "button", h.textContent = c, h.style.cssText = `padding:3px 10px;border-radius:4px;border:1px solid ${d ? nt : "rgba(255,255,255,.3)"};background:${d ? nt : "transparent"};color:${d ? "#111" : "#fff"};cursor:pointer;font-weight:600`, h.addEventListener("click", l), h;
@@ -6179,8 +6189,8 @@ class Es {
6179
6189
  (e = this.sessao) == null || e.mover(t), this.atualizar();
6180
6190
  }
6181
6191
  }
6182
- const ks = ["tipoLinha", "escalaTipoLinha", "deslocamentoTracejado", "opacidadeTraco", "terminacaoTraco", "juncaoTraco"], Is = /* @__PURE__ */ new Set(["ponto", "linha", "poligono", "retangulo", "elipse", "poligono-regular", "estrela", "circulo", "texto", "caneta"]);
6183
- class Ts {
6192
+ const Is = ["tipoLinha", "escalaTipoLinha", "deslocamentoTracejado", "opacidadeTraco", "terminacaoTraco", "juncaoTraco"], Ts = /* @__PURE__ */ new Set(["ponto", "linha", "poligono", "retangulo", "elipse", "poligono-regular", "estrela", "circulo", "texto", "caneta"]);
6193
+ class _s {
6184
6194
  constructor(t) {
6185
6195
  f(this, "desenho", null);
6186
6196
  f(this, "camadaDesenho", null);
@@ -6231,15 +6241,15 @@ class Ts {
6231
6241
  }
6232
6242
  ativarFerramenta(t, e = {}) {
6233
6243
  var n, s;
6234
- if (!ui(t)) return { ok: !1, motivo: "ferramenta-invalida" };
6244
+ if (!pi(t)) return { ok: !1, motivo: "ferramenta-invalida" };
6235
6245
  const o = this.p.obterMapa();
6236
6246
  if (!o) return { ok: !1, motivo: "sem-mapa" };
6237
- if (Is.has(t)) {
6247
+ if (Ts.has(t)) {
6238
6248
  const r = this.motivoCamadaDesenhoInvalida();
6239
6249
  if (r)
6240
6250
  return this.p.emitir("cad-desenho-recusado", { ferramenta: t, motivo: r }), { ok: !1, motivo: r };
6241
6251
  }
6242
- this.p.prepararDesenho(), this.desenho || (this.desenho = new Es({
6252
+ this.p.prepararDesenho(), this.desenho || (this.desenho = new ks({
6243
6253
  map: o,
6244
6254
  buscarSnap: (r) => this.p.buscarSnapEm(r),
6245
6255
  snapAtivo: () => this.p.snapAtivo(),
@@ -6328,11 +6338,11 @@ class Ts {
6328
6338
  }
6329
6339
  const s = this.p.obterLayerManager().getLayerDef(n.camadaId), r = n.estilo ?? {}, c = {}, l = r.corTraco ?? (s == null ? void 0 : s.estilo.corPrimaria);
6330
6340
  l && (c.corTraco = l), r.corPreenchimento && (c.corPreenchimento = r.corPreenchimento), r.espessuraTraco !== void 0 && (c.espessuraTraco = r.espessuraTraco), r.opacidadePreenchimento !== void 0 && (c.opacidadePreenchimento = r.opacidadePreenchimento), r.dashArray && (c.dashArray = r.dashArray);
6331
- for (const d of ks) r[d] !== void 0 && (c[d] = r[d]);
6341
+ for (const d of Is) r[d] !== void 0 && (c[d] = r[d]);
6332
6342
  this.estiloDesenho = { ...this.estiloDesenho, ...c }, this.p.emitir("cad-conta-gotas", { cor: l ?? r.corPreenchimento ?? "", feicao: n, estilo: c });
6333
6343
  }
6334
6344
  }
6335
- class _s {
6345
+ class Ds {
6336
6346
  constructor(t) {
6337
6347
  /** id -> posição na lista da camada (válido enquanto `lista` for a lista atual); evita varrer a camada a cada consulta. */
6338
6348
  f(this, "posicoes", /* @__PURE__ */ new Map());
@@ -6370,7 +6380,7 @@ class _s {
6370
6380
  return { aceitas: 0, recusadas: ["camada existente não é de feições"] };
6371
6381
  const i = [], n = /* @__PURE__ */ new Map();
6372
6382
  return (Array.isArray(e) ? e : []).forEach((s, r) => {
6373
- const c = Le(s, t, this.p.opcoesNormalizacao());
6383
+ const c = Ce(s, t, this.p.opcoesNormalizacao());
6374
6384
  c ? n.set(c.id, c) : i.push(String((s == null ? void 0 : s.id) ?? `#${r}`));
6375
6385
  }), this.p.obterLayerManager().setLayerData(t, { feicoes: [...n.values()] }), this.p.aposDados(), { aceitas: n.size, recusadas: i };
6376
6386
  }
@@ -6400,7 +6410,7 @@ class _s {
6400
6410
  }
6401
6411
  mesclar(t, e, o, i) {
6402
6412
  const n = i && e.propriedades && typeof e.propriedades == "object" ? { ...e.propriedades } : { ...t.propriedades, ...e.propriedades };
6403
- return Le({
6413
+ return Ce({
6404
6414
  ...t,
6405
6415
  ...e,
6406
6416
  id: t.id,
@@ -6409,41 +6419,41 @@ class _s {
6409
6419
  }, o, this.p.opcoesNormalizacao());
6410
6420
  }
6411
6421
  aplicar(t, e, o = {}) {
6412
- const i = { adicionadas: 0, atualizadas: 0, removidas: 0, recusadas: [] }, n = [], s = [], r = Array.isArray(e == null ? void 0 : e.adicionar) ? e.adicionar : [], c = Array.isArray(e == null ? void 0 : e.atualizar) ? e.atualizar : [], l = Array.isArray(e == null ? void 0 : e.remover) ? e.remover : [], d = (C, w) => String((C == null ? void 0 : C.id) ?? `#${w}`), h = [], p = (C) => (i.recusadas.push(...h), C), m = [];
6413
- r.forEach((C, w) => {
6414
- const k = Le(C, t, this.p.opcoesNormalizacao());
6415
- k ? m.push(k) : h.push(d(C, w));
6422
+ const i = { adicionadas: 0, atualizadas: 0, removidas: 0, recusadas: [] }, n = [], s = [], r = Array.isArray(e == null ? void 0 : e.adicionar) ? e.adicionar : [], c = Array.isArray(e == null ? void 0 : e.atualizar) ? e.atualizar : [], l = Array.isArray(e == null ? void 0 : e.remover) ? e.remover : [], d = (S, w) => String((S == null ? void 0 : S.id) ?? `#${w}`), h = [], p = (S) => (i.recusadas.push(...h), S), m = [];
6423
+ r.forEach((S, w) => {
6424
+ const k = Ce(S, t, this.p.opcoesNormalizacao());
6425
+ k ? m.push(k) : h.push(d(S, w));
6416
6426
  });
6417
6427
  const g = this.p.obterLayerManager(), u = g.getLayerDef(t);
6418
6428
  if (!(!u || u.tipo === H) || !u && m.length === 0)
6419
- return c.forEach((C, w) => i.recusadas.push(d(C, w))), m.forEach((C) => h.push(C.id)), p({ resultado: i, adicionadas: n, atualizadas: s });
6429
+ return c.forEach((S, w) => i.recusadas.push(d(S, w))), m.forEach((S) => h.push(S.id)), p({ resultado: i, adicionadas: n, atualizadas: s });
6420
6430
  if ((m.length > 0 || u) && !this.garantirCamada(t, o))
6421
- return m.forEach((C) => h.push(C.id)), p({ resultado: i, adicionadas: n, atualizadas: s });
6422
- const M = this.lista(t), z = this.posicaoDe(t), S = M.slice(), L = [], b = [];
6431
+ return m.forEach((S) => h.push(S.id)), p({ resultado: i, adicionadas: n, atualizadas: s });
6432
+ const M = this.lista(t), z = this.posicaoDe(t), C = M.slice(), L = [], b = [];
6423
6433
  let x = !1;
6424
- for (const C of l) {
6425
- const w = String(C), k = z.get(w);
6426
- k === void 0 || S[k] === null || (S[k] = null, L.push(w), i.removidas++, x = !0);
6434
+ for (const S of l) {
6435
+ const w = String(S), k = z.get(w);
6436
+ k === void 0 || C[k] === null || (C[k] = null, L.push(w), i.removidas++, x = !0);
6427
6437
  }
6428
- c.forEach((C, w) => {
6429
- const k = C && typeof C == "object" && C.id !== void 0 && C.id !== null ? String(C.id) : "", I = z.get(k), N = I === void 0 ? null : S[I], $ = N ? this.mesclar(N, C, t, !!o.substituirPropriedades) : null;
6438
+ c.forEach((S, w) => {
6439
+ const k = S && typeof S == "object" && S.id !== void 0 && S.id !== null ? String(S.id) : "", I = z.get(k), N = I === void 0 ? null : C[I], $ = N ? this.mesclar(N, S, t, !!o.substituirPropriedades) : null;
6430
6440
  if (!$ || I === void 0) {
6431
- i.recusadas.push(k || d(C, w));
6441
+ i.recusadas.push(k || d(S, w));
6432
6442
  return;
6433
6443
  }
6434
- S[I] = $, b.push($), s.push($), i.atualizadas++;
6444
+ C[I] = $, b.push($), s.push($), i.atualizadas++;
6435
6445
  });
6436
- for (const C of m) {
6437
- const w = z.get(C.id);
6438
- w !== void 0 && S[w] !== null ? S[w] = C : (z.set(C.id, S.length), S.push(C)), b.push(C), n.push(C), i.adicionadas++;
6446
+ for (const S of m) {
6447
+ const w = z.get(S.id);
6448
+ w !== void 0 && C[w] !== null ? C[w] = S : (z.set(S.id, C.length), C.push(S)), b.push(S), n.push(S), i.adicionadas++;
6439
6449
  }
6440
6450
  if (b.length === 0 && L.length === 0) return p({ resultado: i, adicionadas: n, atualizadas: s });
6441
- const P = x ? S.filter((C) => C !== null) : S, E = { feicoes: P, delta: { base: M, mudadas: b, removidas: L } };
6451
+ const P = x ? C.filter((S) => S !== null) : C, E = { feicoes: P, delta: { base: M, mudadas: b, removidas: L } };
6442
6452
  return g.setLayerData(t, E), delete E.delta, x ? this.posicoes.delete(t) : this.posicoes.set(t, { lista: P, pos: z }), this.p.aposDados(), p({ resultado: i, adicionadas: n, atualizadas: s });
6443
6453
  }
6444
6454
  }
6445
- const Ds = "cm-vertex-edit-hud", st = "cad-edicao-vertices", Rt = "#facc15", ze = "#f472b6", qs = "#22d3ee", $s = 600, Fs = 100, Os = 24, Ns = 2500, Ee = (a, t) => a === t || JSON.stringify(a) === JSON.stringify(t);
6446
- class Rs {
6455
+ const qs = "cm-vertex-edit-hud", st = "cad-edicao-vertices", Rt = "#facc15", Ee = "#f472b6", $s = "#22d3ee", Fs = 600, Os = 100, Ns = 24, Rs = 2500, ke = (a, t) => a === t || JSON.stringify(a) === JSON.stringify(t);
6456
+ class Bs {
6447
6457
  constructor(t) {
6448
6458
  f(this, "feicaoAtual", null);
6449
6459
  /** Feição como foi gravada pela última vez (base do histórico). */
@@ -6529,7 +6539,7 @@ class Rs {
6529
6539
  cancelar() {
6530
6540
  const t = this.feicaoAtual, e = this.inicial;
6531
6541
  if (!(!t || !e)) {
6532
- if (!Ee(e.geometria, t.geometria)) {
6542
+ if (!ke(e.geometria, t.geometria)) {
6533
6543
  const o = { ...t, geometria: e.geometria };
6534
6544
  this.dep.previsualizar(o), this.gravar(o);
6535
6545
  }
@@ -6547,7 +6557,7 @@ class Rs {
6547
6557
  this.feicaoAtual = { ...t, geometria: this.feicaoAtual.geometria };
6548
6558
  return;
6549
6559
  }
6550
- if (this.base && Ee(t.geometria, this.base.geometria)) {
6560
+ if (this.base && ke(t.geometria, this.base.geometria)) {
6551
6561
  this.feicaoAtual = t, this.base = t;
6552
6562
  return;
6553
6563
  }
@@ -6567,7 +6577,7 @@ class Rs {
6567
6577
  }
6568
6578
  // ---- construção ----
6569
6579
  geometriaAtual() {
6570
- return yo(this.feicaoAtual.geometria, this.pts);
6580
+ return bo(this.feicaoAtual.geometria, this.pts);
6571
6581
  }
6572
6582
  feicaoComPontos() {
6573
6583
  return { ...this.feicaoAtual, geometria: this.geometriaAtual() };
@@ -6588,7 +6598,7 @@ class Rs {
6588
6598
  const n = this.criarAlca(o, i);
6589
6599
  this.alcas.push(n), this.grupo.addLayer(n);
6590
6600
  }), this.criarAlcasBezier(), t.tipo !== "Point")
6591
- for (const [o, i] of oi(this.geometriaAtual())) {
6601
+ for (const [o, i] of ii(this.geometriaAtual())) {
6592
6602
  if (!this.segmentoLongoNaTela(o, i)) continue;
6593
6603
  const n = this.criarFantasma(o, i);
6594
6604
  this.fantasmas.push(n), this.grupo.addLayer(n.marker);
@@ -6600,7 +6610,7 @@ class Rs {
6600
6610
  const o = this.pts[t], i = this.pts[e];
6601
6611
  if (!o || !i) return !1;
6602
6612
  const n = this.dep.map.latLngToContainerPoint(o), s = this.dep.map.latLngToContainerPoint(i);
6603
- return Math.hypot(n.x - s.x, n.y - s.y) >= Os;
6613
+ return Math.hypot(n.x - s.x, n.y - s.y) >= Ns;
6604
6614
  }
6605
6615
  icone(t, e, o) {
6606
6616
  return y.divIcon({
@@ -6610,7 +6620,7 @@ class Rs {
6610
6620
  });
6611
6621
  }
6612
6622
  iconeAlca(t) {
6613
- const e = this.ehCirculo && t === 1, o = this.selecionado === t, i = o ? qs : Rt, n = o ? "2px solid #fff;box-shadow:0 0 0 2px #0e7490" : "2px solid #111";
6623
+ const e = this.ehCirculo && t === 1, o = this.selecionado === t, i = o ? $s : Rt, n = o ? "2px solid #fff;box-shadow:0 0 0 2px #0e7490" : "2px solid #111";
6614
6624
  return this.icone("cad-vertex-handle", 12, `background:${i};border:${n};border-radius:${e ? "50%" : "2px"};cursor:${e ? "ew-resize" : "move"}`);
6615
6625
  }
6616
6626
  criarAlca(t, e) {
@@ -6632,7 +6642,7 @@ class Rs {
6632
6642
  }), o.on("contextmenu", (i) => {
6633
6643
  y.DomEvent.preventDefault(i.originalEvent), y.DomEvent.stopPropagation(i.originalEvent), this.excluir(e);
6634
6644
  }), o.on("dblclick", (i) => {
6635
- y.DomEvent.stopPropagation(i.originalEvent), !(Date.now() - this.ultimaInsercao < $s) && this.alternarSuave(e);
6645
+ y.DomEvent.stopPropagation(i.originalEvent), !(Date.now() - this.ultimaInsercao < Fs) && this.alternarSuave(e);
6636
6646
  }), o;
6637
6647
  }
6638
6648
  detectarRetanguloDe(t) {
@@ -6663,15 +6673,15 @@ class Rs {
6663
6673
  var s, r;
6664
6674
  const i = (r = (s = K(t)) == null ? void 0 : s[e]) == null ? void 0 : r[o];
6665
6675
  if (i) return { pos: i, latente: !1 };
6666
- if (this.pts.length > Ea) return null;
6667
- const n = ka(t, e, o);
6676
+ if (this.pts.length > ka) return null;
6677
+ const n = Ia(t, e, o);
6668
6678
  return n ? { pos: n, latente: !0 } : null;
6669
6679
  }
6670
6680
  iconeDaAlca(t) {
6671
6681
  return this.icone(
6672
6682
  "cad-bezier-handle",
6673
6683
  10,
6674
- t ? `background:transparent;border:2px dashed ${ze};opacity:.6;border-radius:50%;cursor:move` : `background:#fff;border:2px solid ${ze};border-radius:50%;cursor:move`
6684
+ t ? `background:transparent;border:2px dashed ${Ee};opacity:.6;border-radius:50%;cursor:move` : `background:#fff;border:2px solid ${Ee};border-radius:50%;cursor:move`
6675
6685
  );
6676
6686
  }
6677
6687
  /** Cria os marcadores das alças do nó que ainda não têm (reais, ou latentes nos nós de canto e nas poligonais). */
@@ -6684,7 +6694,7 @@ class Rs {
6684
6694
  if (!s || this.alcasBezier.some((d) => d.i === t && d.qual === n)) continue;
6685
6695
  const r = y.polyline([o.ponto, s.pos], {
6686
6696
  pane: st,
6687
- color: ze,
6697
+ color: Ee,
6688
6698
  weight: 1,
6689
6699
  opacity: s.latente ? 0.35 : 0.8,
6690
6700
  dashArray: s.latente ? "3 3" : void 0,
@@ -6714,13 +6724,13 @@ class Rs {
6714
6724
  aoArrastarAlca(t, e) {
6715
6725
  const o = this.feicaoAtual;
6716
6726
  if (!o) return;
6717
- const { lat: i, lng: n } = t.marker.getLatLng(), s = Ia(o.geometria, t.i, t.qual, [i, n], e);
6727
+ const { lat: i, lng: n } = t.marker.getLatLng(), s = Ta(o.geometria, t.i, t.qual, [i, n], e);
6718
6728
  this.feicaoAtual = { ...o, geometria: s }, this.completarAlcasDoNo(t.i), this.sincronizarAlcasBezier(), this.dep.previsualizar(this.feicaoAtual), this.atualizarHud();
6719
6729
  }
6720
6730
  alternarSuave(t) {
6721
6731
  const e = this.feicaoAtual;
6722
6732
  if (!e) return;
6723
- const o = Ta(e.geometria, t);
6733
+ const o = _a(e.geometria, t);
6724
6734
  o !== e.geometria && (this.feicaoAtual = { ...e, geometria: o }, this.reconstruir(), this.dep.previsualizar(this.feicaoAtual), this.confirmar(this.feicaoAtual));
6725
6735
  }
6726
6736
  criarFantasma(t, e) {
@@ -6781,10 +6791,10 @@ class Rs {
6781
6791
  comInsercao(t, e) {
6782
6792
  const o = this.feicaoAtual;
6783
6793
  if (!o || this.pts.length === 0) return null;
6784
- const i = this.geometriaAtual(), n = zt(i, t, (t + 1) % this.pts.length), s = wa(i, t, n);
6794
+ const i = this.geometriaAtual(), n = zt(i, t, (t + 1) % this.pts.length), s = za(i, t, n);
6785
6795
  if (s === i) return null;
6786
6796
  const r = pt(s).map((c) => [c[0], c[1]]);
6787
- return e && Number.isFinite(e[0]) && Number.isFinite(e[1]) && (r[t + 1] = e), { feicao: { ...o, geometria: yo(s, r) }, pts: r };
6797
+ return e && Number.isFinite(e[0]) && Number.isFinite(e[1]) && (r[t + 1] = e), { feicao: { ...o, geometria: bo(s, r) }, pts: r };
6788
6798
  }
6789
6799
  inserir(t, e) {
6790
6800
  const o = this.comInsercao(t, e);
@@ -6797,7 +6807,7 @@ class Rs {
6797
6807
  /** Grava o gesto: guarda a geometria anterior no histórico (se mudou) e avisa quem escuta. */
6798
6808
  confirmar(t) {
6799
6809
  const e = this.base;
6800
- e && !Ee(e.geometria, t.geometria) && (this.historico.push(e), this.historico.length > Fs && this.historico.shift(), this.refeitos = []), this.feicaoAtual = t, this.base = t, this.gravar(t), this.atualizarBotoes();
6810
+ e && !ke(e.geometria, t.geometria) && (this.historico.push(e), this.historico.length > Os && this.historico.shift(), this.refeitos = []), this.feicaoAtual = t, this.base = t, this.gravar(t), this.atualizarBotoes();
6801
6811
  }
6802
6812
  gravar(t) {
6803
6813
  this.gravando = !0;
@@ -6809,7 +6819,7 @@ class Rs {
6809
6819
  }
6810
6820
  excluir(t) {
6811
6821
  if (!this.feicaoAtual) return !1;
6812
- const o = this.geometriaAtual(), i = za(o, t);
6822
+ const o = this.geometriaAtual(), i = Ea(o, t);
6813
6823
  if (!i)
6814
6824
  return o.tipo === "Circle" ? this.avisar("Círculo: mova o centro ou a borda (não há nós para excluir).") : o.tipo === "Point" ? this.avisar("Um ponto tem um único nó.") : this.avisar(`Mínimo de ${ce(o)} nós: não dá para excluir mais.`), !1;
6815
6825
  this.pts = pt(i).map((s) => [s[0], s[1]]), this.retangulo = !1, this.selecionado = null, this.reconstruir();
@@ -6865,7 +6875,7 @@ class Rs {
6865
6875
  montarHud() {
6866
6876
  var d;
6867
6877
  const t = this.dep.map.getContainer(), e = document.createElement("div");
6868
- e.id = Ds, e.style.cssText = pi + "gap:8px;align-items:center;padding:4px 10px;border-radius:8px;background:rgba(15,23,42,.92);color:#fff;font:11px var(--ui-fonte-base,sans-serif);border:1px solid rgba(255,255,255,.2);pointer-events:auto";
6878
+ e.id = qs, e.style.cssText = fi + "gap:8px;align-items:center;padding:4px 10px;border-radius:8px;background:rgba(15,23,42,.92);color:#fff;font:11px var(--ui-fonte-base,sans-serif);border:1px solid rgba(255,255,255,.2);pointer-events:auto";
6869
6879
  const o = (h) => {
6870
6880
  const p = document.createElement("span");
6871
6881
  return p.dataset.campo = h, p;
@@ -6899,7 +6909,7 @@ class Rs {
6899
6909
  const e = (o = this.hud) == null ? void 0 : o.querySelector('[data-campo="aviso"]');
6900
6910
  e && (e.textContent = t, this.avisoTimer && clearTimeout(this.avisoTimer), this.avisoTimer = setTimeout(() => {
6901
6911
  e.textContent = "", this.avisoTimer = null;
6902
- }, Ns));
6912
+ }, Rs));
6903
6913
  }
6904
6914
  atualizarHud(t) {
6905
6915
  if (!this.hud || !this.feicaoAtual) return;
@@ -6929,7 +6939,7 @@ class Rs {
6929
6939
  i && (i.setLatLng(e), this.aoArrastar(i, t, o), i.fire("dragend"));
6930
6940
  }
6931
6941
  }
6932
- class Bs {
6942
+ class Vs {
6933
6943
  constructor(t) {
6934
6944
  f(this, "editor", null);
6935
6945
  f(this, "pararDeVigiarCamada", null);
@@ -6960,13 +6970,13 @@ class Bs {
6960
6970
  var d, h, p;
6961
6971
  const o = this.p.buscar(t, e);
6962
6972
  if (!o || o.excluida) return { ok: !1, motivo: "inexistente" };
6963
- const i = this.p.obterLayerManager().getLayerDef(t), n = vo(o, !!(i != null && i.bloqueada));
6973
+ const i = this.p.obterLayerManager().getLayerDef(t), n = yo(o, !!(i != null && i.bloqueada));
6964
6974
  if (n)
6965
6975
  return this.p.emitir("cad-edicao-recusada", { motivo: n, feicao: o }), { ok: !1, motivo: n };
6966
6976
  const s = this.p.obterMapa();
6967
6977
  if (!s) return { ok: !1, motivo: "sem-mapa" };
6968
6978
  this.p.desativarFerramenta(), (d = this.editor) == null || d.parar(), this.p.aplicarMargensHud(), this.p.selecionarUma({ camadaId: t, id: e }), this.p.fecharPopup();
6969
- const r = this.p.obterLayerManager(), c = O.get(H), l = new Rs({
6979
+ const r = this.p.obterLayerManager(), c = O.get(H), l = new Bs({
6970
6980
  map: s,
6971
6981
  snapLigado: () => this.p.snapAtivo(),
6972
6982
  alternarSnap: () => this.p.alternarSnap(),
@@ -7002,7 +7012,7 @@ class Bs {
7002
7012
  const t = this.p.selecionadas();
7003
7013
  if (t.length !== 1) return null;
7004
7014
  const e = this.p.obterLayerManager().getLayerDef(t[0].camadaId);
7005
- return vo(t[0], !!(e != null && e.bloqueada)) === null ? t[0] : null;
7015
+ return yo(t[0], !!(e != null && e.bloqueada)) === null ? t[0] : null;
7006
7016
  }
7007
7017
  /** Enter: edita a única feição selecionada, se ela for editável. Devolve se a edição começou. */
7008
7018
  editarSelecionada() {
@@ -7022,13 +7032,13 @@ class Bs {
7022
7032
  (t = this.editor) == null || t.parar();
7023
7033
  }
7024
7034
  }
7025
- const fi = 10, At = (a, t) => Math.hypot(a.x - t.x, a.y - t.y);
7026
- function Io(a, t, e) {
7035
+ const mi = 10, At = (a, t) => Math.hypot(a.x - t.x, a.y - t.y);
7036
+ function To(a, t, e) {
7027
7037
  const o = e.x - t.x, i = e.y - t.y, n = o * o + i * i, s = n === 0 ? 0 : Math.max(0, Math.min(1, ((a.x - t.x) * o + (a.y - t.y) * i) / n));
7028
7038
  return { t: s, d: Math.hypot(a.x - (t.x + s * o), a.y - (t.y + s * i)) };
7029
7039
  }
7030
- function Vs(a, t, e, o = {}, i) {
7031
- const n = o.toleranciaPx ?? fi, s = o.vertice !== !1, r = o.meio !== !1, c = o.aresta !== !1;
7040
+ function js(a, t, e, o = {}, i) {
7041
+ const n = o.toleranciaPx ?? mi, s = o.vertice !== !1, r = o.meio !== !1, c = o.aresta !== !1;
7032
7042
  let l = null, d = null, h = null;
7033
7043
  const p = (m, g) => !m || g.distanciaPx < m.distanciaPx ? g : m;
7034
7044
  for (const m of t) {
@@ -7049,7 +7059,7 @@ function Vs(a, t, e, o = {}, i) {
7049
7059
  b <= n && (l = p(l, { tipo: "vertice", coordenada: L.ponto, distanciaPx: b, ...v }));
7050
7060
  }
7051
7061
  if (r)
7052
- for (const [L, b] of oi(u)) {
7062
+ for (const [L, b] of ii(u)) {
7053
7063
  const x = zt(u, L, b), P = At(a, e(x));
7054
7064
  P <= n && (d = p(d, { tipo: "meio", coordenada: x, distanciaPx: P, ...v }));
7055
7065
  }
@@ -7058,21 +7068,21 @@ function Vs(a, t, e, o = {}, i) {
7058
7068
  for (let P = 0; P < L.length - 1; P++) x.push([P, P + 1]);
7059
7069
  u.tipo === "Polygon" && L.length > 2 && x.push([L.length - 1, 0]);
7060
7070
  for (const [P, A] of x) {
7061
- const { t: E, d: C } = Io(a, b[P], b[A]);
7062
- if (C <= n) {
7071
+ const { t: E, d: S } = To(a, b[P], b[A]);
7072
+ if (S <= n) {
7063
7073
  const w = [L[P][0] + E * (L[A][0] - L[P][0]), L[P][1] + E * (L[A][1] - L[P][1])];
7064
- h = p(h, { tipo: "aresta", coordenada: w, distanciaPx: C, ...v });
7074
+ h = p(h, { tipo: "aresta", coordenada: w, distanciaPx: S, ...v });
7065
7075
  }
7066
7076
  }
7067
7077
  }
7068
7078
  continue;
7069
7079
  }
7070
- const z = u.tipo === "LineString" ? it(u).map((L) => ({ pts: L, fechado: !1 })) : [{ pts: X(u), fechado: u.tipo === "Polygon" }], S = g ? i.vertice : void 0;
7080
+ const z = u.tipo === "LineString" ? it(u).map((L) => ({ pts: L, fechado: !1 })) : [{ pts: X(u), fechado: u.tipo === "Polygon" }], C = g ? i.vertice : void 0;
7071
7081
  for (const { pts: L, fechado: b } of z) {
7072
7082
  const x = L.map(e);
7073
7083
  if (s)
7074
7084
  for (let A = 0; A < L.length; A++) {
7075
- if (A === S) continue;
7085
+ if (A === C) continue;
7076
7086
  const E = At(a, x[A]);
7077
7087
  E <= n && (l = p(l, { tipo: "vertice", coordenada: L[A], distanciaPx: E, ...v }));
7078
7088
  }
@@ -7081,15 +7091,15 @@ function Vs(a, t, e, o = {}, i) {
7081
7091
  for (let A = 0; A < L.length - 1; A++) P.push([A, A + 1]);
7082
7092
  b && L.length > 2 && P.push([L.length - 1, 0]);
7083
7093
  for (const [A, E] of P)
7084
- if (!(S !== void 0 && (A === S || E === S)) && !(g && S === void 0)) {
7094
+ if (!(C !== void 0 && (A === C || E === C)) && !(g && C === void 0)) {
7085
7095
  if (r) {
7086
- const C = ti(L[A], L[E]), w = At(a, e(C));
7087
- w <= n && (d = p(d, { tipo: "meio", coordenada: C, distanciaPx: w, ...v }));
7096
+ const S = ei(L[A], L[E]), w = At(a, e(S));
7097
+ w <= n && (d = p(d, { tipo: "meio", coordenada: S, distanciaPx: w, ...v }));
7088
7098
  }
7089
7099
  if (c) {
7090
- const { t: C, d: w } = Io(a, x[A], x[E]);
7100
+ const { t: S, d: w } = To(a, x[A], x[E]);
7091
7101
  if (w <= n) {
7092
- const k = [L[A][0] + C * (L[E][0] - L[A][0]), L[A][1] + C * (L[E][1] - L[A][1])];
7102
+ const k = [L[A][0] + S * (L[E][0] - L[A][0]), L[A][1] + S * (L[E][1] - L[A][1])];
7093
7103
  h = p(h, { tipo: "aresta", coordenada: k, distanciaPx: w, ...v });
7094
7104
  }
7095
7105
  }
@@ -7098,7 +7108,7 @@ function Vs(a, t, e, o = {}, i) {
7098
7108
  }
7099
7109
  return l ?? d ?? h;
7100
7110
  }
7101
- class js {
7111
+ class Hs {
7102
7112
  constructor(t) {
7103
7113
  this.p = t;
7104
7114
  }
@@ -7123,8 +7133,8 @@ class js {
7123
7133
  buscarSnapEm(t, e) {
7124
7134
  const o = this.p.obterMapa();
7125
7135
  if (!o) return null;
7126
- const i = o.latLngToContainerPoint(t), n = this.candidatasEm(t, fi);
7127
- return Vs({ x: i.x, y: i.y }, n, (s) => o.latLngToContainerPoint(s), {}, e);
7136
+ const i = o.latLngToContainerPoint(t), n = this.candidatasEm(t, mi);
7137
+ return js({ x: i.x, y: i.y }, n, (s) => o.latLngToContainerPoint(s), {}, e);
7128
7138
  }
7129
7139
  feicaoSob(t, e) {
7130
7140
  const o = this.p.obterMapa();
@@ -7133,7 +7143,7 @@ class js {
7133
7143
  return { feicao: de({ x: n.x, y: n.y }, this.candidatasEm(r, 8), (l) => o.latLngToContainerPoint(l)), coordenada: r };
7134
7144
  }
7135
7145
  }
7136
- class Hs {
7146
+ class Gs {
7137
7147
  constructor(t) {
7138
7148
  f(this, "hoverId", null);
7139
7149
  f(this, "hoverAgendado", !1);
@@ -7178,11 +7188,11 @@ class Hs {
7178
7188
  this.hoverId = null;
7179
7189
  }
7180
7190
  }
7181
- const Gs = 111320;
7191
+ const Us = 111320;
7182
7192
  function wt(a, t) {
7183
7193
  return a.x >= t.x1 && a.x <= t.x2 && a.y >= t.y1 && a.y <= t.y2;
7184
7194
  }
7185
- function To(a, t, e) {
7195
+ function _o(a, t, e) {
7186
7196
  let o = 0, i = 1;
7187
7197
  const n = t.x - a.x, s = t.y - a.y, r = [-n, n, -s, s], c = [a.x - e.x1, e.x2 - a.x, a.y - e.y1, e.y2 - a.y];
7188
7198
  for (let l = 0; l < 4; l++)
@@ -7200,7 +7210,7 @@ function To(a, t, e) {
7200
7210
  }
7201
7211
  return !0;
7202
7212
  }
7203
- function _o(a, t) {
7213
+ function Do(a, t) {
7204
7214
  let e = !1;
7205
7215
  for (let o = 0, i = t.length - 1; o < t.length; i = o++) {
7206
7216
  const n = t[o], s = t[i];
@@ -7208,15 +7218,15 @@ function _o(a, t) {
7208
7218
  }
7209
7219
  return e;
7210
7220
  }
7211
- function Do(a, t, e) {
7212
- for (let o = 1; o < a.length; o++) if (To(a[o - 1], a[o], t)) return !0;
7213
- return e && a.length > 2 && To(a[a.length - 1], a[0], t);
7221
+ function qo(a, t, e) {
7222
+ for (let o = 1; o < a.length; o++) if (_o(a[o - 1], a[o], t)) return !0;
7223
+ return e && a.length > 2 && _o(a[a.length - 1], a[0], t);
7214
7224
  }
7215
- function Us(a, t, e) {
7216
- const o = e(a), i = e([a[0] + t / Gs, a[1]]);
7225
+ function Ws(a, t, e) {
7226
+ const o = e(a), i = e([a[0] + t / Us, a[1]]);
7217
7227
  return Math.hypot(i.x - o.x, i.y - o.y);
7218
7228
  }
7219
- function Ws(a, t, e, o) {
7229
+ function Zs(a, t, e, o) {
7220
7230
  if (a.oculta) return !1;
7221
7231
  const i = a.geometria, n = o === "window";
7222
7232
  switch (i.tipo) {
@@ -7225,18 +7235,18 @@ function Ws(a, t, e, o) {
7225
7235
  return wt(e(i.coordenada), t);
7226
7236
  case "LineString": {
7227
7237
  const s = it(i).map((r) => r.map(e));
7228
- return n ? s.every((r) => r.every((c) => wt(c, t))) : s.some((r) => r.some((c) => wt(c, t)) || Do(r, t, !1));
7238
+ return n ? s.every((r) => r.every((c) => wt(c, t))) : s.some((r) => r.some((c) => wt(c, t)) || qo(r, t, !1));
7229
7239
  }
7230
7240
  case "Polygon": {
7231
7241
  const s = i.aneis.map((l) => l.map(e)), r = s[0];
7232
7242
  if (!r) return !1;
7233
7243
  if (n) return r.every((l) => wt(l, t));
7234
- if (s.some((l) => l.some((d) => wt(d, t)) || Do(l, t, !0))) return !0;
7244
+ if (s.some((l) => l.some((d) => wt(d, t)) || qo(l, t, !0))) return !0;
7235
7245
  const c = { x: t.x1, y: t.y1 };
7236
- return _o(c, r) && !s.slice(1).some((l) => _o(c, l));
7246
+ return Do(c, r) && !s.slice(1).some((l) => Do(c, l));
7237
7247
  }
7238
7248
  case "Circle": {
7239
- const s = e(i.centro), r = Us(i.centro, i.raioMetros, e);
7249
+ const s = e(i.centro), r = Ws(i.centro, i.raioMetros, e);
7240
7250
  if (n)
7241
7251
  return s.x - r >= t.x1 && s.x + r <= t.x2 && s.y - r >= t.y1 && s.y + r <= t.y2;
7242
7252
  const c = Math.max(t.x1, Math.min(s.x, t.x2)), l = Math.max(t.y1, Math.min(s.y, t.y2));
@@ -7244,9 +7254,9 @@ function Ws(a, t, e, o) {
7244
7254
  }
7245
7255
  }
7246
7256
  }
7247
- function Zs(a, t) {
7257
+ function Xs(a, t) {
7248
7258
  if (t.length < 3 || a.oculta) return !1;
7249
- const e = (i) => Ko(i, [t]), o = a.geometria;
7259
+ const e = (i) => Jo(i, [t]), o = a.geometria;
7250
7260
  switch (o.tipo) {
7251
7261
  case "Point":
7252
7262
  case "Text":
@@ -7264,7 +7274,7 @@ function Zs(a, t) {
7264
7274
  }
7265
7275
  }
7266
7276
  }
7267
- class Xs {
7277
+ class Ys {
7268
7278
  constructor(t) {
7269
7279
  this.p = t;
7270
7280
  }
@@ -7274,7 +7284,7 @@ class Xs {
7274
7284
  for (const o of this.p.obterLayerManager().getActiveSelectableLayers())
7275
7285
  if (o.tipo === H)
7276
7286
  for (const i of this.p.lista(o.id))
7277
- this.p.desenhada(i) && Zs(i, t) && e.push({ camadaId: o.id, id: i.id });
7287
+ this.p.desenhada(i) && Xs(i, t) && e.push({ camadaId: o.id, id: i.id });
7278
7288
  this.p.desativarFerramenta(), this.p.selecionar(e);
7279
7289
  }
7280
7290
  /** Caixa de seleção: só feições de camadas visíveis, interativas e desbloqueadas, com toque geométrico real. */
@@ -7285,19 +7295,19 @@ class Xs {
7285
7295
  for (const r of this.p.obterLayerManager().getActiveSelectableLayers())
7286
7296
  if (r.tipo === H)
7287
7297
  for (const c of this.p.lista(r.id))
7288
- this.p.desenhada(c) && Ws(c, t, n, e) && s.push({ camadaId: r.id, id: c.id });
7298
+ this.p.desenhada(c) && Zs(c, t, n, e) && s.push({ camadaId: r.id, id: c.id });
7289
7299
  o ? this.p.alternarVarias(s) : this.p.selecionar(s);
7290
7300
  }
7291
7301
  }
7292
- function Ys(a) {
7293
- return a.key !== "Enter" || a.defaultPrevented || a.ctrlKey || a.metaKey || a.altKey || a.shiftKey ? !1 : !Tt(a) && !Fo(a);
7302
+ function Ks(a) {
7303
+ return a.key !== "Enter" || a.defaultPrevented || a.ctrlKey || a.metaKey || a.altKey || a.shiftKey ? !1 : !Tt(a) && !Oo(a);
7294
7304
  }
7295
- class Ks {
7305
+ class Js {
7296
7306
  constructor(t) {
7297
7307
  f(this, "ouvintes", new Qt());
7298
7308
  f(this, "aoTecla", (t) => {
7299
7309
  try {
7300
- if (!Ys(t) || this.p.ocupado() || !this.p.atalhosValem()) return;
7310
+ if (!Ks(t) || this.p.ocupado() || !this.p.atalhosValem()) return;
7301
7311
  this.p.editarSelecionada() && t.preventDefault();
7302
7312
  } catch (e) {
7303
7313
  console.error("[ui-canvas-cad] falha no atalho Enter da edição", e);
@@ -7313,7 +7323,7 @@ class Ks {
7313
7323
  this.ouvintes.cleanup();
7314
7324
  }
7315
7325
  }
7316
- class Js {
7326
+ class Qs {
7317
7327
  constructor(t) {
7318
7328
  f(this, "operacoes");
7319
7329
  f(this, "selecao");
@@ -7333,22 +7343,22 @@ class Js {
7333
7343
  /** Aceita a coordenada (0, 0) exata nas feições de entrada (atributo `aceitar-origem`). */
7334
7344
  f(this, "aceitarOrigem", !1);
7335
7345
  f(this, "opcoesPopup", { copiarParaAreaDeTransferencia: !0 });
7336
- this.contexto = t, this.repositorio = new _s({
7346
+ this.contexto = t, this.repositorio = new Ds({
7337
7347
  obterLayerManager: () => this.contexto.obterLayerManager(),
7338
7348
  opcoesNormalizacao: () => this.opcoesNormalizacao(),
7339
7349
  aposDados: () => this.aposDados()
7340
- }), this.consulta = new js({
7350
+ }), this.consulta = new Hs({
7341
7351
  obterMapa: () => this.contexto.obterMapa(),
7342
7352
  obterLayerManager: () => this.contexto.obterLayerManager(),
7343
7353
  desenhada: (e) => this.desenhada(e)
7344
- }), this.ponteiro = new Hs({
7354
+ }), this.ponteiro = new Gs({
7345
7355
  emitir: (e, o, i) => this.contexto.emitir(e, o, i),
7346
7356
  feicaoSob: (e, o) => this.consulta.feicaoSob(e, o),
7347
7357
  interacaoAtiva: () => this.ferramentas.ativo || this.edicao.editando,
7348
7358
  popupNoDuploClique: () => this.modoPopups() !== "desligado",
7349
7359
  botaoDireitoDaFerramenta: () => this.ferramentas.ativo ? (this.ferramentas.botaoDireito(), !0) : !1,
7350
7360
  abrirPopup: (e) => this.popup.abrir(e)
7351
- }), this.regiao = new Xs({
7361
+ }), this.regiao = new Ys({
7352
7362
  obterMapa: () => this.contexto.obterMapa(),
7353
7363
  obterLayerManager: () => this.contexto.obterLayerManager(),
7354
7364
  lista: (e) => this.lista(e),
@@ -7356,7 +7366,7 @@ class Js {
7356
7366
  desativarFerramenta: () => this.ferramentas.desativarFerramenta(),
7357
7367
  selecionar: (e) => this.selecao.selecionar(e),
7358
7368
  alternarVarias: (e) => this.selecao.alternarVarias(e)
7359
- }), this.edicao = new Bs({
7369
+ }), this.edicao = new Vs({
7360
7370
  obterMapa: () => this.contexto.obterMapa(),
7361
7371
  obterLayerManager: () => this.contexto.obterLayerManager(),
7362
7372
  emitir: (e, o) => this.contexto.emitir(e, o),
@@ -7379,17 +7389,17 @@ class Js {
7379
7389
  snapAtivo: () => this.snap.ativo,
7380
7390
  alternarSnap: () => this.snap.alternar(),
7381
7391
  buscarSnapEm: (e, o) => this.buscarSnapEm(e, o)
7382
- }), this.teclado = new Ks({
7392
+ }), this.teclado = new Js({
7383
7393
  ocupado: () => this.edicao.editando || this.ferramentas.ativo,
7384
7394
  atalhosValem: () => this.atalhosValem(),
7385
7395
  editarSelecionada: () => this.edicao.editarSelecionada()
7386
- }), this.versoes = new ls({
7396
+ }), this.versoes = new ds({
7387
7397
  obterLayerManager: () => this.contexto.obterLayerManager(),
7388
7398
  emitir: (e, o) => this.contexto.emitir(e, o),
7389
7399
  buscar: (e, o) => this.buscar(e, o),
7390
7400
  lista: (e) => this.lista(e),
7391
7401
  aposDados: () => this.aposDados()
7392
- }, t.regra ?? new We()), this.ferramentas = new Ts({
7402
+ }, t.regra ?? new Ze()), this.ferramentas = new _s({
7393
7403
  obterMapa: () => this.contexto.obterMapa(),
7394
7404
  obterLayerManager: () => this.contexto.obterLayerManager(),
7395
7405
  emitir: (e, o, i) => this.contexto.emitir(e, o, i),
@@ -7408,14 +7418,14 @@ class Js {
7408
7418
  dividirComLinha: (e) => this.dividirComLinha(e),
7409
7419
  selecionarNoLaco: (e) => this.selecionarNoLaco(e),
7410
7420
  candidatasEm: (e, o) => this.candidatasEm(e, o)
7411
- }), this.camera = new ds({
7421
+ }), this.camera = new hs({
7412
7422
  obterMapa: () => this.contexto.obterMapa(),
7413
7423
  obterLayerManager: () => this.contexto.obterLayerManager(),
7414
7424
  buscar: (e, o) => this.buscar(e, o),
7415
7425
  lista: (e) => this.lista(e),
7416
7426
  desenhada: (e) => this.desenhada(e),
7417
7427
  garantirVisivel: (e) => this.versoes.garantirVisivel(e)
7418
- }), this.operacoes = new cs({
7428
+ }), this.operacoes = new ls({
7419
7429
  emitir: (e, o) => this.contexto.emitir(e, o),
7420
7430
  obterLayerManager: () => this.contexto.obterLayerManager(),
7421
7431
  buscar: (e, o) => this.buscar(e, o),
@@ -7428,18 +7438,18 @@ class Js {
7428
7438
  estaSelecionada: (e) => this.selecao.contem(e),
7429
7439
  divisaoAtiva: () => this.ferramentas.ferramentaAtiva === "dividir",
7430
7440
  encerrarDesenho: () => this.ferramentas.desativarFerramenta()
7431
- }), this.cursores = new Qn(() => this.contexto.obterMapa()), this.snap = new rs({
7441
+ }), this.cursores = new ts(() => this.contexto.obterMapa()), this.snap = new cs({
7432
7442
  aplica: () => this.atalhosValem(),
7433
7443
  aoMudar: (e) => {
7434
7444
  var o, i;
7435
7445
  this.contexto.emitir("cad-snap", e), this.edicao.atualizarSnapNoHud(), (i = (o = this.contexto).aoSnapMudar) == null || i.call(o, e.ligado);
7436
7446
  }
7437
- }), this.popup = new ss({
7447
+ }), this.popup = new rs({
7438
7448
  obterMapa: () => this.contexto.obterMapa(),
7439
7449
  obterCamada: (e) => this.contexto.obterLayerManager().getLayerDef(e),
7440
7450
  aoAcao: (e, o) => this.tratarAcaoPopup(e, o),
7441
7451
  liberar: (e) => this.contexto.liberarPopups ? this.contexto.liberarPopups(e) : e()
7442
- }), this.selecao = new ts({
7452
+ }), this.selecao = new es({
7443
7453
  obterFeicao: (e) => this.buscar(e.camadaId, e.id),
7444
7454
  aplicarVisual: (e, o) => {
7445
7455
  const i = this.contexto.obterLayerManager().getLayerInstance(e), n = O.get(H);
@@ -7576,7 +7586,7 @@ class Js {
7576
7586
  }
7577
7587
  aplicarMargensHud() {
7578
7588
  const t = this.contexto.obterMapa();
7579
- t && xs(t.getContainer(), this.margensHud);
7589
+ t && Ps(t.getContainer(), this.margensHud);
7580
7590
  }
7581
7591
  // ---- versões (oficial × prévia) ----
7582
7592
  // ---- versões (oficial × prévia) ----
@@ -7788,7 +7798,7 @@ class Js {
7788
7798
  return this.operacoes.juntarFeicoes(t, e, o);
7789
7799
  }
7790
7800
  }
7791
- const qo = {
7801
+ const $o = {
7792
7802
  ponto: "Ponto",
7793
7803
  linha: "Linha",
7794
7804
  poligono: "Polígono",
@@ -7805,19 +7815,19 @@ const qo = {
7805
7815
  "selecao-laco": "Laço",
7806
7816
  "conta-gotas": "Cor"
7807
7817
  };
7808
- function Qs(a) {
7818
+ function tr(a) {
7809
7819
  if (!a) return [];
7810
7820
  const t = a.split(/[\s,]+/).map((o) => o.trim().toLowerCase()).filter(Boolean);
7811
- if (t.includes("todas")) return [...Ve];
7812
- const e = new Set(t.filter(ui));
7813
- return Ve.filter((o) => e.has(o));
7821
+ if (t.includes("todas")) return [...je];
7822
+ const e = new Set(t.filter(pi));
7823
+ return je.filter((o) => e.has(o));
7814
7824
  }
7815
- function tr(a) {
7825
+ function er(a) {
7816
7826
  if (!a) return !1;
7817
7827
  const t = a.split(/[\s,]+/).map((e) => e.trim().toLowerCase());
7818
7828
  return t.includes("todas") || t.includes("editar");
7819
7829
  }
7820
- class er {
7830
+ class or {
7821
7831
  constructor(t) {
7822
7832
  f(this, "barra", null);
7823
7833
  f(this, "editando", !1);
@@ -7832,7 +7842,7 @@ class er {
7832
7842
  i.className = "cad-quick-toolbar cad-draw-toolbar", i.setAttribute("role", "toolbar"), i.setAttribute("aria-label", "Ferramentas de desenho");
7833
7843
  for (const s of t) {
7834
7844
  const r = document.createElement("button");
7835
- r.type = "button", r.className = "cad-btn-tool cad-draw-btn", r.dataset.ferramenta = s, r.textContent = qo[s], r.title = qo[s], r.setAttribute("aria-pressed", "false"), r.addEventListener("click", () => this.ctx.aoEscolher(s)), i.appendChild(r);
7845
+ r.type = "button", r.className = "cad-btn-tool cad-draw-btn", r.dataset.ferramenta = s, r.textContent = $o[s], r.title = $o[s], r.setAttribute("aria-pressed", "false"), r.addEventListener("click", () => this.ctx.aoEscolher(s)), i.appendChild(r);
7836
7846
  }
7837
7847
  if (o) {
7838
7848
  const s = document.createElement("button");
@@ -7859,8 +7869,8 @@ class er {
7859
7869
  (t = this.barra) == null || t.remove(), this.barra = null;
7860
7870
  }
7861
7871
  }
7862
- const or = "data-cad-estilos-externos";
7863
- function ir(a) {
7872
+ const ir = "data-cad-estilos-externos";
7873
+ function ar(a) {
7864
7874
  try {
7865
7875
  return Array.from(a.cssRules, (t) => t.cssText).join(`
7866
7876
  `);
@@ -7868,10 +7878,10 @@ function ir(a) {
7868
7878
  return "";
7869
7879
  }
7870
7880
  }
7871
- function ar(a) {
7872
- return typeof a == "string" ? a.trim() ? [a] : [] : Array.isArray(a) ? a.map((t) => typeof t == "string" ? t : ir(t)).filter((t) => t.trim() !== "") : [];
7881
+ function nr(a) {
7882
+ return typeof a == "string" ? a.trim() ? [a] : [] : Array.isArray(a) ? a.map((t) => typeof t == "string" ? t : ar(t)).filter((t) => t.trim() !== "") : [];
7873
7883
  }
7874
- class nr {
7884
+ class sr {
7875
7885
  constructor(t) {
7876
7886
  f(this, "textos", []);
7877
7887
  f(this, "adotadas", []);
@@ -7883,7 +7893,7 @@ class nr {
7883
7893
  return this.textos;
7884
7894
  }
7885
7895
  definir(t) {
7886
- this.textos = ar(t), this.aplicar();
7896
+ this.textos = nr(t), this.aplicar();
7887
7897
  }
7888
7898
  /** Tira as folhas do shadow root, mantendo o pedido para `aplicar()` depois. */
7889
7899
  limpar() {
@@ -7903,7 +7913,7 @@ class nr {
7903
7913
  this.adotadas = [];
7904
7914
  }
7905
7915
  const e = document.createElement("style");
7906
- e.setAttribute(or, ""), e.textContent = this.textos.join(`
7916
+ e.setAttribute(ir, ""), e.textContent = this.textos.join(`
7907
7917
  `), this.shadow.appendChild(e), this.fallback = e;
7908
7918
  }
7909
7919
  remover() {
@@ -7912,7 +7922,7 @@ class nr {
7912
7922
  this.adotadas.length > 0 && Array.isArray(t.adoptedStyleSheets) && (t.adoptedStyleSheets = t.adoptedStyleSheets.filter((o) => !this.adotadas.includes(o))), this.adotadas = [], (e = this.fallback) == null || e.remove(), this.fallback = null;
7913
7923
  }
7914
7924
  }
7915
- const mi = {
7925
+ const gi = {
7916
7926
  "linha-cor": "cor",
7917
7927
  "linha-espessura": "espessura",
7918
7928
  "linha-tipo": "tipo",
@@ -7932,22 +7942,22 @@ const mi = {
7932
7942
  opacidade: "opacidadeTraco",
7933
7943
  terminacao: "terminacaoTraco",
7934
7944
  juncao: "juncaoTraco"
7935
- }, sr = 100, rr = /^\s*\d+(\.\d+)?([\s,]+\d+(\.\d+)?)*\s*$/;
7936
- function cr(a) {
7937
- return Object.prototype.hasOwnProperty.call(mi, a);
7945
+ }, rr = 100, cr = /^\s*\d+(\.\d+)?([\s,]+\d+(\.\d+)?)*\s*$/;
7946
+ function lr(a) {
7947
+ return Object.prototype.hasOwnProperty.call(gi, a);
7938
7948
  }
7939
7949
  const Bt = (a) => {
7940
7950
  const t = typeof a == "number" ? a : typeof a == "string" && a.trim() !== "" ? Number(a) : NaN;
7941
7951
  return Number.isFinite(t) ? t : void 0;
7942
7952
  };
7943
- function lr(a, t) {
7953
+ function dr(a, t) {
7944
7954
  if (t != null)
7945
7955
  switch (a) {
7946
7956
  case "cor":
7947
7957
  return (typeof t == "string" ? ot(t, "") : "") || void 0;
7948
7958
  case "espessura": {
7949
7959
  const e = Bt(t);
7950
- return e !== void 0 && e >= 0 ? Math.min(sr, e) : void 0;
7960
+ return e !== void 0 && e >= 0 ? Math.min(rr, e) : void 0;
7951
7961
  }
7952
7962
  case "escala": {
7953
7963
  const e = Bt(t);
@@ -7960,28 +7970,28 @@ function lr(a, t) {
7960
7970
  return e !== void 0 ? Math.min(1, Math.max(0, e)) : void 0;
7961
7971
  }
7962
7972
  case "tipo":
7963
- return $i(t);
7973
+ return Fi(t);
7964
7974
  case "tracejado":
7965
- return typeof t == "string" && rr.test(t) ? t.trim() : void 0;
7975
+ return typeof t == "string" && cr.test(t) ? t.trim() : void 0;
7966
7976
  case "terminacao":
7967
- return qi(t) ? t : void 0;
7977
+ return $i(t) ? t : void 0;
7968
7978
  case "juncao":
7969
- return Di(t) ? t : void 0;
7979
+ return qi(t) ? t : void 0;
7970
7980
  default:
7971
7981
  return;
7972
7982
  }
7973
7983
  }
7974
- function $o(a, t) {
7984
+ function Fo(a, t) {
7975
7985
  const e = { ...a };
7976
7986
  if (!t || typeof t != "object") return e;
7977
7987
  for (const o of Object.keys(Wt)) {
7978
7988
  if (!Object.prototype.hasOwnProperty.call(t, o)) continue;
7979
- const i = lr(o, t[o]);
7989
+ const i = dr(o, t[o]);
7980
7990
  i === void 0 ? delete e[Wt[o]] : e[Wt[o]] = i;
7981
7991
  }
7982
7992
  return e;
7983
7993
  }
7984
- function dr(a) {
7994
+ function hr(a) {
7985
7995
  const t = {};
7986
7996
  for (const [e, o] of Object.entries(Wt)) {
7987
7997
  const i = a[o];
@@ -7989,10 +7999,10 @@ function dr(a) {
7989
7999
  }
7990
8000
  return t;
7991
8001
  }
7992
- function hr(a, t) {
7993
- return { [mi[a]]: t };
8002
+ function ur(a, t) {
8003
+ return { [gi[a]]: t };
7994
8004
  }
7995
- class ur extends Oi {
8005
+ class pr extends Ni {
7996
8006
  constructor() {
7997
8007
  super();
7998
8008
  f(this, "shadow");
@@ -8016,7 +8026,7 @@ class ur extends Oi {
8016
8026
  f(this, "ponteiroSobre", !1);
8017
8027
  f(this, "_chaveGrupo");
8018
8028
  f(this, "_zonaProjecao", 22);
8019
- this.shadow = this.attachShadow({ mode: "open" }), this.controller = new bn(), this.controladorTamanho = En(this, this.controller), this.shadow.innerHTML = Dn(), this.estilosExternos = new nr(this.shadow), this.mapContainer = this.shadow.getElementById("cad-map-container"), this.layersPanel = this.shadow.getElementById("qgis-layer-panel"), this.toolbarPainel = new In({
8029
+ this.shadow = this.attachShadow({ mode: "open" }), this.controller = new xn(), this.controladorTamanho = kn(this, this.controller), this.shadow.innerHTML = qn(), this.estilosExternos = new sr(this.shadow), this.mapContainer = this.shadow.getElementById("cad-map-container"), this.layersPanel = this.shadow.getElementById("qgis-layer-panel"), this.toolbarPainel = new Tn({
8020
8030
  shadow: this.shadow,
8021
8031
  mapContainer: this.mapContainer,
8022
8032
  layersPanel: this.layersPanel,
@@ -8027,23 +8037,23 @@ class ur extends Oi {
8027
8037
  onToggleSnap: () => this.feicoes.alternarSnap(),
8028
8038
  onTratarCliqueCanvas: (n) => this.tratarCliqueLivreCanvas(n),
8029
8039
  onDispararAcaoPopup: (n, s) => this.dispararAcaoPopup(n, s)
8030
- }), this.broadcastConfig = new kn({
8040
+ }), this.broadcastConfig = new In({
8031
8041
  host: this,
8032
8042
  controller: this.controller,
8033
8043
  mapContainer: this.mapContainer,
8034
8044
  setLayerOpacity: (n, s) => this.setLayerOpacity(n, s)
8035
- }), this.colecoesDados = new Tn({
8045
+ }), this.colecoesDados = new _n({
8036
8046
  obterController: () => this.controller,
8037
8047
  obterChaveGrupo: () => this.chaveGrupo,
8038
8048
  setLayerVisibility: (n, s) => this.setLayerVisibility(n, s)
8039
8049
  });
8040
- const e = new We(), o = this.controller.context, i = this.controller.canvasInteracao.ctx;
8041
- Object.assign(o, { regraVersoes: e, renderizador: () => this.renderizador }), this.feicoes = new Js({
8050
+ const e = new Ze(), o = this.controller.context, i = this.controller.canvasInteracao.ctx;
8051
+ Object.assign(o, { regraVersoes: e, renderizador: () => this.renderizador }), this.feicoes = new Qs({
8042
8052
  obterLayerManager: () => this.controller.layerManager,
8043
8053
  obterMapa: () => this.controller.getMap(),
8044
8054
  regra: e,
8045
8055
  modoPopups: () => this.popups,
8046
- liberarPopups: (n) => Xe(this.controller.getMap(), n),
8056
+ liberarPopups: (n) => Ye(this.controller.getMap(), n),
8047
8057
  aoFerramenta: (n) => {
8048
8058
  this.barraFerramentas.marcar(n);
8049
8059
  },
@@ -8063,7 +8073,7 @@ class ur extends Oi {
8063
8073
  const r = this.feicoes.tratarAcaoCamada(n, s);
8064
8074
  r && this.dispatchEvent(new CustomEvent(r, { detail: s, bubbles: !0, composed: !0 }));
8065
8075
  }
8066
- }), this.barraFerramentas = new er({
8076
+ }), this.barraFerramentas = new or({
8067
8077
  raiz: this.shadow.getElementById("cad-root"),
8068
8078
  aoEscolher: (n) => {
8069
8079
  this.feicoes.alternarFerramenta(n);
@@ -8077,7 +8087,7 @@ class ur extends Oi {
8077
8087
  edicaoAtiva: () => this.feicoes.editando,
8078
8088
  aoLimparSelecao: () => this.feicoes.aoPedirLimpeza(),
8079
8089
  selecionarFeicoesNaCaixa: (n, s, r) => this.feicoes.selecionarNaCaixa(n, s, r)
8080
- }), Bn(this.shadow), So(this.shadow, !0);
8090
+ }), Vn(this.shadow), So(this.shadow, !0);
8081
8091
  }
8082
8092
  static get observedAttributes() {
8083
8093
  return [
@@ -8121,13 +8131,13 @@ class ur extends Oi {
8121
8131
  this.ponteiroSobre = !0;
8122
8132
  }), this.hoverListeners.add(this, "mouseleave", () => {
8123
8133
  this.ponteiroSobre = !1;
8124
- }), this.montarBarra(this.getAttribute("ferramentas")), this.broadcastConfig.conectar(), (o = this.desligarAnuncios) == null || o.call(this), this.desligarAnuncios = Un(this, this.shadow), this.estilosExternos.aplicar(), this.initTimeout = window.setTimeout(() => {
8134
+ }), this.montarBarra(this.getAttribute("ferramentas")), this.broadcastConfig.conectar(), (o = this.desligarAnuncios) == null || o.call(this), this.desligarAnuncios = Wn(this, this.shadow), this.estilosExternos.aplicar(), this.initTimeout = window.setTimeout(() => {
8125
8135
  this.initTimeout = void 0, this.inicializarAgora();
8126
8136
  }, 0);
8127
8137
  }
8128
8138
  montarBarra(e) {
8129
8139
  var o;
8130
- (o = this.barraFerramentas) == null || o.montar(Qs(e), tr(e));
8140
+ (o = this.barraFerramentas) == null || o.montar(tr(e), er(e));
8131
8141
  }
8132
8142
  /** Único canvas da página: os atalhos valem em qualquer lugar (comportamento de sempre). Com vários, só no que está sob o mouse ou com foco. */
8133
8143
  ehUnicoCanvas() {
@@ -8145,7 +8155,7 @@ class ur extends Oi {
8145
8155
  }
8146
8156
  destroy() {
8147
8157
  var e;
8148
- this.initTimeout && (window.clearTimeout(this.initTimeout), this.initTimeout = void 0), this.controladorTamanho.disconnect(), this.estilosExternos.limpar(), this.feicoes.pararEdicao(), this.feicoes.desativarFerramenta(), this.feicoes.limparMedicao(), this.feicoes.desconectarTeclado(), this.feicoes.destruir(), this.hoverListeners.cleanup(), (e = this.desligarAnuncios) == null || e.call(this), this.desligarAnuncios = null, this.broadcastConfig.desconectar(), this.limparDestaque(), this.toolbarPainel.limpar(), this.layerItemListeners.cleanup(), this.controller.destroy(), ci(this.mapContainer);
8158
+ this.initTimeout && (window.clearTimeout(this.initTimeout), this.initTimeout = void 0), this.controladorTamanho.disconnect(), this.estilosExternos.limpar(), this.feicoes.pararEdicao(), this.feicoes.desativarFerramenta(), this.feicoes.limparMedicao(), this.feicoes.desconectarTeclado(), this.feicoes.destruir(), this.hoverListeners.cleanup(), (e = this.desligarAnuncios) == null || e.call(this), this.desligarAnuncios = null, this.broadcastConfig.desconectar(), this.limparDestaque(), this.toolbarPainel.limpar(), this.layerItemListeners.cleanup(), this.controller.destroy(), li(this.mapContainer);
8149
8159
  }
8150
8160
  disconnectedCallback() {
8151
8161
  this.destroy();
@@ -8172,8 +8182,8 @@ class ur extends Oi {
8172
8182
  Gt(o) !== Gt(i) && ((c = this.controller) == null || c.layerManager.recriarCamadasDoTipo("feicoes"));
8173
8183
  return;
8174
8184
  }
8175
- if (cr(e)) {
8176
- (l = this.feicoes) == null || l.definirEstiloDesenho($o(this.feicoes.obterEstiloDesenho(), hr(e, i)));
8185
+ if (lr(e)) {
8186
+ (l = this.feicoes) == null || l.definirEstiloDesenho(Fo(this.feicoes.obterEstiloDesenho(), ur(e, i)));
8177
8187
  return;
8178
8188
  }
8179
8189
  if (e === "aceitar-origem") {
@@ -8184,7 +8194,7 @@ class ur extends Oi {
8184
8194
  this.montarBarra(i), (h = this.barraFerramentas) == null || h.marcar(((d = this.feicoes) == null ? void 0 : d.ferramentaAtiva) ?? null), (m = this.barraFerramentas) == null || m.marcarEdicao(!!((p = this.feicoes) != null && p.editando));
8185
8195
  return;
8186
8196
  }
8187
- qn(
8197
+ $n(
8188
8198
  {
8189
8199
  host: this,
8190
8200
  controller: this.controller,
@@ -8220,7 +8230,7 @@ class ur extends Oi {
8220
8230
  this.estilosExternos.definir(e);
8221
8231
  }
8222
8232
  initCAD() {
8223
- $n({
8233
+ Fn({
8224
8234
  host: this,
8225
8235
  shadow: this.shadow,
8226
8236
  mapContainer: this.mapContainer,
@@ -8250,11 +8260,11 @@ class ur extends Oi {
8250
8260
  }
8251
8261
  tratarCliqueLivreCanvas(e, o, i) {
8252
8262
  const n = Date.now();
8253
- n - this.lastCanvasClickTime < 50 || (this.lastCanvasClickTime = n, Mn(this.obterContextoEventos(), e, o, i));
8263
+ n - this.lastCanvasClickTime < 50 || (this.lastCanvasClickTime = n, An(this.obterContextoEventos(), e, o, i));
8254
8264
  }
8255
8265
  dispararAcaoPopup(e, o, i) {
8256
8266
  const n = Date.now();
8257
- this.lastPopupActionEmit && this.lastPopupActionEmit.acaoId === e && this.lastPopupActionEmit.elementoId === o && n - this.lastPopupActionEmit.time < 50 || (this.lastPopupActionEmit = { acaoId: e, elementoId: o, time: n }, An(this.obterContextoEventos(), e, o, i));
8267
+ this.lastPopupActionEmit && this.lastPopupActionEmit.acaoId === e && this.lastPopupActionEmit.elementoId === o && n - this.lastPopupActionEmit.time < 50 || (this.lastPopupActionEmit = { acaoId: e, elementoId: o, time: n }, wn(this.obterContextoEventos(), e, o, i));
8258
8268
  }
8259
8269
  toggleLayersPanel() {
8260
8270
  this.hasAttribute("sem-painel-camadas") || this.toolbarPainel.toggleLayersPanel();
@@ -8264,7 +8274,7 @@ class ur extends Oi {
8264
8274
  }
8265
8275
  renderLayersUI() {
8266
8276
  const e = this.shadow.getElementById("layers-list-container");
8267
- xn(e, this.controller.layerManager.getLayers(), this.layerItemListeners, {
8277
+ Pn(e, this.controller.layerManager.getLayers(), this.layerItemListeners, {
8268
8278
  setLayerVisibility: (o, i) => this.setLayerVisibility(o, i),
8269
8279
  setLayerOpacity: (o, i) => this.setLayerOpacity(o, i),
8270
8280
  setLayerBlocked: (o, i) => this.controller.layerManager.setLayerBlocked(o, i),
@@ -8393,11 +8403,11 @@ class ur extends Oi {
8393
8403
  this.controller.selectPonto(e, o);
8394
8404
  }
8395
8405
  get pontosSelecionados() {
8396
- return Pn(this.controller);
8406
+ return Ln(this.controller);
8397
8407
  }
8398
8408
  set pontosSelecionados(e) {
8399
8409
  const o = Array.isArray(e) ? e : [];
8400
- ri(this.controller, o), this.controller.atualizarDestaqueMarcadores();
8410
+ ci(this.controller, o), this.controller.atualizarDestaqueMarcadores();
8401
8411
  }
8402
8412
  atualizarDestaqueMarcadores() {
8403
8413
  this.controller.atualizarDestaqueMarcadores();
@@ -8570,10 +8580,10 @@ class ur extends Oi {
8570
8580
  * inválido é ignorado (a opção volta ao padrão). Os atributos `linha-*` fazem o mesmo.
8571
8581
  */
8572
8582
  definirLinhaPadrao(e) {
8573
- this.feicoes.definirEstiloDesenho($o(this.feicoes.obterEstiloDesenho(), e));
8583
+ this.feicoes.definirEstiloDesenho(Fo(this.feicoes.obterEstiloDesenho(), e));
8574
8584
  }
8575
8585
  obterLinhaPadrao() {
8576
- return dr(this.feicoes.obterEstiloDesenho());
8586
+ return hr(this.feicoes.obterEstiloDesenho());
8577
8587
  }
8578
8588
  /**
8579
8589
  * Ferramentas: ponto, linha, poligono, retangulo, elipse, poligono-regular, estrela, circulo, texto, caneta,
@@ -8686,8 +8696,8 @@ class ur extends Oi {
8686
8696
  return this.controller.layerManager;
8687
8697
  }
8688
8698
  }
8689
- Fi("ui-canvas-cad", ur);
8690
- class Tr {
8699
+ Oi("ui-canvas-cad", pr);
8700
+ class _r {
8691
8701
  constructor(t, e) {
8692
8702
  f(this, "polylines", []);
8693
8703
  f(this, "bancoPontosAtivo", !1);
@@ -8743,7 +8753,7 @@ class Tr {
8743
8753
  const p = Xt(h);
8744
8754
  if (p.length < 2) return;
8745
8755
  for (let z = 0; z < p.length - 1; z++) {
8746
- const S = p[z], L = p[z + 1], b = [[S.lat, S.lon], [L.lat, L.lon]], x = y.polyline(b, {
8756
+ const C = p[z], L = p[z + 1], b = [[C.lat, C.lon], [L.lat, L.lon]], x = y.polyline(b, {
8747
8757
  color: "#080d0a",
8748
8758
  weight: s + 3,
8749
8759
  opacity: 0.85,
@@ -8830,7 +8840,7 @@ class Tr {
8830
8840
  this.core.map && this.polylines.forEach((t) => this.core.map.removeLayer(t)), this.core.bancoPontosGroup && this.core.bancoPontosGroup.clearLayers(), this.polylines = [];
8831
8841
  }
8832
8842
  }
8833
- class _r {
8843
+ class Dr {
8834
8844
  constructor(t, e) {
8835
8845
  f(this, "markers", []);
8836
8846
  f(this, "vizinhosMarkers", []);
@@ -8969,203 +8979,203 @@ class _r {
8969
8979
  }
8970
8980
  }
8971
8981
  export {
8972
- mi as ATRIBUTOS_LINHA_PADRAO,
8973
- zi as AgrupadorCluster,
8974
- bn as CADMapaController,
8975
- Zi as CAD_INTERACTIVE_PANES,
8976
- Or as CELULA_CLUSTER_PX,
8977
- ko as CLASSE_FERRAMENTA_ATIVA,
8978
- Ue as COR_PADRAO,
8982
+ gi as ATRIBUTOS_LINHA_PADRAO,
8983
+ Ei as AgrupadorCluster,
8984
+ xn as CADMapaController,
8985
+ Xi as CAD_INTERACTIVE_PANES,
8986
+ Nr as CELULA_CLUSTER_PX,
8987
+ Io as CLASSE_FERRAMENTA_ATIVA,
8988
+ We as COR_PADRAO,
8979
8989
  Jt as COR_SELECAO,
8980
- pi as CSS_POSICAO_HUD,
8981
- bn as CanvasCADController,
8990
+ fi as CSS_POSICAO_HUD,
8991
+ xn as CanvasCADController,
8982
8992
  ae as CanvasFormas,
8983
- na as CanvasInteracao,
8984
- an as CanvasLayerManager,
8985
- Es as ControleDesenho,
8986
- Qn as CursoresRemotos,
8987
- no as DEFAULT_CONFIG,
8988
- Po as DEFAULT_LAYERS,
8989
- Nr as DadosCamada,
8990
- en as DespachanteFeicoes,
8991
- Rs as EditorVertices,
8992
- Ve as FERRAMENTAS,
8993
- ys as FOLGA_HUD,
8994
- bs as FRACAO_LARGURA_HUD,
8995
- ss as FeicaoPopup,
8996
- tn as FeicoesCanvasRenderer,
8997
- Va as FeicoesLayerRenderer,
8998
- bn as GerenciGeoMapaController,
8999
- ua as GridLayerRenderer,
9000
- $e as ICONES_FEICAO,
9001
- Ps as ID_HUD_DESENHO,
9002
- Ds as ID_HUD_EDICAO,
9003
- Li as IndiceEspacial,
9004
- Rr as InternadorEstilos,
9005
- _e as LIMIAR_DENSIDADE_ALTA,
8993
+ sa as CanvasInteracao,
8994
+ nn as CanvasLayerManager,
8995
+ ks as ControleDesenho,
8996
+ ts as CursoresRemotos,
8997
+ so as DEFAULT_CONFIG,
8998
+ Lo as DEFAULT_LAYERS,
8999
+ Rr as DadosCamada,
9000
+ on as DespachanteFeicoes,
9001
+ Bs as EditorVertices,
9002
+ je as FERRAMENTAS,
9003
+ bs as FOLGA_HUD,
9004
+ xs as FRACAO_LARGURA_HUD,
9005
+ rs as FeicaoPopup,
9006
+ en as FeicoesCanvasRenderer,
9007
+ ja as FeicoesLayerRenderer,
9008
+ xn as GerenciGeoMapaController,
9009
+ pa as GridLayerRenderer,
9010
+ Fe as ICONES_FEICAO,
9011
+ Ls as ID_HUD_DESENHO,
9012
+ qs as ID_HUD_EDICAO,
9013
+ Ci as IndiceEspacial,
9014
+ Br as InternadorEstilos,
9015
+ De as LIMIAR_DENSIDADE_ALTA,
9006
9016
  ye as LIMITE_CULLING,
9007
- Br as LIMITE_MARCA_PX,
9017
+ Vr as LIMITE_MARCA_PX,
9008
9018
  O as LayerRendererFactory,
9009
- vs as MARGEM_HUD_PADRAO,
9010
- Ea as MAX_NOS_COM_ALCA_LATENTE,
9011
- Vr as MAX_PONTOS_SEM_CLUSTER,
9012
- Pa as MAX_VERTICES_EDICAO,
9013
- Ci as MIN_VERTICES_SIMPLIFICAR,
9014
- Ie as MapaConfigManager,
9015
- Wi as MapaCore,
9016
- Tr as MapaLinhas,
9017
- _r as MapaMarcadores,
9018
- ki as MotorFormas,
9019
- jr as OPACIDADE_MARCA,
9020
- we as PROPRIEDADES_HUD,
9021
- ni as PintorCanvas2D,
9022
- Ce as RAIO_MINIMO_CIRCULO_M,
9023
- Ca as RAIO_MINIMO_EDICAO_CIRCULO_M,
9024
- We as RegraVersoes,
9025
- ts as SelecaoFeicoes,
9026
- Ae as SessaoDesenho,
9027
- Hr as TIPOS_LINHA,
9028
- _a as TOLERANCIA_AMOSTRA_PX,
9019
+ ys as MARGEM_HUD_PADRAO,
9020
+ ka as MAX_NOS_COM_ALCA_LATENTE,
9021
+ jr as MAX_PONTOS_SEM_CLUSTER,
9022
+ La as MAX_VERTICES_EDICAO,
9023
+ Mi as MIN_VERTICES_SIMPLIFICAR,
9024
+ Te as MapaConfigManager,
9025
+ Zi as MapaCore,
9026
+ _r as MapaLinhas,
9027
+ Dr as MapaMarcadores,
9028
+ Ii as MotorFormas,
9029
+ Hr as OPACIDADE_MARCA,
9030
+ ze as PROPRIEDADES_HUD,
9031
+ si as PintorCanvas2D,
9032
+ Me as RAIO_MINIMO_CIRCULO_M,
9033
+ Ma as RAIO_MINIMO_EDICAO_CIRCULO_M,
9034
+ Ze as RegraVersoes,
9035
+ es as SelecaoFeicoes,
9036
+ we as SessaoDesenho,
9037
+ Gr as TIPOS_LINHA,
9038
+ Da as TOLERANCIA_AMOSTRA_PX,
9029
9039
  he as TOLERANCIA_LINHA_PX,
9030
- Yi as TOLERANCIA_PONTO_PX,
9031
- fi as TOLERANCIA_SNAP_PX,
9032
- sa as TileLayerRenderer,
9033
- ur as UICanvasCAD,
9034
- ca as VectorLinesLayerRenderer,
9035
- da as VectorPointsLayerRenderer,
9036
- ha as VectorPolygonsLayerRenderer,
9037
- ra as WmsLayerRenderer,
9038
- Gr as ZOOM_DESMEMBRAR,
9039
- to as ZOOM_SEM_SIMPLIFICACAO,
9040
- Ur as agruparMarcasPorCor,
9041
- Wr as agruparPontos,
9040
+ Ki as TOLERANCIA_PONTO_PX,
9041
+ mi as TOLERANCIA_SNAP_PX,
9042
+ ra as TileLayerRenderer,
9043
+ pr as UICanvasCAD,
9044
+ la as VectorLinesLayerRenderer,
9045
+ ha as VectorPointsLayerRenderer,
9046
+ ua as VectorPolygonsLayerRenderer,
9047
+ ca as WmsLayerRenderer,
9048
+ Ur as ZOOM_DESMEMBRAR,
9049
+ eo as ZOOM_SEM_SIMPLIFICACAO,
9050
+ Wr as agruparMarcasPorCor,
9051
+ Zr as agruparPontos,
9042
9052
  Zt as agruparPontosPorChave,
9043
- ka as alcaLatente,
9044
- Ta as alternarSuavidade,
9045
- ms as amostrarBezier,
9046
- xs as aplicarMargensHud,
9053
+ Ia as alcaLatente,
9054
+ _a as alternarSuavidade,
9055
+ gs as amostrarBezier,
9056
+ Ps as aplicarMargensHud,
9047
9057
  dt as areaDaGeometria,
9048
- Zr as areaMetros2,
9058
+ Xr as areaMetros2,
9049
9059
  kt as bindPopupAcoesEvents,
9050
- Vs as buscarSnap,
9051
- Xr as caixaDaFeicao,
9052
- Yr as caixaPx,
9060
+ js as buscarSnap,
9061
+ Yr as caixaDaFeicao,
9062
+ Kr as caixaPx,
9053
9063
  _t as caixasSeTocam,
9054
- Kr as centroDe,
9064
+ Jr as centroDe,
9055
9065
  ge as clonarFeicao,
9056
- yo as comPontos,
9066
+ bo as comPontos,
9057
9067
  le as comVertices,
9058
- No as comprimentoMetros,
9059
- kr as confrontanteParaFeicao,
9060
- Ho as consultarFeicoesNoPonto,
9061
- xo as contarItensCanvas,
9068
+ Ro as comprimentoMetros,
9069
+ Ir as confrontanteParaFeicao,
9070
+ Go as consultarFeicoesNoPonto,
9071
+ Po as contarItensCanvas,
9062
9072
  Sr as converterArea,
9063
- Lr as converterComprimento,
9073
+ Cr as converterComprimento,
9064
9074
  ne as coordenadaDeReferencia,
9065
- Be as corHexSegura,
9075
+ Ve as corHexSegura,
9066
9076
  ot as corSegura,
9067
- En as criarControladorTamanho,
9077
+ kn as criarControladorTamanho,
9068
9078
  Kt as criarLinha,
9069
- Jr as dashTipoLinha,
9070
- Cr as ddParaDms,
9071
- xa as deslocarGeometria,
9072
- oo as deveAgrupar,
9073
- eo as diagonalPx,
9074
- Ar as distanciaEntre,
9079
+ Qr as dashTipoLinha,
9080
+ Mr as ddParaDms,
9081
+ Pa as deslocarGeometria,
9082
+ io as deveAgrupar,
9083
+ oo as diagonalPx,
9084
+ wr as distanciaEntre,
9075
9085
  xt as distanciaMetros,
9076
- pa as dividirPoligonoComLinha,
9077
- Mr as dmsParaDd,
9078
- ui as ehFerramenta,
9079
- Ai as ehMarca,
9086
+ fa as dividirPoligonoComLinha,
9087
+ Ar as dmsParaDd,
9088
+ pi as ehFerramenta,
9089
+ wi as ehMarca,
9080
9090
  Yt as ehMultilinha,
9081
- Qr as ehTipoLinha,
9091
+ tc as ehTipoLinha,
9082
9092
  ct as entidadeDe,
9083
9093
  se as entradaDaAncora,
9084
- tc as escalaDoZoom,
9085
- ec as escalaLatitude,
9086
- oc as escalaTipoLinhaSegura,
9094
+ ec as escalaDoZoom,
9095
+ oc as escalaLatitude,
9096
+ ic as escalaTipoLinhaSegura,
9087
9097
  T as escapeHtml,
9088
- ke as estiloVetorDe,
9098
+ Ie as estiloVetorDe,
9089
9099
  ht as extensaoDaGeometria,
9090
- Je as extrairCentroDeWkt,
9091
- la as extrairCorPonto,
9092
- Uo as fatorDensidade,
9093
- Ws as feicaoNaCaixa,
9094
- Zs as feicaoNoLaco,
9100
+ Qe as extrairCentroDeWkt,
9101
+ da as extrairCorPonto,
9102
+ Wo as fatorDensidade,
9103
+ Zs as feicaoNaCaixa,
9104
+ Xs as feicaoNoLaco,
9095
9105
  de as feicaoNoPonto,
9096
- Pr as feicaoNoTopo,
9097
- $r as formatUTM,
9106
+ Lr as feicaoNoTopo,
9107
+ Fr as formatUTM,
9098
9108
  Lt as formatarArea,
9099
9109
  W as formatarExtensao,
9100
- Ji as garantirCanvasSemEventos,
9101
- ba as gerarBuffer,
9110
+ Qi as garantirCanvasSemEventos,
9111
+ xa as gerarBuffer,
9102
9112
  oe as getPointShapeHtml,
9103
- wa as inserirPonto,
9104
- La as inserirVertice,
9105
- Di as juncaoCanvas,
9106
- fa as juntarLinhas,
9107
- va as juntarPoligonos,
9108
- wi as ladoMarca,
9109
- ao as latLonDoMundo,
9113
+ za as inserirPonto,
9114
+ Ca as inserirVertice,
9115
+ qi as juncaoCanvas,
9116
+ ma as juntarLinhas,
9117
+ ya as juntarPoligonos,
9118
+ zi as ladoMarca,
9119
+ no as latLonDoMundo,
9110
9120
  Gt as lerModoRenderizador,
9111
- Ti as limitesDaGeometria,
9112
- je as metrosPorGrau,
9113
- ic as metrosPorPixel,
9121
+ _i as limitesDaGeometria,
9122
+ He as metrosPorGrau,
9123
+ ac as metrosPorPixel,
9114
9124
  ce as minimoVertices,
9115
- De as modoDensidade,
9116
- Ia as moverAlca,
9117
- wr as moverVertice,
9118
- di as normalizarAnel,
9125
+ qe as modoDensidade,
9126
+ Ta as moverAlca,
9127
+ zr as moverVertice,
9128
+ hi as normalizarAnel,
9119
9129
  Z as normalizarCoordenada,
9120
- Le as normalizarFeicaoEntrada,
9121
- Co as normalizarLinha,
9122
- Zn as normalizarPoligono,
9123
- $i as normalizarTipoLinha,
9130
+ Ce as normalizarFeicaoEntrada,
9131
+ Mo as normalizarLinha,
9132
+ Xn as normalizarPoligono,
9133
+ Fi as normalizarTipoLinha,
9124
9134
  K as nosDe,
9125
9135
  Ut as nosDeAncoras,
9126
9136
  It as nosOuVertices,
9127
9137
  Xt as ordenarPontosPorSequencia,
9128
9138
  V as parseCoordenada,
9129
- Ha as parseDash,
9139
+ Ga as parseDash,
9130
9140
  it as partesDaLinha,
9131
- Pi as pintarMarcas,
9132
- Ma as pontoDaBordaDoCirculo,
9133
- ti as pontoMedio,
9141
+ Li as pintarMarcas,
9142
+ Aa as pontoDaBordaDoCirculo,
9143
+ ei as pontoMedio,
9134
9144
  zt as pontoMedioDoSegmento,
9135
- Ko as pontoNoPoligono,
9136
- zr as pontoParaFeicao,
9145
+ Jo as pontoNoPoligono,
9146
+ Er as pontoParaFeicao,
9137
9147
  pt as pontosDe,
9138
- Ir as posicaoHud,
9139
- An as processarAcaoPopup,
9140
- Mn as processarCliqueLivreCanvas,
9141
- ac as projetarCentro,
9142
- nc as projetarEm,
9143
- sc as projetarMercator,
9144
- rc as projetarVertices,
9145
- cc as raioCirculoPx,
9146
- io as raioPontoPx,
9147
- Ua as regioesExpostas,
9148
- Vo as registrarFonteHit,
9149
- jo as removerFonteHit,
9150
- za as removerPonto,
9148
+ Tr as posicaoHud,
9149
+ wn as processarAcaoPopup,
9150
+ An as processarCliqueLivreCanvas,
9151
+ nc as projetarCentro,
9152
+ sc as projetarEm,
9153
+ rc as projetarMercator,
9154
+ cc as projetarVertices,
9155
+ lc as raioCirculoPx,
9156
+ ao as raioPontoPx,
9157
+ Wa as regioesExpostas,
9158
+ jo as registrarFonteHit,
9159
+ Ho as removerFonteHit,
9160
+ Ea as removerPonto,
9151
9161
  Sa as removerVertice,
9152
9162
  Et as renderPopupAcoesHtml,
9153
- xn as renderizarPainelCamadas,
9154
- aa as resolverCliqueCentral,
9155
- Er as segmentoParaFeicao,
9156
- ei as segmentosDe,
9157
- oi as segmentosDoEditor,
9158
- lc as simplificarAnel,
9159
- Mi as simplificarGeometria,
9160
- dc as simplificarLinha,
9161
- hc as simplificarPx,
9163
+ Pn as renderizarPainelCamadas,
9164
+ na as resolverCliqueCentral,
9165
+ kr as segmentoParaFeicao,
9166
+ oi as segmentosDe,
9167
+ ii as segmentosDoEditor,
9168
+ dc as simplificarAnel,
9169
+ Ai as simplificarGeometria,
9170
+ hc as simplificarLinha,
9171
+ uc as simplificarPx,
9162
9172
  mt as statusDe,
9163
- qi as terminacaoCanvas,
9164
- Ei as textoRotulo,
9165
- uc as toleranciaPorZoom,
9166
- wn as tratarCliqueMarcador,
9167
- zn as tratarCliqueSegmento,
9168
- vo as verificarEditavel,
9173
+ $i as terminacaoCanvas,
9174
+ ki as textoRotulo,
9175
+ pc as toleranciaPorZoom,
9176
+ zn as tratarCliqueMarcador,
9177
+ En as tratarCliqueSegmento,
9178
+ yo as verificarEditavel,
9169
9179
  Si as vertices,
9170
9180
  X as verticesDe
9171
9181
  };