@thibezer/ui-components-kit 2.31.4 → 2.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/canvas.js CHANGED
@@ -2,20 +2,20 @@ var ma = Object.defineProperty;
2
2
  var ga = (n, t, e) => t in n ? ma(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var p = (n, t, e) => ga(n, typeof t != "symbol" ? t + "" : t, e);
4
4
  /* empty css */
5
- import { n as yt, f as va, g as ba, C as Zt, d as st, h as je, I as ya, s as vt, i as dt, v as xa, M as Pa, Z as Qe, j as Ca, k as Dt, l as Me, r as Ye, o as _t, a as Je, q as Sa, R as He, b as xt, p as Fo, c as La, u as Ma, w as Aa, x as za } from "./geometria-px-wXudjSxA.js";
6
- import { y as sc, T as rc, z as cc, A as lc, B as dc, D as hc, E as uc, F as pc, G as fc, H as mc, J as gc, K as vc, L as bc, N as yc, O as xc, P as Pc, Q as Cc, S as Sc, U as Lc, V as Mc } from "./geometria-px-wXudjSxA.js";
5
+ import { n as yt, f as va, g as ba, C as Wt, d as st, h as je, I as ya, s as vt, i as dt, v as xa, M as Pa, Z as Qe, j as Ca, k as Dt, l as Me, r as Ye, o as _t, a as Je, q as Sa, R as He, b as xt, p as Fo, c as La, u as Ma, w as Aa, x as za } from "./geometria-px-wXudjSxA.js";
6
+ import { y as rc, T as cc, z as lc, A as dc, B as hc, D as uc, E as pc, F as fc, G as mc, H as gc, J as vc, K as bc, L as yc, N as xc, O as Pc, P as Cc, Q as Sc, S as Lc, U as Mc, V as Ac } from "./geometria-px-wXudjSxA.js";
7
7
  import { pintarMarcas as wa, ehMarca as Ea, ladoMarca as ka, diagonalPx as to, deveAgrupar as eo, AgrupadorCluster as Ia, MotorFormas as Ta } from "./motor.js";
8
- import { CELULA_CLUSTER_PX as zc, DadosCamada as wc, LIMITE_MARCA_PX as Ec, LIMITE_MIUDA_PX as kc, MAX_PONTOS_SEM_CLUSTER as Ic, OPACIDADE_MARCA as Tc, ZOOM_DESMEMBRAR as Dc, ZOOM_MAX_MIUDA as _c, agruparMarcasPorCor as Fc, agruparPontos as Oc, centroDe as qc, nivelDetalhe as Nc, projetarMercator as $c } from "./motor.js";
8
+ import { CELULA_CLUSTER_PX as wc, DadosCamada as Ec, LIMITE_MARCA_PX as kc, LIMITE_MIUDA_PX as Ic, MAX_PONTOS_SEM_CLUSTER as Tc, OPACIDADE_MARCA as Dc, ZOOM_DESMEMBRAR as _c, ZOOM_MAX_MIUDA as Fc, agruparMarcasPorCor as Oc, agruparPontos as qc, centroDe as Nc, nivelDetalhe as $c, projetarMercator as Rc } from "./motor.js";
9
9
  import b from "leaflet";
10
- import { e as I, p as V, r as Et, b as kt, a as Wt, o as Xt, c as oo, l as Da, f as ao } from "./utils-B2HuBLwz.js";
11
- import { d as Bc, g as Vc } from "./utils-B2HuBLwz.js";
12
- import { K as Pt, M as ie, L as Kt, l as _a, S as Fa, A as Oa, g as io, s as qa, d as Na } from "./kit-base-CBXA66aM.js";
13
- import { p as Qt, t as $a, b as Ae, g as ut, h as pt, i as Ct, j as K, f as no, l as Ra, d as Oo, c as Ba } from "./feature_metricas-hUren6kK.js";
14
- import { a as Hc, e as Gc, m as Uc } from "./feature_metricas-hUren6kK.js";
15
- import { E as Va, s as ja, p as Ha, c as se, P as qo, d as Ga, e as re, f as Ua, h as Za, j as Wa, i as Xa, k as Q, l as St, n as U, m as ft, o as No, q as et, r as ze, t as $o, u as so, v as Ka, w as we, x as ro, y as Qa, M as Ya, z as Ft, A as Ja, B as ti, C as ei, D as co, T as oi, F as ai, G as ii, H as ni } from "./feature_caixa-zoUAn0qg.js";
16
- import { I as Wc, R as Xc, J as Kc, K as Qc, L as Yc, N as Jc, O as tl, Q as el, S as ol, U as al, V as il, W as nl, X as sl } from "./feature_caixa-zoUAn0qg.js";
17
- import { S as ce, e as lo, a as Ro, F as ho } from "./feature_desenho-fQfbVPvn.js";
18
- import { R as cl, b as ll, n as dl } from "./feature_desenho-fQfbVPvn.js";
10
+ import { e as I, p as V, r as Et, b as kt, a as Xt, o as Kt, c as oo, l as Da, f as ao } from "./utils-B2HuBLwz.js";
11
+ import { d as Vc, g as jc } from "./utils-B2HuBLwz.js";
12
+ import { K as Pt, M as ne, L as Qt, l as _a, S as Fa, A as Oa, g as io, s as qa, d as Na } from "./kit-base-CBXA66aM.js";
13
+ import { p as Yt, t as $a, b as Ae, g as ut, h as pt, i as Ct, j as K, f as no, l as Ra, d as Oo, c as Ba } from "./feature_metricas-hUren6kK.js";
14
+ import { a as Gc, e as Uc, m as Zc } from "./feature_metricas-hUren6kK.js";
15
+ import { E as Va, s as ja, p as Ha, c as re, P as qo, d as Ga, e as Ft, f as Ua, o as Za, h as Wa, j as Xa, i as Ka, k as Q, l as St, n as U, m as ft, q as No, r as et, t as ze, u as $o, v as so, w as Qa, x as we, y as ro, z as Ya, M as Ja, A as Ot, B as ti, C as ei, D as oi, F as co, T as ai, G as ii, H as ni, I as si } from "./feature_caixa-DdI35r81.js";
16
+ import { J as Xc, R as Kc, K as Qc, L as Yc, N as Jc, O as tl, Q as el, S as ol, U as al, V as il, W as nl, X as sl, Y as rl } from "./feature_caixa-DdI35r81.js";
17
+ import { S as ce, e as lo, a as Ro, F as ho } from "./feature_desenho-BSuO-kdG.js";
18
+ import { R as ll, b as dl, n as hl } from "./feature_desenho-BSuO-kdG.js";
19
19
  const uo = {
20
20
  perimetroWeight: 1,
21
21
  fechamentoWeight: 1,
@@ -60,21 +60,21 @@ const uo = {
60
60
  };
61
61
  p(ht, "instance");
62
62
  let Ee = ht;
63
- const Ge = "sob-demanda", si = 700;
64
- function Yt(n) {
63
+ const Ge = "sob-demanda", ri = 700;
64
+ function Jt(n) {
65
65
  const t = typeof n == "string" ? n.trim().toLowerCase() : "";
66
66
  return t === "automatico" || t === "desligado" || t === "sob-demanda" ? t : Ge;
67
67
  }
68
- const jt = /* @__PURE__ */ new WeakMap();
69
- function ri(n) {
68
+ const Ht = /* @__PURE__ */ new WeakMap();
69
+ function ci(n) {
70
70
  const t = n && typeof n == "object" ? n.options : void 0;
71
71
  return !!t && t.closeButton !== void 0 && t.autoPan !== void 0;
72
72
  }
73
73
  function Ue(n, t) {
74
- const e = n ? jt.get(n) : void 0;
74
+ const e = n ? Ht.get(n) : void 0;
75
75
  return e ? e.liberar(t) : t();
76
76
  }
77
- class ci {
77
+ class li {
78
78
  constructor(t, e = Ge) {
79
79
  p(this, "liberados", 0);
80
80
  /** Verdadeiro durante o despacho síncrono de um clique no mapa (o Leaflet abre popups dentro dele). */
@@ -93,14 +93,14 @@ class ci {
93
93
  this.map = t, this.modoAtual = e, this.original = t.addLayer;
94
94
  const o = this;
95
95
  t.addLayer = function(i) {
96
- return ri(i) ? o.aoAbrir(this, i) : o.original.call(this, i);
97
- }, this.container = typeof t.getContainer == "function" ? t.getContainer() : null, (a = this.container) == null || a.addEventListener("click", this.marcarClique, !0), jt.set(t, this);
96
+ return ci(i) ? o.aoAbrir(this, i) : o.original.call(this, i);
97
+ }, this.container = typeof t.getContainer == "function" ? t.getContainer() : null, (a = this.container) == null || a.addEventListener("click", this.marcarClique, !0), Ht.set(t, this);
98
98
  }
99
99
  get modo() {
100
100
  return this.modoAtual;
101
101
  }
102
102
  definirModo(t) {
103
- this.modoAtual = Yt(t), this.modoAtual !== "sob-demanda" && this.cancelarPendentes();
103
+ this.modoAtual = Jt(t), this.modoAtual !== "sob-demanda" && this.cancelarPendentes();
104
104
  }
105
105
  /** Abre o que `fn` abrir, independentemente do modo. Reentrante e sempre devolve o portão ao estado anterior. */
106
106
  liberar(t) {
@@ -113,7 +113,7 @@ class ci {
113
113
  }
114
114
  destruir() {
115
115
  var t;
116
- this.instalado && (this.instalado = !1, this.cancelarPendentes(), (t = this.container) == null || t.removeEventListener("click", this.marcarClique, !0), delete this.map.addLayer, jt.get(this.map) === this && jt.delete(this.map));
116
+ this.instalado && (this.instalado = !1, this.cancelarPendentes(), (t = this.container) == null || t.removeEventListener("click", this.marcarClique, !0), delete this.map.addLayer, Ht.get(this.map) === this && Ht.delete(this.map));
117
117
  }
118
118
  aoAbrir(t, e) {
119
119
  return this.modoAtual === "automatico" ? this.original.call(t, e) : this.emClique && this.liberados === 0 ? (this.modoAtual === "sob-demanda" && this.aguardarDuploClique(e), t) : (e.options && (e.options.autoPan = !1), this.original.call(t, e));
@@ -131,7 +131,7 @@ class ci {
131
131
  return (r = e.openPopup) == null ? void 0 : r.call(e, typeof e.getLatLng == "function" || s == null ? void 0 : s.latlng);
132
132
  });
133
133
  };
134
- o = setTimeout(a, si), e.on("dblclick", i), this.pendentes.set(e, a);
134
+ o = setTimeout(a, ri), e.on("dblclick", i), this.pendentes.set(e, a);
135
135
  }
136
136
  cancelarPendentes() {
137
137
  for (const t of [...this.pendentes.values()]) t();
@@ -139,22 +139,22 @@ class ci {
139
139
  }
140
140
  }
141
141
  const Bo = "https://geoportal.incra.gov.br/geoserver/wms", ke = "geonode:sigef_geo";
142
- function li(n, t, e, o) {
142
+ function di(n, t, e, o) {
143
143
  return `${Bo}?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image/png&TRANSPARENT=true&QUERY_LAYERS=${ke}&LAYERS=${ke}&FEATURE_COUNT=10&INFO_FORMAT=application/json&X=${n}&Y=${t}&WIDTH=${e.x}&HEIGHT=${e.y}&SRS=EPSG:4326&BBOX=${o}`;
144
144
  }
145
- function di(n, t, e = typeof window < "u" ? window.location.origin : "") {
145
+ function hi(n, t, e = typeof window < "u" ? window.location.origin : "") {
146
146
  return e.includes("localhost") || e.includes("127.0.0.1") || e.includes("[::1]") ? `${t}/proxy/sigef?url=${encodeURIComponent(n)}` : `${e}/api.php?action=proxy_sigef&url=${encodeURIComponent(n)}`;
147
147
  }
148
- function hi(n) {
148
+ function ui(n) {
149
149
  const t = (n == null ? void 0 : n.properties) ?? {}, e = n == null ? void 0 : n.id, o = e != null && !String(e).startsWith("sigef_geo.") ? String(e) : "";
150
150
  return String(t.parcela_codigo || t.co_parcela || t.id_parcela || o || "").trim();
151
151
  }
152
- function ui(n) {
152
+ function pi(n) {
153
153
  const t = n && typeof n == "object" && Array.isArray(n.features) ? n.features : [], e = /* @__PURE__ */ new Set(), o = [];
154
154
  return t.forEach((a, i) => {
155
155
  const s = a == null ? void 0 : a.properties;
156
156
  if (!s || typeof s != "object" || Object.keys(s).length === 0) return;
157
- const r = hi(a), c = r || `sem-id-${i}`;
157
+ const r = ui(a), c = r || `sem-id-${i}`;
158
158
  e.has(c) || (e.add(c), o.push({
159
159
  codigo: r,
160
160
  nome: String(s.nome_area || s.nome_imovel || "Imóvel Sem Nome"),
@@ -175,14 +175,14 @@ function Vo(n, t) {
175
175
  return { x: 0, y: 0 };
176
176
  }
177
177
  async function jo(n, t, e, o = {}) {
178
- const { signal: a, timeoutMs: i = 8e3 } = o, s = n.getSize(), r = n.getBounds().getSouthWest(), c = n.getBounds().getNorthEast(), l = `${r.lng},${r.lat},${c.lng},${c.lat}`, d = li(Math.round(t.x), Math.round(t.y), s, l), h = new AbortController();
178
+ const { signal: a, timeoutMs: i = 8e3 } = o, s = n.getSize(), r = n.getBounds().getSouthWest(), c = n.getBounds().getNorthEast(), l = `${r.lng},${r.lat},${c.lng},${c.lat}`, d = di(Math.round(t.x), Math.round(t.y), s, l), h = new AbortController();
179
179
  let f = !1;
180
180
  const g = setTimeout(() => {
181
181
  f = !0, h.abort();
182
182
  }, i), m = () => h.abort();
183
183
  a && (a.aborted ? h.abort() : a.addEventListener("abort", m, { once: !0 }));
184
184
  try {
185
- const u = await fetch(di(d, e), { signal: h.signal }), v = await u.text();
185
+ const u = await fetch(hi(d, e), { signal: h.signal }), v = await u.text();
186
186
  let y = null;
187
187
  try {
188
188
  y = JSON.parse(v);
@@ -194,14 +194,14 @@ async function jo(n, t, e, o = {}) {
194
194
  }
195
195
  if (!y || y.error && !Array.isArray(y.features))
196
196
  throw new Error(typeof (y == null ? void 0 : y.error) == "string" ? y.error : "O INCRA devolveu uma resposta inesperada.");
197
- return ui(y);
197
+ return pi(y);
198
198
  } catch (u) {
199
199
  throw (u == null ? void 0 : u.name) === "AbortError" && f ? new Error(`Tempo limite de consulta ao INCRA esgotado (${Math.round(i / 1e3)}s).`) : u;
200
200
  } finally {
201
201
  clearTimeout(g), a == null || a.removeEventListener("abort", m);
202
202
  }
203
203
  }
204
- async function pi(n, t, e, o) {
204
+ async function fi(n, t, e, o) {
205
205
  const a = Vo(n, t), i = n.getContainer();
206
206
  i.style.cursor = "wait";
207
207
  const s = b.popup({
@@ -284,7 +284,7 @@ async function pi(n, t, e, o) {
284
284
  i.style.cursor = "";
285
285
  }
286
286
  }
287
- async function fi(n, t, e, o, a) {
287
+ async function mi(n, t, e, o, a) {
288
288
  var l;
289
289
  const i = Vo(n, t), s = { lat: t.latlng.lat, lng: t.latlng.lng };
290
290
  (l = o.currentAbortController) == null || l.abort();
@@ -303,7 +303,7 @@ async function fi(n, t, e, o, a) {
303
303
  o.currentAbortController === r && (o.currentAbortController = void 0);
304
304
  }
305
305
  }
306
- function mi(n, t) {
306
+ function gi(n, t) {
307
307
  if (!n) return;
308
308
  const e = Math.floor(n.getZoom()), o = Math.max(e, 12), a = Math.min(e + 1, 19), i = t.pad(0.2), s = ["mt0", "mt1", "mt2", "mt3"];
309
309
  let r = 0;
@@ -326,21 +326,21 @@ function fo(n, t) {
326
326
  (1 - Math.log(Math.tan(e) + 1 / Math.cos(e)) / Math.PI) / 2 * Math.pow(2, t)
327
327
  );
328
328
  }
329
- const gi = {
329
+ const vi = {
330
330
  zoomSnap: 0.25,
331
331
  zoomDelta: 0.5,
332
332
  wheelPxPerZoomLevel: 90
333
333
  };
334
- function vi(n, t) {
334
+ function bi(n, t) {
335
335
  const e = n;
336
336
  return !e || !t || e._popup !== t ? !1 : (e._popup = null, !0);
337
337
  }
338
- function bi(n) {
338
+ function yi(n) {
339
339
  n.on("popupclose", (t) => {
340
- vi(n, t.popup);
340
+ bi(n, t.popup);
341
341
  });
342
342
  }
343
- class yi {
343
+ class xi {
344
344
  constructor(t) {
345
345
  p(this, "map", null);
346
346
  p(this, "configManager", Ee.getInstance());
@@ -364,7 +364,7 @@ class yi {
364
364
  /** Vale já, ou assim que o mapa for criado (o atributo `popups` pode ser lido antes do mapa existir). */
365
365
  definirModoPopups(t) {
366
366
  var e;
367
- this.modoPopups = Yt(t), (e = this.popups) == null || e.definirModo(this.modoPopups);
367
+ this.modoPopups = Jt(t), (e = this.popups) == null || e.definirModo(this.modoPopups);
368
368
  }
369
369
  init(t) {
370
370
  var o;
@@ -390,8 +390,8 @@ class yi {
390
390
  scrollWheelZoom: !0,
391
391
  preferCanvas: this.config.preferCanvas !== void 0 ? this.config.preferCanvas : !0,
392
392
  zoomControl: !1,
393
- ...gi
394
- }).setView([-23.7661, -53.3204], 14), this.popups = new ci(this.map, this.modoPopups), this.listenConfigBroadcast(), this.applyMapStyles(), bi(this.map), !this.map.getPane("sigefPane")) {
393
+ ...vi
394
+ }).setView([-23.7661, -53.3204], 14), this.popups = new li(this.map, this.modoPopups), this.listenConfigBroadcast(), this.applyMapStyles(), yi(this.map), !this.map.getPane("sigefPane")) {
395
395
  const a = this.map.createPane("sigefPane");
396
396
  a.style.zIndex = "390";
397
397
  }
@@ -470,19 +470,19 @@ class yi {
470
470
  }
471
471
  }
472
472
  preCarregarTilesRegiao(t) {
473
- mi(this.map, t);
473
+ gi(this.map, t);
474
474
  }
475
475
  async consultarSigef(t) {
476
476
  if (this.map) {
477
477
  if (!this.sigefPopup) {
478
- this.aoParcelasSigef && await fi(this.map, t, this.apiBaseUrl, this.sigefState, this.aoParcelasSigef);
478
+ this.aoParcelasSigef && await mi(this.map, t, this.apiBaseUrl, this.sigefState, this.aoParcelasSigef);
479
479
  return;
480
480
  }
481
- await pi(this.map, t, this.apiBaseUrl, this.sigefState);
481
+ await fi(this.map, t, this.apiBaseUrl, this.sigefState);
482
482
  }
483
483
  }
484
484
  }
485
- const xi = [
485
+ const Pi = [
486
486
  "verticesPane",
487
487
  "perimetroPane",
488
488
  "overlayPane",
@@ -493,7 +493,7 @@ const xi = [
493
493
  "pane-homologados",
494
494
  "pane-homologados-pontos"
495
495
  ];
496
- class Pi {
496
+ class Ci {
497
497
  constructor(t, e, o) {
498
498
  p(this, "map");
499
499
  p(this, "mapContainer");
@@ -508,7 +508,7 @@ class Pi {
508
508
  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));
509
509
  }
510
510
  setPanesPointerEvents(t) {
511
- xi.forEach((e) => {
511
+ Pi.forEach((e) => {
512
512
  const o = this.map.getPane(e);
513
513
  o && (o.style.pointerEvents = t);
514
514
  });
@@ -586,28 +586,28 @@ function Z(n, t, e) {
586
586
  }
587
587
  return a;
588
588
  }
589
- const mo = "ui-canvas-hit-test-estilo", le = 6, Ci = 4, Si = 4, Ot = { poligono: 1, linha: 2, ponto: 3, texto: 3 };
590
- function Li(n) {
589
+ const mo = "ui-canvas-hit-test-estilo", le = 6, Si = 4, Li = 4, qt = { poligono: 1, linha: 2, ponto: 3, texto: 3 };
590
+ function Mi(n) {
591
591
  var a;
592
592
  const t = n.getRootNode(), e = t instanceof ShadowRoot ? t : document.head;
593
593
  if ((a = e.querySelector) != null && a.call(e, `#${mo}`)) return;
594
594
  const o = document.createElement("style");
595
595
  o.id = mo, o.textContent = ".leaflet-pane > canvas { pointer-events: none !important; }", e.appendChild(o);
596
596
  }
597
- const Jt = /* @__PURE__ */ new WeakMap();
597
+ const te = /* @__PURE__ */ new WeakMap();
598
598
  function Uo(n, t, e) {
599
- let o = Jt.get(n);
600
- o || (o = /* @__PURE__ */ new Map(), Jt.set(n, o)), o.set(t, e);
599
+ let o = te.get(n);
600
+ o || (o = /* @__PURE__ */ new Map(), te.set(n, o)), o.set(t, e);
601
601
  }
602
602
  function Zo(n, t, e) {
603
- const o = Jt.get(n);
603
+ const o = te.get(n);
604
604
  (o == null ? void 0 : o.get(t)) === e && o.delete(t);
605
605
  }
606
606
  function de(n, t) {
607
607
  var e, o;
608
608
  return t + (((e = n.options) == null ? void 0 : e.stroke) === !1 ? 0 : (((o = n.options) == null ? void 0 : o.weight) ?? 0) / 2);
609
609
  }
610
- function Mi(n, t, e) {
610
+ function Ai(n, t, e) {
611
611
  let o = 1 / 0;
612
612
  for (const a of n) {
613
613
  for (let i = 1; i < a.length; i++)
@@ -616,24 +616,24 @@ function Mi(n, t, e) {
616
616
  }
617
617
  return o;
618
618
  }
619
- function Ai(n) {
619
+ function zi(n) {
620
620
  const t = n._pxBounds;
621
621
  return t ? (t.max.x - t.min.x) * (t.max.y - t.min.y) : 0;
622
622
  }
623
- function zi(n, t, e) {
623
+ function wi(n, t, e) {
624
624
  var o, a, i;
625
625
  if (!((o = n.options) != null && o.interactive)) return null;
626
626
  if (n._point && n._radius !== void 0) {
627
- const s = n._radius, r = n._radiusY ?? n._radius, c = n._point.distanceTo(t), l = (s + r) / 2, d = e === "ponto" ? Ci : de(n, le);
627
+ const s = n._radius, r = n._radiusY ?? n._radius, c = n._point.distanceTo(t), l = (s + r) / 2, d = e === "ponto" ? Si : de(n, le);
628
628
  return n.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;
629
629
  }
630
630
  if (n._parts) {
631
- const s = n instanceof b.Polygon, r = Mi(n._parts, t, s);
631
+ const s = n instanceof b.Polygon, r = Ai(n._parts, t, s);
632
632
  return e === "linha" ? r <= de(n, le) ? r : null : s && ((a = n._containsPoint) != null && a.call(n, t)) ? 0 : r <= de(n, le) ? r : null;
633
633
  }
634
634
  return (i = n._containsPoint) != null && i.call(n, t) ? 0 : null;
635
635
  }
636
- function wi(n) {
636
+ function Ei(n) {
637
637
  const t = [];
638
638
  for (let e = n._drawFirst; e; e = e.next) t.push(e.layer);
639
639
  return t;
@@ -647,12 +647,12 @@ function Wo(n, t, e) {
647
647
  for (const l of Ho) {
648
648
  const d = o[Go(r.id, l)];
649
649
  if (d)
650
- for (const h of wi(d).reverse()) {
651
- const f = zi(h, e, l);
652
- f !== null && i.push({ camada: r, tipo: l, alvo: h, distancia: f, area: Ai(h) });
650
+ for (const h of Ei(d).reverse()) {
651
+ const f = wi(h, e, l);
652
+ f !== null && i.push({ camada: r, tipo: l, alvo: h, distancia: f, area: zi(h) });
653
653
  }
654
654
  }
655
- const c = (s = Jt.get(n)) == null ? void 0 : s.get(r.id);
655
+ const c = (s = te.get(n)) == null ? void 0 : s.get(r.id);
656
656
  if (c)
657
657
  try {
658
658
  for (const l of c.consultar(e))
@@ -660,19 +660,19 @@ function Wo(n, t, e) {
660
660
  } catch {
661
661
  }
662
662
  }
663
- return i.sort((r, c) => Ot[r.tipo] !== Ot[c.tipo] ? Ot[c.tipo] - Ot[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);
663
+ return i.sort((r, c) => qt[r.tipo] !== qt[c.tipo] ? qt[c.tipo] - qt[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);
664
664
  }
665
665
  const Ie = /* @__PURE__ */ new WeakMap();
666
- function Ei(n, t, e) {
666
+ function ki(n, t, e) {
667
667
  const o = e.map((s) => s.chave === void 0 ? String(b.Util.stamp(s.alvo)) : `${b.Util.stamp(s.alvo)}:${s.chave}`), a = Ie.get(n);
668
668
  let i = 0;
669
- return a && Math.hypot(a.x - t.x, a.y - t.y) <= Si && a.ids.length === o.length && a.ids.every((s, r) => s === o[r]) && (i = (a.indice + 1) % e.length), Ie.set(n, { x: t.x, y: t.y, ids: o, indice: i }), e[i];
669
+ return a && Math.hypot(a.x - t.x, a.y - t.y) <= Li && a.ids.length === o.length && a.ids.every((s, r) => s === o[r]) && (i = (a.indice + 1) % e.length), Ie.set(n, { x: t.x, y: t.y, ids: o, indice: i }), e[i];
670
670
  }
671
- function ki(n, t, e) {
671
+ function Ii(n, t, e) {
672
672
  const o = n.mouseEventToLayerPoint(e), a = Wo(n, t, o);
673
673
  if (a.length === 0)
674
674
  return Ie.delete(n), !1;
675
- const i = Ei(n, o, a);
675
+ const i = ki(n, o, a);
676
676
  return i.alvo.fire(
677
677
  e.type,
678
678
  {
@@ -685,11 +685,11 @@ function ki(n, t, e) {
685
685
  !0
686
686
  ), !0;
687
687
  }
688
- function Qr(n, t, e) {
688
+ function Yr(n, t, e) {
689
689
  return Wo(n, t, n.mouseEventToLayerPoint(e))[0] ?? null;
690
690
  }
691
691
  const go = ".cad-vertex-handle, .cad-vertex-ghost, .cad-bezier-handle, #cm-vertex-edit-hud, #cm-draw-hud";
692
- class Ii {
692
+ class Ti {
693
693
  constructor(t) {
694
694
  p(this, "ctx");
695
695
  p(this, "map", null);
@@ -737,7 +737,7 @@ class Ii {
737
737
  });
738
738
  p(this, "handleClick", (t) => {
739
739
  var e, o, a, i, s, r;
740
- !this.map || !this.ctx.layerManager || (o = (e = this.ctx).ferramentaAtiva) != null && o.call(e) || (i = (a = this.ctx).edicaoAtiva) != null && i.call(a) || (r = (s = t.target) == null ? void 0 : s.closest) != null && r.call(s, ".leaflet-marker-icon") || ki(this.map, this.ctx.layerManager.getLayers(), t);
740
+ !this.map || !this.ctx.layerManager || (o = (e = this.ctx).ferramentaAtiva) != null && o.call(e) || (i = (a = this.ctx).edicaoAtiva) != null && i.call(a) || (r = (s = t.target) == null ? void 0 : s.closest) != null && r.call(s, ".leaflet-marker-icon") || Ii(this.map, this.ctx.layerManager.getLayers(), t);
741
741
  });
742
742
  p(this, "handleMouseDown", (t) => {
743
743
  var o, a, i, s, r, c, l;
@@ -796,7 +796,7 @@ class Ii {
796
796
  return;
797
797
  }
798
798
  if (t.code === "Space" || t.key === " ") {
799
- if (Pt(t) || ie(t)) return;
799
+ if (Pt(t) || ne(t)) return;
800
800
  this.isSpacePressed || (this.isSpacePressed = !0, this.mapContainer && !this.isPanning && (this.mapContainer.style.cursor = "grab")), this.mapContainer && (this.mapContainer.matches(":hover") || (c = (r = this.ctx.containerHost) == null ? void 0 : r.matches) != null && c.call(r, ":focus-within")) && t.preventDefault();
801
801
  }
802
802
  });
@@ -817,7 +817,7 @@ class Ii {
817
817
  };
818
818
  }
819
819
  ativar(t, e) {
820
- 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 Pi(this.map, this.mapContainer, this.ctx), Li(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), window.addEventListener("keyup", this.handleKeyUp), window.addEventListener("blur", this.handleBlur), 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)));
820
+ 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 Ci(this.map, this.mapContainer, this.ctx), Mi(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), window.addEventListener("keyup", this.handleKeyUp), window.addEventListener("blur", this.handleBlur), 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)));
821
821
  }
822
822
  desativar() {
823
823
  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), window.removeEventListener("keyup", this.handleKeyUp), window.removeEventListener("blur", this.handleBlur), this.isSpacePressed = !1, this.isSpacePanning = !1, 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;
@@ -872,7 +872,7 @@ class R {
872
872
  }
873
873
  }
874
874
  p(R, "renderers", /* @__PURE__ */ new Map());
875
- class Ti {
875
+ class Di {
876
876
  render(t, e, o) {
877
877
  var l, d, h, f;
878
878
  let a = 16;
@@ -902,7 +902,7 @@ class Ti {
902
902
  e.hasLayer(t) && e.removeLayer(t);
903
903
  }
904
904
  }
905
- class Di {
905
+ class _i {
906
906
  render(t, e, o) {
907
907
  var l, d, h, f;
908
908
  const a = ((l = t.dados) == null ? void 0 : l.url) || Bo, i = ((d = t.dados) == null ? void 0 : d.layers) || ke, s = ((h = t.dados) == null ? void 0 : h.format) || "image/png", r = ((f = t.dados) == null ? void 0 : f.attribution) || "INCRA/SIGEF";
@@ -1005,9 +1005,9 @@ function vo(n, t, e, o, a) {
1005
1005
  return;
1006
1006
  }
1007
1007
  if ((y = n.dados) != null && y.polilinhaSequencial || ((P = n.dados) == null ? void 0 : P.fechar) !== void 0 && f.length >= 2) {
1008
- const C = ((x = n.dados) == null ? void 0 : x.chaveGrupo) || o.chaveGrupo, L = Wt(f, C), z = ((M = n.dados) == null ? void 0 : M.fechar) !== !1, E = n.estilo.corPrimaria || "#00f5a0";
1008
+ const C = ((x = n.dados) == null ? void 0 : x.chaveGrupo) || o.chaveGrupo, L = Xt(f, C), z = ((M = n.dados) == null ? void 0 : M.fechar) !== !1, E = n.estilo.corPrimaria || "#00f5a0";
1009
1009
  Object.entries(L).forEach(([S, k]) => {
1010
- const T = Xt(k);
1010
+ const T = Kt(k);
1011
1011
  if (T.length < 2) return;
1012
1012
  const D = T.map((O) => [O.lat, O.lon]);
1013
1013
  gt(t, D, l, a, n.estilo.dashArray);
@@ -1081,9 +1081,9 @@ function vo(n, t, e, o, a) {
1081
1081
  else if (f && f.length >= 2) {
1082
1082
  const C = f.filter(
1083
1083
  (k) => k.lat && k.lon && k.tipo_ponto !== "B" && k.tipo !== "B" && k.ignorar_poligono !== 1
1084
- ), L = ((A = n.dados) == null ? void 0 : A.chaveGrupo) || o.chaveGrupo, z = Wt(C, L), E = n.estilo.corPrimaria || (i ? "#f59e0b" : "#10b981"), S = n.estilo.dashArray || (i ? "6, 8" : void 0);
1084
+ ), L = ((A = n.dados) == null ? void 0 : A.chaveGrupo) || o.chaveGrupo, z = Xt(C, L), E = n.estilo.corPrimaria || (i ? "#f59e0b" : "#10b981"), S = n.estilo.dashArray || (i ? "6, 8" : void 0);
1085
1085
  Object.values(z).forEach((k) => {
1086
- const T = Xt(k);
1086
+ const T = Kt(k);
1087
1087
  if (T.length < 2) return;
1088
1088
  const D = T.map((O) => [O.lat, O.lon]);
1089
1089
  if (gt(t, D, l, a, S), b.polyline(D, {
@@ -1107,7 +1107,7 @@ function vo(n, t, e, o, a) {
1107
1107
  });
1108
1108
  }
1109
1109
  }
1110
- class _i {
1110
+ class Fi {
1111
1111
  constructor() {
1112
1112
  p(this, "zoomListenerMap", /* @__PURE__ */ new WeakMap());
1113
1113
  }
@@ -1141,7 +1141,7 @@ function Ko(n, t) {
1141
1141
  const e = Math.max(0.7, 1 - 0.3 * Math.log10(n / Te)), o = t >= 18 ? 1 : t >= 16 ? 0.92 : t >= 14 ? 0.82 : 0.72;
1142
1142
  return Math.max(0.6, e * o);
1143
1143
  }
1144
- function Fi(n) {
1144
+ function Oi(n) {
1145
1145
  if (!n) return "#00f5a0";
1146
1146
  const t = n.trim();
1147
1147
  if (t.startsWith("#") || t.startsWith("rgb") || t.startsWith("hsl") || t.startsWith("var("))
@@ -1174,8 +1174,8 @@ const he = {
1174
1174
  cross: ["M6 1.2V10.8", "M1.2 6H10.8"],
1175
1175
  x: ["M2 2L10 10", "M10 2L2 10"]
1176
1176
  };
1177
- function te(n, t, e, o = "", a = "", i = !1, s = {}) {
1178
- const r = i || o.includes("ponto-selecionado") || o.includes("cad-marker-selected"), c = s.densidade === "compacta", l = bo(Fi(e)), d = t + 6, h = r ? `color-mix(in srgb, ${l} 38%, #000000)` : l, f = r ? 1 : c ? 0.72 : 0.9, g = r ? "rgba(255,255,255,0.95)" : c ? "rgba(0,0,0,0.55)" : "rgba(0,0,0,0.7)", m = r ? 1.3 : c ? 0.8 : 1, u = r ? "rgba(255,255,255,0.9)" : "rgba(0,0,0,0.6)", v = (L, z, E, S = "") => `class="${L}" stroke="${z}" stroke-width="${E}" vector-effect="non-scaling-stroke" ${S}`, y = n in he ? `<polygon points="${he[n]}" style="fill:${h}" fill-opacity="${f}" stroke-linejoin="round" ${v("cad-pt-contorno", g, m)} />` : n in ue ? ue[n].map(
1177
+ function ee(n, t, e, o = "", a = "", i = !1, s = {}) {
1178
+ const r = i || o.includes("ponto-selecionado") || o.includes("cad-marker-selected"), c = s.densidade === "compacta", l = bo(Oi(e)), d = t + 6, h = r ? `color-mix(in srgb, ${l} 38%, #000000)` : l, f = r ? 1 : c ? 0.72 : 0.9, g = r ? "rgba(255,255,255,0.95)" : c ? "rgba(0,0,0,0.55)" : "rgba(0,0,0,0.7)", m = r ? 1.3 : c ? 0.8 : 1, u = r ? "rgba(255,255,255,0.9)" : "rgba(0,0,0,0.6)", v = (L, z, E, S = "") => `class="${L}" stroke="${z}" stroke-width="${E}" vector-effect="non-scaling-stroke" ${S}`, y = n in he ? `<polygon points="${he[n]}" style="fill:${h}" fill-opacity="${f}" stroke-linejoin="round" ${v("cad-pt-contorno", g, m)} />` : n in ue ? ue[n].map(
1179
1179
  (L) => (
1180
1180
  // Traço = halo escuro (contraste sobre satélite) + traço colorido por cima
1181
1181
  `<path d="${L}" fill="none" stroke-linecap="round" ${v("cad-pt-halo", u, c ? 2.6 : 3.4)} /><path d="${L}" 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}"`)} />`
@@ -1189,7 +1189,7 @@ function te(n, t, e, o = "", a = "", i = !1, s = {}) {
1189
1189
  </div>
1190
1190
  `;
1191
1191
  }
1192
- class Oi {
1192
+ class qi {
1193
1193
  constructor() {
1194
1194
  p(this, "zoomListenerMap", /* @__PURE__ */ new WeakMap());
1195
1195
  }
@@ -1208,7 +1208,7 @@ class Oi {
1208
1208
  return e.on("zoomend", s), this.zoomListenerMap.set(a, s), a;
1209
1209
  }
1210
1210
  criarIcone(t, e, o, a, i, s, r, c) {
1211
- const l = e.config.enableAnimations ? "cad-pt-anim" : "", d = te(
1211
+ const l = e.config.enableAnimations ? "cad-pt-anim" : "", d = ee(
1212
1212
  o,
1213
1213
  a,
1214
1214
  i,
@@ -1277,7 +1277,7 @@ class Oi {
1277
1277
  o && (e.off("zoomend", o), this.zoomListenerMap.delete(t)), t.clearLayers(), e.hasLayer(t) && e.removeLayer(t);
1278
1278
  }
1279
1279
  }
1280
- class qi {
1280
+ class Ni {
1281
1281
  render(t, e, o) {
1282
1282
  const a = b.layerGroup();
1283
1283
  return this.rebuildPolygons(t, a, o, e), a;
@@ -1417,7 +1417,7 @@ class qi {
1417
1417
  t.clearLayers(), e.hasLayer(t) && e.removeLayer(t);
1418
1418
  }
1419
1419
  }
1420
- class Ni {
1420
+ class $i {
1421
1421
  constructor() {
1422
1422
  p(this, "moveListenerMap", /* @__PURE__ */ new WeakMap());
1423
1423
  }
@@ -1507,12 +1507,12 @@ function Ze(n, t) {
1507
1507
  function ta(n, t) {
1508
1508
  n.definirCurva(yt(t)), n.setLatLngs(t.tipo === "Polygon" ? t.aneis[0] : t.coordenadas);
1509
1509
  }
1510
- const $i = 6, pe = (n, t) => Math.hypot(n.x - t.x, n.y - t.y);
1510
+ const Ri = 6, pe = (n, t) => Math.hypot(n.x - t.x, n.y - t.y);
1511
1511
  function yo(n, t, e) {
1512
1512
  const o = e.x - t.x, a = e.y - t.y, i = o * o + a * a, s = i === 0 ? 0 : Math.max(0, Math.min(1, ((n.x - t.x) * o + (n.y - t.y) * a) / i));
1513
1513
  return Math.hypot(n.x - (t.x + s * o), n.y - (t.y + s * a));
1514
1514
  }
1515
- function Ri(n, t) {
1515
+ function Bi(n, t) {
1516
1516
  const e = n.geometria;
1517
1517
  if (e.tipo !== "Polygon") return 0;
1518
1518
  let o = 1 / 0, a = -1 / 0, i = 1 / 0, s = -1 / 0;
@@ -1522,7 +1522,7 @@ function Ri(n, t) {
1522
1522
  }
1523
1523
  return (a - o) * (s - i);
1524
1524
  }
1525
- function ne(n, t, e, o = $i, a = Va) {
1525
+ function se(n, t, e, o = Ri, a = Va) {
1526
1526
  let i = null, s = null, r = null;
1527
1527
  for (const c of t) {
1528
1528
  if (c.excluida || c.oculta) continue;
@@ -1532,7 +1532,7 @@ function ne(n, t, e, o = $i, a = Va) {
1532
1532
  d <= o + 2 && (!i || d < i.d) && (i = { f: c, d });
1533
1533
  } else if (l.tipo === "LineString") {
1534
1534
  let d = 1 / 0;
1535
- for (const h of Qt(l)) {
1535
+ for (const h of Yt(l)) {
1536
1536
  const f = h.map(e);
1537
1537
  for (let g = 1; g < f.length; g++) d = Math.min(d, yo(n, f[g - 1], f[g]));
1538
1538
  }
@@ -1548,19 +1548,19 @@ function ne(n, t, e, o = $i, a = Va) {
1548
1548
  let h = 1 / 0;
1549
1549
  for (const [g, m] of ja(l)) h = Math.min(h, yo(n, d[g], d[m]));
1550
1550
  if (Ha([n.y, n.x], [d.map((g) => [g.y, g.x]), ...l.aneis.slice(1).map((g) => g.map(e).map((m) => [m.y, m.x]))]) || h <= o) {
1551
- const g = Ri(c, e);
1551
+ const g = Bi(c, e);
1552
1552
  (!r || g < r.a) && (r = { f: c, a: g });
1553
1553
  }
1554
1554
  }
1555
1555
  }
1556
1556
  return (i == null ? void 0 : i.f) ?? (s == null ? void 0 : s.f) ?? (r == null ? void 0 : r.f) ?? null;
1557
1557
  }
1558
- const qt = 0.1, Bi = 2, Vi = typeof requestAnimationFrame == "function" ? (n) => {
1558
+ const Nt = 0.1, Vi = 2, ji = typeof requestAnimationFrame == "function" ? (n) => {
1559
1559
  requestAnimationFrame(n);
1560
1560
  } : (n) => {
1561
1561
  setTimeout(n, 16);
1562
1562
  };
1563
- class ji extends b.Layer {
1563
+ class Hi extends b.Layer {
1564
1564
  constructor(e, o) {
1565
1565
  super();
1566
1566
  p(this, "canvas", null);
@@ -1584,7 +1584,7 @@ class ji extends b.Layer {
1584
1584
  }
1585
1585
  /** Pede um redesenho no próximo quadro (vários pedidos viram um só). */
1586
1586
  solicitarRedesenho() {
1587
- this.agendado || !this.vivo || (this.agendado = !0, Vi(() => {
1587
+ this.agendado || !this.vivo || (this.agendado = !0, ji(() => {
1588
1588
  this.agendado = !1, this.vivo && this.redesenhar();
1589
1589
  }));
1590
1590
  }
@@ -1596,9 +1596,9 @@ class ji extends b.Layer {
1596
1596
  const e = this._map, o = this.canvas;
1597
1597
  if (!(!e || !o))
1598
1598
  try {
1599
- const a = e.getSize(), i = Math.ceil(a.x * (1 + 2 * qt)), s = Math.ceil(a.y * (1 + 2 * qt));
1599
+ const a = e.getSize(), i = Math.ceil(a.x * (1 + 2 * Nt)), s = Math.ceil(a.y * (1 + 2 * Nt));
1600
1600
  if (!(i > 0 && s > 0)) return;
1601
- const r = Math.min(Bi, typeof window < "u" && window.devicePixelRatio || 1), c = e.containerPointToLayerPoint([-a.x * qt, -a.y * qt]).round();
1601
+ const r = Math.min(Vi, typeof window < "u" && window.devicePixelRatio || 1), c = e.containerPointToLayerPoint([-a.x * Nt, -a.y * Nt]).round();
1602
1602
  (o.width !== Math.round(i * r) || o.height !== Math.round(s * r)) && (o.width = Math.round(i * r), o.height = Math.round(s * r)), o.style.width = `${i}px`, o.style.height = `${s}px`, b.DomUtil.setPosition(o, c), o.style.display = "";
1603
1603
  const l = o.getContext("2d");
1604
1604
  if (!l) return;
@@ -1616,18 +1616,18 @@ const ea = /* @__PURE__ */ new WeakMap(), _e = {
1616
1616
  water: '<path d="M12 3 C12 3 5 11 5 15.5 A7 7 0 0 0 19 15.5 C19 11 12 3 12 3 Z" />',
1617
1617
  boundary: '<path d="M12 2 L22 12 L12 22 L2 12 Z" />'
1618
1618
  };
1619
- function Ht(n, t, e = !1) {
1620
- const o = n.estilo ?? {}, a = o.tamanhoIcone ?? t.tamanhoMarcador, i = typeof a == "number" && Number.isFinite(a) && a > 0 ? a : 22, s = e ? Zt : st(o.corTraco ?? o.corPreenchimento ?? t.corPrimaria, je), r = Number.isFinite(o.rotacaoIcone) ? o.rotacaoIcone : 0, c = _e[o.icone ?? ""] ?? "";
1619
+ function Gt(n, t, e = !1) {
1620
+ const o = n.estilo ?? {}, a = o.tamanhoIcone ?? t.tamanhoMarcador, i = typeof a == "number" && Number.isFinite(a) && a > 0 ? a : 22, s = e ? Wt : st(o.corTraco ?? o.corPreenchimento ?? t.corPrimaria, je), r = Number.isFinite(o.rotacaoIcone) ? o.rotacaoIcone : 0, c = _e[o.icone ?? ""] ?? "";
1621
1621
  return b.divIcon({
1622
1622
  className: `custom-leaflet-marker${e ? " cad-feicao-selecionada" : ""}`,
1623
1623
  iconSize: [i, i],
1624
- html: `<svg width="${i}" height="${i}" viewBox="0 0 24 24" fill="${s}" fill-opacity="0.25" stroke="${s}" stroke-width="1.6" stroke-linejoin="round" stroke-linecap="round" style="transform:rotate(${r}deg);overflow:visible;display:block${e ? `;filter:drop-shadow(0 0 3px ${Zt})` : ""}">${c}</svg>`
1624
+ html: `<svg width="${i}" height="${i}" viewBox="0 0 24 24" fill="${s}" fill-opacity="0.25" stroke="${s}" stroke-width="1.6" stroke-linejoin="round" stroke-linecap="round" style="transform:rotate(${r}deg);overflow:visible;display:block${e ? `;filter:drop-shadow(0 0 3px ${Wt})` : ""}">${c}</svg>`
1625
1625
  });
1626
1626
  }
1627
- function Gt(n, t, e = !1) {
1628
- const o = n.estilo ?? {}, a = n.geometria.tipo === "Text" ? n.geometria.texto : "", i = e ? Zt : st(o.corTraco ?? t.corPrimaria, "#ffffff"), s = Number.isFinite(o.tamanhoFonte) ? o.tamanhoFonte : 13, c = `display:inline-block;white-space:nowrap;transform:translate(-50%,-50%) rotate(${Number.isFinite(o.rotacaoIcone) ? o.rotacaoIcone : 0}deg);color:${i};font-size:${s}px;font-weight:600;`, l = st(o.corFundo, "");
1627
+ function Ut(n, t, e = !1) {
1628
+ const o = n.estilo ?? {}, a = n.geometria.tipo === "Text" ? n.geometria.texto : "", i = e ? Wt : st(o.corTraco ?? t.corPrimaria, "#ffffff"), s = Number.isFinite(o.tamanhoFonte) ? o.tamanhoFonte : 13, c = `display:inline-block;white-space:nowrap;transform:translate(-50%,-50%) rotate(${Number.isFinite(o.rotacaoIcone) ? o.rotacaoIcone : 0}deg);color:${i};font-size:${s}px;font-weight:600;`, l = st(o.corFundo, "");
1629
1629
  if (l) {
1630
- const h = st(o.corBorda, ""), f = typeof o.opacidadeFundo == "number" && Number.isFinite(o.opacidadeFundo) ? Math.min(1, Math.max(0, o.opacidadeFundo)) : 0.85, g = typeof o.raioBorda == "number" && Number.isFinite(o.raioBorda) ? Math.min(50, Math.max(0, o.raioBorda)) : 4, m = e ? `1px solid ${Zt}` : h ? `1px solid ${h}` : "none";
1630
+ const h = st(o.corBorda, ""), f = typeof o.opacidadeFundo == "number" && Number.isFinite(o.opacidadeFundo) ? Math.min(1, Math.max(0, o.opacidadeFundo)) : 0.85, g = typeof o.raioBorda == "number" && Number.isFinite(o.raioBorda) ? Math.min(50, Math.max(0, o.raioBorda)) : 4, m = e ? `1px solid ${Wt}` : h ? `1px solid ${h}` : "none";
1631
1631
  return b.divIcon({
1632
1632
  className: `custom-leaflet-marker cad-feicao-texto cad-feicao-selo${e ? " cad-feicao-selecionada" : ""}`,
1633
1633
  iconSize: void 0,
@@ -1665,12 +1665,12 @@ function Oe(n, t) {
1665
1665
  interactive: t
1666
1666
  };
1667
1667
  }
1668
- const Hi = 150, Gi = 100, fe = 300, me = 0.75, Ui = 20, Zi = 0.3, ge = typeof requestAnimationFrame == "function" ? (n) => {
1668
+ const Gi = 150, Ui = 100, fe = 300, me = 0.75, Zi = 20, Wi = 0.3, ge = typeof requestAnimationFrame == "function" ? (n) => {
1669
1669
  requestAnimationFrame(n);
1670
1670
  } : (n) => {
1671
1671
  setTimeout(n, 16);
1672
1672
  };
1673
- class Wi {
1673
+ class Xi {
1674
1674
  constructor() {
1675
1675
  p(this, "estados", /* @__PURE__ */ new WeakMap());
1676
1676
  /** Por definição de camada (uma por componente), para a seleção sobreviver à recriação do grupo. */
@@ -1787,7 +1787,7 @@ class Wi {
1787
1787
  h.add(u.id), s.loja.get(u.id) !== u && d.add(u.id);
1788
1788
  const f = [...s.loja.keys()].filter((u) => !h.has(u));
1789
1789
  if (d.size > 0 || f.length > 0) {
1790
- if (s.revisao++, s.revisaoBase++, s.lod.clear(), s.loja.size === 0 || d.size + f.length > l.length * Zi)
1790
+ if (s.revisao++, s.revisaoBase++, s.lod.clear(), s.loja.size === 0 || d.size + f.length > l.length * Wi)
1791
1791
  s.indice.construir(l);
1792
1792
  else {
1793
1793
  for (const u of l) d.has(u.id) && s.indice.atualizar(u);
@@ -1925,7 +1925,7 @@ class Wi {
1925
1925
  return;
1926
1926
  }
1927
1927
  if (!t.camadaMarcas) {
1928
- const e = Z(t.map, t.layerDef.id, "poligono"), o = new ji(e, () => t.marcas.values());
1928
+ const e = Z(t.map, t.layerDef.id, "poligono"), o = new Hi(e, () => t.marcas.values());
1929
1929
  t.camadaMarcas = o, o.addTo(t.map), o.on("click", (a) => {
1930
1930
  var r, c;
1931
1931
  const { feicaoHit: i, originalEvent: s } = a;
@@ -1963,8 +1963,8 @@ class Wi {
1963
1963
  const u = a.latLngToContainerPoint(m);
1964
1964
  return { x: u.x, y: u.y };
1965
1965
  }, f = a.getZoom(), g = [];
1966
- for (let m = 0; m < Ui && d.length > 0; m++) {
1967
- const u = ne({ x: i.x, y: i.y }, d, h);
1966
+ for (let m = 0; m < Zi && d.length > 0; m++) {
1967
+ const u = se({ x: i.x, y: i.y }, d, h);
1968
1968
  if (!u) break;
1969
1969
  d.splice(d.indexOf(u), 1);
1970
1970
  const v = to(t.indice.caixaDe(u.id) ?? l, f);
@@ -2221,7 +2221,7 @@ class Wi {
2221
2221
  const x = P ? o.entradas.get(v) : void 0;
2222
2222
  x && "bringToFront" in x.layer && x.layer.bringToFront();
2223
2223
  }, u = (this.tokenLote.get(t) ?? 0) + 1;
2224
- if (this.tokenLote.set(t, u), s.length <= Hi)
2224
+ if (this.tokenLote.set(t, u), s.length <= Gi)
2225
2225
  s.forEach(m);
2226
2226
  else {
2227
2227
  const v = l ? this.caixaDe(r.getBounds()) : null, y = (A) => {
@@ -2231,7 +2231,7 @@ class Wi {
2231
2231
  }, P = s.filter(y), x = s.filter((A) => !y(A));
2232
2232
  P.forEach(m);
2233
2233
  const M = () => {
2234
- this.tokenLote.get(t) !== u || !o.vivo || (x.splice(0, Gi).forEach(m), x.length > 0 ? ge(M) : this.sincronizarMarcas(o));
2234
+ this.tokenLote.get(t) !== u || !o.vivo || (x.splice(0, Ui).forEach(m), x.length > 0 ? ge(M) : this.sincronizarMarcas(o));
2235
2235
  };
2236
2236
  x.length > 0 && ge(M);
2237
2237
  }
@@ -2268,7 +2268,7 @@ class Wi {
2268
2268
  case "Circle":
2269
2269
  return b.circle(r.centro, { ...c, radius: r.raioMetros, pane: s });
2270
2270
  case "LineString":
2271
- return b.polyline(r.partes && r.partes.length > 1 ? Qt(r) : r.coordenadas, { ...c, pane: s });
2271
+ return b.polyline(r.partes && r.partes.length > 1 ? Yt(r) : r.coordenadas, { ...c, pane: s });
2272
2272
  case "Point": {
2273
2273
  const h = (d = t.estilo) == null ? void 0 : d.icone;
2274
2274
  return h && _e[h] ? b.marker(r.coordenada, { icon: this.iconeSvg(t, e, i), pane: s, interactive: a }) : b.circleMarker(r.coordenada, {
@@ -2289,17 +2289,17 @@ class Wi {
2289
2289
  remendar(t, e, o, a, i) {
2290
2290
  var c, l;
2291
2291
  const s = e.geometria, r = this.estiloVetor(e, o, a, i);
2292
- (t instanceof Yo || t instanceof Jo) && yt(s) ? (ta(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 ? Qt(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 b.CircleMarker ? (t.setLatLng(s.coordenada), t.setRadius(Ye(e, o.estilo)), t.setStyle(r)) : t instanceof b.Marker && (t.setLatLng(s.tipo === "Point" || s.tipo === "Text" ? s.coordenada : t.getLatLng()), t.setIcon(s.tipo === "Text" ? this.iconeTexto(e, o, i) : this.iconeSvg(e, o, i)), s.tipo === "Text" && (a && !e.bloqueada ? (c = t.dragging) == null || c.enable() : (l = t.dragging) == null || l.disable())), this.aplicarRotulo(t, e);
2292
+ (t instanceof Yo || t instanceof Jo) && yt(s) ? (ta(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 ? Yt(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 b.CircleMarker ? (t.setLatLng(s.coordenada), t.setRadius(Ye(e, o.estilo)), t.setStyle(r)) : t instanceof b.Marker && (t.setLatLng(s.tipo === "Point" || s.tipo === "Text" ? s.coordenada : t.getLatLng()), t.setIcon(s.tipo === "Text" ? this.iconeTexto(e, o, i) : this.iconeSvg(e, o, i)), s.tipo === "Text" && (a && !e.bloqueada ? (c = t.dragging) == null || c.enable() : (l = t.dragging) == null || l.disable())), this.aplicarRotulo(t, e);
2293
2293
  }
2294
2294
  /** Só o estilo (seleção): sem `setLatLngs`, que reprojetaria e recalcularia limites da forma. */
2295
2295
  restilizar(t, e, o, a, i) {
2296
2296
  t instanceof b.Marker ? t.setIcon(e.geometria.tipo === "Text" ? this.iconeTexto(e, o, i) : this.iconeSvg(e, o, i)) : t instanceof b.Path && t.setStyle(this.estiloVetor(e, o, a, i));
2297
2297
  }
2298
2298
  iconeSvg(t, e, o = !1) {
2299
- return Ht(t, e.estilo, o);
2299
+ return Gt(t, e.estilo, o);
2300
2300
  }
2301
2301
  iconeTexto(t, e, o = !1) {
2302
- return Gt(t, e.estilo, o);
2302
+ return Ut(t, e.estilo, o);
2303
2303
  }
2304
2304
  aplicarRotulo(t, e) {
2305
2305
  const o = e.estilo;
@@ -2339,7 +2339,7 @@ class Wi {
2339
2339
  });
2340
2340
  }
2341
2341
  }
2342
- function Xi() {
2342
+ function Ki() {
2343
2343
  return {
2344
2344
  agora: () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(),
2345
2345
  quadro: (t) => {
@@ -2351,7 +2351,7 @@ function Xi() {
2351
2351
  }
2352
2352
  };
2353
2353
  }
2354
- class Ki {
2354
+ class Qi {
2355
2355
  constructor(t) {
2356
2356
  /** Orçamento de cada quadro para a fila de quadro (ms). Medido: ~12 ms deixam o quadro respirar sem alongar o redesenho. */
2357
2357
  p(this, "fatiaMs", 12);
@@ -2367,7 +2367,7 @@ class Ki {
2367
2367
  this.relogio = t ?? null;
2368
2368
  }
2369
2369
  get r() {
2370
- return this.relogio ?? (this.relogio = Xi());
2370
+ return this.relogio ?? (this.relogio = Ki());
2371
2371
  }
2372
2372
  /** O relógio dos prazos: quem trabalha dentro de um `passo` mede o tempo por aqui. */
2373
2373
  agora() {
@@ -2479,9 +2479,9 @@ class Ki {
2479
2479
  this.pedirOcioso();
2480
2480
  }
2481
2481
  }
2482
- const ot = new Ki();
2482
+ const ot = new Qi();
2483
2483
  let at = null, Lt = null;
2484
- function Qi(n, t) {
2484
+ function Yi(n, t) {
2485
2485
  if (typeof document > "u") return null;
2486
2486
  try {
2487
2487
  return at || (at = document.createElement("canvas"), Lt = at.getContext("2d")), Lt ? (at.width !== n || at.height !== t ? (at.width = n, at.height = t) : (Lt.setTransform(1, 0, 0, 1, 0, 0), Lt.clearRect(0, 0, n, t)), Lt) : null;
@@ -2489,7 +2489,7 @@ function Qi(n, t) {
2489
2489
  return null;
2490
2490
  }
2491
2491
  }
2492
- function Yi(n, t, e, o) {
2492
+ function Ji(n, t, e, o) {
2493
2493
  const a = [], i = Math.abs(e), s = Math.abs(o);
2494
2494
  return i > 0 && a.push({ x: e > 0 ? n - i : 0, y: 0, largura: i, altura: t }), s > 0 && a.push({ x: e > 0 ? 0 : i, y: o > 0 ? t - s : 0, largura: n - i, altura: s }), a;
2495
2495
  }
@@ -2595,7 +2595,7 @@ const W = class W extends b.Canvas {
2595
2595
  this.provisorio = !0, this.conteudoValido = !1;
2596
2596
  else if (g && a && a.mundo) {
2597
2597
  const P = r.x - a.mundo.x, x = r.y - a.mundo.y;
2598
- !this.branco && this.itens <= this.limiteRepintar ? u = !0 : Math.abs(P) < d.x && Math.abs(x) < d.y && ((P !== 0 || x !== 0) && !this.branco && (l.save(), l.setTransform(1, 0, 0, 1, 0, 0), l.globalCompositeOperation = "copy", l.drawImage(c, -P * h, -x * h), l.restore()), m = Yi(d.x, d.y, P, x));
2598
+ !this.branco && this.itens <= this.limiteRepintar ? u = !0 : Math.abs(P) < d.x && Math.abs(x) < d.y && ((P !== 0 || x !== 0) && !this.branco && (l.save(), l.setTransform(1, 0, 0, 1, 0, 0), l.globalCompositeOperation = "copy", l.drawImage(c, -P * h, -x * h), l.restore()), m = Ji(d.x, d.y, P, x));
2599
2599
  }
2600
2600
  !m && !u && !v && (this.provisorio = !1, c.width !== h * d.x || c.height !== h * d.y ? (c.width = h * d.x, c.height = h * d.y) : this.branco || (l.setTransform(1, 0, 0, 1, 0, 0), l.clearRect(0, 0, c.width, c.height)), this.branco = !0, c.style.width = `${d.x}px`, c.style.height = `${d.y}px`, this.conteudoValido = !1), this.regioesDaVez = m, this.adiarDaVez = !!this.aoPintarFatiado && (!m && !u || !!m && this.redesenhoPendente), this.mundoMin = r;
2601
2601
  const y = o.getSize();
@@ -2702,7 +2702,7 @@ const W = class W extends b.Canvas {
2702
2702
  }
2703
2703
  if (!o) {
2704
2704
  if (!e.preparar(s)) return !1;
2705
- const r = e.itens(), l = this._container, d = l && r > W.limiteFatiar ? this.quadroAtual(null) : null, h = d && l ? Qi(l.width, l.height) : null;
2705
+ const r = e.itens(), l = this._container, d = l && r > W.limiteFatiar ? this.quadroAtual(null) : null, h = d && l ? Yi(l.width, l.height) : null;
2706
2706
  return !d || !h ? (this.provisorio = !1, this.pintarQuadro(null), i()) : (o = e.pintarFatiado({ ...d, ctx: h, branco: !0, regioes: null }), !1);
2707
2707
  }
2708
2708
  return o.passo(s) ? (this.trocarPeloBuffer(o.resultado()), i()) : !1;
@@ -2773,7 +2773,7 @@ p(W, "limiteRepintar", 500), /**
2773
2773
  */
2774
2774
  p(W, "limiteFatiar", 12e3), p(W, "pendentes", /* @__PURE__ */ new Set()), /** Redesenhos adiados concluídos desde o carregamento, em todo o documento (diagnóstico: zoom seguido conclui só o último). */
2775
2775
  p(W, "redesenhosConcluidos", 0);
2776
- let ee = W;
2776
+ let oe = W;
2777
2777
  const xo = Object.freeze({
2778
2778
  alta: Object.freeze({
2779
2779
  nivel: "alta",
@@ -2829,7 +2829,7 @@ function be(n, t) {
2829
2829
  return n == null ? t.renderizadorPadrao : String(n).trim().toLowerCase() === "canvas" ? "canvas" : "leaflet";
2830
2830
  }
2831
2831
  const Po = /* @__PURE__ */ new WeakMap();
2832
- function Ji(n, t) {
2832
+ function tn(n, t) {
2833
2833
  try {
2834
2834
  if (!n || typeof n != "object" || !n.options) return;
2835
2835
  let e = Po.get(n);
@@ -2846,23 +2846,23 @@ function Ji(n, t) {
2846
2846
  } catch {
2847
2847
  }
2848
2848
  }
2849
- const Ne = "cad-formas-sobreposicao", tn = "7000", Nt = 8, en = 8, on = 20, oa = typeof requestAnimationFrame == "function" ? (n) => {
2849
+ const Ne = "cad-formas-sobreposicao", en = "7000", $t = 8, on = 8, an = 20, oa = typeof requestAnimationFrame == "function" ? (n) => {
2850
2850
  requestAnimationFrame(n);
2851
2851
  } : (n) => {
2852
2852
  setTimeout(n, 16);
2853
- }, an = /* @__PURE__ */ new Set(["icone", "texto", "cluster", "rotulo", "curva"]), nn = 32, $t = () => ot.agora(), it = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap();
2853
+ }, nn = /* @__PURE__ */ new Set(["icone", "texto", "cluster", "rotulo", "curva"]), sn = 32, Rt = () => ot.agora(), it = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap();
2854
2854
  function Y(n) {
2855
2855
  return { caixa: n.caixa, zoom: n.zoom, larguraPx: n.larguraPx, alturaPx: n.alturaPx, dpr: n.dpr, origemPx: n.origemPx };
2856
2856
  }
2857
- const sn = (n) => !!n._loaded;
2858
- function rn(n) {
2857
+ const rn = (n) => !!n._loaded;
2858
+ function cn(n) {
2859
2859
  const t = it.get(n);
2860
2860
  if (t) return t;
2861
2861
  const e = { estados: /* @__PURE__ */ new Set(), quadro: null, agendado: !1, noMapa: !1 };
2862
2862
  return e.pintor = new qo({
2863
2863
  camada: () => null,
2864
2864
  sobreposicao: () => e.quadro ? { ctx: e.quadro.ctx, largura: e.quadro.larguraPx, altura: e.quadro.alturaPx, dpr: e.quadro.dpr } : null
2865
- }), e.canvas = new ee({ pane: Ne, padding: 0.1 }, (o) => {
2865
+ }), e.canvas = new oe({ pane: Ne, padding: 0.1 }, (o) => {
2866
2866
  e.quadro = o;
2867
2867
  const a = Y(o), i = [];
2868
2868
  for (const s of [...e.estados].sort((r, c) => r.layerDef.zIndex - c.layerDef.zIndex)) {
@@ -2873,11 +2873,11 @@ function rn(n) {
2873
2873
  return o.branco && i.length === 0 ? !1 : (e.pintor.desenhar({ vista: a, origem: o.origemPx, camadas: i }, a, { alvo: "sobreposicao" }), i.length > 0);
2874
2874
  }), it.set(n, e), e;
2875
2875
  }
2876
- function cn(n, t) {
2876
+ function ln(n, t) {
2877
2877
  t.noMapa || (t.noMapa = !0, n.whenReady(() => {
2878
2878
  if (!n.getPane(Ne)) {
2879
2879
  const e = n.createPane(Ne);
2880
- e.style.zIndex = tn, e.style.pointerEvents = "none";
2880
+ e.style.zIndex = en, e.style.pointerEvents = "none";
2881
2881
  }
2882
2882
  it.get(n) === t && n.addLayer(t.canvas);
2883
2883
  }));
@@ -2887,7 +2887,7 @@ function Mt(n) {
2887
2887
  n.agendado = !1, n.noMapa && n.canvas.pintar();
2888
2888
  }));
2889
2889
  }
2890
- function ln(n) {
2890
+ function dn(n) {
2891
2891
  var t;
2892
2892
  try {
2893
2893
  return ((t = n.qualidade) == null ? void 0 : t.call(n)) ?? qe("alta");
@@ -2895,7 +2895,7 @@ function ln(n) {
2895
2895
  return qe("alta");
2896
2896
  }
2897
2897
  }
2898
- class dn {
2898
+ class hn {
2899
2899
  constructor() {
2900
2900
  p(this, "estados", /* @__PURE__ */ new WeakMap());
2901
2901
  /** Por definição de camada, para a seleção sobreviver à recriação do grupo (ocultar e exibir a camada). */
@@ -2903,7 +2903,7 @@ class dn {
2903
2903
  }
2904
2904
  // ---------------------------------------------------------------- ILayerRenderer
2905
2905
  render(t, e, o) {
2906
- const a = b.layerGroup(), i = new Ta(), s = ln(o);
2906
+ const a = b.layerGroup(), i = new Ta(), s = dn(o);
2907
2907
  i.definirQualidade({ limiteMarcaPx: s.limiteMarcaPx, limiteMiudaPx: s.limiteMiudaPx, toleranciaPx: s.toleranciaPx });
2908
2908
  const r = o.regraVersoes;
2909
2909
  r && i.definirRegra(Object.assign((h, f) => r.visivel(h, f), { soPrevias: !0 })), i.definirCamada(this.defMotor(t)), i.definirFeicoes(t.id, this.feicoesDe(t));
@@ -2929,15 +2929,15 @@ class dn {
2929
2929
  l.pintor = new qo({
2930
2930
  camada: () => l.quadro ? { ctx: l.quadro.ctx, largura: l.quadro.larguraPx, altura: l.quadro.alturaPx, dpr: l.quadro.dpr } : null,
2931
2931
  sobreposicao: () => null
2932
- }), l.pintor.definirTracejado(s.tracejado), e.getPane(bt(t.id)) || e.createPane(bt(t.id)), l.base = new ee(
2932
+ }), l.pintor.definirTracejado(s.tracejado), e.getPane(bt(t.id)) || e.createPane(bt(t.id)), l.base = new oe(
2933
2933
  { pane: bt(t.id), padding: 0.1, incremental: !0, dprMaximo: s.dprMaximo },
2934
2934
  (h) => this.pintarBase(l, h),
2935
2935
  (h) => this.redesenhoBase(l, h)
2936
2936
  ), this.estados.set(a, l), e.whenReady(() => {
2937
2937
  l.vivo && a.addLayer(l.base);
2938
2938
  });
2939
- const d = rn(e);
2940
- return d.pintor.definirTracejado(s.tracejado), d.canvas.definirDprMaximo(s.dprMaximo), d.estados.add(l), cn(e, d), this.registrarHit(l), a;
2939
+ const d = cn(e);
2940
+ return d.pintor.definirTracejado(s.tracejado), d.canvas.definirDprMaximo(s.dprMaximo), d.estados.add(l), ln(e, d), this.registrarHit(l), a;
2941
2941
  }
2942
2942
  update(t, e, o, a, i) {
2943
2943
  var r;
@@ -3077,7 +3077,7 @@ class dn {
3077
3077
  }
3078
3078
  /** A vista de uma faixa exposta no pan incremental (a origem continua sendo a do canvas inteiro). */
3079
3079
  vistaDaFaixa(t, e) {
3080
- const o = en, [a, i] = _t(t.origemPx.x + e.x - o, t.origemPx.y + e.y - o, t.zoom), [s, r] = _t(t.origemPx.x + e.x + e.largura + o, t.origemPx.y + e.y + e.altura + o, t.zoom);
3080
+ const o = on, [a, i] = _t(t.origemPx.x + e.x - o, t.origemPx.y + e.y - o, t.zoom), [s, r] = _t(t.origemPx.x + e.x + e.largura + o, t.origemPx.y + e.y + e.altura + o, t.zoom);
3081
3081
  return {
3082
3082
  ...Y(t),
3083
3083
  larguraPx: e.largura,
@@ -3098,13 +3098,13 @@ class dn {
3098
3098
  if (e.regioes) {
3099
3099
  a = 0;
3100
3100
  for (const r of e.regioes) {
3101
- const c = this.vistaDaFaixa(e, r), l = t.motor.listaDesenho(c, { camadas: [o], parte: "canvas" }), d = se(l.camadas[0]);
3101
+ const c = this.vistaDaFaixa(e, r), l = t.motor.listaDesenho(c, { camadas: [o], parte: "canvas" }), d = re(l.camadas[0]);
3102
3102
  d !== 0 && (t.pintor.desenhar(l, c, { limpar: !1, recorte: r }), a += d);
3103
3103
  }
3104
3104
  const s = t.motor.listaDesenho(Y(e), { camadas: [o], parte: "dom" }).camadas[0];
3105
3105
  s && this.sincronizarDom(t, s);
3106
3106
  } else {
3107
- const s = Y(e), r = t.motor.listaDesenho(s, { camadas: [o] }), c = r.camadas[0] ?? null, l = se(c);
3107
+ const s = Y(e), r = t.motor.listaDesenho(s, { camadas: [o] }), c = r.camadas[0] ?? null, l = re(c);
3108
3108
  c ? l === 0 && e.branco ? a = 0 : (t.pintor.desenhar(r, s), a = l) : a = !e.branco, t.ultima = c, c && t.domNaAgenda ? ot.agendar(t.chaveDom, this.sincronizacaoDom(t, c)) : c && this.sincronizarDom(t, c);
3109
3109
  }
3110
3110
  t.domNaAgenda = !1;
@@ -3121,17 +3121,17 @@ class dn {
3121
3121
  if (!t.vivo) return null;
3122
3122
  const o = t.layerDef.id, a = Y(e);
3123
3123
  ot.cancelar(t.chaveAquecer);
3124
- const i = t.motor.criarAquecimento(o, a, $t);
3124
+ const i = t.motor.criarAquecimento(o, a, Rt);
3125
3125
  let s = null, r = null, c = 0, l = !1;
3126
3126
  return {
3127
3127
  preparar: (d) => !t.vivo || i.passo(d),
3128
3128
  cancelado: () => {
3129
3129
  t.domNaAgenda = !1;
3130
3130
  },
3131
- itens: () => t.vivo ? (s = t.motor.listaDesenho(a, { camadas: [o] }), r = s.camadas[0] ?? null, c = se(r), t.domNaAgenda = !0, r ? c : 0) : 0,
3131
+ itens: () => t.vivo ? (s = t.motor.listaDesenho(a, { camadas: [o] }), r = s.camadas[0] ?? null, c = re(r), t.domNaAgenda = !0, r ? c : 0) : 0,
3132
3132
  pintarFatiado: (d) => {
3133
3133
  l = !0, t.quadro = d;
3134
- const h = s && t.vivo ? t.pintor.desenharFatiado(s, a, {}, $t) : null;
3134
+ const h = s && t.vivo ? t.pintor.desenharFatiado(s, a, {}, Rt) : null;
3135
3135
  return { passo: (f) => !h || h.passo(f), resultado: () => c };
3136
3136
  },
3137
3137
  concluido: () => {
@@ -3179,7 +3179,7 @@ class dn {
3179
3179
  passo: (g) => {
3180
3180
  for (; d < l.length; ) {
3181
3181
  if (!t.vivo || !t.layerDef.visivel) return !0;
3182
- if (h ?? (h = t.motor.criarAquecimento(r, l[d], $t, { lista: !0 })), !h.passo(g)) return !1;
3182
+ if (h ?? (h = t.motor.criarAquecimento(r, l[d], Rt, { lista: !0 })), !h.passo(g)) return !1;
3183
3183
  h = null, d++;
3184
3184
  }
3185
3185
  return !0;
@@ -3214,7 +3214,7 @@ class dn {
3214
3214
  sincronizacaoDom(t, e) {
3215
3215
  const o = /* @__PURE__ */ new Set(), a = [];
3216
3216
  for (const c of e.itens)
3217
- an.has(c.forma) && (o.add(`${c.forma}:${c.id}`), a.push(c));
3217
+ nn.has(c.forma) && (o.add(`${c.forma}:${c.id}`), a.push(c));
3218
3218
  const i = [];
3219
3219
  let s = 0, r = !1;
3220
3220
  return {
@@ -3226,7 +3226,7 @@ class dn {
3226
3226
  o.has(l) || !l.startsWith("cluster:") || (i.push(d), t.dom.delete(l));
3227
3227
  }
3228
3228
  for (; s < a.length; ) {
3229
- const l = Math.min(a.length, s + nn);
3229
+ const l = Math.min(a.length, s + sn);
3230
3230
  for (; s < l; s++) {
3231
3231
  const d = a[s], h = `${d.forma}:${d.id}`;
3232
3232
  try {
@@ -3236,7 +3236,7 @@ class dn {
3236
3236
  f && t.grupo.removeLayer(f.layer), t.dom.delete(h);
3237
3237
  }
3238
3238
  }
3239
- if (s < a.length && $t() >= c) return !1;
3239
+ if (s < a.length && Rt() >= c) return !1;
3240
3240
  }
3241
3241
  for (const [l, d] of t.dom)
3242
3242
  o.has(l) || (t.grupo.removeLayer(d.layer), t.dom.delete(l));
@@ -3254,10 +3254,10 @@ class dn {
3254
3254
  const { map: i, layerDef: s, grupo: r } = t, c = o.feicao ?? null, l = t.dom.get(e), d = s.estilo ?? {};
3255
3255
  if (o.forma === "icone" && c && o.coordenada) {
3256
3256
  if (l) {
3257
- l.fonte !== c ? (l.layer.setLatLng(o.coordenada), l.layer.setIcon(Ht(c, d, o.selecionada)), l.fonte = c, l.selecionada = o.selecionada) : l.selecionada !== o.selecionada && this.trocarIcone(l, c, d, o.selecionada);
3257
+ l.fonte !== c ? (l.layer.setLatLng(o.coordenada), l.layer.setIcon(Gt(c, d, o.selecionada)), l.fonte = c, l.selecionada = o.selecionada) : l.selecionada !== o.selecionada && this.trocarIcone(l, c, d, o.selecionada);
3258
3258
  return;
3259
3259
  }
3260
- const g = b.marker(o.coordenada, { icon: Ht(c, d, o.selecionada), pane: Z(i, s.id, "ponto"), interactive: t.interativo, keyboard: !1 });
3260
+ const g = b.marker(o.coordenada, { icon: Gt(c, d, o.selecionada), pane: Z(i, s.id, "ponto"), interactive: t.interativo, keyboard: !1 });
3261
3261
  g.on("click", (m) => this.acao(t, c, m)), r.addLayer(g), t.dom.set(e, { layer: g, fonte: c, selecionada: o.selecionada, assinatura: "" });
3262
3262
  return;
3263
3263
  }
@@ -3265,12 +3265,12 @@ class dn {
3265
3265
  if (l) {
3266
3266
  if (l.fonte !== c) {
3267
3267
  const m = l.layer;
3268
- m.setLatLng(o.coordenada), m.setIcon(Gt(c, d, o.selecionada)), t.interativo && !c.bloqueada ? (h = m.dragging) == null || h.enable() : (f = m.dragging) == null || f.disable(), l.fonte = c, l.selecionada = o.selecionada;
3268
+ m.setLatLng(o.coordenada), m.setIcon(Ut(c, d, o.selecionada)), t.interativo && !c.bloqueada ? (h = m.dragging) == null || h.enable() : (f = m.dragging) == null || f.disable(), l.fonte = c, l.selecionada = o.selecionada;
3269
3269
  } else l.selecionada !== o.selecionada && this.trocarIcone(l, c, d, o.selecionada);
3270
3270
  return;
3271
3271
  }
3272
3272
  const g = b.marker(o.coordenada, {
3273
- icon: Gt(c, d, o.selecionada),
3273
+ icon: Ut(c, d, o.selecionada),
3274
3274
  pane: Z(i, s.id, "texto"),
3275
3275
  interactive: t.interativo,
3276
3276
  draggable: t.interativo && !c.bloqueada,
@@ -3295,8 +3295,8 @@ class dn {
3295
3295
  }
3296
3296
  u && r.removeLayer(u.layer);
3297
3297
  const v = b.marker(o.coordenada, { icon: Fe(g, d), pane: Z(i, s.id, "ponto"), keyboard: !1 });
3298
- v.bindTooltip(`${g} feições agrupadas`, { direction: "top" }), Rt.set(v, o.id), v.on("click", () => {
3299
- const y = t.motor.membrosDoCluster(s.id, Rt.get(v) ?? o.id);
3298
+ v.bindTooltip(`${g} feições agrupadas`, { direction: "top" }), Bt.set(v, o.id), v.on("click", () => {
3299
+ const y = t.motor.membrosDoCluster(s.id, Bt.get(v) ?? o.id);
3300
3300
  y.length > 0 && i.fitBounds(b.latLngBounds(y.map((P) => P.coordenada)), { padding: [60, 60], maxZoom: 18 });
3301
3301
  }), r.addLayer(v), t.dom.set(e, { layer: v, fonte: null, selecionada: !1, assinatura: m });
3302
3302
  return;
@@ -3335,13 +3335,13 @@ class dn {
3335
3335
  reaproveitarCluster(t, e, o, a) {
3336
3336
  var h, f;
3337
3337
  const i = t.layer;
3338
- if (!Rt.has(i) || !e.coordenada) return !1;
3339
- Rt.set(i, e.id), i.setLatLng(e.coordenada);
3338
+ if (!Bt.has(i) || !e.coordenada) return !1;
3339
+ Bt.set(i, e.id), i.setLatLng(e.coordenada);
3340
3340
  const s = Fe(o, a ?? {}), r = (h = i.options.icon) == null ? void 0 : h.options.iconSize, c = s.options.iconSize, l = (f = i.getElement()) == null ? void 0 : f.firstElementChild;
3341
3341
  return Array.isArray(r) && Array.isArray(c) && r[0] === c[0] && l ? (i.options.icon = s, l.textContent = String(o)) : i.setIcon(s), i.setTooltipContent(`${o} feições agrupadas`), !0;
3342
3342
  }
3343
3343
  trocarIcone(t, e, o, a) {
3344
- t.layer.setIcon(e.geometria.tipo === "Text" ? Gt(e, o, a) : Ht(e, o, a)), t.selecionada = a;
3344
+ t.layer.setIcon(e.geometria.tipo === "Text" ? Ut(e, o, a) : Gt(e, o, a)), t.selecionada = a;
3345
3345
  }
3346
3346
  /** A seleção de UMA feição mudou: só o marcador DOM (ícone, texto) ou a curva dela precisa de aparência nova. */
3347
3347
  atualizarSelecaoDom(t, e) {
@@ -3366,8 +3366,8 @@ class dn {
3366
3366
  alvo: t.base,
3367
3367
  consultar: (o) => {
3368
3368
  const { map: a, layerDef: i, motor: s } = t;
3369
- if (!t.vivo || !t.interativo || !i.visivel || !sn(a)) return [];
3370
- const r = a.layerPointToContainerPoint(o), c = a.containerPointToLatLng([r.x - Nt, r.y + Nt]), l = a.containerPointToLatLng([r.x + Nt, r.y - Nt]), d = {
3369
+ if (!t.vivo || !t.interativo || !i.visivel || !rn(a)) return [];
3370
+ const r = a.layerPointToContainerPoint(o), c = a.containerPointToLatLng([r.x - $t, r.y + $t]), l = a.containerPointToLatLng([r.x + $t, r.y - $t]), d = {
3371
3371
  minLat: Math.min(c.lat, l.lat),
3372
3372
  maxLat: Math.max(c.lat, l.lat),
3373
3373
  minLon: Math.min(c.lng, l.lng),
@@ -3381,8 +3381,8 @@ class dn {
3381
3381
  const u = a.latLngToContainerPoint(m);
3382
3382
  return { x: u.x, y: u.y };
3383
3383
  }, g = [];
3384
- for (let m = 0; m < on && h.length > 0; m++) {
3385
- const u = ne({ x: r.x, y: r.y }, h, f);
3384
+ for (let m = 0; m < an && h.length > 0; m++) {
3385
+ const u = se({ x: r.x, y: r.y }, h, f);
3386
3386
  if (!u) break;
3387
3387
  h.splice(h.indexOf(u), 1);
3388
3388
  const v = s.caixaDe(i.id, u.id), y = v ? (() => {
@@ -3414,18 +3414,18 @@ class dn {
3414
3414
  });
3415
3415
  }
3416
3416
  }
3417
- function hn(n) {
3417
+ function un(n) {
3418
3418
  return String(n ?? "").trim().toLowerCase() === "canvas" ? "canvas" : "leaflet";
3419
3419
  }
3420
- class un {
3421
- constructor(t = new Wi(), e = new dn()) {
3420
+ class pn {
3421
+ constructor(t = new Xi(), e = new hn()) {
3422
3422
  p(this, "roteamento", /* @__PURE__ */ new WeakMap());
3423
3423
  this.leaflet = t, this.canvas = e;
3424
3424
  }
3425
3425
  modo(t) {
3426
3426
  var e;
3427
3427
  try {
3428
- return hn((e = t.renderizador) == null ? void 0 : e.call(t));
3428
+ return un((e = t.renderizador) == null ? void 0 : e.call(t));
3429
3429
  } catch {
3430
3430
  return "leaflet";
3431
3431
  }
@@ -3470,13 +3470,13 @@ class un {
3470
3470
  this.de(t).aplicarSelecao(t, e);
3471
3471
  }
3472
3472
  }
3473
- R.register("tile", new Ti());
3474
- R.register("wms", new Di());
3475
- R.register("vetorial-linhas", new _i());
3476
- R.register("vetorial-pontos", new Oi());
3477
- R.register("vetorial-poligonos", new qi());
3478
- R.register("grid", new Ni());
3479
- R.register("feicoes", new un());
3473
+ R.register("tile", new Di());
3474
+ R.register("wms", new _i());
3475
+ R.register("vetorial-linhas", new Fi());
3476
+ R.register("vetorial-pontos", new qi());
3477
+ R.register("vetorial-poligonos", new Ni());
3478
+ R.register("grid", new $i());
3479
+ R.register("feicoes", new pn());
3480
3480
  const Co = [
3481
3481
  {
3482
3482
  id: "satelite",
@@ -3601,11 +3601,11 @@ const Co = [
3601
3601
  scaleMode: "screen"
3602
3602
  }
3603
3603
  }
3604
- ], pn = /* @__PURE__ */ new Set(["tile", "wms", "grid"]);
3604
+ ], fn = /* @__PURE__ */ new Set(["tile", "wms", "grid"]);
3605
3605
  function ye(n, t) {
3606
3606
  return typeof n == "number" && Number.isFinite(n) ? Math.max(0, Math.min(1, n)) : t;
3607
3607
  }
3608
- class fn {
3608
+ class mn {
3609
3609
  constructor(t) {
3610
3610
  p(this, "layers", []);
3611
3611
  p(this, "layerInstances", /* @__PURE__ */ new Map());
@@ -3639,7 +3639,7 @@ class fn {
3639
3639
  }
3640
3640
  renderAllLayers(t = !1) {
3641
3641
  this.renderPendente = !1, !(!this.map || !this.context) && (this.layers.forEach((e) => {
3642
- if (!(t && pn.has(e.tipo) && e.visivel && this.layerInstances.has(e.id))) {
3642
+ if (!(t && fn.has(e.tipo) && e.visivel && this.layerInstances.has(e.id))) {
3643
3643
  if (this.layerInstances.has(e.id)) {
3644
3644
  const o = this.layerInstances.get(e.id), a = R.get(e.tipo);
3645
3645
  a && a.destroy(o, this.map), this.layerInstances.delete(e.id);
@@ -3963,7 +3963,7 @@ function aa(n, t) {
3963
3963
  }
3964
3964
  return null;
3965
3965
  }
3966
- function mn(n, t, e, o) {
3966
+ function gn(n, t, e, o) {
3967
3967
  var g, m;
3968
3968
  $e(t, n.getMap());
3969
3969
  const a = n.getMap();
@@ -4004,7 +4004,7 @@ function mn(n, t, e, o) {
4004
4004
  function $e(n, t) {
4005
4005
  n.destaqueTimeoutId !== null && (window.clearTimeout(n.destaqueTimeoutId), n.destaqueTimeoutId = null), n.destaqueMarker && (t && t.hasLayer(n.destaqueMarker) ? t.removeLayer(n.destaqueMarker) : typeof n.destaqueMarker.remove == "function" && n.destaqueMarker.remove(), n.destaqueMarker = null);
4006
4006
  }
4007
- function gn(n, t) {
4007
+ function vn(n, t) {
4008
4008
  const e = /* @__PURE__ */ new Map();
4009
4009
  n.forEach((a) => {
4010
4010
  const i = a.lat ?? a.latitude ?? a.y, s = a.lon ?? a.lng ?? a.longitude ?? a.x, r = V(i, s);
@@ -4030,7 +4030,7 @@ function gn(n, t) {
4030
4030
  });
4031
4031
  }), Array.from(o.values()).filter((a) => a.pontos && a.pontos.length > 0 || !!a.poligono_wkt);
4032
4032
  }
4033
- function vn(n, t) {
4033
+ function bn(n, t) {
4034
4034
  const e = /* @__PURE__ */ new Map();
4035
4035
  return t.forEach((o) => {
4036
4036
  o.id !== void 0 && o.id !== null && o.pontos && o.pontos.length > 0 && e.set(o.id, o.pontos);
@@ -4039,7 +4039,7 @@ function vn(n, t) {
4039
4039
  return a !== void 0 && (!o.pontos || o.pontos.length === 0) && e.has(a) ? { ...o, pontos: e.get(a) } : { ...o };
4040
4040
  });
4041
4041
  }
4042
- function bn(n, t, e = !1) {
4042
+ function yn(n, t, e = !1) {
4043
4043
  let o = [...n];
4044
4044
  e && t && t.forEach((i) => {
4045
4045
  i.pontos && o.push(...i.pontos);
@@ -4050,7 +4050,7 @@ function bn(n, t, e = !1) {
4050
4050
  }).filter((i) => i !== null);
4051
4051
  return a.length === 1 ? { single: a[0] } : a.length > 1 ? { bounds: b.latLngBounds(a) } : null;
4052
4052
  }
4053
- function yn(n, t) {
4053
+ function xn(n, t) {
4054
4054
  var i;
4055
4055
  (i = t == null ? void 0 : t.flushRender) == null || i.call(t);
4056
4056
  const e = [], o = /* @__PURE__ */ new Set(), a = (s) => {
@@ -4062,14 +4062,14 @@ function yn(n, t) {
4062
4062
  a(s), typeof s.eachLayer == "function" && s.eachLayer(a);
4063
4063
  }), e;
4064
4064
  }
4065
- function xn(n, t, e = "vertices", o) {
4065
+ function Pn(n, t, e = "vertices", o) {
4066
4066
  const a = t || [];
4067
4067
  n.layerManager.getOrCreateLayer(e, "vetorial-pontos", "Pontos / Vértices"), e === "vertices" && (n.context.pontos = a, n.canvasInteracao.ctx.pontosList = a, o && (n.customMarkerClickCallback = (i) => {
4068
4068
  const s = a.find((r) => String(r.id) === String(i)) || { id: i, lat: 0, lon: 0 };
4069
4069
  o(s);
4070
4070
  })), n.layerManager.setLayerData(e, { pontos: a, onClique: o }), n.layerManager.setLayerVisibility(e, !0);
4071
4071
  }
4072
- function Pn(n, t, e = "linhas") {
4072
+ function Cn(n, t, e = "linhas") {
4073
4073
  const o = t || [];
4074
4074
  n.layerManager.getOrCreateLayer(e, "vetorial-linhas", "Conexões / Linhas"), (e === "linhas" || e === "perimetro") && (n.context.segmentos = o.map((a) => ({
4075
4075
  ponto_inicio_id: Number(a.origemId) || 0,
@@ -4077,7 +4077,7 @@ function Pn(n, t, e = "linhas") {
4077
4077
  tipo_limite_sigef: a.tipoLinha === "tracejada" ? "LN1" : "LA1"
4078
4078
  }))), n.layerManager.setLayerData(e, { conexoes: o }), n.layerManager.setLayerVisibility(e, !0);
4079
4079
  }
4080
- function Cn(n, t, e = !0, o = "polilinha", a) {
4080
+ function Sn(n, t, e = !0, o = "polilinha", a) {
4081
4081
  const i = t || [];
4082
4082
  n.layerManager.getOrCreateLayer(o, "vetorial-linhas", "Polilinhas"), (o === "polilinha" || o === "perimetro") && (n.context.pontos = i, n.context.segmentos = [], n.canvasInteracao.ctx.pontosList = i);
4083
4083
  const s = a || n.chaveGrupo || n.context.chaveGrupo;
@@ -4088,11 +4088,11 @@ function Cn(n, t, e = !0, o = "polilinha", a) {
4088
4088
  chaveGrupo: s
4089
4089
  }), n.layerManager.setLayerVisibility(o, !0);
4090
4090
  }
4091
- function Sn(n, t, e = "poligonos") {
4091
+ function Ln(n, t, e = "poligonos") {
4092
4092
  const o = t || [];
4093
4093
  n.layerManager.getOrCreateLayer(e, "vetorial-poligonos", "Polígonos"), n.layerManager.setLayerData(e, { poligonos: o }), n.layerManager.setLayerVisibility(e, !0);
4094
4094
  }
4095
- function Ln(n, t, e) {
4095
+ function Mn(n, t, e) {
4096
4096
  const o = t || [];
4097
4097
  if (e != null) {
4098
4098
  const a = e || [];
@@ -4103,7 +4103,7 @@ function Ln(n, t, e) {
4103
4103
  ...e != null ? { pontos: n.context.pontos } : {}
4104
4104
  });
4105
4105
  }
4106
- function Mn(n, t = !1) {
4106
+ function An(n, t = !1) {
4107
4107
  n.context.pontos = [], n.context.segmentos = [], n.context.confrontantes = [], n.canvasInteracao.ctx.pontosList = [], n.canvasInteracao.limparSelecao();
4108
4108
  const e = {
4109
4109
  pontos: [],
@@ -4115,7 +4115,7 @@ function Mn(n, t = !1) {
4115
4115
  function So(n) {
4116
4116
  return n != null && !isNaN(Number(n)) && String(n).trim() !== "" ? Number(n) : n;
4117
4117
  }
4118
- function An(n, t) {
4118
+ function zn(n, t) {
4119
4119
  var r, c;
4120
4120
  const e = n.core.map, o = n.layerManager.getLayerDef(t.layerId), a = t.baseSize || 8, i = ((r = n.context.graphicScale) == null ? void 0 : r.markerScaleMultiplier) || 1;
4121
4121
  if (e && ((c = o == null ? void 0 : o.estilo) == null ? void 0 : c.scaleMode) === "world") {
@@ -4125,8 +4125,8 @@ function An(n, t) {
4125
4125
  const s = Ko(t.densTotal || 0, (e == null ? void 0 : e.getZoom()) ?? 18);
4126
4126
  return Math.max(s < 1 ? 5 : 4, Math.round(a * i * s));
4127
4127
  }
4128
- function zn(n, t, e, o, a) {
4129
- const i = An(n, e), s = n.context.config.enableAnimations ? "cad-pt-anim" : "", r = te(
4128
+ function wn(n, t, e, o, a) {
4129
+ const i = zn(n, e), s = n.context.config.enableAnimations ? "cad-pt-anim" : "", r = ee(
4130
4130
  e.shapeStyle,
4131
4131
  i,
4132
4132
  e.markerBg,
@@ -4141,7 +4141,7 @@ function zn(n, t, e, o, a) {
4141
4141
  iconSize: [i + 6, i + 6]
4142
4142
  }));
4143
4143
  }
4144
- function wn(n) {
4144
+ function En(n) {
4145
4145
  const t = n.context.selectedPontoIds || [], e = n.canvasInteracao.ctx.selectedVizinhoPontoIds || [], o = /* @__PURE__ */ new Set([
4146
4146
  ...t.map(String),
4147
4147
  ...e.map(String)
@@ -4151,12 +4151,12 @@ function wn(n) {
4151
4151
  if (s == null) continue;
4152
4152
  const r = o.has(String(s));
4153
4153
  if (i.isSelected === r) continue;
4154
- i.isSelected = r, a.setZIndexOffset(r ? 2e3 : 0), i.shapeStyle && i.baseSize && i.markerBg && zn(n, a, i, s, r);
4154
+ i.isSelected = r, a.setZIndexOffset(r ? 2e3 : 0), i.shapeStyle && i.baseSize && i.markerBg && wn(n, a, i, s, r);
4155
4155
  const c = a.getElement();
4156
4156
  c && (r ? c.classList.add("cad-marker-selected", "ponto-selecionado") : c.classList.remove("cad-marker-selected", "ponto-selecionado"));
4157
4157
  }
4158
4158
  }
4159
- class En {
4159
+ class kn {
4160
4160
  constructor(t) {
4161
4161
  p(this, "core");
4162
4162
  p(this, "layerManager");
@@ -4172,7 +4172,7 @@ class En {
4172
4172
  destaqueMarker: null,
4173
4173
  destaqueTimeoutId: null
4174
4174
  });
4175
- this.core = new yi(this), this.layerManager = new fn(t), this.canvasInteracao = new Ii({
4175
+ this.core = new xi(this), this.layerManager = new mn(t), this.canvasInteracao = new Ti({
4176
4176
  mapaController: this,
4177
4177
  layerManager: this.layerManager
4178
4178
  }), this.context = {
@@ -4237,16 +4237,16 @@ class En {
4237
4237
  this.context.confrontantes = e, this.layerManager.updateContext({ confrontantes: e });
4238
4238
  }
4239
4239
  plotarPontos(t, e = "vertices", o) {
4240
- xn(this, t, e, o);
4240
+ Pn(this, t, e, o);
4241
4241
  }
4242
4242
  plotarConexoes(t, e = "linhas") {
4243
- Pn(this, t, e);
4243
+ Cn(this, t, e);
4244
4244
  }
4245
4245
  plotarPolilinhaSequencial(t, e = !0, o = "polilinha", a) {
4246
- Cn(this, t, e, o, a);
4246
+ Sn(this, t, e, o, a);
4247
4247
  }
4248
4248
  plotarPoligonos(t, e = "poligonos") {
4249
- Sn(this, t, e);
4249
+ Ln(this, t, e);
4250
4250
  }
4251
4251
  limparCamadas(t) {
4252
4252
  this.layerManager.clearLayers(t), (!t || t.length === 0) && this.canvasInteracao.limparSelecao();
@@ -4268,7 +4268,7 @@ class En {
4268
4268
  e && (this.customMarkerClickCallback = e), this.setPontos(t || []);
4269
4269
  }
4270
4270
  plotSegmentos(t, e) {
4271
- Ln(this, t, e);
4271
+ Mn(this, t, e);
4272
4272
  }
4273
4273
  plotPolilinhaTemporaria(t) {
4274
4274
  const e = t || [];
@@ -4279,15 +4279,15 @@ class En {
4279
4279
  this.setBancoPontos(e), this.layerManager.setLayerVisibility("homologados", !0), this.layerManager.setLayerVisibility("homologados-pontos", !0);
4280
4280
  }
4281
4281
  plotPontosVizinhos(t) {
4282
- const e = gn(t || [], this.context.confrontantes || []);
4282
+ const e = vn(t || [], this.context.confrontantes || []);
4283
4283
  this.setConfrontantes(e), this.layerManager.setLayerVisibility("vizinhos", !0);
4284
4284
  }
4285
4285
  plotPoligonosVizinhos(t) {
4286
- const e = vn(t || [], this.context.confrontantes || []);
4286
+ const e = bn(t || [], this.context.confrontantes || []);
4287
4287
  this.setConfrontantes(e), this.layerManager.setLayerVisibility("vizinhos", !0);
4288
4288
  }
4289
4289
  clearOverlays(t = !1) {
4290
- Mn(this, t);
4290
+ An(this, t);
4291
4291
  }
4292
4292
  setGraphicScale(t) {
4293
4293
  this.layerManager.setGraphicScale(t);
@@ -4309,7 +4309,7 @@ class En {
4309
4309
  this.canvasInteracao.ctx.selectedPontoIds = [i], this.canvasInteracao.ctx.lastSelectedPontoId = i, this.context.selectedPontoIds = [i], this.atualizarDestaqueMarcadores();
4310
4310
  }
4311
4311
  atualizarDestaqueMarcadores() {
4312
- wn(this);
4312
+ En(this);
4313
4313
  }
4314
4314
  selectSegmento(t) {
4315
4315
  const e = t != null ? String(t) : null;
@@ -4317,7 +4317,7 @@ class En {
4317
4317
  }
4318
4318
  fitBounds(t, e = [40, 40], o = !1) {
4319
4319
  if (!this.core.map) return;
4320
- const a = bn(t || this.context.pontos || [], this.context.confrontantes, o);
4320
+ const a = yn(t || this.context.pontos || [], this.context.confrontantes, o);
4321
4321
  if (a) {
4322
4322
  a.single ? this.core.map.setView(a.single, 18) : a.bounds && (this.core.map.fitBounds(a.bounds, { padding: e }), this.core.map.once("moveend", () => {
4323
4323
  this.core.preCarregarTilesRegiao(a.bounds);
@@ -4329,7 +4329,7 @@ class En {
4329
4329
  }
4330
4330
  }
4331
4331
  getMarkers() {
4332
- return yn(this.core.map, this.layerManager);
4332
+ return xn(this.core.map, this.layerManager);
4333
4333
  }
4334
4334
  getVizinhosMarkers() {
4335
4335
  return this.getMarkers().filter((t) => !!t.isVizinho);
@@ -4341,7 +4341,7 @@ class En {
4341
4341
  return aa(this, t);
4342
4342
  }
4343
4343
  destacarElemento(t, e) {
4344
- mn(this, this.destaqueState, t, e);
4344
+ gn(this, this.destaqueState, t, e);
4345
4345
  }
4346
4346
  limparDestaque() {
4347
4347
  $e(this.destaqueState, this.getMap());
@@ -4359,7 +4359,7 @@ class En {
4359
4359
  return this.core.map;
4360
4360
  }
4361
4361
  }
4362
- function kn(n, t, e, o) {
4362
+ function In(n, t, e, o) {
4363
4363
  if (!n) return;
4364
4364
  if (n.querySelectorAll(".layer-item").length === t.length) {
4365
4365
  t.forEach((i) => {
@@ -4439,7 +4439,7 @@ function kn(n, t, e, o) {
4439
4439
  });
4440
4440
  });
4441
4441
  }
4442
- function In(n) {
4442
+ function Tn(n) {
4443
4443
  return n.context.selectedPontoIds || n.canvasInteracao.ctx.selectedPontoIds || [];
4444
4444
  }
4445
4445
  function ia(n, t) {
@@ -4449,11 +4449,11 @@ function We(n) {
4449
4449
  const t = n;
4450
4450
  return (t == null ? void 0 : t.originalEvent) || t || {};
4451
4451
  }
4452
- function Tn(n) {
4452
+ function Dn(n) {
4453
4453
  const t = n, e = We(n), o = typeof e.composedPath == "function" ? e.composedPath() : [];
4454
4454
  return o.length > 0 ? o[0] : e.target || (t == null ? void 0 : t.target) || null;
4455
4455
  }
4456
- function Dn(n, t, e) {
4456
+ function _n(n, t, e) {
4457
4457
  var i, s, r, c;
4458
4458
  if (t) return { x: Math.round(t.x), y: Math.round(t.y) };
4459
4459
  const o = n;
@@ -4468,21 +4468,21 @@ function Dn(n, t, e) {
4468
4468
  y: Math.round((a.clientY ?? 0) - e.top)
4469
4469
  };
4470
4470
  }
4471
- function _n(n, t) {
4471
+ function Fn(n, t) {
4472
4472
  const e = t || (n == null ? void 0 : n.latlng);
4473
4473
  return e && typeof e.lat == "number" ? { lat: e.lat, lng: e.lng ?? e.lon ?? 0 } : null;
4474
4474
  }
4475
- function Fn(n, t, e, o) {
4475
+ function On(n, t, e, o) {
4476
4476
  var m, u;
4477
4477
  if (n.modoSequencial || n.controller.canvasInteracao.selectionHappened || n.controller.canvasInteracao.panHappened || n.mouseMovedSinceDown) return !1;
4478
- const a = We(t), i = Tn(t);
4478
+ const a = We(t), i = Dn(t);
4479
4479
  if (i) {
4480
4480
  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"]';
4481
4481
  if (((m = i.matches) == null ? void 0 : m.call(i, v)) || ((u = i.closest) == null ? void 0 : u.call(i, v))) return !1;
4482
4482
  }
4483
4483
  const s = n.controller.getMap();
4484
4484
  if (!s || !n.mapContainer) return !1;
4485
- const r = Dn(t, o, n.mapContainer.getBoundingClientRect()), l = _n(t, e) ?? s.containerPointToLatLng(b.point(r.x, r.y)), d = l.lat, h = l.lng, f = n.controller.layerManager ? n.controller.layerManager.getLayers().filter((v) => v.visivel).map((v) => v.id) : [], g = a;
4485
+ const r = _n(t, o, n.mapContainer.getBoundingClientRect()), l = Fn(t, e) ?? s.containerPointToLatLng(b.point(r.x, r.y)), d = l.lat, h = l.lng, f = n.controller.layerManager ? n.controller.layerManager.getLayers().filter((v) => v.visivel).map((v) => v.id) : [], g = a;
4486
4486
  return n.host.dispatchEvent(new CustomEvent("ui-canvas-clique", {
4487
4487
  detail: {
4488
4488
  coordenadas: {
@@ -4500,7 +4500,7 @@ function Fn(n, t, e, o) {
4500
4500
  composed: !0
4501
4501
  })), !0;
4502
4502
  }
4503
- function On(n, t, e, o) {
4503
+ function qn(n, t, e, o) {
4504
4504
  const a = o || n.obterElementoPorId(e);
4505
4505
  n.host.dispatchEvent(new CustomEvent("ui-acao-popup", {
4506
4506
  detail: {
@@ -4512,7 +4512,7 @@ function On(n, t, e, o) {
4512
4512
  composed: !0
4513
4513
  })), n.fecharPopup();
4514
4514
  }
4515
- function qn(n, t, e, o, a, i, s) {
4515
+ function Nn(n, t, e, o, a, i, s) {
4516
4516
  let r = o || n.obterElementoPorId(t), c = a;
4517
4517
  if (!c && r) {
4518
4518
  const l = r, d = l.lat ?? l.latitude ?? 0, h = l.lon ?? l.lng ?? l.longitude ?? 0;
@@ -4553,7 +4553,7 @@ function qn(n, t, e, o, a, i, s) {
4553
4553
  composed: !0
4554
4554
  }));
4555
4555
  }
4556
- function Nn(n, t, e, o, a) {
4556
+ function $n(n, t, e, o, a) {
4557
4557
  if (n.modoSequencial) {
4558
4558
  n.fecharPopup();
4559
4559
  return;
@@ -4585,7 +4585,7 @@ function Nn(n, t, e, o, a) {
4585
4585
  composed: !0
4586
4586
  }));
4587
4587
  }
4588
- function $n(n, t) {
4588
+ function Rn(n, t) {
4589
4589
  let e = null, o = null, a = 0, i = 0;
4590
4590
  function s() {
4591
4591
  var d;
@@ -4621,7 +4621,7 @@ function $n(n, t) {
4621
4621
  invalidateSizeSafely: s
4622
4622
  };
4623
4623
  }
4624
- class Rn {
4624
+ class Bn {
4625
4625
  constructor(t) {
4626
4626
  p(this, "canal", null);
4627
4627
  p(this, "contexto");
@@ -4682,10 +4682,10 @@ class Rn {
4682
4682
  }
4683
4683
  }
4684
4684
  }
4685
- class Bn {
4685
+ class Vn {
4686
4686
  constructor(t) {
4687
4687
  p(this, "contexto");
4688
- p(this, "uiListeners", new Kt());
4688
+ p(this, "uiListeners", new Qt());
4689
4689
  p(this, "isLayersPanelOpen", !1);
4690
4690
  p(this, "mouseMovedSinceDown", !1);
4691
4691
  p(this, "mouseDownPos", { x: 0, y: 0 });
@@ -4745,7 +4745,7 @@ class Bn {
4745
4745
  this.uiListeners.cleanup();
4746
4746
  }
4747
4747
  }
4748
- class Vn {
4748
+ class jn {
4749
4749
  constructor(t) {
4750
4750
  p(this, "contexto");
4751
4751
  p(this, "_pontos", []);
@@ -4845,12 +4845,12 @@ class Vn {
4845
4845
  return this.contexto.obterController().getVizinhosMarkers();
4846
4846
  }
4847
4847
  }
4848
- const jn = ':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:var(--ui-degrade-interno, var(--ui-canvas-cad-fundo, #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:var(--ui-canvas-cad-viewport-fundo, #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:var(--ui-degrade-interno, var(--ui-canvas-cad-camadas-fundo, rgba(10, 18, 14, .92)));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: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-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}.cad-coordenadas-hud{position:absolute;top:var(--ui-cad-hud-coordenadas-topo, auto);bottom:var(--ui-cad-hud-coordenadas-base, 8px);left:var(--ui-cad-hud-coordenadas-esquerda, auto);right:var(--ui-cad-hud-coordenadas-direita, 12px);z-index:var(--ui-z-workspace-hud, 500);display:flex;align-items:center;gap:8px;padding:3px 8px;transition:bottom .25s cubic-bezier(.16,1,.3,1),left .25s cubic-bezier(.16,1,.3,1);background:#0a120ee0;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid rgba(255,255,255,.12);border-radius:var(--ui-raio-sm, 4px);font-family:var(--ui-fonte-codigo, monospace);font-size:11px;color:#ffffffd9;pointer-events:none;-webkit-user-select:none;user-select:none;box-shadow:0 4px 12px #0006}:host([sem-hud-coordenadas]) .cad-coordenadas-hud{display:none!important}.cad-coordenadas-hud .cad-coord-fuso{color:#00f5a0;font-weight:700;padding:1px 4px;background:#00f5a01f;border-radius:2px}.cad-coordenadas-hud .cad-coord-utm{color:#fffffff2;font-weight:500}.cad-coordenadas-hud .cad-coord-geo{color:#fff9;font-size:10px}.cad-coordenadas-hud .cad-coord-zoom{color:#fff9;font-size:10px;padding-left:8px;border-left:1px solid rgba(255,255,255,.15)}.cad-coordenadas-hud>span{font-variant-numeric:tabular-nums;white-space:nowrap}';
4849
- function Hn() {
4848
+ const Hn = ':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:var(--ui-degrade-interno, var(--ui-canvas-cad-fundo, #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:var(--ui-canvas-cad-viewport-fundo, #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:var(--ui-degrade-interno, var(--ui-canvas-cad-camadas-fundo, rgba(10, 18, 14, .92)));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: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-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}.cad-coordenadas-hud{position:absolute;top:var(--ui-cad-hud-coordenadas-topo, auto);bottom:var(--ui-cad-hud-coordenadas-base, 8px);left:var(--ui-cad-hud-coordenadas-esquerda, auto);right:var(--ui-cad-hud-coordenadas-direita, 12px);z-index:var(--ui-z-workspace-hud, 500);display:flex;align-items:center;gap:8px;padding:3px 8px;transition:bottom .25s cubic-bezier(.16,1,.3,1),left .25s cubic-bezier(.16,1,.3,1);background:#0a120ee0;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid rgba(255,255,255,.12);border-radius:var(--ui-raio-sm, 4px);font-family:var(--ui-fonte-codigo, monospace);font-size:11px;color:#ffffffd9;pointer-events:none;-webkit-user-select:none;user-select:none;box-shadow:0 4px 12px #0006}:host([sem-hud-coordenadas]) .cad-coordenadas-hud{display:none!important}.cad-coordenadas-hud .cad-coord-fuso{color:#00f5a0;font-weight:700;padding:1px 4px;background:#00f5a01f;border-radius:2px}.cad-coordenadas-hud .cad-coord-utm{color:#fffffff2;font-weight:500}.cad-coordenadas-hud .cad-coord-geo{color:#fff9;font-size:10px}.cad-coordenadas-hud .cad-coord-zoom{color:#fff9;font-size:10px;padding-left:8px;border-left:1px solid rgba(255,255,255,.15)}.cad-coordenadas-hud>span{font-variant-numeric:tabular-nums;white-space:nowrap}';
4849
+ function Gn() {
4850
4850
  return `
4851
4851
  <style>
4852
4852
  ${_a}
4853
- ${jn}
4853
+ ${Hn}
4854
4854
  </style>
4855
4855
  <div class="cad-root" id="cad-root" part="base" role="region" aria-label="Mapa CAD">
4856
4856
  <div class="cad-map-container" id="cad-map-container" part="viewport"></div>
@@ -4891,34 +4891,34 @@ function Hn() {
4891
4891
  </div>
4892
4892
  `;
4893
4893
  }
4894
- const Gn = 1, Un = 60;
4895
- function oe(n) {
4894
+ const Un = 1, Zn = 60;
4895
+ function ae(n) {
4896
4896
  let t;
4897
4897
  if (typeof n == "number") t = Number.isFinite(n) ? Math.trunc(n) : NaN;
4898
4898
  else if (typeof n == "string") t = parseInt(n.trim(), 10);
4899
4899
  else return null;
4900
- return Number.isInteger(t) && t >= Gn && t <= Un ? t : null;
4900
+ return Number.isInteger(t) && t >= Un && t <= Zn ? t : null;
4901
4901
  }
4902
- const Zn = Object.freeze({
4902
+ const Wn = Object.freeze({
4903
4903
  fuso: "—",
4904
4904
  utm: "E: — | N: —",
4905
4905
  geo: "Lat: — Lon: —"
4906
4906
  });
4907
- function Wn(n) {
4907
+ function Xn(n) {
4908
4908
  if (typeof n != "number" || !Number.isFinite(n)) return "Zoom: —";
4909
4909
  const t = Math.round(n * 10) / 10;
4910
4910
  return `Zoom: ${Number.isInteger(t) ? t.toFixed(0) : t.toFixed(1)}`;
4911
4911
  }
4912
- function Xn(n, t, e) {
4912
+ function Kn(n, t, e) {
4913
4913
  if (!Number.isFinite(n) || !Number.isFinite(t)) return null;
4914
- const o = Da(n, t, oe(e) ?? void 0);
4914
+ const o = Da(n, t, ae(e) ?? void 0);
4915
4915
  return {
4916
4916
  fuso: o ? `${o.fuso}${o.hemisferio}` : "—",
4917
4917
  utm: `E: ${ao(o == null ? void 0 : o.este, 2)} m | N: ${ao(o == null ? void 0 : o.norte, 2)} m`.replace(/— m/g, "—"),
4918
4918
  geo: `Lat: ${n.toFixed(6)}° Lon: ${t.toFixed(6)}°`
4919
4919
  };
4920
4920
  }
4921
- function Kn(n, t, e, o) {
4921
+ function Qn(n, t, e, o) {
4922
4922
  if (e !== o) {
4923
4923
  if (t === "sat-opacity") {
4924
4924
  const a = parseFloat(o);
@@ -4930,7 +4930,7 @@ function Kn(n, t, e, o) {
4930
4930
  else if (t === "chave-grupo")
4931
4931
  n.host.chaveGrupo = o || void 0;
4932
4932
  else if (t === "zona-projecao" || t === "fuso") {
4933
- const a = oe(o);
4933
+ const a = ae(o);
4934
4934
  a !== null && (n.atualizarZonaProjecao(a), t === "fuso" && n.host.getAttribute("zona-projecao") !== o ? n.host.setAttribute("zona-projecao", o) : t === "zona-projecao" && n.host.hasAttribute("fuso") && n.host.getAttribute("fuso") !== o && n.host.setAttribute("fuso", o), n.controller.zonaProjecao = a, n.controller.context.zonaProjecao = a);
4935
4935
  } else if (t === "canal-configuracao")
4936
4936
  n.broadcastConfig.conectar(o);
@@ -4956,7 +4956,7 @@ function na(n) {
4956
4956
  }
4957
4957
  return !0;
4958
4958
  }
4959
- function Qn(n) {
4959
+ function Yn(n) {
4960
4960
  if (!n.mapContainer) return;
4961
4961
  if (n.controller.getMap() || na(n.mapContainer), n.controller.init(n.mapContainer, n.shadow), n.toolbarPainel.vincularEventos(), n.renderLayersUI(), n.host.hasAttribute("modo-sequencial") && (n.controller.modoCliqueSequencialAtivo = !0, n.controller.context.modoSequencial = !0), n.host.hasAttribute("chave-grupo")) {
4962
4962
  const o = n.host.getAttribute("chave-grupo");
@@ -4979,7 +4979,7 @@ function Qn(n) {
4979
4979
  });
4980
4980
  const t = n.controller.context.onMarkerClick;
4981
4981
  n.controller.context.onMarkerClick = (o, a, i, s) => {
4982
- qn(
4982
+ Nn(
4983
4983
  n.obterContextoEventos(),
4984
4984
  o,
4985
4985
  a,
@@ -4989,7 +4989,7 @@ function Qn(n) {
4989
4989
  n.colecoesDados.customMarkerClickHandler
4990
4990
  );
4991
4991
  }, n.controller.context.onSegmentoClick = (o, a, i) => {
4992
- Nn(
4992
+ $n(
4993
4993
  n.obterContextoEventos(),
4994
4994
  o,
4995
4995
  a,
@@ -5005,12 +5005,12 @@ function Qn(n) {
5005
5005
  n.invalidateSizeSafely();
5006
5006
  }, 150);
5007
5007
  }
5008
- const Yn = {
5008
+ const Jn = {
5009
5009
  "sem-camada": "Escolha uma camada de desenho antes de usar esta ferramenta.",
5010
5010
  "camada-invalida": "A camada de desenho não é uma camada de feições.",
5011
5011
  "camada-bloqueada": "A camada de desenho está bloqueada.",
5012
5012
  "geometria-invalida": "Não foi possível criar a figura: a geometria é inválida."
5013
- }, Jn = {
5013
+ }, ts = {
5014
5014
  bloqueada: "Esta feição (ou a camada dela) está bloqueada e não pode ser editada.",
5015
5015
  "poligono-com-furos": "Polígono com furos não pode ser editado no mapa.",
5016
5016
  multiparte: "Feição com várias partes não pode ser editada no mapa.",
@@ -5022,13 +5022,13 @@ const Yn = {
5022
5022
  function sa(n, t, e) {
5023
5023
  return typeof t == "string" && Object.prototype.hasOwnProperty.call(n, t) ? n[t] : e;
5024
5024
  }
5025
- function ts(n) {
5026
- return sa(Yn, n, "Não foi possível ativar a ferramenta de desenho.");
5027
- }
5028
5025
  function es(n) {
5029
- return sa(Jn, n, "Não foi possível editar os vértices desta feição.");
5026
+ return sa(Jn, n, "Não foi possível ativar a ferramenta de desenho.");
5030
5027
  }
5031
5028
  function os(n) {
5029
+ return sa(ts, n, "Não foi possível editar os vértices desta feição.");
5030
+ }
5031
+ function as(n) {
5032
5032
  n.querySelectorAll(".cad-quick-toolbar .cad-btn-tool, .layer-panel-close").forEach((t) => {
5033
5033
  const e = t.getAttribute("title");
5034
5034
  e && !t.hasAttribute("aria-label") && t.setAttribute("aria-label", e);
@@ -5038,38 +5038,38 @@ function Lo(n, t) {
5038
5038
  const e = n.getElementById("btn-toggle-snap");
5039
5039
  e == null || e.classList.toggle("active", t), e == null || e.setAttribute("aria-pressed", String(t));
5040
5040
  }
5041
- function as(n) {
5041
+ function is(n) {
5042
5042
  return n <= 0 ? "Nenhuma feição selecionada" : n === 1 ? "1 feição selecionada" : `${n} feições selecionadas`;
5043
5043
  }
5044
- function is(n) {
5044
+ function ns(n) {
5045
5045
  return n ? `Ferramenta ${n} ativa` : "Ferramenta desativada";
5046
5046
  }
5047
5047
  function xe(n, t) {
5048
5048
  const e = n.getElementById("cad-status");
5049
5049
  e && e.textContent !== t && (e.textContent = t);
5050
5050
  }
5051
- const ns = 5e3;
5052
- function ss(n, t, e) {
5051
+ const ss = 5e3;
5052
+ function rs(n, t, e) {
5053
5053
  const o = n.getElementById("cad-aviso");
5054
5054
  return o ? (e !== void 0 && window.clearTimeout(e), o.textContent = t, o.hidden = !1, window.setTimeout(() => {
5055
5055
  o.hidden = !0, o.textContent = "";
5056
- }, ns)) : e;
5056
+ }, ss)) : e;
5057
5057
  }
5058
- function rs(n, t) {
5058
+ function cs(n, t) {
5059
5059
  let e;
5060
5060
  const o = (c) => (l) => {
5061
5061
  var h;
5062
5062
  if (n.hasAttribute("sem-avisos")) return;
5063
5063
  const d = c((h = l.detail) == null ? void 0 : h.motivo);
5064
- xe(t, d), e = ss(t, d, e);
5065
- }, a = o(ts), i = o(es), s = (c) => {
5064
+ xe(t, d), e = rs(t, d, e);
5065
+ }, a = o(es), i = o(os), s = (c) => {
5066
5066
  var d;
5067
5067
  const l = (d = c.detail) == null ? void 0 : d.feicoes;
5068
- xe(t, as(Array.isArray(l) ? l.length : 0));
5068
+ xe(t, is(Array.isArray(l) ? l.length : 0));
5069
5069
  }, r = (c) => {
5070
5070
  var d;
5071
5071
  const l = ((d = c.detail) == null ? void 0 : d.ferramenta) ?? null;
5072
- xe(t, is(l));
5072
+ xe(t, ns(l));
5073
5073
  };
5074
5074
  return n.addEventListener("cad-selecao", s), n.addEventListener("cad-ferramenta", r), n.addEventListener("cad-desenho-recusado", a), n.addEventListener("cad-edicao-recusada", i), () => {
5075
5075
  n.removeEventListener("cad-selecao", s), n.removeEventListener("cad-ferramenta", r), n.removeEventListener("cad-desenho-recusado", a), n.removeEventListener("cad-edicao-recusada", i), e !== void 0 && window.clearTimeout(e), e = void 0;
@@ -5089,23 +5089,23 @@ function J(n, t) {
5089
5089
  const a = V(e, o, t);
5090
5090
  return !a || !Number.isFinite(a.lat) || !Number.isFinite(a.lon) ? null : [a.lat, a.lon];
5091
5091
  }
5092
- function cs(n, t) {
5092
+ function ls(n, t) {
5093
5093
  return n[0] === t[0] && n[1] === t[1];
5094
5094
  }
5095
5095
  function ra(n, t) {
5096
5096
  const e = n.map((o) => J(o, t)).filter((o) => o !== null);
5097
- return e.length > 1 && cs(e[0], e[e.length - 1]) && e.pop(), e.length >= 3 ? e : null;
5097
+ return e.length > 1 && ls(e[0], e[e.length - 1]) && e.pop(), e.length >= 3 ? e : null;
5098
5098
  }
5099
5099
  function Mo(n, t) {
5100
5100
  const e = n.map((o) => J(o, t)).filter((o) => o !== null);
5101
5101
  return e.length >= 2 ? e : null;
5102
5102
  }
5103
- function ls(n, t) {
5103
+ function ds(n, t) {
5104
5104
  if (!Array.isArray(n) || n.length === 0) return null;
5105
5105
  const o = (Array.isArray(n[0]) && Array.isArray(n[0][0]) ? n : [n]).map((a) => ra(a, t));
5106
5106
  return o.some((a) => a === null) ? null : o;
5107
5107
  }
5108
- function Yr(n, t) {
5108
+ function Jr(n, t) {
5109
5109
  const e = V(n.lat, n.lon);
5110
5110
  return e ? {
5111
5111
  id: String(n.id),
@@ -5114,7 +5114,7 @@ function Yr(n, t) {
5114
5114
  propriedades: { ...n }
5115
5115
  } : null;
5116
5116
  }
5117
- function Jr(n, t, e) {
5117
+ function tc(n, t, e) {
5118
5118
  const o = t.get(String(n.ponto_inicio_id)), a = t.get(String(n.ponto_fim_id));
5119
5119
  if (!o || !a) return null;
5120
5120
  const i = V(o.lat, o.lon), s = V(a.lat, a.lon);
@@ -5128,7 +5128,7 @@ function Jr(n, t, e) {
5128
5128
  propriedades: { ...n }
5129
5129
  };
5130
5130
  }
5131
- function tc(n, t) {
5131
+ function ec(n, t) {
5132
5132
  if (!n.poligono_wkt) return null;
5133
5133
  const e = /POLYGON\s*\(\s*\(\s*(.*?)\s*\)\s*\)/i.exec(n.poligono_wkt);
5134
5134
  if (!e) return null;
@@ -5155,11 +5155,11 @@ function Ao(n, t) {
5155
5155
  }
5156
5156
  return o;
5157
5157
  }
5158
- const ds = /* @__PURE__ */ new Set(["Point", "LineString", "Polygon", "Circle", "Text"]);
5158
+ const hs = /* @__PURE__ */ new Set(["Point", "LineString", "Polygon", "Circle", "Text"]);
5159
5159
  function Pe(n, t, e) {
5160
5160
  if (!n || typeof n != "object") return null;
5161
5161
  const o = n, a = o.geometria;
5162
- if (!a || !ds.has(a.tipo) || o.id === void 0 || o.id === null || o.id === "") return null;
5162
+ if (!a || !hs.has(a.tipo) || o.id === void 0 || o.id === null || o.id === "") return null;
5163
5163
  let i = null;
5164
5164
  switch (a.tipo) {
5165
5165
  case "Point": {
@@ -5185,7 +5185,7 @@ function Pe(n, t, e) {
5185
5185
  break;
5186
5186
  }
5187
5187
  case "Polygon": {
5188
- const r = Array.isArray(a.aneis) ? ls(a.aneis, e) : null;
5188
+ const r = Array.isArray(a.aneis) ? ds(a.aneis, e) : null;
5189
5189
  r && (i = { tipo: "Polygon", aneis: r });
5190
5190
  const c = r && r.length === 1 ? Ao(a.curva, e) : null;
5191
5191
  i && c && c.length >= 3 && (i = { tipo: "Polygon", aneis: [Je(c, !0)], curva: c });
@@ -5210,7 +5210,7 @@ function Pe(n, t, e) {
5210
5210
  };
5211
5211
  return o.oculta && (s.oculta = !0), (typeof o.entidadeId == "string" || typeof o.entidadeId == "number") && (s.entidadeId = String(o.entidadeId)), s.status = vt({ ...s, status: o.status }), s;
5212
5212
  }
5213
- const hs = 8;
5213
+ const us = 8;
5214
5214
  function Re(n, t, e) {
5215
5215
  if (n === t) return !0;
5216
5216
  if (typeof n != "object" || typeof t != "object" || n === null || t === null || e <= 0) return !1;
@@ -5229,21 +5229,21 @@ function Re(n, t, e) {
5229
5229
  for (const r in a) Object.prototype.hasOwnProperty.call(a, r) && s++;
5230
5230
  return i === s;
5231
5231
  }
5232
- function us(n, t) {
5233
- return !n || !t ? !1 : n === t ? !0 : Re(n, t, hs);
5232
+ function ps(n, t) {
5233
+ return !n || !t ? !1 : n === t ? !0 : Re(n, t, us);
5234
5234
  }
5235
- const Ce = "cad-cursores", ps = /^#[0-9a-f]{3,8}$/i, fs = "#94a3b8";
5235
+ const Ce = "cad-cursores", fs = /^#[0-9a-f]{3,8}$/i, ms = "#94a3b8";
5236
5236
  function Be(n) {
5237
- return typeof n == "string" && ps.test(n.trim()) ? n.trim() : fs;
5237
+ return typeof n == "string" && fs.test(n.trim()) ? n.trim() : ms;
5238
5238
  }
5239
- const ms = '<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>';
5239
+ const gs = '<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>';
5240
5240
  function zo(n) {
5241
5241
  const t = document.createElement("div");
5242
- t.style.cssText = `color:${Be(n.cor)};position:relative;pointer-events:none`, t.innerHTML = ms;
5242
+ t.style.cssText = `color:${Be(n.cor)};position:relative;pointer-events:none`, t.innerHTML = gs;
5243
5243
  const e = document.createElement("span");
5244
5244
  return e.textContent = String(n.nome ?? n.id), e.style.cssText = `position:absolute;left:16px;top:14px;white-space:nowrap;font:600 11px sans-serif;color:#fff;background:${Be(n.cor)};padding:1px 5px;border-radius:3px;max-width:160px;overflow:hidden;text-overflow:ellipsis`, t.appendChild(e), b.divIcon({ className: "custom-leaflet-marker cad-cursor-remoto", iconSize: [18, 18], iconAnchor: [3, 2], html: t });
5245
5245
  }
5246
- class gs {
5246
+ class vs {
5247
5247
  constructor(t) {
5248
5248
  p(this, "marcadores", /* @__PURE__ */ new Map());
5249
5249
  this.obterMapa = t;
@@ -5271,7 +5271,7 @@ class gs {
5271
5271
  }
5272
5272
  }
5273
5273
  const At = (n) => `${n.camadaId}\0${n.id}`;
5274
- class vs {
5274
+ class bs {
5275
5275
  constructor(t) {
5276
5276
  p(this, "itens", /* @__PURE__ */ new Map());
5277
5277
  this.dep = t;
@@ -5358,13 +5358,13 @@ class vs {
5358
5358
  this.dep.aoSelecionar(o), o.length <= 1 && this.dep.aoSelecionarUma(o[0] ?? null);
5359
5359
  }
5360
5360
  }
5361
- const bs = {
5361
+ const ys = {
5362
5362
  Point: "Ponto",
5363
5363
  LineString: "Linha",
5364
5364
  Polygon: "Polígono",
5365
5365
  Circle: "Círculo",
5366
5366
  Text: "Texto"
5367
- }, ys = /* @__PURE__ */ new Set([
5367
+ }, xs = /* @__PURE__ */ new Set([
5368
5368
  "name",
5369
5369
  "nome",
5370
5370
  "category",
@@ -5386,15 +5386,15 @@ function zt(n, t) {
5386
5386
  }
5387
5387
  return "";
5388
5388
  }
5389
- function xs(n) {
5389
+ function Ps(n) {
5390
5390
  const t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(n), e = t ? new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3])) : new Date(n);
5391
5391
  return Number.isNaN(e.getTime()) ? n : e.toLocaleDateString("pt-BR");
5392
5392
  }
5393
- function Ps(n) {
5393
+ function Cs(n) {
5394
5394
  const t = typeof n == "object" ? JSON.stringify(n) : String(n);
5395
5395
  return t.length > 80 ? `${t.slice(0, 77)}...` : t;
5396
5396
  }
5397
- function ae(n) {
5397
+ function ie(n) {
5398
5398
  const t = n.geometria;
5399
5399
  switch (t.tipo) {
5400
5400
  case "Point":
@@ -5410,18 +5410,18 @@ function ae(n) {
5410
5410
  }
5411
5411
  }
5412
5412
  }
5413
- function Cs(n) {
5413
+ function Ss(n) {
5414
5414
  const t = n.geometria, e = [], o = ut(t), a = pt(t);
5415
5415
  if (t.tipo === "Polygon")
5416
5416
  e.push(["Área", Ct(o ?? 0)], ["Perímetro", K(a ?? 0)]), e.push(["Vértices", String(t.aneis.reduce((r, c) => r + c.length, 0))]);
5417
5417
  else if (t.tipo === "LineString") {
5418
- const r = Qt(t);
5418
+ const r = Yt(t);
5419
5419
  e.push(["Extensão", K(a ?? 0)], ["Vértices", String(r.reduce((c, l) => c + l.length, 0))]), r.length > 1 && e.push(["Partes", String(r.length)]);
5420
5420
  } else t.tipo === "Circle" && e.push(["Raio", K(t.raioMetros)], ["Área", Ct(o ?? 0)]);
5421
- const [i, s] = ae(n);
5421
+ const [i, s] = ie(n);
5422
5422
  return e.push(["Coordenadas", `${i.toFixed(6)}, ${s.toFixed(6)}`]), e;
5423
5423
  }
5424
- class Ss {
5424
+ class Ls {
5425
5425
  constructor(t) {
5426
5426
  p(this, "popup", null);
5427
5427
  p(this, "feicaoAtual", null);
@@ -5445,14 +5445,14 @@ class Ss {
5445
5445
  autoClose: !1,
5446
5446
  autoPanPaddingTopLeft: b.point(this.margens.esquerda, this.margens.topo),
5447
5447
  autoPanPaddingBottomRight: b.point(this.margens.direita, this.margens.base)
5448
- }).setLatLng(ae(t)).setContent(this.montar(t));
5448
+ }).setLatLng(ie(t)).setContent(this.montar(t));
5449
5449
  const o = this.popup;
5450
5450
  this.dep.liberar ? this.dep.liberar(() => o.openOn(e)) : o.openOn(e);
5451
5451
  }
5452
5452
  /** Reconstrói o conteúdo se a feição aberta mudou (estilo, propriedades, geometria). */
5453
5453
  atualizar(t) {
5454
5454
  var e;
5455
- !this.popup || ((e = this.feicaoAtual) == null ? void 0 : e.id) !== t.id || this.feicaoAtual.camadaId !== t.camadaId || (this.feicaoAtual = t, this.popup.setLatLng(ae(t)).setContent(this.montar(t)));
5455
+ !this.popup || ((e = this.feicaoAtual) == null ? void 0 : e.id) !== t.id || this.feicaoAtual.camadaId !== t.camadaId || (this.feicaoAtual = t, this.popup.setLatLng(ie(t)).setContent(this.montar(t)));
5456
5456
  }
5457
5457
  fechar() {
5458
5458
  const t = this.popup;
@@ -5465,7 +5465,7 @@ class Ss {
5465
5465
  return y && (x.style.cssText = y), P !== void 0 && (x.textContent = P), x;
5466
5466
  }, i = a("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");
5467
5467
  i.className = "cad-feicao-popup", i.appendChild(a("div", "font-weight:700;font-size:13px;margin-bottom:1px", zt(t, ["name", "nome"]) || t.id));
5468
- const s = zt(t, ["category", "categoria"]), r = [bs[t.geometria.tipo], (e == null ? void 0 : e.nome) ?? t.camadaId, s].filter(Boolean).join(" · ");
5468
+ const s = zt(t, ["category", "categoria"]), r = [ys[t.geometria.tipo], (e == null ? void 0 : e.nome) ?? t.camadaId, s].filter(Boolean).join(" · ");
5469
5469
  i.appendChild(a("div", "font-size:11px;color:rgba(255,255,255,.6);margin-bottom:4px", r));
5470
5470
  const c = zt(t, ["description", "descricao"]);
5471
5471
  c && i.appendChild(a("div", "font-size:11px;margin-bottom:4px", c));
@@ -5477,12 +5477,12 @@ class Ss {
5477
5477
  }
5478
5478
  return y;
5479
5479
  };
5480
- i.appendChild(l(Cs(t)));
5481
- const d = Object.entries(t.propriedades ?? {}).filter(([v, y]) => !ys.has(v) && y !== void 0 && y !== null && y !== "");
5482
- d.length > 0 && (i.appendChild(l(d.slice(0, wo).map(([v, y]) => [v, Ps(y)]))), d.length > wo && i.appendChild(a("div", "font-size:10px;color:rgba(255,255,255,.55);margin-bottom:4px", `${d.length} atributos`)));
5480
+ i.appendChild(l(Ss(t)));
5481
+ const d = Object.entries(t.propriedades ?? {}).filter(([v, y]) => !xs.has(v) && y !== void 0 && y !== null && y !== "");
5482
+ d.length > 0 && (i.appendChild(l(d.slice(0, wo).map(([v, y]) => [v, Cs(y)]))), d.length > wo && i.appendChild(a("div", "font-size:10px;color:rgba(255,255,255,.55);margin-bottom:4px", `${d.length} atributos`)));
5483
5483
  const h = zt(t, ["author", "autor"]), f = zt(t, ["date", "data", "created_at", "criadoEm"]);
5484
5484
  if (h || f) {
5485
- const v = [h, f ? xs(f) : ""].filter(Boolean).join(" · ");
5485
+ const v = [h, f ? Ps(f) : ""].filter(Boolean).join(" · ");
5486
5486
  i.appendChild(a("div", "font-size:10px;color:rgba(255,255,255,.55);margin-bottom:4px", v));
5487
5487
  }
5488
5488
  const g = a("div", "display:flex;gap:4px;flex-wrap:wrap;margin-top:6px"), m = [["inspecionar", "Inspecionar"], ["zoom", "Zoom"]];
@@ -5496,7 +5496,7 @@ class Ss {
5496
5496
  return i.appendChild(g), i;
5497
5497
  }
5498
5498
  }
5499
- class Ls {
5499
+ class Ms {
5500
5500
  constructor(t) {
5501
5501
  p(this, "_ligado", !0);
5502
5502
  p(this, "_altSegurado", !1);
@@ -5553,7 +5553,7 @@ class Ls {
5553
5553
  }
5554
5554
  }
5555
5555
  const H = "feicoes";
5556
- class Ms {
5556
+ class As {
5557
5557
  constructor(t) {
5558
5558
  this.p = t;
5559
5559
  }
@@ -5583,7 +5583,7 @@ class Ms {
5583
5583
  this.p.divisaoAtiva() && this.p.estaSelecionada({ camadaId: l.camadaId, id: l.id }) && this.p.encerrarDesenho(), this.p.removerFeicao(l.camadaId, l.id);
5584
5584
  const h = [];
5585
5585
  if (d.forEach((f, g) => {
5586
- const m = re(l, this.p.idLivre(l.camadaId, `${l.id}-${g + 1}`), { tipo: "Polygon", aneis: [f] }), u = this.p.adicionarFeicao(l.camadaId, m);
5586
+ const m = Ft(l, this.p.idLivre(l.camadaId, `${l.id}-${g + 1}`), { tipo: "Polygon", aneis: [f] }), u = this.p.adicionarFeicao(l.camadaId, m);
5587
5587
  u && h.push(u);
5588
5588
  }), h.length !== d.length) {
5589
5589
  for (const f of h) this.p.removerFeicao(f.camadaId, f.id);
@@ -5608,11 +5608,20 @@ class Ms {
5608
5608
  });
5609
5609
  return c && this.p.emitir("cad-feicao-criada", { camadaId: r, feicao: c }), c;
5610
5610
  }
5611
+ /** Cria a feição paralela (offset de CAD) a `metros` do `lado` do sentido do traçado; linha ou polígono sem furos. */
5612
+ offsetFeicao(t, e, o, a, i = {}) {
5613
+ const s = this.p.buscar(t, e);
5614
+ if (!s) return null;
5615
+ const r = Za(s.geometria, o, a);
5616
+ if (!r) return null;
5617
+ const c = i.camadaDestino ?? t, l = this.p.adicionarFeicao(c, Ft(s, i.id ?? this.p.idLivre(c, `${e}-offset`), r));
5618
+ return l && this.p.emitir("cad-feicao-criada", { camadaId: c, feicao: l }), l;
5619
+ }
5611
5620
  /** Copia a feição deslocada (em metros para leste/norte). */
5612
5621
  duplicarFeicao(t, e, o = {}, a = {}) {
5613
5622
  const i = this.p.buscar(t, e);
5614
5623
  if (!i) return null;
5615
- const s = Za(i.geometria, o.lesteM ?? 0, o.norteM ?? 0), r = this.p.adicionarFeicao(t, re(i, a.id ?? this.p.idLivre(t, `${e}-copia`), s));
5624
+ const s = Wa(i.geometria, o.lesteM ?? 0, o.norteM ?? 0), r = this.p.adicionarFeicao(t, Ft(i, a.id ?? this.p.idLivre(t, `${e}-copia`), s));
5616
5625
  return r && this.p.emitir("cad-feicao-criada", { camadaId: t, feicao: r }), r;
5617
5626
  }
5618
5627
  /**
@@ -5634,18 +5643,18 @@ class Ms {
5634
5643
  let l = null;
5635
5644
  if (s.every((h) => h.geometria.tipo === "LineString")) {
5636
5645
  if (s.some((g) => no(g.geometria))) return a("multiparte");
5637
- const h = s.map((g) => g.geometria.coordenadas), f = Wa(h, c);
5646
+ const h = s.map((g) => g.geometria.coordenadas), f = Xa(h, c);
5638
5647
  f && (l = Ae([f]));
5639
5648
  } else if (s.every((h) => h.geometria.tipo === "Polygon" && h.geometria.aneis.length === 1)) {
5640
5649
  let h = s[0].geometria.aneis[0];
5641
5650
  for (const f of s.slice(1))
5642
- h = h ? Xa(h, f.geometria.aneis[0], c) : null;
5651
+ h = h ? Ka(h, f.geometria.aneis[0], c) : null;
5643
5652
  h && (l = { tipo: "Polygon", aneis: [h] });
5644
5653
  } else
5645
5654
  return a("tipos-incompativeis");
5646
5655
  if (!l) return a("sem-ligacao");
5647
5656
  for (const h of s) this.p.removerFeicao(t, h.id);
5648
- const d = this.p.adicionarFeicao(t, re(s[0], o.id ?? this.p.idLivre(t, `${s[0].id}-uniao`), l));
5657
+ const d = this.p.adicionarFeicao(t, Ft(s[0], o.id ?? this.p.idLivre(t, `${s[0].id}-uniao`), l));
5649
5658
  if (!d) {
5650
5659
  for (const h of s) this.p.adicionarFeicao(t, h);
5651
5660
  return a("geometria-invalida");
@@ -5653,7 +5662,7 @@ class Ms {
5653
5662
  return this.p.emitir("cad-feicao-unida", { origens: s, resultado: d }), d;
5654
5663
  }
5655
5664
  }
5656
- class As {
5665
+ class zs {
5657
5666
  constructor(t, e) {
5658
5667
  p(this, "cacheOficiais", /* @__PURE__ */ new WeakMap());
5659
5668
  this.p = t, this.regra = e;
@@ -5713,7 +5722,7 @@ class As {
5713
5722
  }
5714
5723
  }
5715
5724
  }
5716
- class zs {
5725
+ class ws {
5717
5726
  constructor(t) {
5718
5727
  this.p = t;
5719
5728
  }
@@ -5755,22 +5764,22 @@ class zs {
5755
5764
  return !o || o.tipo !== H ? !1 : (o.visivel || e.setLayerVisibility(t, !0), this.enquadrar(this.p.lista(t).filter((a) => this.p.desenhada(a))));
5756
5765
  }
5757
5766
  }
5758
- const ws = { topo: 0, base: 16, esquerda: 0, direita: 0 }, Es = 16, ks = 0.92, Se = {
5767
+ const Es = { topo: 0, base: 16, esquerda: 0, direita: 0 }, ks = 16, Is = 0.92, Se = {
5759
5768
  topo: "--cad-hud-topo",
5760
5769
  base: "--cad-hud-base",
5761
5770
  esquerda: "--cad-hud-esquerda",
5762
5771
  direita: "--cad-hud-direita"
5763
5772
  }, ca = "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;";
5764
- function ec(n, t, e = {}) {
5765
- const o = { ...ws, ...e }, a = Math.max(0, n - o.esquerda - o.direita);
5773
+ function oc(n, t, e = {}) {
5774
+ const o = { ...Es, ...e }, a = Math.max(0, n - o.esquerda - o.direita);
5766
5775
  return {
5767
5776
  centroX: o.esquerda + a / 2,
5768
5777
  base: o.base,
5769
- larguraMax: Math.max(0, Math.min(n * ks, a - Es)),
5778
+ larguraMax: Math.max(0, Math.min(n * Is, a - ks)),
5770
5779
  alturaMax: Math.max(0, t - o.topo - o.base - 8)
5771
5780
  };
5772
5781
  }
5773
- function Is(n, t) {
5782
+ function Ts(n, t) {
5774
5783
  for (const e of Object.keys(Se)) {
5775
5784
  const o = t[e];
5776
5785
  typeof o == "number" && Number.isFinite(o) && o >= 0 ? n.style.setProperty(Se[e], `${o}px`) : n.style.removeProperty(Se[e]);
@@ -5783,11 +5792,11 @@ const X = {
5783
5792
  suave: "var(--cad-hud-suave,#888899)",
5784
5793
  destaque: "var(--cad-hud-destaque,#00e08a)",
5785
5794
  campo: "var(--cad-hud-campo,rgba(255,255,255,.06))"
5786
- }, Ts = `gap:2px 6px;align-items:center;padding:3px 8px;border-radius:6px;background:${X.superficie};color:${X.texto};font:12px var(--ui-fonte-base,sans-serif);border:1px solid ${X.borda};box-shadow:0 4px 14px rgba(0,0,0,.45);pointer-events:auto`;
5795
+ }, Ds = `gap:2px 6px;align-items:center;padding:3px 8px;border-radius:6px;background:${X.superficie};color:${X.texto};font:12px var(--ui-fonte-base,sans-serif);border:1px solid ${X.borda};box-shadow:0 4px 14px rgba(0,0,0,.45);pointer-events:auto`;
5787
5796
  function la(n = !1) {
5788
5797
  return `display:inline-flex;align-items:center;height:24px;padding:0 8px;font:inherit;font-size:11.5px;border-radius:4px;border:0;background:transparent;color:${n ? X.destaque : X.suave};${n ? "font-weight:600;" : ""}cursor:pointer;white-space:nowrap`;
5789
5798
  }
5790
- const Ds = `height:22px;box-sizing:border-box;padding:0 6px;font:inherit;font-size:11px;border-radius:4px;border:1px solid ${X.borda};background:${X.campo};color:${X.texto};outline:none`;
5799
+ const _s = `height:22px;box-sizing:border-box;padding:0 6px;font:inherit;font-size:11px;border-radius:4px;border:1px solid ${X.borda};background:${X.campo};color:${X.texto};outline:none`;
5791
5800
  function da(n) {
5792
5801
  n.addEventListener("mouseenter", () => {
5793
5802
  n.disabled || (n.style.background = "rgba(255,255,255,.08)");
@@ -5795,7 +5804,7 @@ function da(n) {
5795
5804
  n.getAttribute("aria-pressed") !== "true" && (n.style.background = "transparent");
5796
5805
  });
5797
5806
  }
5798
- const _s = "cm-draw-hud", Eo = "cad-ferramenta-ativa", nt = "cad-desenho", ct = "#22d3ee", Fs = 4, Os = 450, qs = 10, Ns = 8, $s = 2500, Rs = {
5807
+ const Fs = "cm-draw-hud", Eo = "cad-ferramenta-ativa", nt = "cad-desenho", ct = "#22d3ee", Os = 4, qs = 450, Ns = 10, $s = 8, Rs = 2500, Bs = {
5799
5808
  ponto: "Ponto",
5800
5809
  linha: "Linha",
5801
5810
  poligono: "Polígono",
@@ -5811,7 +5820,7 @@ const _s = "cm-draw-hud", Eo = "cad-ferramenta-ativa", nt = "cad-desenho", ct =
5811
5820
  dividir: "Dividir polígono",
5812
5821
  "selecao-laco": "Seleção por laço",
5813
5822
  "conta-gotas": "Conta-gotas"
5814
- }, Bs = {
5823
+ }, Vs = {
5815
5824
  ponto: "Clique para colocar",
5816
5825
  linha: "Clique nos vértices · Enter ou duplo clique conclui",
5817
5826
  poligono: "Clique nos vértices · Enter ou duplo clique conclui",
@@ -5828,7 +5837,7 @@ const _s = "cm-draw-hud", Eo = "cad-ferramenta-ativa", nt = "cad-desenho", ct =
5828
5837
  "selecao-laco": "Desenhe o laço · Enter ou 1º ponto fecha e seleciona",
5829
5838
  "conta-gotas": "Clique numa feição para copiar o estilo"
5830
5839
  };
5831
- class Vs {
5840
+ class js {
5832
5841
  constructor(t) {
5833
5842
  p(this, "sessao", null);
5834
5843
  p(this, "fechar", !1);
@@ -5895,7 +5904,7 @@ class Vs {
5895
5904
  }
5896
5905
  if (!o)
5897
5906
  if (t.key === "Enter") {
5898
- if (ie(t)) return;
5907
+ if (ne(t)) return;
5899
5908
  this.concluir(), t.preventDefault();
5900
5909
  } else (t.key === "Backspace" || (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "z") && (e.desfazer() && this.atualizar(), t.preventDefault());
5901
5910
  });
@@ -5954,7 +5963,7 @@ class Vs {
5954
5963
  return o ? (this.mostrarSnap(o.coordenada), o.coordenada) : (this.esconderSnap(), e);
5955
5964
  }
5956
5965
  repetido(t) {
5957
- const e = this.ultimoClique, o = Date.now(), a = t.containerPoint, i = !!e && Math.hypot(e.x - a.x, e.y - a.y) <= Fs && o - e.t <= Os;
5966
+ const e = this.ultimoClique, o = Date.now(), a = t.containerPoint, i = !!e && Math.hypot(e.x - a.x, e.y - a.y) <= Os && o - e.t <= qs;
5958
5967
  return this.ultimoClique = { x: a.x, y: a.y, t: o }, i;
5959
5968
  }
5960
5969
  /** Com 3+ vértices, um clique perto do primeiro fecha a figura em polígono. */
@@ -5962,7 +5971,7 @@ class Vs {
5962
5971
  const e = this.sessao, o = e == null ? void 0 : e.primeiro;
5963
5972
  if (!e || !o || !e.fechaNoPrimeiro) return !1;
5964
5973
  const a = this.dep.map.latLngToContainerPoint(o);
5965
- if (Math.hypot(a.x - t.containerPoint.x, a.y - t.containerPoint.y) > qs) return !1;
5974
+ if (Math.hypot(a.x - t.containerPoint.x, a.y - t.containerPoint.y) > Ns) return !1;
5966
5975
  const i = e.concluirFechando();
5967
5976
  return i && this.finalizar(i), !!i;
5968
5977
  }
@@ -5972,7 +5981,7 @@ class Vs {
5972
5981
  if (!e) return null;
5973
5982
  const o = this.dep.map, a = (i) => {
5974
5983
  const s = o.latLngToContainerPoint(i);
5975
- return Math.hypot(s.x - t.containerPoint.x, s.y - t.containerPoint.y) <= Ns;
5984
+ return Math.hypot(s.x - t.containerPoint.x, s.y - t.containerPoint.y) <= $s;
5976
5985
  };
5977
5986
  for (let i = e.ancoras.length - 1; i >= 0; i--) {
5978
5987
  const s = e.ancoras[i];
@@ -5998,7 +6007,7 @@ class Vs {
5998
6007
  const e = (o = this.hud) == null ? void 0 : o.querySelector('[data-campo="aviso"]');
5999
6008
  e && (e.textContent = t, this.avisoTimer && clearTimeout(this.avisoTimer), this.avisoTimer = setTimeout(() => {
6000
6009
  e.textContent = "", this.avisoTimer = null;
6001
- }, $s));
6010
+ }, Rs));
6002
6011
  }
6003
6012
  /**
6004
6013
  * Botão direito com a ferramenta ativa: conclui se já dá figura; senão desfaz o último vértice;
@@ -6131,14 +6140,14 @@ class Vs {
6131
6140
  const t = this.sessao;
6132
6141
  if (!t) return;
6133
6142
  const e = document.createElement("div");
6134
- e.id = _s, e.style.cssText = ca + "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";
6143
+ e.id = Fs, e.style.cssText = ca + "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";
6135
6144
  const o = (c) => {
6136
6145
  const l = document.createElement("span");
6137
6146
  return l.dataset.campo = c, l;
6138
6147
  }, a = document.createElement("strong");
6139
- a.textContent = Rs[t.ferramenta];
6148
+ a.textContent = Bs[t.ferramenta];
6140
6149
  const i = o("dica");
6141
- i.style.opacity = ".7", i.textContent = Bs[t.ferramenta];
6150
+ i.style.opacity = ".7", i.textContent = Vs[t.ferramenta];
6142
6151
  const s = (c, l, d = !1) => {
6143
6152
  const h = document.createElement("button");
6144
6153
  return h.type = "button", h.textContent = c, h.style.cssText = `padding:3px 10px;border-radius:4px;border:1px solid ${d ? ct : "rgba(255,255,255,.3)"};background:${d ? ct : "transparent"};color:${d ? "#111" : "#fff"};cursor:pointer;font-weight:600`, h.addEventListener("click", l), h;
@@ -6172,8 +6181,8 @@ class Vs {
6172
6181
  (e = this.sessao) == null || e.mover(t), this.atualizar();
6173
6182
  }
6174
6183
  }
6175
- const js = ["tipoLinha", "escalaTipoLinha", "deslocamentoTracejado", "opacidadeTraco", "terminacaoTraco", "juncaoTraco"], Hs = /* @__PURE__ */ new Set(["ponto", "linha", "poligono", "retangulo", "elipse", "poligono-regular", "estrela", "circulo", "texto", "caneta"]);
6176
- class Gs {
6184
+ const Hs = ["tipoLinha", "escalaTipoLinha", "deslocamentoTracejado", "opacidadeTraco", "terminacaoTraco", "juncaoTraco"], Gs = /* @__PURE__ */ new Set(["ponto", "linha", "poligono", "retangulo", "elipse", "poligono-regular", "estrela", "circulo", "texto", "caneta"]);
6185
+ class Us {
6177
6186
  constructor(t) {
6178
6187
  p(this, "desenho", null);
6179
6188
  p(this, "camadaDesenho", null);
@@ -6227,12 +6236,12 @@ class Gs {
6227
6236
  if (!Ro(t)) return { ok: !1, motivo: "ferramenta-invalida" };
6228
6237
  const o = this.p.obterMapa();
6229
6238
  if (!o) return { ok: !1, motivo: "sem-mapa" };
6230
- if (Hs.has(t)) {
6239
+ if (Gs.has(t)) {
6231
6240
  const r = this.motivoCamadaDesenhoInvalida();
6232
6241
  if (r)
6233
6242
  return this.p.emitir("cad-desenho-recusado", { ferramenta: t, motivo: r }), { ok: !1, motivo: r };
6234
6243
  }
6235
- this.p.prepararDesenho(), this.desenho || (this.desenho = new Vs({
6244
+ this.p.prepararDesenho(), this.desenho || (this.desenho = new js({
6236
6245
  map: o,
6237
6246
  buscarSnap: (r) => this.p.buscarSnapEm(r),
6238
6247
  snapAtivo: () => this.p.snapAtivo(),
@@ -6314,18 +6323,18 @@ class Gs {
6314
6323
  amostrarEstilo(t) {
6315
6324
  const e = this.p.obterMapa();
6316
6325
  if (!e) return;
6317
- const o = e.latLngToContainerPoint(t), a = this.p.candidatasEm(t, 8), i = ne({ x: o.x, y: o.y }, a, (d) => e.latLngToContainerPoint(d));
6326
+ const o = e.latLngToContainerPoint(t), a = this.p.candidatasEm(t, 8), i = se({ x: o.x, y: o.y }, a, (d) => e.latLngToContainerPoint(d));
6318
6327
  if (!i) {
6319
6328
  this.p.emitir("cad-conta-gotas", { cor: "", feicao: null, estilo: {} });
6320
6329
  return;
6321
6330
  }
6322
6331
  const s = this.p.obterLayerManager().getLayerDef(i.camadaId), r = i.estilo ?? {}, c = {}, l = r.corTraco ?? (s == null ? void 0 : s.estilo.corPrimaria);
6323
6332
  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);
6324
- for (const d of js) r[d] !== void 0 && (c[d] = r[d]);
6333
+ for (const d of Hs) r[d] !== void 0 && (c[d] = r[d]);
6325
6334
  this.estiloDesenho = { ...this.estiloDesenho, ...c }, this.p.emitir("cad-conta-gotas", { cor: l ?? r.corPreenchimento ?? "", feicao: i, estilo: c });
6326
6335
  }
6327
6336
  }
6328
- class Us {
6337
+ class Zs {
6329
6338
  constructor(t) {
6330
6339
  /** id -> posição na lista da camada (válido enquanto `lista` for a lista atual); evita varrer a camada a cada consulta. */
6331
6340
  p(this, "posicoes", /* @__PURE__ */ new Map());
@@ -6367,7 +6376,7 @@ class Us {
6367
6376
  const l = Pe(r, t, this.p.opcoesNormalizacao());
6368
6377
  if (l) {
6369
6378
  const d = s.get(l.id);
6370
- i.set(l.id, d && us(d, l) ? d : l);
6379
+ i.set(l.id, d && ps(d, l) ? d : l);
6371
6380
  } else a.push(String((r == null ? void 0 : r.id) ?? `#${c}`));
6372
6381
  }), this.p.obterLayerManager().setLayerData(t, { feicoes: [...i.values()] }), this.p.aposDados(), { aceitas: i.size, recusadas: a };
6373
6382
  }
@@ -6439,8 +6448,8 @@ class Us {
6439
6448
  return m.setLayerData(t, E), delete E.delta, C ? this.posicoes.delete(t) : this.posicoes.set(t, { lista: L, pos: P }), this.p.aposDados(), f({ resultado: a, adicionadas: i, atualizadas: s });
6440
6449
  }
6441
6450
  }
6442
- const It = (n) => Array.isArray(n) && n.length === 2 && Number.isFinite(n[0]) && Number.isFinite(n[1]), Xe = Math.PI / 180, Ve = 0.01, mt = Ka;
6443
- function Zs(n, t, e) {
6451
+ const It = (n) => Array.isArray(n) && n.length === 2 && Number.isFinite(n[0]) && Number.isFinite(n[1]), Xe = Math.PI / 180, Ve = 0.01, mt = Qa;
6452
+ function Ws(n, t, e) {
6444
6453
  let o = U(n);
6445
6454
  if (!o || t < 0 || t >= o.length) return n;
6446
6455
  if (e === "canto") {
@@ -6462,28 +6471,28 @@ function Zs(n, t, e) {
6462
6471
  const d = o.slice();
6463
6472
  return d[t] = r, ft(a, d);
6464
6473
  }
6465
- function Ws(n, t, e = 45) {
6474
+ function Xs(n, t, e = 45) {
6466
6475
  if (!It(n) || !It(t) || !(e > 0)) return t;
6467
6476
  const o = mt(n), [a, i] = Q(o, t), s = Math.hypot(a, i);
6468
6477
  if (s === 0) return t;
6469
6478
  const r = e * Xe, c = Math.round(Math.atan2(i, a) / r) * r;
6470
6479
  return St(o, Math.cos(c) * s, Math.sin(c) * s);
6471
6480
  }
6472
- function Xs(n, t, e) {
6481
+ function Ks(n, t, e) {
6473
6482
  var c;
6474
6483
  const o = (c = U(n)) == null ? void 0 : c[t], a = o == null ? void 0 : o[e];
6475
6484
  if (!o || !a) return null;
6476
6485
  const [i, s] = Q(mt(o.ponto), a), r = (Math.atan2(i, s) / Xe + 360) % 360;
6477
6486
  return { comprimentoM: Math.hypot(i, s), azimuteGraus: r };
6478
6487
  }
6479
- function Ks(n, t, e, o, a = !0) {
6488
+ function Qs(n, t, e, o, a = !0) {
6480
6489
  var l;
6481
6490
  const i = (l = U(n)) == null ? void 0 : l[t];
6482
6491
  if (!i || !Number.isFinite(o.comprimentoM) || !Number.isFinite(o.azimuteGraus) || o.comprimentoM < 0) return n;
6483
6492
  const s = mt(i.ponto), r = o.azimuteGraus * Xe, c = St(s, Math.sin(r) * o.comprimentoM, Math.cos(r) * o.comprimentoM);
6484
6493
  return $o(n, t, e, c, a);
6485
6494
  }
6486
- function Qs(n, t, e) {
6495
+ function Ys(n, t, e) {
6487
6496
  if (!It(e)) return n;
6488
6497
  const o = et(n).map((a) => [a[0], a[1]]);
6489
6498
  return n.tipo === "Circle" || n.tipo === "Point" || t < 0 || t >= o.length ? n : (o[t] = [e[0], e[1]], ze(n, o));
@@ -6495,7 +6504,7 @@ function Ke(n, t, e, o) {
6495
6504
  const [a, i] = La(t[e], t[o]), s = t[e].saida ?? we(n, e, "saida"), r = t[o].entrada ?? we(n, o, "entrada");
6496
6505
  return !s || !r ? null : [t[e].saida ? a : s, t[o].entrada ? i : r];
6497
6506
  }
6498
- function Ys(n, t, e) {
6507
+ function Js(n, t, e) {
6499
6508
  const o = U(n);
6500
6509
  if (!o || !It(e)) return null;
6501
6510
  const a = Tt(n, o.length, t);
@@ -6534,7 +6543,7 @@ function ko(n, t, e, o) {
6534
6543
  const r = Math.min(ua, Math.max(ha, e)), c = 1 - r, l = Fo(a[t].ponto, s[0], s[1], a[i].ponto, r), d = o[0] - l[0], h = o[1] - l[1], f = c * c + r * r, g = 1 / (3 * r * f), m = 1 / (3 * c * f), u = [s[0][0] + d * g, s[0][1] + h * g], v = [s[1][0] + d * m, s[1][1] + h * m], y = a.slice();
6535
6544
  return y[t] = so(a[t], "saida", u, "livre"), y[i] = so(i === t ? y[t] : a[i], "entrada", v, "livre"), ft(n, y);
6536
6545
  }
6537
- function Js(n, t) {
6546
+ function tr(n, t) {
6538
6547
  const e = U(n);
6539
6548
  if (!e) return n;
6540
6549
  const o = Tt(n, e.length, t);
@@ -6547,7 +6556,7 @@ function Js(n, t) {
6547
6556
  function Io(n) {
6548
6557
  return !n.entrada && !n.saida ? (delete n.modo, n) : { ...n, modo: "livre" };
6549
6558
  }
6550
- function tr(n, t) {
6559
+ function er(n, t) {
6551
6560
  const e = U(n);
6552
6561
  if (!e) return n;
6553
6562
  const o = Tt(n, e.length, t);
@@ -6557,7 +6566,7 @@ function tr(n, t) {
6557
6566
  const i = e.slice();
6558
6567
  return e[t].saida || (i[t] = { ...e[t], saida: a[0], modo: xt(e[t]) === "canto" ? "livre" : e[t].modo }), e[o].entrada || (i[o] = { ...o === t ? i[t] : e[o], entrada: a[1], modo: xt(e[o]) === "canto" ? "livre" : e[o].modo }), ft(n, i);
6559
6568
  }
6560
- function er(n, t, e, o) {
6569
+ function or(n, t, e, o) {
6561
6570
  const a = Math.max(1, Math.ceil(Math.abs(o) / (Math.PI / 2) - 1e-9)), i = o / a, s = 4 / 3 * Math.tan(i / 4), r = [];
6562
6571
  for (let c = 0; c < a; c++) {
6563
6572
  const l = e + c * i, d = l + i, h = [n[0] + t * Math.cos(l), n[1] + t * Math.sin(l)], f = [n[0] + t * Math.cos(d), n[1] + t * Math.sin(d)];
@@ -6570,13 +6579,13 @@ function er(n, t, e, o) {
6570
6579
  return r;
6571
6580
  }
6572
6581
  function pa(n, t, e, o, a, i, s) {
6573
- const r = er(o, a, i, s), c = (f) => St(n, f[0], f[1]), l = { ...t, saida: c(r[0].c1), modo: "livre" }, d = [];
6582
+ const r = or(o, a, i, s), c = (f) => St(n, f[0], f[1]), l = { ...t, saida: c(r[0].c1), modo: "livre" }, d = [];
6574
6583
  for (let f = 0; f < r.length - 1; f++)
6575
6584
  d.push({ ponto: c(r[f].fim), entrada: c(r[f].c2), saida: c(r[f + 1].c1), modo: "simetrico" });
6576
6585
  const h = { ...e, entrada: c(r[r.length - 1].c2), modo: "livre" };
6577
6586
  return { a: l, meio: d, b: h };
6578
6587
  }
6579
- function or(n, t, e, o = "esquerda") {
6588
+ function ar(n, t, e, o = "esquerda") {
6580
6589
  const a = U(n);
6581
6590
  if (!a || !Number.isFinite(e) || e < Ve) return null;
6582
6591
  const i = Tt(n, a.length, t);
@@ -6586,7 +6595,7 @@ function or(n, t, e, o = "esquerda") {
6586
6595
  const d = Math.max(e, l / 2), h = Math.sqrt(Math.max(0, d * d - (l / 2) ** 2)), f = (c[0] - r[0]) / l, m = [-((c[1] - r[1]) / l), f], u = o === "esquerda" ? -1 : 1, v = [(r[0] + c[0]) / 2, (r[1] + c[1]) / 2], y = [v[0] + m[0] * h * u, v[1] + m[1] * h * u], P = Math.atan2(r[1] - y[1], r[0] - y[0]), x = Math.asin(Math.min(1, l / (2 * d))), M = pa(s, a[t], a[i], y, d, P, u * 2 * x), A = a.slice();
6587
6596
  return A[t] = M.a, A[i] = i === t ? M.a : M.b, A.splice(t + 1, 0, ...M.meio), ft(n, A);
6588
6597
  }
6589
- function ar(n, t, e) {
6598
+ function ir(n, t, e) {
6590
6599
  const o = U(n);
6591
6600
  if (!o || !Number.isFinite(e) || e < Ve || t < 0 || t >= o.length || xt(o[t]) !== "canto") return null;
6592
6601
  const a = o.length, i = n.tipo === "Polygon", s = t > 0 ? o[t - 1] : i ? o[a - 1] : null, r = t < a - 1 ? o[t + 1] : i ? o[0] : null;
@@ -6604,7 +6613,7 @@ function ar(n, t, e) {
6604
6613
  const O = { ponto: St(c, A[0], A[1]) }, F = { ponto: St(c, C[0], C[1]) }, _ = pa(c, O, F, k, x, T, w), q = o.slice();
6605
6614
  return q.splice(t, 1, _.a, ..._.meio, _.b), ft(n, q);
6606
6615
  }
6607
- const ir = 10, nr = [
6616
+ const nr = 10, sr = [
6608
6617
  { tipo: "canto", rotulo: "Canto", titulo: "Sem alças: o traçado muda de direção no nó" },
6609
6618
  { tipo: "suave", rotulo: "Suave", titulo: "Alças alinhadas, cada uma com o seu comprimento" },
6610
6619
  { tipo: "simetrico", rotulo: "Simétrico", titulo: "Alças alinhadas e do mesmo comprimento" },
@@ -6616,8 +6625,8 @@ function wt(n) {
6616
6625
  const e = Number(t);
6617
6626
  return Number.isFinite(e) ? e : null;
6618
6627
  }
6619
- const sr = la(), rr = Ds + ";width:84px", cr = X.destaque;
6620
- class lr {
6628
+ const rr = la(), cr = _s + ";width:84px", lr = X.destaque;
6629
+ class dr {
6621
6630
  constructor(t) {
6622
6631
  p(this, "el");
6623
6632
  p(this, "campos", /* @__PURE__ */ new Map());
@@ -6633,7 +6642,7 @@ class lr {
6633
6642
  }
6634
6643
  campo(t, e, o, a) {
6635
6644
  const i = document.createElement("input");
6636
- i.type = "text", i.inputMode = "decimal", i.autocomplete = "off", i.spellcheck = !1, i.dataset.campo = t, i.title = e, i.setAttribute("aria-label", e), i.style.cssText = rr + (a ? `;width:${a}px` : "");
6645
+ i.type = "text", i.inputMode = "decimal", i.autocomplete = "off", i.spellcheck = !1, i.dataset.campo = t, i.title = e, i.setAttribute("aria-label", e), i.style.cssText = cr + (a ? `;width:${a}px` : "");
6637
6646
  const s = () => o();
6638
6647
  return i.addEventListener("change", s), i.addEventListener("keydown", (r) => {
6639
6648
  r.stopPropagation(), r.key === "Enter" && (r.preventDefault(), s());
@@ -6641,14 +6650,14 @@ class lr {
6641
6650
  }
6642
6651
  botao(t, e, o, a) {
6643
6652
  const i = document.createElement("button");
6644
- return i.type = "button", i.dataset.acao = t, i.textContent = e, i.title = o, i.style.cssText = sr, da(i), i.addEventListener("click", a), this.botoes.set(t, i), i;
6653
+ return i.type = "button", i.dataset.acao = t, i.textContent = e, i.title = o, i.style.cssText = rr, da(i), i.addEventListener("click", a), this.botoes.set(t, i), i;
6645
6654
  }
6646
6655
  montar() {
6647
6656
  const t = (...r) => {
6648
6657
  const c = document.createElement("span");
6649
6658
  return c.style.cssText = "display:inline-flex;gap:4px;align-items:center", c.append(...r), c;
6650
6659
  }, e = t(this.rotulo("Nó"));
6651
- for (const r of nr) {
6660
+ for (const r of sr) {
6652
6661
  const c = this.botao(`tipo-${r.tipo}`, r.rotulo, r.titulo, () => this.acoes.definirTipo(r.tipo));
6653
6662
  this.botoesTipo.set(r.tipo, c), e.append(c);
6654
6663
  }
@@ -6674,7 +6683,7 @@ class lr {
6674
6683
  this.botao("arco-dir", "Arco ⟳", "Troca o trecho que sai deste nó por um arco abaulado para a direita", () => this.pedirArco("direita")),
6675
6684
  this.botao("concordar", "Concordar", "Arredonda o canto deste nó com um arco tangente aos dois trechos (raio ao lado)", () => this.pedirConcordar())
6676
6685
  );
6677
- this.campos.get("raio").value = String(ir), this.el.append(e, o, a("entrada", "Alça ←"), a("saida", "Alça →"), i, s);
6686
+ this.campos.get("raio").value = String(nr), this.el.append(e, o, a("entrada", "Alça ←"), a("saida", "Alça →"), i, s);
6678
6687
  }
6679
6688
  confirmarCoordenada() {
6680
6689
  const t = wt(this.campos.get("lat").value), e = wt(this.campos.get("lon").value);
@@ -6715,7 +6724,7 @@ class lr {
6715
6724
  const i = xt(a);
6716
6725
  for (const [c, l] of this.botoesTipo) {
6717
6726
  const d = c === i;
6718
- l.style.background = d ? cr : "transparent", l.style.color = d ? "#0b0b0d" : X.suave, l.style.fontWeight = d ? "600" : "400", l.setAttribute("aria-pressed", String(d));
6727
+ l.style.background = d ? lr : "transparent", l.style.color = d ? "#0b0b0d" : X.suave, l.style.fontWeight = d ? "600" : "400", l.setAttribute("aria-pressed", String(d));
6719
6728
  }
6720
6729
  const s = (c, l, d = !0) => {
6721
6730
  const h = this.campos.get(c);
@@ -6723,7 +6732,7 @@ class lr {
6723
6732
  };
6724
6733
  s("lat", a.ponto[0].toFixed(7)), s("lon", a.ponto[1].toFixed(7));
6725
6734
  for (const c of ["entrada", "saida"]) {
6726
- const l = Xs(t, e, c);
6735
+ const l = Ks(t, e, c);
6727
6736
  s(`${c}-comp`, l ? l.comprimentoM.toFixed(3) : "", !!l), s(`${c}-az`, l ? l.azimuteGraus.toFixed(2) : "", !!l);
6728
6737
  }
6729
6738
  const r = e < o.length - 1 || t.tipo === "Polygon";
@@ -6735,8 +6744,8 @@ class lr {
6735
6744
  o && (o.disabled = !e, o.style.opacity = e ? "1" : ".4", o.style.cursor = e ? "pointer" : "default");
6736
6745
  }
6737
6746
  }
6738
- const dr = "cm-vertex-edit-hud", lt = "cad-edicao-vertices", To = "#facc15", Le = "#f472b6", hr = "#22d3ee", ur = 600, pr = 100, fr = 24, mr = 2500, gr = 7, vr = 3, br = 45, Bt = (n, t) => n === t || JSON.stringify(n) === JSON.stringify(t);
6739
- class yr {
6747
+ const hr = "cm-vertex-edit-hud", lt = "cad-edicao-vertices", To = "#facc15", Le = "#f472b6", ur = "#22d3ee", pr = 600, fr = 100, mr = 24, gr = 2500, vr = 7, br = 3, yr = 45, Vt = (n, t) => n === t || JSON.stringify(n) === JSON.stringify(t);
6748
+ class xr {
6740
6749
  constructor(t) {
6741
6750
  p(this, "feicaoAtual", null);
6742
6751
  /** Feição como foi gravada pela última vez (base do histórico). */
@@ -6783,7 +6792,7 @@ class yr {
6783
6792
  const e = this.molde, o = this.feicaoAtual;
6784
6793
  if (!e || !o) return;
6785
6794
  const a = this.dep.map.mouseEventToContainerPoint(t);
6786
- if (!e.moveu && Math.hypot(a.x - e.x, a.y - e.y) < vr) return;
6795
+ if (!e.moveu && Math.hypot(a.x - e.x, a.y - e.y) < br) return;
6787
6796
  e.moveu = !0;
6788
6797
  const i = this.dep.map.containerPointToLatLng(a), s = ko(e.antes.geometria, e.i, e.t, [i.lat, i.lng]);
6789
6798
  s && (this.feicaoAtual = { ...o, geometria: s }, this.sincronizarAlcasBezier(), this.dep.previsualizar(this.feicaoAtual), this.atualizarHud(s));
@@ -6802,7 +6811,7 @@ class yr {
6802
6811
  } else if (t.key === "Escape")
6803
6812
  this.selecionado !== null ? this.selecionarNo(null) : this.cancelar();
6804
6813
  else if (t.key === "Enter") {
6805
- if (ie(t)) return;
6814
+ if (ne(t)) return;
6806
6815
  this.parar();
6807
6816
  } else
6808
6817
  return;
@@ -6849,7 +6858,7 @@ class yr {
6849
6858
  cancelar() {
6850
6859
  const t = this.feicaoAtual, e = this.inicial;
6851
6860
  if (!(!t || !e)) {
6852
- if (!Bt(e.geometria, t.geometria)) {
6861
+ if (!Vt(e.geometria, t.geometria)) {
6853
6862
  const o = { ...t, geometria: e.geometria };
6854
6863
  this.feicaoAtual = o, this.dep.previsualizar(o), this.gravar(o);
6855
6864
  }
@@ -6867,7 +6876,7 @@ class yr {
6867
6876
  this.feicaoAtual = { ...t, geometria: this.feicaoAtual.geometria };
6868
6877
  return;
6869
6878
  }
6870
- if (this.base && Bt(t.geometria, this.base.geometria)) {
6879
+ if (this.base && Vt(t.geometria, this.base.geometria)) {
6871
6880
  this.feicaoAtual = t, this.base = t;
6872
6881
  return;
6873
6882
  }
@@ -6920,7 +6929,7 @@ class yr {
6920
6929
  const o = this.pts[t], a = this.pts[e];
6921
6930
  if (!o || !a) return !1;
6922
6931
  const i = this.dep.map.latLngToContainerPoint(o), s = this.dep.map.latLngToContainerPoint(a);
6923
- return Math.hypot(i.x - s.x, i.y - s.y) >= fr;
6932
+ return Math.hypot(i.x - s.x, i.y - s.y) >= mr;
6924
6933
  }
6925
6934
  icone(t, e, o) {
6926
6935
  return b.divIcon({
@@ -6930,7 +6939,7 @@ class yr {
6930
6939
  });
6931
6940
  }
6932
6941
  iconeAlca(t) {
6933
- const e = this.ehCirculo && t === 1, o = this.selecionado === t, a = o ? hr : To, i = o ? "2px solid #fff;box-shadow:0 0 0 2px #0e7490" : "2px solid #111";
6942
+ const e = this.ehCirculo && t === 1, o = this.selecionado === t, a = o ? ur : To, i = o ? "2px solid #fff;box-shadow:0 0 0 2px #0e7490" : "2px solid #111";
6934
6943
  return this.icone("cad-vertex-handle", 12, `background:${a};border:${i};border-radius:${e ? "50%" : "2px"};cursor:${e ? "ew-resize" : "move"}`);
6935
6944
  }
6936
6945
  criarAlca(t, e) {
@@ -6952,7 +6961,7 @@ class yr {
6952
6961
  }), o.on("contextmenu", (a) => {
6953
6962
  b.DomEvent.preventDefault(a.originalEvent), b.DomEvent.stopPropagation(a.originalEvent), this.excluir(e);
6954
6963
  }), o.on("dblclick", (a) => {
6955
- b.DomEvent.stopPropagation(a.originalEvent), !(Date.now() - this.ultimaInsercao < ur) && this.alternarSuave(e);
6964
+ b.DomEvent.stopPropagation(a.originalEvent), !(Date.now() - this.ultimaInsercao < pr) && this.alternarSuave(e);
6956
6965
  }), o;
6957
6966
  }
6958
6967
  detectarRetanguloDe(t) {
@@ -7000,9 +7009,9 @@ class yr {
7000
7009
  /** Posição da alça: a real do nó ou, se o nó é de canto, a latente (sempre à mão para curvar). */
7001
7010
  posicaoDaAlca(t, e, o) {
7002
7011
  var s, r;
7003
- const a = (r = (s = Qa(t)) == null ? void 0 : s[e]) == null ? void 0 : r[o];
7012
+ const a = (r = (s = Ya(t)) == null ? void 0 : s[e]) == null ? void 0 : r[o];
7004
7013
  if (a) return { pos: a, latente: !1 };
7005
- if (this.pts.length > Ya) return null;
7014
+ if (this.pts.length > Ja) return null;
7006
7015
  const i = we(t, e, o);
7007
7016
  return i ? { pos: i, latente: !0 } : null;
7008
7017
  }
@@ -7058,7 +7067,7 @@ class yr {
7058
7067
  let i = [t.marker.getLatLng().lat, t.marker.getLatLng().lng];
7059
7068
  const s = (c = U(a.geometria)) == null ? void 0 : c[t.i];
7060
7069
  if (o && s)
7061
- i = Ws(s.ponto, i, br), t.marker.setLatLng(i), this.esconderSnap();
7070
+ i = Xs(s.ponto, i, yr), t.marker.setLatLng(i), this.esconderSnap();
7062
7071
  else if (this.dep.snapLigado()) {
7063
7072
  const l = this.dep.buscarSnap(i, { feicaoId: a.id, camadaId: a.camadaId, vertice: t.i });
7064
7073
  l && l.feicaoId !== a.id ? (i = l.coordenada, t.marker.setLatLng(i), this.mostrarSnap(i)) : this.esconderSnap();
@@ -7074,7 +7083,7 @@ class yr {
7074
7083
  o !== e.geometria && (this.feicaoAtual = { ...e, geometria: o }, this.reconstruir(), this.dep.previsualizar(this.feicaoAtual), this.confirmar(this.feicaoAtual));
7075
7084
  }
7076
7085
  criarFantasma(t, e) {
7077
- const o = b.marker(Ft(this.geometriaAtual(), t, e), {
7086
+ const o = b.marker(Ot(this.geometriaAtual(), t, e), {
7078
7087
  icon: this.icone("cad-vertex-ghost", 9, `background:${To};opacity:.45;border:1px solid #111;border-radius:50%;cursor:copy`),
7079
7088
  draggable: !0,
7080
7089
  pane: lt,
@@ -7111,7 +7120,7 @@ class yr {
7111
7120
  }
7112
7121
  this.retangulo && !o ? this.moverCantoDoRetangulo(e, i) : this.pts[e] = i;
7113
7122
  for (const c of this.fantasmas)
7114
- this.retangulo && !o ? c.marker.setLatLng(Ft(this.geometriaAtual(), c.i, c.j)) : (c.i === e || c.j === e) && c.marker.setLatLng(Ft(this.geometriaAtual(), c.i, c.j));
7123
+ this.retangulo && !o ? c.marker.setLatLng(Ot(this.geometriaAtual(), c.i, c.j)) : (c.i === e || c.j === e) && c.marker.setLatLng(Ot(this.geometriaAtual(), c.i, c.j));
7115
7124
  this.dep.previsualizar(this.feicaoComPontos()), this.atualizarAlcasDoNo(e), this.atualizarHud();
7116
7125
  }
7117
7126
  /** Move o canto `i` para `pos` e arrasta os dois vizinhos para o retângulo continuar alinhado, com o canto oposto fixo. */
@@ -7131,7 +7140,7 @@ class yr {
7131
7140
  comInsercao(t, e) {
7132
7141
  const o = this.feicaoAtual;
7133
7142
  if (!o || this.pts.length === 0) return null;
7134
- const a = this.geometriaAtual(), i = Ft(a, t, (t + 1) % this.pts.length), s = Ja(a, t, i);
7143
+ const a = this.geometriaAtual(), i = Ot(a, t, (t + 1) % this.pts.length), s = ti(a, t, i);
7135
7144
  if (s === a) return null;
7136
7145
  const r = et(s).map((c) => [c[0], c[1]]);
7137
7146
  return e && Number.isFinite(e[0]) && Number.isFinite(e[1]) && (r[t + 1] = e), { feicao: { ...o, geometria: ze(s, r) }, pts: r };
@@ -7147,7 +7156,7 @@ class yr {
7147
7156
  /** Grava o gesto: guarda a geometria anterior no histórico (se mudou) e avisa quem escuta. */
7148
7157
  confirmar(t) {
7149
7158
  const e = this.base;
7150
- e && !Bt(e.geometria, t.geometria) && (this.historico.push(e), this.historico.length > pr && this.historico.shift(), this.refeitos = []), this.feicaoAtual = t, this.base = t, this.gravar(t), this.atualizarBotoes();
7159
+ e && !Vt(e.geometria, t.geometria) && (this.historico.push(e), this.historico.length > fr && this.historico.shift(), this.refeitos = []), this.feicaoAtual = t, this.base = t, this.gravar(t), this.atualizarBotoes();
7151
7160
  }
7152
7161
  gravar(t) {
7153
7162
  this.gravando = !0;
@@ -7159,9 +7168,9 @@ class yr {
7159
7168
  }
7160
7169
  excluir(t) {
7161
7170
  if (!this.feicaoAtual) return !1;
7162
- const o = this.geometriaAtual(), a = ti(o, t);
7171
+ const o = this.geometriaAtual(), a = ei(o, t);
7163
7172
  if (!a)
7164
- 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 ${ei(o)} nós: não dá para excluir mais.`), !1;
7173
+ 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 ${oi(o)} nós: não dá para excluir mais.`), !1;
7165
7174
  this.pts = et(a).map((s) => [s[0], s[1]]), this.retangulo = !1, this.selecionado = null, this.reconstruir();
7166
7175
  const i = this.feicaoComPontos();
7167
7176
  return this.dep.previsualizar(i), this.confirmar(i), !0;
@@ -7182,7 +7191,7 @@ class yr {
7182
7191
  /** Troca a geometria por `nova` num gesto só (histórico, gravação, alças). `null` = recusada: mostra `recusa`. */
7183
7192
  aplicarGeometria(t, e, o) {
7184
7193
  const a = this.feicaoAtual;
7185
- return a ? t ? Bt(t, this.geometriaAtual()) ? !1 : (this.pts = et(t).map((i) => [i[0], i[1]]), this.feicaoAtual = { ...a, geometria: t }, this.retangulo = !1, this.selecionado = e !== null && e >= 0 && e < this.pts.length ? e : null, this.reconstruir(), this.dep.previsualizar(this.feicaoAtual), this.confirmar(this.feicaoAtual), !0) : (o && this.avisar(o), !1) : !1;
7194
+ return a ? t ? Vt(t, this.geometriaAtual()) ? !1 : (this.pts = et(t).map((i) => [i[0], i[1]]), this.feicaoAtual = { ...a, geometria: t }, this.retangulo = !1, this.selecionado = e !== null && e >= 0 && e < this.pts.length ? e : null, this.reconstruir(), this.dep.previsualizar(this.feicaoAtual), this.confirmar(this.feicaoAtual), !0) : (o && this.avisar(o), !1) : !1;
7186
7195
  }
7187
7196
  /** Índice do nó selecionado numa linha/polígono; sem seleção avisa e devolve `null`. */
7188
7197
  noParaEditar() {
@@ -7193,45 +7202,45 @@ class yr {
7193
7202
  /** Muda o tipo do nó selecionado (canto, suave, simétrico, livre). */
7194
7203
  definirTipoDoNoSelecionado(t) {
7195
7204
  const e = this.noParaEditar();
7196
- return e !== null && this.aplicarGeometria(Zs(this.geometriaAtual(), e, t), e, "");
7205
+ return e !== null && this.aplicarGeometria(Ws(this.geometriaAtual(), e, t), e, "");
7197
7206
  }
7198
7207
  /** Move o nó selecionado para a coordenada digitada, levando as alças junto. */
7199
7208
  moverNoSelecionadoPara(t) {
7200
7209
  const e = this.noParaEditar();
7201
7210
  if (e === null) return !1;
7202
- const o = this.geometriaAtual(), a = Qs(o, e, t);
7211
+ const o = this.geometriaAtual(), a = Ys(o, e, t);
7203
7212
  return this.aplicarGeometria(a === o ? null : a, e, "Coordenada inválida.");
7204
7213
  }
7205
7214
  /** Põe a alça do nó selecionado a `comprimentoM` metros, no azimute dado (0 = norte, horário). */
7206
7215
  definirAlcaDoNoSelecionado(t, e) {
7207
7216
  const o = this.noParaEditar();
7208
7217
  if (o === null) return !1;
7209
- const a = this.geometriaAtual(), i = Ks(a, o, t, e);
7218
+ const a = this.geometriaAtual(), i = Qs(a, o, t, e);
7210
7219
  return this.aplicarGeometria(i === a ? null : i, o, "Alça inválida.");
7211
7220
  }
7212
7221
  /** O trecho que sai do nó selecionado perde as alças (vira reta). */
7213
7222
  endireitarSegmentoSeguinte() {
7214
7223
  const t = this.noParaEditar();
7215
- return t !== null && this.aplicarGeometria(Js(this.geometriaAtual(), t), t, "");
7224
+ return t !== null && this.aplicarGeometria(tr(this.geometriaAtual(), t), t, "");
7216
7225
  }
7217
7226
  /** O trecho que sai do nó selecionado ganha alças (as latentes viram reais). */
7218
7227
  curvarSegmentoSeguinte() {
7219
7228
  const t = this.noParaEditar();
7220
- return t !== null && this.aplicarGeometria(tr(this.geometriaAtual(), t), t, "");
7229
+ return t !== null && this.aplicarGeometria(er(this.geometriaAtual(), t), t, "");
7221
7230
  }
7222
7231
  /** Troca o trecho que sai do nó selecionado por um arco de raio `raioM`, abaulado para `lado`. */
7223
7232
  arcoNoSegmentoSeguinte(t, e = "esquerda") {
7224
7233
  const o = this.noParaEditar();
7225
- return o !== null && this.aplicarGeometria(or(this.geometriaAtual(), o, t, e), o, "Arco: o nó precisa ter um trecho seguinte e o raio deve ser maior que zero.");
7234
+ return o !== null && this.aplicarGeometria(ar(this.geometriaAtual(), o, t, e), o, "Arco: o nó precisa ter um trecho seguinte e o raio deve ser maior que zero.");
7226
7235
  }
7227
7236
  /** Arredonda o canto do nó selecionado com um arco tangente de raio `raioM` (reduzido se os vizinhos forem curtos). */
7228
7237
  concordarNoSelecionado(t) {
7229
7238
  const e = this.noParaEditar();
7230
- return e !== null && this.aplicarGeometria(ar(this.geometriaAtual(), e, t), null, "Concordância: só em nó de canto com dois trechos que não estejam alinhados.");
7239
+ return e !== null && this.aplicarGeometria(ir(this.geometriaAtual(), e, t), null, "Concordância: só em nó de canto com dois trechos que não estejam alinhados.");
7231
7240
  }
7232
7241
  // ---- moldar o segmento arrastando o traçado ----
7233
7242
  /** Segmento mais perto de `coord` (a até `toleranciaPx` pixels) e o parâmetro `t` do ponto dele; `null` se nenhum. */
7234
- segmentoMaisProximo(t, e = gr) {
7243
+ segmentoMaisProximo(t, e = vr) {
7235
7244
  if (!this.feicaoAtual || !Number.isFinite(t[0]) || !Number.isFinite(t[1])) return null;
7236
7245
  const a = this.geometriaAtual(), i = U(a);
7237
7246
  if (!i || a.tipo !== "LineString" && a.tipo !== "Polygon") return null;
@@ -7240,7 +7249,7 @@ class yr {
7240
7249
  for (const [d, h] of ro(a)) {
7241
7250
  const f = i[d], g = i[h], m = [f.ponto, g.ponto, f.saida, g.entrada].filter((M) => !!M).map((M) => s.latLngToContainerPoint(M)), u = m.map((M) => M.x), v = m.map((M) => M.y);
7242
7251
  if (r.x < Math.min(...u) - e || r.x > Math.max(...u) + e || r.y < Math.min(...v) - e || r.y > Math.max(...v) + e) continue;
7243
- const y = Ys(a, d, t);
7252
+ const y = Js(a, d, t);
7244
7253
  if (!y) continue;
7245
7254
  const P = s.latLngToContainerPoint(y.ponto), x = Math.hypot(P.x - r.x, P.y - r.y);
7246
7255
  x <= l && (l = x, c = { i: d, t: y.t });
@@ -7296,7 +7305,7 @@ class yr {
7296
7305
  montarHud() {
7297
7306
  var f;
7298
7307
  const t = this.dep.map.getContainer(), e = document.createElement("div");
7299
- e.id = dr, e.style.cssText = ca + Ts;
7308
+ e.id = hr, e.style.cssText = ca + Ds;
7300
7309
  const o = (g) => {
7301
7310
  const m = document.createElement("span");
7302
7311
  return m.dataset.campo = g, m;
@@ -7313,7 +7322,7 @@ class yr {
7313
7322
  l.style.color = "#fbbf24", l.setAttribute("role", "status");
7314
7323
  const d = o("nos"), h = o("medida");
7315
7324
  for (const g of [d, h]) g.style.color = "var(--cad-hud-suave,#888899)";
7316
- e.append(s, d, h, r, c, l), e.append(a("desfazer", "Desfazer", "Desfazer o último gesto (Ctrl+Z)", () => this.desfazer())), e.append(a("refazer", "Refazer", "Refazer (Ctrl+Shift+Z ou Ctrl+Y)", () => this.refazer())), (i === "LineString" || i === "Polygon") && e.append(a("excluir-no", "Excluir nó", "Exclui o nó selecionado (Delete); clique num nó para selecioná-lo", () => this.excluirSelecionado())), e.append(a("cancelar", "Cancelar", "Descartar tudo o que foi alterado nesta edição", () => this.cancelar())), e.append(a("concluir", "Concluir", "Concluir a edição (Enter ou Esc)", () => this.parar(), !0)), (i === "LineString" || i === "Polygon") && (this.painel = new lr({
7325
+ e.append(s, d, h, r, c, l), e.append(a("desfazer", "Desfazer", "Desfazer o último gesto (Ctrl+Z)", () => this.desfazer())), e.append(a("refazer", "Refazer", "Refazer (Ctrl+Shift+Z ou Ctrl+Y)", () => this.refazer())), (i === "LineString" || i === "Polygon") && e.append(a("excluir-no", "Excluir nó", "Exclui o nó selecionado (Delete); clique num nó para selecioná-lo", () => this.excluirSelecionado())), e.append(a("cancelar", "Cancelar", "Descartar tudo o que foi alterado nesta edição", () => this.cancelar())), e.append(a("concluir", "Concluir", "Concluir a edição (Enter ou Esc)", () => this.parar(), !0)), (i === "LineString" || i === "Polygon") && (this.painel = new dr({
7317
7326
  moverNo: (g) => this.moverNoSelecionadoPara(g),
7318
7327
  definirAlca: (g, m) => this.definirAlcaDoNoSelecionado(g, m),
7319
7328
  definirTipo: (g) => this.definirTipoDoNoSelecionado(g),
@@ -7346,7 +7355,7 @@ class yr {
7346
7355
  const e = (o = this.hud) == null ? void 0 : o.querySelector('[data-campo="aviso"]');
7347
7356
  e && (e.textContent = t, this.avisoTimer && clearTimeout(this.avisoTimer), this.avisoTimer = setTimeout(() => {
7348
7357
  e.textContent = "", this.avisoTimer = null;
7349
- }, mr));
7358
+ }, gr));
7350
7359
  }
7351
7360
  atualizarHud(t) {
7352
7361
  if (!this.hud || !this.feicaoAtual) return;
@@ -7377,7 +7386,7 @@ class yr {
7377
7386
  a && (a.setLatLng(e), this.aoArrastar(a, t, o), a.fire("dragend"));
7378
7387
  }
7379
7388
  }
7380
- class xr {
7389
+ class Pr {
7381
7390
  constructor(t) {
7382
7391
  p(this, "editor", null);
7383
7392
  p(this, "pararDeVigiarCamada", null);
@@ -7414,7 +7423,7 @@ class xr {
7414
7423
  const s = this.p.obterMapa();
7415
7424
  if (!s) return { ok: !1, motivo: "sem-mapa" };
7416
7425
  this.p.desativarFerramenta(), (d = this.editor) == null || d.parar(), this.p.aplicarMargensHud(), this.p.selecionarUma({ camadaId: t, id: e }), this.p.fecharPopup();
7417
- const r = this.p.obterLayerManager(), c = R.get(H), l = new yr({
7426
+ const r = this.p.obterLayerManager(), c = R.get(H), l = new xr({
7418
7427
  map: s,
7419
7428
  snapLigado: () => this.p.snapAtivo(),
7420
7429
  alternarSnap: () => this.p.alternarSnap(),
@@ -7474,7 +7483,7 @@ class xr {
7474
7483
  (t = this.editor) == null || t.parar();
7475
7484
  }
7476
7485
  }
7477
- class Pr {
7486
+ class Cr {
7478
7487
  constructor(t) {
7479
7488
  this.p = t;
7480
7489
  }
@@ -7499,17 +7508,17 @@ class Pr {
7499
7508
  buscarSnapEm(t, e) {
7500
7509
  const o = this.p.obterMapa();
7501
7510
  if (!o) return null;
7502
- const a = o.latLngToContainerPoint(t), i = this.candidatasEm(t, oi);
7503
- return ai({ x: a.x, y: a.y }, i, (s) => o.latLngToContainerPoint(s), {}, e);
7511
+ const a = o.latLngToContainerPoint(t), i = this.candidatasEm(t, ai);
7512
+ return ii({ x: a.x, y: a.y }, i, (s) => o.latLngToContainerPoint(s), {}, e);
7504
7513
  }
7505
7514
  feicaoSob(t, e) {
7506
7515
  const o = this.p.obterMapa();
7507
7516
  if (!o) return null;
7508
7517
  const a = o.getContainer().getBoundingClientRect(), i = b.point(t - a.left, e - a.top), s = o.containerPointToLatLng(i), r = [s.lat, s.lng];
7509
- return { feicao: ne({ x: i.x, y: i.y }, this.candidatasEm(r, 8), (l) => o.latLngToContainerPoint(l)), coordenada: r };
7518
+ return { feicao: se({ x: i.x, y: i.y }, this.candidatasEm(r, 8), (l) => o.latLngToContainerPoint(l)), coordenada: r };
7510
7519
  }
7511
7520
  }
7512
- class Cr {
7521
+ class Sr {
7513
7522
  constructor(t) {
7514
7523
  p(this, "hoverId", null);
7515
7524
  p(this, "hoverAgendado", !1);
@@ -7554,7 +7563,7 @@ class Cr {
7554
7563
  this.hoverId = null;
7555
7564
  }
7556
7565
  }
7557
- class Sr {
7566
+ class Lr {
7558
7567
  constructor(t) {
7559
7568
  this.p = t;
7560
7569
  }
@@ -7564,7 +7573,7 @@ class Sr {
7564
7573
  for (const o of this.p.obterLayerManager().getActiveSelectableLayers())
7565
7574
  if (o.tipo === H)
7566
7575
  for (const a of this.p.lista(o.id))
7567
- this.p.desenhada(a) && ii(a, t) && e.push({ camadaId: o.id, id: a.id });
7576
+ this.p.desenhada(a) && ni(a, t) && e.push({ camadaId: o.id, id: a.id });
7568
7577
  this.p.desativarFerramenta(), this.p.selecionar(e);
7569
7578
  }
7570
7579
  /** Caixa de seleção: só feições de camadas visíveis, interativas e desbloqueadas, com toque geométrico real. */
@@ -7575,19 +7584,19 @@ class Sr {
7575
7584
  for (const r of this.p.obterLayerManager().getActiveSelectableLayers())
7576
7585
  if (r.tipo === H)
7577
7586
  for (const c of this.p.lista(r.id))
7578
- this.p.desenhada(c) && ni(c, t, i, e) && s.push({ camadaId: r.id, id: c.id });
7587
+ this.p.desenhada(c) && si(c, t, i, e) && s.push({ camadaId: r.id, id: c.id });
7579
7588
  o === "adicionar" ? this.p.adicionar ? this.p.adicionar(s) : this.p.alternarVarias(s) : o === "subtrair" ? this.p.subtrair ? this.p.subtrair(s) : this.p.alternarVarias(s) : o === !0 ? this.p.alternarVarias(s) : this.p.selecionar(s);
7580
7589
  }
7581
7590
  }
7582
- function Lr(n) {
7583
- return n.key !== "Enter" || n.defaultPrevented || n.ctrlKey || n.metaKey || n.altKey || n.shiftKey ? !1 : !Pt(n) && !ie(n);
7591
+ function Mr(n) {
7592
+ return n.key !== "Enter" || n.defaultPrevented || n.ctrlKey || n.metaKey || n.altKey || n.shiftKey ? !1 : !Pt(n) && !ne(n);
7584
7593
  }
7585
- class Mr {
7594
+ class Ar {
7586
7595
  constructor(t) {
7587
- p(this, "ouvintes", new Kt());
7596
+ p(this, "ouvintes", new Qt());
7588
7597
  p(this, "aoTecla", (t) => {
7589
7598
  try {
7590
- if (!Lr(t) || this.p.ocupado() || !this.p.atalhosValem()) return;
7599
+ if (!Mr(t) || this.p.ocupado() || !this.p.atalhosValem()) return;
7591
7600
  this.p.editarSelecionada() && t.preventDefault();
7592
7601
  } catch (e) {
7593
7602
  console.error("[ui-canvas-cad] falha no atalho Enter da edição", e);
@@ -7603,7 +7612,7 @@ class Mr {
7603
7612
  this.ouvintes.cleanup();
7604
7613
  }
7605
7614
  }
7606
- class Ar {
7615
+ class zr {
7607
7616
  constructor(t) {
7608
7617
  p(this, "operacoes");
7609
7618
  p(this, "selecao");
@@ -7623,22 +7632,22 @@ class Ar {
7623
7632
  /** Aceita a coordenada (0, 0) exata nas feições de entrada (atributo `aceitar-origem`). */
7624
7633
  p(this, "aceitarOrigem", !1);
7625
7634
  p(this, "opcoesPopup", { copiarParaAreaDeTransferencia: !0 });
7626
- this.contexto = t, this.repositorio = new Us({
7635
+ this.contexto = t, this.repositorio = new Zs({
7627
7636
  obterLayerManager: () => this.contexto.obterLayerManager(),
7628
7637
  opcoesNormalizacao: () => this.opcoesNormalizacao(),
7629
7638
  aposDados: () => this.aposDados()
7630
- }), this.consulta = new Pr({
7639
+ }), this.consulta = new Cr({
7631
7640
  obterMapa: () => this.contexto.obterMapa(),
7632
7641
  obterLayerManager: () => this.contexto.obterLayerManager(),
7633
7642
  desenhada: (e) => this.desenhada(e)
7634
- }), this.ponteiro = new Cr({
7643
+ }), this.ponteiro = new Sr({
7635
7644
  emitir: (e, o, a) => this.contexto.emitir(e, o, a),
7636
7645
  feicaoSob: (e, o) => this.consulta.feicaoSob(e, o),
7637
7646
  interacaoAtiva: () => this.ferramentas.ativo || this.edicao.editando,
7638
7647
  popupNoDuploClique: () => this.modoPopups() !== "desligado",
7639
7648
  botaoDireitoDaFerramenta: () => this.ferramentas.ativo ? (this.ferramentas.botaoDireito(), !0) : !1,
7640
7649
  abrirPopup: (e) => this.popup.abrir(e)
7641
- }), this.regiao = new Sr({
7650
+ }), this.regiao = new Lr({
7642
7651
  obterMapa: () => this.contexto.obterMapa(),
7643
7652
  obterLayerManager: () => this.contexto.obterLayerManager(),
7644
7653
  lista: (e) => this.lista(e),
@@ -7648,7 +7657,7 @@ class Ar {
7648
7657
  adicionar: (e) => this.selecao.adicionar(e),
7649
7658
  subtrair: (e) => this.selecao.subtrair(e),
7650
7659
  alternarVarias: (e) => this.selecao.alternarVarias(e)
7651
- }), this.edicao = new xr({
7660
+ }), this.edicao = new Pr({
7652
7661
  obterMapa: () => this.contexto.obterMapa(),
7653
7662
  obterLayerManager: () => this.contexto.obterLayerManager(),
7654
7663
  emitir: (e, o) => this.contexto.emitir(e, o),
@@ -7671,17 +7680,17 @@ class Ar {
7671
7680
  snapAtivo: () => this.snap.ativo,
7672
7681
  alternarSnap: () => this.snap.alternar(),
7673
7682
  buscarSnapEm: (e, o) => this.buscarSnapEm(e, o)
7674
- }), this.teclado = new Mr({
7683
+ }), this.teclado = new Ar({
7675
7684
  ocupado: () => this.edicao.editando || this.ferramentas.ativo,
7676
7685
  atalhosValem: () => this.atalhosValem(),
7677
7686
  editarSelecionada: () => this.edicao.editarSelecionada()
7678
- }), this.versoes = new As({
7687
+ }), this.versoes = new zs({
7679
7688
  obterLayerManager: () => this.contexto.obterLayerManager(),
7680
7689
  emitir: (e, o) => this.contexto.emitir(e, o),
7681
7690
  buscar: (e, o) => this.buscar(e, o),
7682
7691
  lista: (e) => this.lista(e),
7683
7692
  aposDados: () => this.aposDados()
7684
- }, t.regra ?? new He()), this.ferramentas = new Gs({
7693
+ }, t.regra ?? new He()), this.ferramentas = new Us({
7685
7694
  obterMapa: () => this.contexto.obterMapa(),
7686
7695
  obterLayerManager: () => this.contexto.obterLayerManager(),
7687
7696
  emitir: (e, o, a) => this.contexto.emitir(e, o, a),
@@ -7700,14 +7709,14 @@ class Ar {
7700
7709
  dividirComLinha: (e) => this.dividirComLinha(e),
7701
7710
  selecionarNoLaco: (e) => this.selecionarNoLaco(e),
7702
7711
  candidatasEm: (e, o) => this.candidatasEm(e, o)
7703
- }), this.camera = new zs({
7712
+ }), this.camera = new ws({
7704
7713
  obterMapa: () => this.contexto.obterMapa(),
7705
7714
  obterLayerManager: () => this.contexto.obterLayerManager(),
7706
7715
  buscar: (e, o) => this.buscar(e, o),
7707
7716
  lista: (e) => this.lista(e),
7708
7717
  desenhada: (e) => this.desenhada(e),
7709
7718
  garantirVisivel: (e) => this.versoes.garantirVisivel(e)
7710
- }), this.operacoes = new Ms({
7719
+ }), this.operacoes = new As({
7711
7720
  emitir: (e, o) => this.contexto.emitir(e, o),
7712
7721
  obterLayerManager: () => this.contexto.obterLayerManager(),
7713
7722
  buscar: (e, o) => this.buscar(e, o),
@@ -7720,18 +7729,18 @@ class Ar {
7720
7729
  estaSelecionada: (e) => this.selecao.contem(e),
7721
7730
  divisaoAtiva: () => this.ferramentas.ferramentaAtiva === "dividir",
7722
7731
  encerrarDesenho: () => this.ferramentas.desativarFerramenta()
7723
- }), this.cursores = new gs(() => this.contexto.obterMapa()), this.snap = new Ls({
7732
+ }), this.cursores = new vs(() => this.contexto.obterMapa()), this.snap = new Ms({
7724
7733
  aplica: () => this.atalhosValem(),
7725
7734
  aoMudar: (e) => {
7726
7735
  var o, a;
7727
7736
  this.contexto.emitir("cad-snap", e), this.edicao.atualizarSnapNoHud(), (a = (o = this.contexto).aoSnapMudar) == null || a.call(o, e.ligado);
7728
7737
  }
7729
- }), this.popup = new Ss({
7738
+ }), this.popup = new Ls({
7730
7739
  obterMapa: () => this.contexto.obterMapa(),
7731
7740
  obterCamada: (e) => this.contexto.obterLayerManager().getLayerDef(e),
7732
7741
  aoAcao: (e, o) => this.tratarAcaoPopup(e, o),
7733
7742
  liberar: (e) => this.contexto.liberarPopups ? this.contexto.liberarPopups(e) : e()
7734
- }), this.selecao = new vs({
7743
+ }), this.selecao = new bs({
7735
7744
  obterFeicao: (e) => this.buscar(e.camadaId, e.id),
7736
7745
  aplicarVisual: (e, o) => {
7737
7746
  const a = this.contexto.obterLayerManager().getLayerInstance(e), i = R.get(H);
@@ -7868,7 +7877,7 @@ class Ar {
7868
7877
  }
7869
7878
  aplicarMargensHud() {
7870
7879
  const t = this.contexto.obterMapa();
7871
- t && Is(t.getContainer(), this.margensHud);
7880
+ t && Ts(t.getContainer(), this.margensHud);
7872
7881
  }
7873
7882
  // ---- versões (oficial × prévia) ----
7874
7883
  // ---- versões (oficial × prévia) ----
@@ -7951,7 +7960,7 @@ class Ar {
7951
7960
  tratarAcaoPopup(t, e) {
7952
7961
  var o, a, i;
7953
7962
  if (t === "zoom" && this.zoomParaFeicao(e.camadaId, e.id), t === "vertices" && this.iniciarEdicao(e.camadaId, e.id), t === "copiar" && this.opcoesPopup.copiarParaAreaDeTransferencia) {
7954
- const [s, r] = ae(e);
7963
+ const [s, r] = ie(e);
7955
7964
  (i = (a = (o = globalThis.navigator) == null ? void 0 : o.clipboard) == null ? void 0 : a.writeText(`${s.toFixed(6)}, ${r.toFixed(6)}`)) == null || i.catch(() => {
7956
7965
  });
7957
7966
  }
@@ -8071,6 +8080,10 @@ class Ar {
8071
8080
  gerarBuffer(t, e, o, a = {}) {
8072
8081
  return this.operacoes.gerarBuffer(t, e, o, a);
8073
8082
  }
8083
+ /** Cria a feição paralela (offset de CAD) a `metros` do `lado` do sentido do traçado. */
8084
+ offsetFeicao(t, e, o, a, i = {}) {
8085
+ return this.operacoes.offsetFeicao(t, e, o, a, i);
8086
+ }
8074
8087
  /** Copia a feição deslocada (em metros para leste/norte). */
8075
8088
  duplicarFeicao(t, e, o = {}, a = {}) {
8076
8089
  return this.operacoes.duplicarFeicao(t, e, o, a);
@@ -8097,19 +8110,19 @@ const Do = {
8097
8110
  "selecao-laco": "Laço",
8098
8111
  "conta-gotas": "Cor"
8099
8112
  };
8100
- function zr(n) {
8113
+ function wr(n) {
8101
8114
  if (!n) return [];
8102
8115
  const t = n.split(/[\s,]+/).map((o) => o.trim().toLowerCase()).filter(Boolean);
8103
8116
  if (t.includes("todas")) return [...ho];
8104
8117
  const e = new Set(t.filter(Ro));
8105
8118
  return ho.filter((o) => e.has(o));
8106
8119
  }
8107
- function wr(n) {
8120
+ function Er(n) {
8108
8121
  if (!n) return !1;
8109
8122
  const t = n.split(/[\s,]+/).map((e) => e.trim().toLowerCase());
8110
8123
  return t.includes("todas") || t.includes("editar");
8111
8124
  }
8112
- class Er {
8125
+ class kr {
8113
8126
  constructor(t) {
8114
8127
  p(this, "barra", null);
8115
8128
  p(this, "editando", !1);
@@ -8151,8 +8164,8 @@ class Er {
8151
8164
  (t = this.barra) == null || t.remove(), this.barra = null;
8152
8165
  }
8153
8166
  }
8154
- const kr = "data-cad-estilos-externos";
8155
- function Ir(n) {
8167
+ const Ir = "data-cad-estilos-externos";
8168
+ function Tr(n) {
8156
8169
  try {
8157
8170
  return Array.from(n.cssRules, (t) => t.cssText).join(`
8158
8171
  `);
@@ -8160,10 +8173,10 @@ function Ir(n) {
8160
8173
  return "";
8161
8174
  }
8162
8175
  }
8163
- function Tr(n) {
8164
- return typeof n == "string" ? n.trim() ? [n] : [] : Array.isArray(n) ? n.map((t) => typeof t == "string" ? t : Ir(t)).filter((t) => t.trim() !== "") : [];
8176
+ function Dr(n) {
8177
+ return typeof n == "string" ? n.trim() ? [n] : [] : Array.isArray(n) ? n.map((t) => typeof t == "string" ? t : Tr(t)).filter((t) => t.trim() !== "") : [];
8165
8178
  }
8166
- class Dr {
8179
+ class _r {
8167
8180
  constructor(t) {
8168
8181
  p(this, "textos", []);
8169
8182
  p(this, "adotadas", []);
@@ -8175,7 +8188,7 @@ class Dr {
8175
8188
  return this.textos;
8176
8189
  }
8177
8190
  definir(t) {
8178
- this.textos = Tr(t), this.aplicar();
8191
+ this.textos = Dr(t), this.aplicar();
8179
8192
  }
8180
8193
  /** Tira as folhas do shadow root, mantendo o pedido para `aplicar()` depois. */
8181
8194
  limpar() {
@@ -8195,7 +8208,7 @@ class Dr {
8195
8208
  this.adotadas = [];
8196
8209
  }
8197
8210
  const e = document.createElement("style");
8198
- e.setAttribute(kr, ""), e.textContent = this.textos.join(`
8211
+ e.setAttribute(Ir, ""), e.textContent = this.textos.join(`
8199
8212
  `), this.shadow.appendChild(e), this.fallback = e;
8200
8213
  }
8201
8214
  remover() {
@@ -8214,7 +8227,7 @@ const fa = {
8214
8227
  "linha-opacidade": "opacidade",
8215
8228
  "linha-terminacao": "terminacao",
8216
8229
  "linha-juncao": "juncao"
8217
- }, Ut = {
8230
+ }, Zt = {
8218
8231
  cor: "corTraco",
8219
8232
  espessura: "espessuraTraco",
8220
8233
  tipo: "tipoLinha",
@@ -8224,37 +8237,37 @@ const fa = {
8224
8237
  opacidade: "opacidadeTraco",
8225
8238
  terminacao: "terminacaoTraco",
8226
8239
  juncao: "juncaoTraco"
8227
- }, _r = 100, Fr = /^\s*\d+(\.\d+)?([\s,]+\d+(\.\d+)?)*\s*$/;
8228
- function Or(n) {
8240
+ }, Fr = 100, Or = /^\s*\d+(\.\d+)?([\s,]+\d+(\.\d+)?)*\s*$/;
8241
+ function qr(n) {
8229
8242
  return Object.prototype.hasOwnProperty.call(fa, n);
8230
8243
  }
8231
- const Vt = (n) => {
8244
+ const jt = (n) => {
8232
8245
  const t = typeof n == "number" ? n : typeof n == "string" && n.trim() !== "" ? Number(n) : NaN;
8233
8246
  return Number.isFinite(t) ? t : void 0;
8234
8247
  };
8235
- function qr(n, t) {
8248
+ function Nr(n, t) {
8236
8249
  if (t != null)
8237
8250
  switch (n) {
8238
8251
  case "cor":
8239
8252
  return (typeof t == "string" ? st(t, "") : "") || void 0;
8240
8253
  case "espessura": {
8241
- const e = Vt(t);
8242
- return e !== void 0 && e >= 0 ? Math.min(_r, e) : void 0;
8254
+ const e = jt(t);
8255
+ return e !== void 0 && e >= 0 ? Math.min(Fr, e) : void 0;
8243
8256
  }
8244
8257
  case "escala": {
8245
- const e = Vt(t);
8258
+ const e = jt(t);
8246
8259
  return e !== void 0 && e > 0 ? e : void 0;
8247
8260
  }
8248
8261
  case "deslocamento":
8249
- return Vt(t);
8262
+ return jt(t);
8250
8263
  case "opacidade": {
8251
- const e = Vt(t);
8264
+ const e = jt(t);
8252
8265
  return e !== void 0 ? Math.min(1, Math.max(0, e)) : void 0;
8253
8266
  }
8254
8267
  case "tipo":
8255
8268
  return za(t);
8256
8269
  case "tracejado":
8257
- return typeof t == "string" && Fr.test(t) ? t.trim() : void 0;
8270
+ return typeof t == "string" && Or.test(t) ? t.trim() : void 0;
8258
8271
  case "terminacao":
8259
8272
  return Aa(t) ? t : void 0;
8260
8273
  case "juncao":
@@ -8266,25 +8279,25 @@ function qr(n, t) {
8266
8279
  function _o(n, t) {
8267
8280
  const e = { ...n };
8268
8281
  if (!t || typeof t != "object") return e;
8269
- for (const o of Object.keys(Ut)) {
8282
+ for (const o of Object.keys(Zt)) {
8270
8283
  if (!Object.prototype.hasOwnProperty.call(t, o)) continue;
8271
- const a = qr(o, t[o]);
8272
- a === void 0 ? delete e[Ut[o]] : e[Ut[o]] = a;
8284
+ const a = Nr(o, t[o]);
8285
+ a === void 0 ? delete e[Zt[o]] : e[Zt[o]] = a;
8273
8286
  }
8274
8287
  return e;
8275
8288
  }
8276
- function Nr(n) {
8289
+ function $r(n) {
8277
8290
  const t = {};
8278
- for (const [e, o] of Object.entries(Ut)) {
8291
+ for (const [e, o] of Object.entries(Zt)) {
8279
8292
  const a = n[o];
8280
8293
  a !== void 0 && (t[e] = a);
8281
8294
  }
8282
8295
  return t;
8283
8296
  }
8284
- function $r(n, t) {
8297
+ function Rr(n, t) {
8285
8298
  return { [fa[n]]: t };
8286
8299
  }
8287
- class Rr extends Fa {
8300
+ class Br extends Fa {
8288
8301
  constructor() {
8289
8302
  super();
8290
8303
  p(this, "shadow");
@@ -8297,9 +8310,9 @@ class Rr extends Fa {
8297
8310
  p(this, "colecoesDados");
8298
8311
  p(this, "feicoes");
8299
8312
  p(this, "barraFerramentas");
8300
- p(this, "hoverListeners", new Kt());
8313
+ p(this, "hoverListeners", new Qt());
8301
8314
  p(this, "desligarAnuncios", null);
8302
- p(this, "layerItemListeners", new Kt());
8315
+ p(this, "layerItemListeners", new Qt());
8303
8316
  p(this, "initTimeout");
8304
8317
  p(this, "estilosExternos");
8305
8318
  p(this, "lastPopupActionEmit");
@@ -8311,7 +8324,7 @@ class Rr extends Fa {
8311
8324
  p(this, "_zonaProjecao");
8312
8325
  p(this, "hudCoordAgendado", !1);
8313
8326
  p(this, "hudCursorFora", !0);
8314
- this.shadow = this.attachShadow({ mode: "open" }), this.controller = new En(), this.controladorTamanho = $n(this, this.controller), this.shadow.innerHTML = Hn(), this.estilosExternos = new Dr(this.shadow), this.mapContainer = this.shadow.getElementById("cad-map-container"), this.layersPanel = this.shadow.getElementById("qgis-layer-panel"), this.toolbarPainel = new Bn({
8327
+ this.shadow = this.attachShadow({ mode: "open" }), this.controller = new kn(), this.controladorTamanho = Rn(this, this.controller), this.shadow.innerHTML = Gn(), this.estilosExternos = new _r(this.shadow), this.mapContainer = this.shadow.getElementById("cad-map-container"), this.layersPanel = this.shadow.getElementById("qgis-layer-panel"), this.toolbarPainel = new Vn({
8315
8328
  shadow: this.shadow,
8316
8329
  mapContainer: this.mapContainer,
8317
8330
  layersPanel: this.layersPanel,
@@ -8322,18 +8335,18 @@ class Rr extends Fa {
8322
8335
  onToggleSnap: () => this.feicoes.alternarSnap(),
8323
8336
  onTratarCliqueCanvas: (i) => this.tratarCliqueLivreCanvas(i),
8324
8337
  onDispararAcaoPopup: (i, s) => this.dispararAcaoPopup(i, s)
8325
- }), this.broadcastConfig = new Rn({
8338
+ }), this.broadcastConfig = new Bn({
8326
8339
  host: this,
8327
8340
  controller: this.controller,
8328
8341
  mapContainer: this.mapContainer,
8329
8342
  setLayerOpacity: (i, s) => this.setLayerOpacity(i, s)
8330
- }), this.colecoesDados = new Vn({
8343
+ }), this.colecoesDados = new jn({
8331
8344
  obterController: () => this.controller,
8332
8345
  obterChaveGrupo: () => this.chaveGrupo,
8333
8346
  setLayerVisibility: (i, s) => this.setLayerVisibility(i, s)
8334
8347
  });
8335
8348
  const e = new He(), o = this.controller.context, a = this.controller.canvasInteracao.ctx;
8336
- Object.assign(o, { regraVersoes: e, renderizador: () => this.renderizador, qualidade: () => this.perfilQualidade }), this.feicoes = new Ar({
8349
+ Object.assign(o, { regraVersoes: e, renderizador: () => this.renderizador, qualidade: () => this.perfilQualidade }), this.feicoes = new zr({
8337
8350
  obterLayerManager: () => this.controller.layerManager,
8338
8351
  obterMapa: () => this.controller.getMap(),
8339
8352
  regra: e,
@@ -8358,7 +8371,7 @@ class Rr extends Fa {
8358
8371
  const r = this.feicoes.tratarAcaoCamada(i, s);
8359
8372
  r && this.dispatchEvent(new CustomEvent(r, { detail: s, bubbles: !0, composed: !0 }));
8360
8373
  }
8361
- }), this.barraFerramentas = new Er({
8374
+ }), this.barraFerramentas = new kr({
8362
8375
  raiz: this.shadow.getElementById("cad-root"),
8363
8376
  aoEscolher: (i) => {
8364
8377
  this.feicoes.alternarFerramenta(i);
@@ -8372,7 +8385,7 @@ class Rr extends Fa {
8372
8385
  edicaoAtiva: () => this.feicoes.editando,
8373
8386
  aoLimparSelecao: () => this.feicoes.aoPedirLimpeza(),
8374
8387
  selecionarFeicoesNaCaixa: (i, s, r) => this.feicoes.selecionarNaCaixa(i, s, r)
8375
- }), os(this.shadow), Lo(this.shadow, !0);
8388
+ }), as(this.shadow), Lo(this.shadow, !0);
8376
8389
  }
8377
8390
  static get observedAttributes() {
8378
8391
  return [
@@ -8411,16 +8424,16 @@ class Rr extends Fa {
8411
8424
  }
8412
8425
  connectedCallback() {
8413
8426
  var o;
8414
- const e = oe(this.getAttribute("zona-projecao") || this.getAttribute("fuso"));
8427
+ const e = ae(this.getAttribute("zona-projecao") || this.getAttribute("fuso"));
8415
8428
  e !== null && (this._zonaProjecao = e, this.controller.zonaProjecao = e, this.controller.context.zonaProjecao = e), this.controller.core.definirModoPopups(this.popups), this.aplicarPopupSigef(), this.controladorTamanho.observe(), this.feicoes.conectarTeclado(), this.hoverListeners.cleanup(), this.mapContainer && (this.hoverListeners.add(this.mapContainer, "mousemove", (a) => {
8416
8429
  this.feicoes.aoMoverMouse(a), this.hudCursorFora = !1, this.atualizarHudCoordenadas(a);
8417
8430
  }), this.hoverListeners.add(this.mapContainer, "mouseleave", () => {
8418
- this.hudCursorFora = !0, this.escreverHudCoordenadas(Zn);
8431
+ this.hudCursorFora = !0, this.escreverHudCoordenadas(Wn);
8419
8432
  }), this.hoverListeners.add(this.mapContainer, "dblclick", (a) => this.feicoes.aoDuploClique(a))), this.hoverListeners.add(this, "mouseenter", () => {
8420
8433
  this.ponteiroSobre = !0;
8421
8434
  }), this.hoverListeners.add(this, "mouseleave", () => {
8422
8435
  this.ponteiroSobre = !1;
8423
- }), this.montarBarra(this.getAttribute("ferramentas")), this.broadcastConfig.conectar(), (o = this.desligarAnuncios) == null || o.call(this), this.desligarAnuncios = rs(this, this.shadow), this.estilosExternos.aplicar(), io(this, this.layersPanel), this.initTimeout = window.setTimeout(() => {
8436
+ }), this.montarBarra(this.getAttribute("ferramentas")), this.broadcastConfig.conectar(), (o = this.desligarAnuncios) == null || o.call(this), this.desligarAnuncios = cs(this, this.shadow), this.estilosExternos.aplicar(), io(this, this.layersPanel), this.initTimeout = window.setTimeout(() => {
8424
8437
  this.initTimeout = void 0, this.inicializarAgora();
8425
8438
  }, 0);
8426
8439
  }
@@ -8431,7 +8444,7 @@ class Rr extends Fa {
8431
8444
  atualizarHudZoom() {
8432
8445
  var o;
8433
8446
  const e = this.shadow.getElementById("cad-coord-zoom");
8434
- e && (e.textContent = Wn((o = this.controller.getMap()) == null ? void 0 : o.getZoom()));
8447
+ e && (e.textContent = Xn((o = this.controller.getMap()) == null ? void 0 : o.getZoom()));
8435
8448
  }
8436
8449
  /** Zoom no HUD desde a criação do mapa e a cada `zoomend` (o `map.remove()` do destroy solta o ouvinte). */
8437
8450
  conectarHudZoom() {
@@ -8447,14 +8460,14 @@ class Rr extends Fa {
8447
8460
  if (!s || !this.mapContainer) return;
8448
8461
  const r = this.mapContainer.getBoundingClientRect(), c = b.point(o - r.left, a - r.top), l = s.containerPointToLatLng(c);
8449
8462
  if (!l || !Number.isFinite(l.lat) || !Number.isFinite(l.lng)) return;
8450
- const d = Xn(l.lat, l.lng, this._zonaProjecao);
8463
+ const d = Kn(l.lat, l.lng, this._zonaProjecao);
8451
8464
  d && this.escreverHudCoordenadas(d);
8452
8465
  };
8453
8466
  typeof requestAnimationFrame == "function" ? requestAnimationFrame(i) : setTimeout(i, 16);
8454
8467
  }
8455
8468
  montarBarra(e) {
8456
8469
  var o;
8457
- (o = this.barraFerramentas) == null || o.montar(zr(e), wr(e));
8470
+ (o = this.barraFerramentas) == null || o.montar(wr(e), Er(e));
8458
8471
  }
8459
8472
  /** Ú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. */
8460
8473
  ehUnicoCanvas() {
@@ -8500,7 +8513,7 @@ class Rr extends Fa {
8500
8513
  return;
8501
8514
  }
8502
8515
  if (e === "popups") {
8503
- (r = this.controller) == null || r.core.definirModoPopups(Yt(a));
8516
+ (r = this.controller) == null || r.core.definirModoPopups(Jt(a));
8504
8517
  return;
8505
8518
  }
8506
8519
  if (e === "renderizador") {
@@ -8513,8 +8526,8 @@ class Rr extends Fa {
8513
8526
  this.aplicarQualidadeAoMapa(), (l = this.controller) == null || l.layerManager.recriarCamadasDoTipo("feicoes");
8514
8527
  return;
8515
8528
  }
8516
- if (Or(e)) {
8517
- (d = this.feicoes) == null || d.definirEstiloDesenho(_o(this.feicoes.obterEstiloDesenho(), $r(e, a)));
8529
+ if (qr(e)) {
8530
+ (d = this.feicoes) == null || d.definirEstiloDesenho(_o(this.feicoes.obterEstiloDesenho(), Rr(e, a)));
8518
8531
  return;
8519
8532
  }
8520
8533
  if (e === "aceitar-origem") {
@@ -8525,7 +8538,7 @@ class Rr extends Fa {
8525
8538
  this.montarBarra(a), (f = this.barraFerramentas) == null || f.marcar(((h = this.feicoes) == null ? void 0 : h.ferramentaAtiva) ?? null), (m = this.barraFerramentas) == null || m.marcarEdicao(!!((g = this.feicoes) != null && g.editando));
8526
8539
  return;
8527
8540
  }
8528
- Kn(
8541
+ Qn(
8529
8542
  {
8530
8543
  host: this,
8531
8544
  controller: this.controller,
@@ -8561,7 +8574,7 @@ class Rr extends Fa {
8561
8574
  this.estilosExternos.definir(e);
8562
8575
  }
8563
8576
  initCAD() {
8564
- Qn({
8577
+ Yn({
8565
8578
  host: this,
8566
8579
  shadow: this.shadow,
8567
8580
  mapContainer: this.mapContainer,
@@ -8591,11 +8604,11 @@ class Rr extends Fa {
8591
8604
  }
8592
8605
  tratarCliqueLivreCanvas(e, o, a) {
8593
8606
  const i = Date.now();
8594
- i - this.lastCanvasClickTime < 50 || (this.lastCanvasClickTime = i, Fn(this.obterContextoEventos(), e, o, a));
8607
+ i - this.lastCanvasClickTime < 50 || (this.lastCanvasClickTime = i, On(this.obterContextoEventos(), e, o, a));
8595
8608
  }
8596
8609
  dispararAcaoPopup(e, o, a) {
8597
8610
  const i = Date.now();
8598
- this.lastPopupActionEmit && this.lastPopupActionEmit.acaoId === e && this.lastPopupActionEmit.elementoId === o && i - this.lastPopupActionEmit.time < 50 || (this.lastPopupActionEmit = { acaoId: e, elementoId: o, time: i }, On(this.obterContextoEventos(), e, o, a));
8611
+ this.lastPopupActionEmit && this.lastPopupActionEmit.acaoId === e && this.lastPopupActionEmit.elementoId === o && i - this.lastPopupActionEmit.time < 50 || (this.lastPopupActionEmit = { acaoId: e, elementoId: o, time: i }, qn(this.obterContextoEventos(), e, o, a));
8599
8612
  }
8600
8613
  toggleLayersPanel() {
8601
8614
  this.hasAttribute("sem-painel-camadas") || this.toolbarPainel.toggleLayersPanel();
@@ -8605,7 +8618,7 @@ class Rr extends Fa {
8605
8618
  }
8606
8619
  renderLayersUI() {
8607
8620
  const e = this.shadow.getElementById("layers-list-container");
8608
- kn(e, this.controller.layerManager.getLayers(), this.layerItemListeners, {
8621
+ In(e, this.controller.layerManager.getLayers(), this.layerItemListeners, {
8609
8622
  setLayerVisibility: (o, a) => this.setLayerVisibility(o, a),
8610
8623
  setLayerOpacity: (o, a) => this.setLayerOpacity(o, a),
8611
8624
  setLayerBlocked: (o, a) => this.controller.layerManager.setLayerBlocked(o, a),
@@ -8676,7 +8689,7 @@ class Rr extends Fa {
8676
8689
  * `desligado` só por `abrirPopupFeicao()`. Valor inválido usa o padrão.
8677
8690
  */
8678
8691
  get popups() {
8679
- return Yt(this.getAttribute("popups"));
8692
+ return Jt(this.getAttribute("popups"));
8680
8693
  }
8681
8694
  set popups(e) {
8682
8695
  this.setAttribute("popups", String(e));
@@ -8712,7 +8725,7 @@ class Rr extends Fa {
8712
8725
  }
8713
8726
  aplicarQualidadeAoMapa() {
8714
8727
  var e;
8715
- Ji((e = this.controller) == null ? void 0 : e.getMap(), this.perfilQualidade);
8728
+ tn((e = this.controller) == null ? void 0 : e.getMap(), this.perfilQualidade);
8716
8729
  }
8717
8730
  /**
8718
8731
  * Contadores do desenho de uma camada de feições (`total`, `materializadas`, `desenhadas`, `marcasLOD`, `clusters`,
@@ -8744,7 +8757,7 @@ class Rr extends Fa {
8744
8757
  return this._zonaProjecao ?? 22;
8745
8758
  }
8746
8759
  set zonaProjecao(e) {
8747
- const o = oe(e);
8760
+ const o = ae(e);
8748
8761
  if (o !== null) {
8749
8762
  this._zonaProjecao = o;
8750
8763
  const a = String(o);
@@ -8771,7 +8784,7 @@ class Rr extends Fa {
8771
8784
  this.controller.selectPonto(e, o);
8772
8785
  }
8773
8786
  get pontosSelecionados() {
8774
- return In(this.controller);
8787
+ return Tn(this.controller);
8775
8788
  }
8776
8789
  set pontosSelecionados(e) {
8777
8790
  const o = Array.isArray(e) ? e : [];
@@ -8951,7 +8964,7 @@ class Rr extends Fa {
8951
8964
  this.feicoes.definirEstiloDesenho(_o(this.feicoes.obterEstiloDesenho(), e));
8952
8965
  }
8953
8966
  obterLinhaPadrao() {
8954
- return Nr(this.feicoes.obterEstiloDesenho());
8967
+ return $r(this.feicoes.obterEstiloDesenho());
8955
8968
  }
8956
8969
  /**
8957
8970
  * Ferramentas: ponto, linha, poligono, retangulo, elipse, poligono-regular, estrela, circulo, texto, caneta,
@@ -8981,6 +8994,10 @@ class Rr extends Fa {
8981
8994
  gerarBuffer(e, o, a, i) {
8982
8995
  return this.feicoes.gerarBuffer(e, o, a, i);
8983
8996
  }
8997
+ /** Cria a feição paralela (offset de CAD) a `metros` do `lado` do sentido do traçado; linha ou polígono sem furos. */
8998
+ offsetFeicao(e, o, a, i, s) {
8999
+ return this.feicoes.offsetFeicao(e, o, a, i, s);
9000
+ }
8984
9001
  duplicarFeicao(e, o, a, i) {
8985
9002
  return this.feicoes.duplicarFeicao(e, o, a, i);
8986
9003
  }
@@ -9064,8 +9081,8 @@ class Rr extends Fa {
9064
9081
  return this.controller.layerManager;
9065
9082
  }
9066
9083
  }
9067
- Na("ui-canvas-cad", Rr);
9068
- class oc {
9084
+ Na("ui-canvas-cad", Br);
9085
+ class ac {
9069
9086
  constructor(t, e) {
9070
9087
  p(this, "polylines", []);
9071
9088
  p(this, "bancoPontosAtivo", !1);
@@ -9116,9 +9133,9 @@ class oc {
9116
9133
  (h) => h.lat && h.lon && h.lat !== 0 && h.lon !== 0 && h.tipo_ponto !== "B" && h.tipo !== "B" && h.ignorar_poligono !== 1
9117
9134
  );
9118
9135
  if (e.length < 2) return;
9119
- const o = ((c = this.core.controller) == null ? void 0 : c.chaveGrupo) || ((d = (l = this.core.controller) == null ? void 0 : l.context) == null ? void 0 : d.chaveGrupo), a = Wt(e, o), i = this.bancoPontosAtivo ? "#94a3b8" : "#10b981", s = this.core.config.fechamentoWeight || 2, r = this.bancoPontosAtivo ? 0.4 : 1;
9136
+ const o = ((c = this.core.controller) == null ? void 0 : c.chaveGrupo) || ((d = (l = this.core.controller) == null ? void 0 : l.context) == null ? void 0 : d.chaveGrupo), a = Xt(e, o), i = this.bancoPontosAtivo ? "#94a3b8" : "#10b981", s = this.core.config.fechamentoWeight || 2, r = this.bancoPontosAtivo ? 0.4 : 1;
9120
9137
  Object.values(a).forEach((h) => {
9121
- const f = Xt(h);
9138
+ const f = Kt(h);
9122
9139
  if (f.length < 2) return;
9123
9140
  for (let P = 0; P < f.length - 1; P++) {
9124
9141
  const x = f[P], M = f[P + 1], A = [[x.lat, x.lon], [M.lat, M.lon]], C = b.polyline(A, {
@@ -9189,9 +9206,9 @@ class oc {
9189
9206
  pane: "verticesPane"
9190
9207
  }).bindPopup(h, { className: "compact-popup", maxWidth: 220 }).addTo(this.core.bancoPontosGroup);
9191
9208
  });
9192
- const o = ((i = this.core.controller) == null ? void 0 : i.chaveGrupo) || ((r = (s = this.core.controller) == null ? void 0 : s.context) == null ? void 0 : r.chaveGrupo), a = Wt(e, o);
9209
+ const o = ((i = this.core.controller) == null ? void 0 : i.chaveGrupo) || ((r = (s = this.core.controller) == null ? void 0 : s.context) == null ? void 0 : r.chaveGrupo), a = Xt(e, o);
9193
9210
  for (const c in a) {
9194
- const l = Xt(a[c]);
9211
+ const l = Kt(a[c]);
9195
9212
  if (l.length >= 2) {
9196
9213
  const d = l.map((h) => b.latLng(h.lat, h.lon));
9197
9214
  d.push(b.latLng(l[0].lat, l[0].lon)), b.polyline(d, {
@@ -9208,7 +9225,7 @@ class oc {
9208
9225
  this.core.map && this.polylines.forEach((t) => this.core.map.removeLayer(t)), this.core.bancoPontosGroup && this.core.bancoPontosGroup.clearLayers(), this.polylines = [];
9209
9226
  }
9210
9227
  }
9211
- class ac {
9228
+ class ic {
9212
9229
  constructor(t, e) {
9213
9230
  p(this, "markers", []);
9214
9231
  p(this, "vizinhosMarkers", []);
@@ -9224,7 +9241,7 @@ class ac {
9224
9241
  const r = o.tipo_ponto === "B" || o.tipo === "B", c = o.tipo_ponto === "M" || o.tipo === "M";
9225
9242
  let l = "bg-mint-vibrant", d = "x", h = 7;
9226
9243
  c ? (l = "bg-indigo-500", h = 9) : r && (l = "bg-rose-500", h = 9);
9227
- const f = this.core.config.enableAnimations ? "transition-all duration-150" : "", g = (i = (a = this.controller) == null ? void 0 : a.linhas) != null && i.bancoPontosAtivo ? "opacity-40 hover:opacity-100" : "", m = te(d, h, l, `${f} ${g}`, `map-marker-${o.id}`), u = b.divIcon({
9244
+ const f = this.core.config.enableAnimations ? "transition-all duration-150" : "", g = (i = (a = this.controller) == null ? void 0 : a.linhas) != null && i.bancoPontosAtivo ? "opacity-40 hover:opacity-100" : "", m = ee(d, h, l, `${f} ${g}`, `map-marker-${o.id}`), u = b.divIcon({
9228
9245
  html: m,
9229
9246
  className: "custom-leaflet-marker flex items-center justify-center",
9230
9247
  iconSize: [h + 6, h + 6]
@@ -9296,7 +9313,7 @@ class ac {
9296
9313
  });
9297
9314
  let s = this.core.config.markerStyleV || "cross", r = this.core.config.markerSizeV || 8;
9298
9315
  a.tipo_ponto === "M" || a.tipo === "M" || a.tipo === "B" ? (s = this.core.config.markerStyleM || "circle-dot", r = this.core.config.markerSizeM || 14) : (a.tipo_ponto === "P" || a.tipo === "P" || a.tipo === "O") && (s = this.core.config.markerStyleP || "circle", r = this.core.config.markerSizeP || 10);
9299
- const c = this.core.config.enableAnimations ? "transition-all duration-150" : "", l = te(s, r, "bg-[#a855f7]", c, `map-marker-vizinho-${a.id}`), d = b.divIcon({
9316
+ const c = this.core.config.enableAnimations ? "transition-all duration-150" : "", l = ee(s, r, "bg-[#a855f7]", c, `map-marker-vizinho-${a.id}`), d = b.divIcon({
9300
9317
  html: l,
9301
9318
  className: "custom-leaflet-marker flex items-center justify-center",
9302
9319
  iconSize: [r + 4, r + 4]
@@ -9349,227 +9366,228 @@ class ac {
9349
9366
  export {
9350
9367
  fa as ATRIBUTOS_LINHA_PADRAO,
9351
9368
  Ia as AgrupadorCluster,
9352
- En as CADMapaController,
9353
- xi as CAD_INTERACTIVE_PANES,
9354
- zc as CELULA_CLUSTER_PX,
9369
+ kn as CADMapaController,
9370
+ Pi as CAD_INTERACTIVE_PANES,
9371
+ wc as CELULA_CLUSTER_PX,
9355
9372
  Eo as CLASSE_FERRAMENTA_ATIVA,
9356
9373
  je as COR_PADRAO,
9357
- Zt as COR_SELECAO,
9358
- Ts as CSS_BARRA_HUD,
9359
- Ds as CSS_CAMPO_HUD,
9374
+ Wt as COR_SELECAO,
9375
+ Ds as CSS_BARRA_HUD,
9376
+ _s as CSS_CAMPO_HUD,
9360
9377
  ca as CSS_POSICAO_HUD,
9361
- En as CanvasCADController,
9362
- ee as CanvasFormas,
9363
- Ii as CanvasInteracao,
9364
- fn as CanvasLayerManager,
9365
- Vs as ControleDesenho,
9366
- gs as CursoresRemotos,
9378
+ kn as CanvasCADController,
9379
+ oe as CanvasFormas,
9380
+ Ti as CanvasInteracao,
9381
+ mn as CanvasLayerManager,
9382
+ js as ControleDesenho,
9383
+ vs as CursoresRemotos,
9367
9384
  uo as DEFAULT_CONFIG,
9368
9385
  Co as DEFAULT_LAYERS,
9369
- wc as DadosCamada,
9370
- un as DespachanteFeicoes,
9371
- yr as EditorVertices,
9386
+ Ec as DadosCamada,
9387
+ pn as DespachanteFeicoes,
9388
+ xr as EditorVertices,
9372
9389
  ho as FERRAMENTAS,
9373
- Es as FOLGA_HUD,
9374
- ks as FRACAO_LARGURA_HUD,
9375
- Ss as FeicaoPopup,
9376
- dn as FeicoesCanvasRenderer,
9377
- Wi as FeicoesLayerRenderer,
9378
- En as GerenciGeoMapaController,
9379
- Ni as GridLayerRenderer,
9390
+ ks as FOLGA_HUD,
9391
+ Is as FRACAO_LARGURA_HUD,
9392
+ Ls as FeicaoPopup,
9393
+ hn as FeicoesCanvasRenderer,
9394
+ Xi as FeicoesLayerRenderer,
9395
+ kn as GerenciGeoMapaController,
9396
+ $i as GridLayerRenderer,
9380
9397
  X as HUD_COR,
9381
9398
  _e as ICONES_FEICAO,
9382
- _s as ID_HUD_DESENHO,
9383
- dr as ID_HUD_EDICAO,
9399
+ Fs as ID_HUD_DESENHO,
9400
+ hr as ID_HUD_EDICAO,
9384
9401
  ya as IndiceEspacial,
9385
- sc as InternadorEstilos,
9402
+ rc as InternadorEstilos,
9386
9403
  Te as LIMIAR_DENSIDADE_ALTA,
9387
9404
  fe as LIMITE_CULLING,
9388
- Ec as LIMITE_MARCA_PX,
9389
- kc as LIMITE_MIUDA_PX,
9405
+ kc as LIMITE_MARCA_PX,
9406
+ Ic as LIMITE_MIUDA_PX,
9390
9407
  R as LayerRendererFactory,
9391
- ws as MARGEM_HUD_PADRAO,
9392
- Ya as MAX_NOS_COM_ALCA_LATENTE,
9393
- Ic as MAX_PONTOS_SEM_CLUSTER,
9394
- Wc as MAX_VERTICES_EDICAO,
9408
+ Es as MARGEM_HUD_PADRAO,
9409
+ Ja as MAX_NOS_COM_ALCA_LATENTE,
9410
+ Tc as MAX_PONTOS_SEM_CLUSTER,
9411
+ Xc as MAX_VERTICES_EDICAO,
9395
9412
  Pa as MIN_VERTICES_SIMPLIFICAR,
9396
9413
  Ee as MapaConfigManager,
9397
- yi as MapaCore,
9398
- oc as MapaLinhas,
9399
- ac as MapaMarcadores,
9414
+ xi as MapaCore,
9415
+ ac as MapaLinhas,
9416
+ ic as MapaMarcadores,
9400
9417
  Ta as MotorFormas,
9401
- Tc as OPACIDADE_MARCA,
9418
+ Dc as OPACIDADE_MARCA,
9402
9419
  Se as PROPRIEDADES_HUD,
9403
9420
  qo as PintorCanvas2D,
9404
- cl as RAIO_MINIMO_CIRCULO_M,
9405
- Xc as RAIO_MINIMO_EDICAO_CIRCULO_M,
9421
+ ll as RAIO_MINIMO_CIRCULO_M,
9422
+ Kc as RAIO_MINIMO_EDICAO_CIRCULO_M,
9406
9423
  He as RegraVersoes,
9407
9424
  ke as SIGEF_WMS_CAMADA,
9408
9425
  Bo as SIGEF_WMS_URL,
9409
- vs as SelecaoFeicoes,
9426
+ bs as SelecaoFeicoes,
9410
9427
  ce as SessaoDesenho,
9411
- rc as TIPOS_LINHA,
9412
- $i as TOLERANCIA_AMOSTRA_PX,
9428
+ cc as TIPOS_LINHA,
9429
+ Ri as TOLERANCIA_AMOSTRA_PX,
9413
9430
  le as TOLERANCIA_LINHA_PX,
9414
- Ci as TOLERANCIA_PONTO_PX,
9415
- oi as TOLERANCIA_SNAP_PX,
9416
- Ti as TileLayerRenderer,
9417
- Rr as UICanvasCAD,
9418
- _i as VectorLinesLayerRenderer,
9419
- Oi as VectorPointsLayerRenderer,
9420
- qi as VectorPolygonsLayerRenderer,
9421
- Di as WmsLayerRenderer,
9422
- Dc as ZOOM_DESMEMBRAR,
9423
- _c as ZOOM_MAX_MIUDA,
9431
+ Si as TOLERANCIA_PONTO_PX,
9432
+ ai as TOLERANCIA_SNAP_PX,
9433
+ Di as TileLayerRenderer,
9434
+ Br as UICanvasCAD,
9435
+ Fi as VectorLinesLayerRenderer,
9436
+ qi as VectorPointsLayerRenderer,
9437
+ Ni as VectorPolygonsLayerRenderer,
9438
+ _i as WmsLayerRenderer,
9439
+ _c as ZOOM_DESMEMBRAR,
9440
+ Fc as ZOOM_MAX_MIUDA,
9424
9441
  Qe as ZOOM_SEM_SIMPLIFICACAO,
9425
- Fc as agruparMarcasPorCor,
9426
- Oc as agruparPontos,
9427
- Wt as agruparPontosPorChave,
9442
+ Oc as agruparMarcasPorCor,
9443
+ qc as agruparPontos,
9444
+ Xt as agruparPontosPorChave,
9428
9445
  we as alcaLatente,
9429
9446
  No as alternarSuavidade,
9430
- ll as amostrarBezier,
9431
- Is as aplicarMargensHud,
9447
+ dl as amostrarBezier,
9448
+ Ts as aplicarMargensHud,
9432
9449
  ut as areaDaGeometria,
9433
- Hc as areaMetros2,
9450
+ Gc as areaMetros2,
9434
9451
  kt as bindPopupAcoesEvents,
9435
- ai as buscarSnap,
9436
- cc as caixaDaFeicao,
9437
- lc as caixaPx,
9452
+ ii as buscarSnap,
9453
+ lc as caixaDaFeicao,
9454
+ dc as caixaPx,
9438
9455
  Dt as caixasSeTocam,
9439
- qc as centroDe,
9440
- re as clonarFeicao,
9456
+ Nc as centroDe,
9457
+ Ft as clonarFeicao,
9441
9458
  so as comAlcaMovida,
9442
9459
  ft as comNos,
9443
9460
  ze as comPontos,
9444
- Kc as comVertices,
9461
+ Qc as comVertices,
9445
9462
  Ba as comprimentoMetros,
9446
- tc as confrontanteParaFeicao,
9463
+ ec as confrontanteParaFeicao,
9447
9464
  Wo as consultarFeicoesNoPonto,
9448
9465
  jo as consultarSigefParcelas,
9449
- se as contarItensCanvas,
9450
- Qc as converterArea,
9451
- Yc as converterComprimento,
9452
- ae as coordenadaDeReferencia,
9466
+ re as contarItensCanvas,
9467
+ Yc as converterArea,
9468
+ Jc as converterComprimento,
9469
+ ie as coordenadaDeReferencia,
9453
9470
  Be as corHexSegura,
9454
9471
  st as corSegura,
9455
- $n as criarControladorTamanho,
9472
+ Rn as criarControladorTamanho,
9456
9473
  Ae as criarLinha,
9457
9474
  la as cssBotaoHud,
9458
- dc as dashTipoLinha,
9459
- Bc as ddParaDms,
9475
+ hc as dashTipoLinha,
9476
+ Vc as ddParaDms,
9460
9477
  St as deMetros,
9461
- Za as deslocarGeometria,
9478
+ Wa as deslocarGeometria,
9462
9479
  eo as deveAgrupar,
9463
9480
  to as diagonalPx,
9464
- hc as distSegmentoPx,
9465
- Jc as distanciaEntre,
9481
+ uc as distSegmentoPx,
9482
+ tl as distanciaEntre,
9466
9483
  Oo as distanciaMetros,
9467
9484
  Ga as dividirPoligonoComLinha,
9468
- Vc as dmsParaDd,
9485
+ jc as dmsParaDd,
9469
9486
  Ro as ehFerramenta,
9470
9487
  Ea as ehMarca,
9471
9488
  no as ehMultilinha,
9472
- uc as ehTipoLinha,
9489
+ pc as ehTipoLinha,
9473
9490
  dt as entidadeDe,
9474
9491
  lo as entradaDaAncora,
9475
- pc as escalaDoZoom,
9476
- fc as escalaLatitude,
9477
- mc as escalaTipoLinhaSegura,
9492
+ fc as escalaDoZoom,
9493
+ mc as escalaLatitude,
9494
+ gc as escalaTipoLinhaSegura,
9478
9495
  I as escapeHtml,
9479
9496
  Me as estiloVetorDe,
9480
9497
  pt as extensaoDaGeometria,
9481
9498
  oo as extrairCentroDeWkt,
9482
- hi as extrairCodigoParcelaSigef,
9483
- Fi as extrairCorPonto,
9484
- ui as extrairParcelasSigef,
9485
- Gc as extremosDoCirculoGeografico,
9499
+ ui as extrairCodigoParcelaSigef,
9500
+ Oi as extrairCorPonto,
9501
+ pi as extrairParcelasSigef,
9502
+ Uc as extremosDoCirculoGeografico,
9486
9503
  Ko as fatorDensidade,
9487
- ni as feicaoNaCaixa,
9488
- ii as feicaoNoLaco,
9489
- ne as feicaoNoPonto,
9490
- Qr as feicaoNoTopo,
9491
- us as feicoesEquivalentes,
9504
+ si as feicaoNaCaixa,
9505
+ ni as feicaoNoLaco,
9506
+ se as feicaoNoPonto,
9507
+ Yr as feicaoNoTopo,
9508
+ ps as feicoesEquivalentes,
9492
9509
  ao as formatUTM,
9493
9510
  Ct as formatarArea,
9494
9511
  K as formatarExtensao,
9495
- Li as garantirCanvasSemEventos,
9512
+ Mi as garantirCanvasSemEventos,
9496
9513
  Ua as gerarBuffer,
9497
- te as getPointShapeHtml,
9498
- Ja as inserirPonto,
9499
- tl as inserirVertice,
9514
+ ee as getPointShapeHtml,
9515
+ ti as inserirPonto,
9516
+ el as inserirVertice,
9500
9517
  Ma as juncaoCanvas,
9501
- Wa as juntarLinhas,
9502
- Xa as juntarPoligonos,
9518
+ Xa as juntarLinhas,
9519
+ Ka as juntarPoligonos,
9503
9520
  ka as ladoMarca,
9504
9521
  _t as latLonDoMundo,
9505
9522
  Da as latLonParaUtm,
9506
- hn as lerModoRenderizador,
9523
+ un as lerModoRenderizador,
9507
9524
  da as ligarHoverHud,
9508
9525
  Ra as limitesDaGeometria,
9509
- Uc as metrosPorGrau,
9510
- gc as metrosPorPixel,
9511
- ei as minimoVertices,
9526
+ Zc as metrosPorGrau,
9527
+ vc as metrosPorPixel,
9528
+ oi as minimoVertices,
9512
9529
  De as modoDensidade,
9513
- li as montarUrlConsultaSigef,
9530
+ di as montarUrlConsultaSigef,
9514
9531
  $o as moverAlca,
9515
- el as moverVertice,
9516
- Nc as nivelDetalhe,
9532
+ ol as moverVertice,
9533
+ $c as nivelDetalhe,
9517
9534
  ra as normalizarAnel,
9518
9535
  J as normalizarCoordenada,
9519
9536
  Pe as normalizarFeicaoEntrada,
9520
9537
  Mo as normalizarLinha,
9521
- ls as normalizarPoligono,
9538
+ ds as normalizarPoligono,
9522
9539
  za as normalizarTipoLinha,
9523
- Qa as nosDe,
9524
- dl as nosDeAncoras,
9540
+ Ya as nosDe,
9541
+ hl as nosDeAncoras,
9525
9542
  U as nosOuVertices,
9526
- Xt as ordenarPontosPorSequencia,
9543
+ Za as offsetParalelo,
9544
+ Kt as ordenarPontosPorSequencia,
9527
9545
  Q as paraMetros,
9528
9546
  V as parseCoordenada,
9529
- ol as parseDash,
9530
- Qt as partesDaLinha,
9547
+ al as parseDash,
9548
+ Yt as partesDaLinha,
9531
9549
  wa as pintarMarcas,
9532
- Ka as planoLocal,
9533
- al as pontoDaBordaDoCirculo,
9550
+ Qa as planoLocal,
9551
+ il as pontoDaBordaDoCirculo,
9534
9552
  Vo as pontoDoClique,
9535
- il as pontoMedio,
9536
- Ft as pontoMedioDoSegmento,
9553
+ nl as pontoMedio,
9554
+ Ot as pontoMedioDoSegmento,
9537
9555
  Ha as pontoNoPoligono,
9538
- Yr as pontoParaFeicao,
9556
+ Jr as pontoParaFeicao,
9539
9557
  et as pontosDe,
9540
- ec as posicaoHud,
9541
- On as processarAcaoPopup,
9542
- Fn as processarCliqueLivreCanvas,
9543
- vc as projetarCentro,
9544
- bc as projetarEm,
9545
- $c as projetarMercator,
9546
- yc as projetarSimplificado,
9547
- xc as projetarVertices,
9548
- Pc as raioCirculoPx,
9558
+ oc as posicaoHud,
9559
+ qn as processarAcaoPopup,
9560
+ On as processarCliqueLivreCanvas,
9561
+ bc as projetarCentro,
9562
+ yc as projetarEm,
9563
+ Rc as projetarMercator,
9564
+ xc as projetarSimplificado,
9565
+ Pc as projetarVertices,
9566
+ Cc as raioCirculoPx,
9549
9567
  Ye as raioPontoPx,
9550
- Yi as regioesExpostas,
9568
+ Ji as regioesExpostas,
9551
9569
  Uo as registrarFonteHit,
9552
9570
  Zo as removerFonteHit,
9553
- ti as removerPonto,
9554
- nl as removerVertice,
9571
+ ei as removerPonto,
9572
+ sl as removerVertice,
9555
9573
  Et as renderPopupAcoesHtml,
9556
- kn as renderizarPainelCamadas,
9557
- ki as resolverCliqueCentral,
9558
- Jr as segmentoParaFeicao,
9574
+ In as renderizarPainelCamadas,
9575
+ Ii as resolverCliqueCentral,
9576
+ tc as segmentoParaFeicao,
9559
9577
  ja as segmentosDe,
9560
9578
  ro as segmentosDoEditor,
9561
- Cc as simplificarAnel,
9579
+ Sc as simplificarAnel,
9562
9580
  Ca as simplificarGeometria,
9563
- Sc as simplificarLinha,
9564
- Lc as simplificarPx,
9581
+ Lc as simplificarLinha,
9582
+ Mc as simplificarPx,
9565
9583
  vt as statusDe,
9566
9584
  Aa as terminacaoCanvas,
9567
9585
  $a as textoRotulo,
9568
- Mc as toleranciaPorZoom,
9569
- qn as tratarCliqueMarcador,
9570
- Nn as tratarCliqueSegmento,
9571
- di as urlProxySigef,
9586
+ Ac as toleranciaPorZoom,
9587
+ Nn as tratarCliqueMarcador,
9588
+ $n as tratarCliqueSegmento,
9589
+ hi as urlProxySigef,
9572
9590
  co as verificarEditavel,
9573
9591
  xa as vertices,
9574
- sl as verticesDe
9592
+ rl as verticesDe
9575
9593
  };