@thibezer/ui-components-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +624 -0
  3. package/dist/botao.cjs +1 -0
  4. package/dist/botao.d.ts +8 -0
  5. package/dist/botao.js +6 -0
  6. package/dist/camadas.cjs +296 -0
  7. package/dist/camadas.d.ts +14 -0
  8. package/dist/camadas.js +1857 -0
  9. package/dist/campo-texto.cjs +1 -0
  10. package/dist/campo-texto.d.ts +8 -0
  11. package/dist/campo-texto.js +11 -0
  12. package/dist/canvas.cjs +254 -0
  13. package/dist/canvas.d.ts +8 -0
  14. package/dist/canvas.js +3082 -0
  15. package/dist/card.cjs +1 -0
  16. package/dist/card.d.ts +7 -0
  17. package/dist/card.js +5 -0
  18. package/dist/components/ui-alerta/index.d.ts +2 -0
  19. package/dist/components/ui-alerta/ui-alerta-base.d.ts +23 -0
  20. package/dist/components/ui-alerta/ui-alerta.d.ts +2 -0
  21. package/dist/components/ui-alerta/ui-toast.d.ts +34 -0
  22. package/dist/components/ui-avatar/index.d.ts +1 -0
  23. package/dist/components/ui-avatar/ui-avatar.d.ts +12 -0
  24. package/dist/components/ui-badge/index.d.ts +1 -0
  25. package/dist/components/ui-badge/ui-badge.d.ts +20 -0
  26. package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +22 -0
  27. package/dist/components/ui-barra-ferramentas/ferramentas-icones.d.ts +24 -0
  28. package/dist/components/ui-barra-ferramentas/index.d.ts +4 -0
  29. package/dist/components/ui-barra-ferramentas/tipos.d.ts +55 -0
  30. package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +54 -0
  31. package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +52 -0
  32. package/dist/components/ui-botao/index.d.ts +1 -0
  33. package/dist/components/ui-botao/ui-botao.d.ts +26 -0
  34. package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +18 -0
  35. package/dist/components/ui-camadas/camadas-drag-drop.d.ts +18 -0
  36. package/dist/components/ui-camadas/camadas-eventos-arvore.d.ts +2 -0
  37. package/dist/components/ui-camadas/camadas-eventos-camadas.d.ts +2 -0
  38. package/dist/components/ui-camadas/camadas-eventos-rodape.d.ts +2 -0
  39. package/dist/components/ui-camadas/camadas-host.d.ts +23 -0
  40. package/dist/components/ui-camadas/camadas-icones.d.ts +23 -0
  41. package/dist/components/ui-camadas/camadas-mapas-base.d.ts +3 -0
  42. package/dist/components/ui-camadas/camadas-metricas.d.ts +17 -0
  43. package/dist/components/ui-camadas/camadas-persistencia.d.ts +65 -0
  44. package/dist/components/ui-camadas/camadas-resizer.d.ts +16 -0
  45. package/dist/components/ui-camadas/camadas-rodape.d.ts +2 -0
  46. package/dist/components/ui-camadas/camadas-selecao.d.ts +24 -0
  47. package/dist/components/ui-camadas/camadas-sincronizacao-dom.d.ts +3 -0
  48. package/dist/components/ui-camadas/camadas-teclado.d.ts +3 -0
  49. package/dist/components/ui-camadas/camadas-utils.d.ts +26 -0
  50. package/dist/components/ui-camadas/index.d.ts +11 -0
  51. package/dist/components/ui-camadas/tipos.d.ts +116 -0
  52. package/dist/components/ui-camadas/ui-camadas.d.ts +112 -0
  53. package/dist/components/ui-campo-texto/campo-texto-estados.d.ts +12 -0
  54. package/dist/components/ui-campo-texto/campo-texto-template.d.ts +2 -0
  55. package/dist/components/ui-campo-texto/index.d.ts +1 -0
  56. package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +57 -0
  57. package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +13 -0
  58. package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +19 -0
  59. package/dist/components/ui-canvas-cad/cad-colecoes-dados.d.ts +46 -0
  60. package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +26 -0
  61. package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +19 -0
  62. package/dist/components/ui-canvas-cad/cad-painel-camadas.d.ts +9 -0
  63. package/dist/components/ui-canvas-cad/cad-tamanho-observer.d.ts +7 -0
  64. package/dist/components/ui-canvas-cad/cad-template.d.ts +1 -0
  65. package/dist/components/ui-canvas-cad/cad-toolbar-painel.d.ts +29 -0
  66. package/dist/components/ui-canvas-cad/index.d.ts +8 -0
  67. package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +91 -0
  68. package/dist/components/ui-card/index.d.ts +1 -0
  69. package/dist/components/ui-card/ui-card.d.ts +18 -0
  70. package/dist/components/ui-checkbox/index.d.ts +1 -0
  71. package/dist/components/ui-checkbox/ui-checkbox.d.ts +36 -0
  72. package/dist/components/ui-drawer/drawer-acessibilidade.d.ts +16 -0
  73. package/dist/components/ui-drawer/index.d.ts +1 -0
  74. package/dist/components/ui-drawer/ui-drawer.d.ts +37 -0
  75. package/dist/components/ui-icone/index.d.ts +1 -0
  76. package/dist/components/ui-icone/ui-icone.d.ts +15 -0
  77. package/dist/components/ui-lista-flutuante/index.d.ts +1 -0
  78. package/dist/components/ui-lista-flutuante/lista-flutuante-posicionamento.d.ts +15 -0
  79. package/dist/components/ui-lista-flutuante/lista-flutuante-render.d.ts +9 -0
  80. package/dist/components/ui-lista-flutuante/lista-flutuante-teclado.d.ts +13 -0
  81. package/dist/components/ui-lista-flutuante/lista-flutuante-template.d.ts +2 -0
  82. package/dist/components/ui-lista-flutuante/tipos.d.ts +4 -0
  83. package/dist/components/ui-lista-flutuante/ui-lista-flutuante.d.ts +63 -0
  84. package/dist/components/ui-mapa/index.d.ts +3 -0
  85. package/dist/components/ui-mapa/ui-mapa-linha.d.ts +12 -0
  86. package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +15 -0
  87. package/dist/components/ui-mapa/ui-mapa.d.ts +16 -0
  88. package/dist/components/ui-modal/index.d.ts +2 -0
  89. package/dist/components/ui-modal/modal-acessibilidade.d.ts +12 -0
  90. package/dist/components/ui-modal/ui-modal.d.ts +30 -0
  91. package/dist/components/ui-radio/index.d.ts +1 -0
  92. package/dist/components/ui-radio/radio-grupo-registry.d.ts +10 -0
  93. package/dist/components/ui-radio/ui-radio.d.ts +29 -0
  94. package/dist/components/ui-segmented/index.d.ts +1 -0
  95. package/dist/components/ui-segmented/segmented-indicador.d.ts +13 -0
  96. package/dist/components/ui-segmented/segmented-teclado.d.ts +4 -0
  97. package/dist/components/ui-segmented/segmented-template.d.ts +4 -0
  98. package/dist/components/ui-segmented/ui-segmented.d.ts +48 -0
  99. package/dist/components/ui-seletor-mapa-base/index.d.ts +2 -0
  100. package/dist/components/ui-seletor-mapa-base/tipos.d.ts +22 -0
  101. package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +43 -0
  102. package/dist/components/ui-skeleton/index.d.ts +1 -0
  103. package/dist/components/ui-skeleton/ui-skeleton.d.ts +19 -0
  104. package/dist/components/ui-stat/index.d.ts +1 -0
  105. package/dist/components/ui-stat/ui-stat.d.ts +30 -0
  106. package/dist/components/ui-switch/index.d.ts +1 -0
  107. package/dist/components/ui-switch/ui-switch.d.ts +36 -0
  108. package/dist/components/ui-tabela/index.d.ts +7 -0
  109. package/dist/components/ui-tabela/tabela-atributos-sync.d.ts +14 -0
  110. package/dist/components/ui-tabela/tabela-corpo.d.ts +18 -0
  111. package/dist/components/ui-tabela/tabela-dom.d.ts +15 -0
  112. package/dist/components/ui-tabela/tabela-header.d.ts +18 -0
  113. package/dist/components/ui-tabela/tabela-interacao.d.ts +9 -0
  114. package/dist/components/ui-tabela/tabela-localizador.d.ts +4 -0
  115. package/dist/components/ui-tabela/tabela-ordenacao.d.ts +12 -0
  116. package/dist/components/ui-tabela/tabela-orquestrador-dados.d.ts +18 -0
  117. package/dist/components/ui-tabela/tabela-redimensionamento.d.ts +28 -0
  118. package/dist/components/ui-tabela/tabela-remota.d.ts +15 -0
  119. package/dist/components/ui-tabela/tabela-renderizador.d.ts +29 -0
  120. package/dist/components/ui-tabela/tabela-selecao.d.ts +24 -0
  121. package/dist/components/ui-tabela/tipos.d.ts +27 -0
  122. package/dist/components/ui-tabela/ui-tabela.d.ts +83 -0
  123. package/dist/components/ui-tabela-propriedades/avaliador-expressao.d.ts +6 -0
  124. package/dist/components/ui-tabela-propriedades/editores-basicos.d.ts +7 -0
  125. package/dist/components/ui-tabela-propriedades/editores-cad.d.ts +17 -0
  126. package/dist/components/ui-tabela-propriedades/index.d.ts +6 -0
  127. package/dist/components/ui-tabela-propriedades/propriedades-densidade.d.ts +5 -0
  128. package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +6 -0
  129. package/dist/components/ui-tabela-propriedades/propriedades-editores.d.ts +5 -0
  130. package/dist/components/ui-tabela-propriedades/propriedades-flutuante.d.ts +7 -0
  131. package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +26 -0
  132. package/dist/components/ui-tabela-propriedades/propriedades-painel-controles.d.ts +15 -0
  133. package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +24 -0
  134. package/dist/components/ui-tabela-propriedades/propriedades-seletor-tipo.d.ts +13 -0
  135. package/dist/components/ui-tabela-propriedades/propriedades-splitter.d.ts +13 -0
  136. package/dist/components/ui-tabela-propriedades/propriedades-template.d.ts +1 -0
  137. package/dist/components/ui-tabela-propriedades/tipos.d.ts +48 -0
  138. package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +66 -0
  139. package/dist/components/ui-texto/index.d.ts +1 -0
  140. package/dist/components/ui-texto/ui-texto.d.ts +15 -0
  141. package/dist/components/ui-tooltip/index.d.ts +1 -0
  142. package/dist/components/ui-tooltip/ui-tooltip.d.ts +25 -0
  143. package/dist/core/acessibilidade.d.ts +21 -0
  144. package/dist/core/form-associated-element.d.ts +33 -0
  145. package/dist/core/form-validacao.d.ts +34 -0
  146. package/dist/core/index.d.ts +7 -0
  147. package/dist/core/leaflet-loader.d.ts +7 -0
  148. package/dist/core/leaflet-style.d.ts +7 -0
  149. package/dist/core/listener-bag.d.ts +21 -0
  150. package/dist/core/ssr-safe.d.ts +20 -0
  151. package/dist/core/ui-bus.d.ts +85 -0
  152. package/dist/core/zero-js-triggers.d.ts +1 -0
  153. package/dist/core.cjs +1 -0
  154. package/dist/core.js +22 -0
  155. package/dist/data.cjs +1 -0
  156. package/dist/data.d.ts +22 -0
  157. package/dist/data.js +63 -0
  158. package/dist/feedback.cjs +1 -0
  159. package/dist/feedback.d.ts +26 -0
  160. package/dist/feedback.js +25 -0
  161. package/dist/form-validacao-BIOXxt-1.js +140 -0
  162. package/dist/form-validacao-ytRYSF3E.cjs +1 -0
  163. package/dist/forms.cjs +1 -0
  164. package/dist/forms.d.ts +22 -0
  165. package/dist/forms.js +25 -0
  166. package/dist/gerencigeo-canvas/canvas_destaque.d.ts +13 -0
  167. package/dist/gerencigeo-canvas/canvas_destaque_marcadores.d.ts +8 -0
  168. package/dist/gerencigeo-canvas/canvas_interacao.d.ts +56 -0
  169. package/dist/gerencigeo-canvas/canvas_selecao_box.d.ts +23 -0
  170. package/dist/gerencigeo-canvas/controller_dados_ops.d.ts +15 -0
  171. package/dist/gerencigeo-canvas/index.d.ts +17 -0
  172. package/dist/gerencigeo-canvas/layer_defaults.d.ts +3 -0
  173. package/dist/gerencigeo-canvas/layer_instance_ops.d.ts +6 -0
  174. package/dist/gerencigeo-canvas/layer_manager.d.ts +37 -0
  175. package/dist/gerencigeo-canvas/layer_pane_ops.d.ts +8 -0
  176. package/dist/gerencigeo-canvas/layer_renderer_factory.d.ts +14 -0
  177. package/dist/gerencigeo-canvas/layer_state_ops.d.ts +6 -0
  178. package/dist/gerencigeo-canvas/mapa_config.d.ts +11 -0
  179. package/dist/gerencigeo-canvas/mapa_controller.d.ts +53 -0
  180. package/dist/gerencigeo-canvas/mapa_core.d.ts +30 -0
  181. package/dist/gerencigeo-canvas/mapa_linhas.d.ts +14 -0
  182. package/dist/gerencigeo-canvas/mapa_marcadores.d.ts +18 -0
  183. package/dist/gerencigeo-canvas/mapa_pontos_shapes.d.ts +8 -0
  184. package/dist/gerencigeo-canvas/renderers/grid_renderer.d.ts +9 -0
  185. package/dist/gerencigeo-canvas/renderers/tile_renderer.d.ts +8 -0
  186. package/dist/gerencigeo-canvas/renderers/vector_lines_builder.d.ts +4 -0
  187. package/dist/gerencigeo-canvas/renderers/vector_lines_renderer.d.ts +9 -0
  188. package/dist/gerencigeo-canvas/renderers/vector_points_renderer.d.ts +11 -0
  189. package/dist/gerencigeo-canvas/renderers/vector_polygons_renderer.d.ts +9 -0
  190. package/dist/gerencigeo-canvas/renderers/wms_renderer.d.ts +8 -0
  191. package/dist/gerencigeo-canvas/sigef_consultor.d.ts +9 -0
  192. package/dist/gerencigeo-canvas/tile_preloader.d.ts +2 -0
  193. package/dist/gerencigeo-canvas/types.d.ts +169 -0
  194. package/dist/gerencigeo-canvas/utils.d.ts +46 -0
  195. package/dist/index.cjs +1 -0
  196. package/dist/index.d.ts +116 -0
  197. package/dist/index.js +186 -0
  198. package/dist/leaflet-Cw6tqYFh.cjs +1 -0
  199. package/dist/leaflet-DkaFZYc5.js +69 -0
  200. package/dist/leaflet-loader-94z5VsdY.cjs +2 -0
  201. package/dist/leaflet-loader-Cjcdgj5R.js +21 -0
  202. package/dist/listener-bag-D5omxZ9h.cjs +1 -0
  203. package/dist/listener-bag-DQgv7OON.js +34 -0
  204. package/dist/mapa.cjs +19 -0
  205. package/dist/mapa.d.ts +11 -0
  206. package/dist/mapa.js +264 -0
  207. package/dist/modal.cjs +1 -0
  208. package/dist/modal.d.ts +8 -0
  209. package/dist/modal.js +8 -0
  210. package/dist/register.cjs +1 -0
  211. package/dist/register.d.ts +7 -0
  212. package/dist/register.js +21 -0
  213. package/dist/seletor-mapa-base.cjs +53 -0
  214. package/dist/seletor-mapa-base.d.ts +8 -0
  215. package/dist/seletor-mapa-base.js +275 -0
  216. package/dist/ssr-safe-5cWfJP-s.js +10 -0
  217. package/dist/ssr-safe-CiHD1adl.cjs +1 -0
  218. package/dist/tabela.cjs +1 -0
  219. package/dist/tabela.d.ts +12 -0
  220. package/dist/tabela.js +56 -0
  221. package/dist/tools.cjs +1 -0
  222. package/dist/tools.d.ts +8 -0
  223. package/dist/tools.js +30 -0
  224. package/dist/ui-badge-92yelKls.js +183 -0
  225. package/dist/ui-badge-B95jSECC.cjs +28 -0
  226. package/dist/ui-botao-BShEouvi.js +124 -0
  227. package/dist/ui-botao-DF1yuUUD.cjs +12 -0
  228. package/dist/ui-campo-texto-BCh5HyCM.cjs +16 -0
  229. package/dist/ui-campo-texto-B_JF6POq.js +361 -0
  230. package/dist/ui-card-BJ8SmvVf.js +111 -0
  231. package/dist/ui-card-Bhm6k91e.cjs +20 -0
  232. package/dist/ui-kit.css +1 -0
  233. package/dist/ui-modal-Bi4isGYh.cjs +18 -0
  234. package/dist/ui-modal-DV-pw2x1.js +194 -0
  235. package/dist/ui-paleta-ferramentas-B6dJ0O6K.cjs +18 -0
  236. package/dist/ui-paleta-ferramentas-Bpp4XBVg.js +633 -0
  237. package/dist/ui-segmented-C8wuycjJ.js +411 -0
  238. package/dist/ui-segmented-NC5cBXLh.cjs +19 -0
  239. package/dist/ui-skeleton-B3xQyn0Z.js +396 -0
  240. package/dist/ui-skeleton-D42oQufF.cjs +33 -0
  241. package/dist/ui-switch-C6o4yZUF.cjs +53 -0
  242. package/dist/ui-switch-CO9MoS8x.js +826 -0
  243. package/dist/ui-tabela-propriedades-7yJ9g7ti.cjs +145 -0
  244. package/dist/ui-tabela-propriedades-D-XKNVwK.js +2078 -0
  245. package/dist/ui-toast-CQBqvUm3.cjs +20 -0
  246. package/dist/ui-toast-CwUmiqyG.js +156 -0
  247. package/dist/zero-js-triggers-DdESy0tk.js +205 -0
  248. package/dist/zero-js-triggers-QGD7FOTv.cjs +1 -0
  249. package/package.json +149 -0
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const e=require("./ui-campo-texto-BCh5HyCM.cjs");exports.ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO=e.ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO;exports.UICampoTexto=e.UICampoTexto;exports.UIInput=e.UIInput;exports.criarTemplateCampoTexto=e.criarTemplateCampoTexto;exports.sincronizarFeedbackErro=e.sincronizarFeedbackErro;exports.sincronizarIconeSenha=e.sincronizarIconeSenha;exports.sincronizarLabelEPlaceholder=e.sincronizarLabelEPlaceholder;
@@ -0,0 +1,8 @@
1
+ import { UICampoTexto, UIInput } from './components/ui-campo-texto';
2
+ export * from './components/ui-campo-texto';
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ 'ui-campo-texto': UICampoTexto;
6
+ 'ui-input': UIInput;
7
+ }
8
+ }
@@ -0,0 +1,11 @@
1
+ /* empty css */
2
+ import { A as e, U as s, a as n, c, s as i, b as T, d as p } from "./ui-campo-texto-B_JF6POq.js";
3
+ export {
4
+ e as ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO,
5
+ s as UICampoTexto,
6
+ n as UIInput,
7
+ c as criarTemplateCampoTexto,
8
+ i as sincronizarFeedbackErro,
9
+ T as sincronizarIconeSenha,
10
+ p as sincronizarLabelEPlaceholder
11
+ };
@@ -0,0 +1,254 @@
1
+ "use strict";var kt=Object.defineProperty;var zt=(n,t,e)=>t in n?kt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var u=(n,t,e)=>zt(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const y=require("leaflet"),g=require("./leaflet-Cw6tqYFh.cjs"),st=require("./listener-bag-D5omxZ9h.cjs"),at=require("./ssr-safe-CiHD1adl.cjs"),X={perimetroWeight:1,fechamentoWeight:1,vizinhoWeight:1,bancoWeight:1,markerSizeBase:10,markerStyleM:"circle-dot",markerSizeM:14,markerStyleP:"circle",markerSizeP:10,markerStyleV:"cross",markerSizeV:8,enableAnimations:!1,preferCanvas:!0,crosshair:!1,satOpacity:1,magnetSnap:!1},R=class R{constructor(){u(this,"config");this.config=this.loadConfig()}static getInstance(){return R.instance||(R.instance=new R),R.instance}loadConfig(){try{const t=typeof localStorage<"u"?localStorage.getItem("gerencigeo_mapa_config"):null;if(t)return{...X,...JSON.parse(t)}}catch(t){console.error("Erro ao carregar configurações do mapa",t)}return{...X}}saveConfig(t){this.config={...this.config,...t},typeof localStorage<"u"&&localStorage.setItem("gerencigeo_mapa_config",JSON.stringify(this.config))}getConfig(){return this.config=this.loadConfig(),{...this.config}}};u(R,"instance");let Y=R;async function It(n,t,e,o){const i=n.getSize(),s=n.getBounds(),a=s.getSouthWest(),c=s.getNorthEast(),r=`${a.lng},${a.lat},${c.lng},${c.lat}`;let l=0,p=0;try{if(t.containerPoint)l=Math.round(t.containerPoint.x),p=Math.round(t.containerPoint.y);else if(t.layerPoint){const x=n.layerPointToContainerPoint(t.layerPoint);l=Math.round(x.x),p=Math.round(x.y)}}catch{l=0,p=0}const d=`https://acervofundiario.incra.gov.br/i3geo/ogc.php?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image/png&TRANSPARENT=true&QUERY_LAYERS=certificada_sigef_particular_pr&LAYERS=certificada_sigef_particular_pr&INFO_FORMAT=application/json&X=${l}&Y=${p}&WIDTH=${i.x}&HEIGHT=${i.y}&SRS=EPSG:4326&BBOX=${r}`,f=n.getContainer();f.style.cursor="wait";const h=y.popup({className:"compact-sigef-popup",maxWidth:250}).setLatLng(t.latlng).setContent(`
2
+ <div style="font-family:sans-serif; display:flex; align-items:center; gap:8px; color:rgba(255,255,255,0.9); font-size:12px;">
3
+ <svg style="animation:spin 1s linear infinite; width:14px; height:14px; flex-shrink:0;" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
4
+ <circle cx="12" cy="12" r="10" stroke="rgba(255,255,255,0.2)" stroke-width="4" fill="none"></circle>
5
+ <path fill="#00f5a0" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
6
+ </svg>
7
+ Consultando...
8
+ </div>
9
+ `).openOn(n);o.currentAbortController&&o.currentAbortController.abort(),o.currentAbortController=new AbortController;const b=o.currentAbortController.signal,S=setTimeout(()=>{o.currentAbortController&&o.currentAbortController.abort()},8e3);try{const M=typeof window<"u"&&(window.location.origin.includes("localhost")||window.location.origin.includes("127.0.0.1")||window.location.origin.includes("[::1]"))?`${e}/proxy/sigef?url=${encodeURIComponent(d)}`:`${window.location.origin}/api.php?action=proxy_sigef&url=${encodeURIComponent(d)}`,I=await fetch(M,{signal:b});clearTimeout(S);let z=null;if(I.ok){const A=await I.text();try{z=JSON.parse(A)}catch{z=null}}if(z&&z.features&&z.features.length>0){const A=z.features[0],C=A.properties||{},m=String(A.id||C.parcela_codigo||C.co_parcela||C.id_parcela||""),v=String(C.nome_area||C.nome_imovel||"Imóvel Sem Nome");if(m){const P=encodeURIComponent(m),k=`https://sigef.incra.gov.br/geo/exportar/parcela/shp/${P}/`,_=`https://sigef.incra.gov.br/geo/parcela/detalhe/${P}/`,L=document.createElement("div");L.style.cssText="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.4; min-width:180px;",L.innerHTML=`
10
+ <div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; padding-bottom:5px; border-bottom:1px solid rgba(255, 255, 255, 0.1);">
11
+ <span style="font-weight:700; font-size:11px; color:#10b981; text-transform:uppercase; letter-spacing:0.5px;">SIGEF</span>
12
+ <span style="font-size:10px; color:rgba(255, 255, 255, 0.5);">${g.escapeHtml(C.situacao_informada||C.status||"Certificada")}</span>
13
+ </div>
14
+ <div style="font-weight:700; font-size:12px; margin-bottom:4px; color:#ffffff; word-break:break-word;">${g.escapeHtml(v)}</div>
15
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.7); margin-bottom:2px;">Cód: <span style="font-family:monospace;">${g.escapeHtml(C.codigo_imovel||"N/A")}</span></div>
16
+ <div style="display:flex; gap:12px; font-size:11px; color:rgba(255, 255, 255, 0.7); margin-bottom:6px;">
17
+ <span>Mat: <strong style="color:#ffffff;">${g.escapeHtml(C.registro_matricula||C.matricula||"N/A")}</strong></span>
18
+ <span>${g.escapeHtml(C.data_submissao||"")}</span>
19
+ </div>
20
+ <div style="display:flex; flex-direction:column; gap:5px; padding-top:6px; border-top:1px solid rgba(255, 255, 255, 0.1);">
21
+ <a href="${k}" target="_blank" rel="noopener noreferrer" style="display:flex; align-items:center; justify-content:center; gap:5px; padding:5px 8px; background:rgba(16, 185, 129, 0.15); border:1px solid rgba(16, 185, 129, 0.3); color:#34d399; font-size:11px; font-weight:700; border-radius:5px; text-decoration:none; cursor:pointer;">
22
+ <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
23
+ Baixar Shapefile
24
+ </a>
25
+ <button class="btn-importar-confrontante-sigef" style="display:flex; align-items:center; justify-content:center; gap:5px; padding:5px 8px; background:rgba(14, 165, 233, 0.15); border:1px solid rgba(14, 165, 233, 0.3); color:#38bdf8; font-size:11px; font-weight:700; border-radius:5px; cursor:pointer; width:100%; text-align:center;">
26
+ <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
27
+ Importar Confrontante (CSV)
28
+ </button>
29
+ <a href="${_}" target="_blank" rel="noopener noreferrer" style="display:flex; align-items:center; justify-content:center; gap:4px; padding:4px 6px; background:rgba(255, 255, 255, 0.05); border:1px solid rgba(255, 255, 255, 0.1); color:rgba(255, 255, 255, 0.7); font-size:10px; font-weight:600; border-radius:5px; text-decoration:none; cursor:pointer;">
30
+ <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
31
+ Abrir no SIGEF
32
+ </a>
33
+ </div>
34
+ `;const N=L.querySelector(".btn-importar-confrontante-sigef");N&&N.addEventListener("click",()=>{window.dispatchEvent(new CustomEvent("gerencigeo:importar_vizinho_sigef",{detail:{uuid:m,nome:v}}))}),h.setContent(L)}else h.setContent(`
35
+ <div style="font-family:sans-serif; font-size:12px; color:#b45309; padding:2px 0;">
36
+ Lote identificado, mas código da parcela indisponível.
37
+ </div>
38
+ `)}else h.setContent(`
39
+ <div style="font-family:sans-serif; font-size:12px; color:rgba(255, 255, 255, 0.7); padding:2px 0;">
40
+ Nenhum imóvel SIGEF certificado neste ponto.
41
+ </div>
42
+ `)}catch(x){x.name==="AbortError"?h.setContent(`
43
+ <div style="font-family:sans-serif; font-size:12px; color:#f59e0b; padding:2px 0;">
44
+ Consulta cancelada ou tempo limite de resposta esgotado.
45
+ </div>
46
+ `):(console.warn("Erro ao consultar SIGEF:",x),h.setContent(`
47
+ <div style="font-family:sans-serif; font-size:12px; color:#f59e0b; padding:2px 0;">
48
+ Serviço de consulta SIGEF indisponível nesta área.
49
+ </div>
50
+ `))}finally{f.style.cursor=""}}function At(n,t){if(!n)return;const e=Math.floor(n.getZoom()),o=Math.max(e,12),i=Math.min(e+1,19),s=t.pad(.2),a=["mt0","mt1","mt2","mt3"];let c=0;const r=32;for(let l=o;l<=i&&c<r;l++){const p=s.getNorthWest(),d=s.getSouthEast(),f=Q(p.lng,l),h=Q(d.lng,l),b=tt(p.lat,l),S=tt(d.lat,l);for(let x=f;x<=h&&c<r;x++)for(let M=b;M<=S&&c<r;M++){const z=`https://${a[(x+M)%a.length]}.google.com/vt/lyrs=s,h&x=${x}&y=${M}&z=${l}`,A=new Image;A.src=z,c++}}}function Q(n,t){return Math.floor((n+180)/360*Math.pow(2,t))}function tt(n,t){const e=n*Math.PI/180;return Math.floor((1-Math.log(Math.tan(e)+1/Math.cos(e))/Math.PI)/2*Math.pow(2,t))}class rt{constructor(t){u(this,"map",null);u(this,"configManager",Y.getInstance());u(this,"config",this.configManager.getConfig());u(this,"apiBaseUrl","/api");u(this,"bancoPontosGroup",y.layerGroup());u(this,"pontosVizinhosGroup",y.layerGroup());u(this,"controller");u(this,"containerElement",null);u(this,"bc");u(this,"sigefState",{});this.controller=t}init(t){if(this.map)try{this.map.off(),this.map.remove()}catch{}finally{this.map=null}const e=typeof t=="string"?document.getElementById(t):t;if(!e)return null;if(this.containerElement=e,e._leaflet_id)try{delete e._leaflet_id}catch{e._leaflet_id=void 0}if(this.map=y.map(e,{maxZoom:24,scrollWheelZoom:!0,preferCanvas:this.config.preferCanvas!==void 0?this.config.preferCanvas:!0,zoomControl:!1}).setView([-23.7661,-53.3204],14),this.listenConfigBroadcast(),this.applyMapStyles(),!this.map.getPane("sigefPane")){const o=this.map.createPane("sigefPane");o.style.zIndex="390"}if(!this.map.getPane("perimetroPane")){const o=this.map.createPane("perimetroPane");o.style.zIndex="450"}if(!this.map.getPane("verticesPane")){const o=this.map.createPane("verticesPane");o.style.zIndex="650"}return y.control.scale({metric:!0,imperial:!1,position:"bottomleft"}).addTo(this.map),this.map.on("click",o=>{if(this.controller.modoCliqueSequencialAtivo||this.controller.canvasInteracao&&this.controller.canvasInteracao.selectionHappened)return;(this.controller.layerManager?this.controller.layerManager.isLayerActiveAndSelectable("sigef"):!1)&&this.consultarSigef(o)}),setTimeout(()=>{this.invalidateSize()},250),this.map}invalidateSize(t=!1){var e,o;if(this.map)try{const i=(o=(e=this.map).getContainer)==null?void 0:o.call(e);if(!i||!i.parentNode)return;this.map.invalidateSize({animate:t,pan:!1})}catch{}}applyMapStyles(){const t=this.containerElement||document.getElementById("mapa-triagem");t&&(t.style.cursor=this.config.crosshair?"crosshair":"")}listenConfigBroadcast(){if(!(typeof BroadcastChannel>"u"))try{this.bc=new BroadcastChannel("gerencigeo_map_config"),this.bc.onmessage=t=>{t.data==="RELOAD_REQUIRED"&&(this.config=this.configManager.getConfig(),this.applyMapStyles(),window.dispatchEvent(new CustomEvent("gerencigeo:map_config_changed",{detail:this.config})))}}catch{}}destroy(){if(this.sigefState.currentAbortController&&(this.sigefState.currentAbortController.abort(),this.sigefState.currentAbortController=void 0),this.bc){try{this.bc.close()}catch{}this.bc=void 0}if(this.map)try{this.map.off(),this.map.remove()}catch{}finally{this.map=null}if(this.containerElement&&this.containerElement._leaflet_id)try{delete this.containerElement._leaflet_id}catch{this.containerElement._leaflet_id=void 0}}preCarregarTilesRegiao(t){At(this.map,t)}async consultarSigef(t){this.map&&await It(this.map,t,this.apiBaseUrl,this.sigefState)}}const lt=["verticesPane","perimetroPane","overlayPane","markerPane","pane-vertices","pane-perimetro","pane-vizinhos","pane-homologados","pane-homologados-pontos"];class Et{constructor(t,e,o){u(this,"map");u(this,"mapContainer");u(this,"ctx");u(this,"selectionDiv",null);u(this,"isSelecting",!1);u(this,"selectStartPos",{x:0,y:0});u(this,"selectStartPoint",null);this.map=t,this.mapContainer=e,this.ctx=o,this.criarDivSelecao()}criarDivSelecao(){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))}setPanesPointerEvents(t){lt.forEach(e=>{const o=this.map.getPane(e);o&&(o.style.pointerEvents=t)})}iniciarSelecao(t){const e=this.mapContainer.getBoundingClientRect(),o=t.clientX-e.left,i=t.clientY-e.top;this.isSelecting=!0,this.selectStartPos={x:o,y:i},this.selectStartPoint=this.map.mouseEventToContainerPoint(t),this.selectionDiv&&(this.selectionDiv.style.left=`${o}px`,this.selectionDiv.style.top=`${i}px`,this.selectionDiv.style.width="0px",this.selectionDiv.style.height="0px",this.selectionDiv.style.display="block"),this.setPanesPointerEvents("none")}atualizarSelecao(t){if(!this.isSelecting||!this.selectionDiv)return;const e=this.mapContainer.getBoundingClientRect(),o=t.clientX-e.left,i=t.clientY-e.top,s=Math.abs(o-this.selectStartPos.x),a=Math.abs(i-this.selectStartPos.y),c=Math.min(o,this.selectStartPos.x),r=Math.min(i,this.selectStartPos.y);this.selectionDiv.style.left=`${Math.round(c)}px`,this.selectionDiv.style.top=`${Math.round(r)}px`,this.selectionDiv.style.width=`${Math.round(s)}px`,this.selectionDiv.style.height=`${Math.round(a)}px`,o>=this.selectStartPos.x?(this.selectionDiv.style.background="rgba(14, 116, 144, 0.22)",this.selectionDiv.style.border="1px solid #06b6d4"):(this.selectionDiv.style.background="rgba(16, 185, 129, 0.22)",this.selectionDiv.style.border="1px dashed #10b981")}finalizarSelecao(t,e,o){var M,I,z,A,C,m;if(!this.isSelecting)return!1;this.isSelecting=!1,this.selectionDiv&&(this.selectionDiv.style.display="none"),this.map.closePopup(),setTimeout(()=>{try{this.setPanesPointerEvents("auto"),this.ctx.layerManager&&this.ctx.layerManager.ensurePanes()}catch{}},80);const i=this.mapContainer.getBoundingClientRect(),s=t.clientX-i.left,a=t.clientY-i.top,c=this.map.mouseEventToContainerPoint(t),r=Math.abs(s-this.selectStartPos.x),l=Math.abs(a-this.selectStartPos.y);if(r<4&&l<4){const v=t.target;return v&&((M=v.classList)!=null&&M.contains("leaflet-container")||v.id==="mapa-triagem"||(I=v.closest)!=null&&I.call(v,".leaflet-pane"))&&((z=v.closest)!=null&&z.call(v,".custom-leaflet-marker")||(A=v.closest)!=null&&A.call(v,".custom-div-icon")||o()),!1}if(!this.selectStartPoint)return!1;const p={x1:Math.min(this.selectStartPoint.x,c.x),y1:Math.min(this.selectStartPoint.y,c.y),x2:Math.max(this.selectStartPoint.x,c.x),y2:Math.max(this.selectStartPoint.y,c.y)},d=((C=this.ctx.mapaController)==null?void 0:C.getMarkers())||[],f=((m=this.ctx.mapaController)==null?void 0:m.getVizinhosMarkers())||[],h=[],b=[],S=!this.ctx.layerManager||this.ctx.layerManager.isLayerActiveAndSelectable("vertices"),x=!this.ctx.layerManager||this.ctx.layerManager.isLayerActiveAndSelectable("vizinhos");return S&&d.forEach(v=>{const P=v.pontoId;if(!P)return;const k=this.map.latLngToContainerPoint(v.getLatLng());k.x>=p.x1&&k.x<=p.x2&&k.y>=p.y1&&k.y<=p.y2&&h.push(P)}),x&&f.forEach(v=>{const P=v.pontoId;if(!P)return;const k=this.map.latLngToContainerPoint(v.getLatLng());k.x>=p.x1&&k.x<=p.x2&&k.y>=p.y1&&k.y<=p.y2&&b.push(P)}),t.ctrlKey||t.metaKey?(h.forEach(v=>{this.ctx.selectedPontoIds.includes(v)?this.ctx.selectedPontoIds=this.ctx.selectedPontoIds.filter(P=>P!==v):this.ctx.selectedPontoIds.push(v)}),b.forEach(v=>{this.ctx.selectedVizinhoPontoIds.includes(v)?this.ctx.selectedVizinhoPontoIds=this.ctx.selectedVizinhoPontoIds.filter(P=>P!==v):this.ctx.selectedVizinhoPontoIds.push(v)})):(this.ctx.selectedPontoIds=h,this.ctx.selectedVizinhoPontoIds=b),this.ctx.selectedPontoIds.length>0&&(this.ctx.lastSelectedPontoId=this.ctx.selectedPontoIds[this.ctx.selectedPontoIds.length-1]),e(),!0}cancelarSelecao(){this.isSelecting&&(this.isSelecting=!1,this.selectionDiv&&(this.selectionDiv.style.display="none"),this.setPanesPointerEvents("auto"),this.ctx.layerManager&&this.ctx.layerManager.ensurePanes())}destruir(){this.selectionDiv&&this.selectionDiv.parentNode&&(this.selectionDiv.parentNode.removeChild(this.selectionDiv),this.selectionDiv=null),this.setPanesPointerEvents("auto")}}class ct{constructor(t){u(this,"ctx");u(this,"map",null);u(this,"mapContainer",null);u(this,"selecaoBox",null);u(this,"isPanning",!1);u(this,"lastMousePos",{x:0,y:0});u(this,"lastMiddleClickTime",0);u(this,"touchStartPos",{x:0,y:0});u(this,"touchStartDist",0);u(this,"isTouchPanning",!1);u(this,"selectionHappened",!1);u(this,"panHappened",!1);u(this,"handleTouchStart",t=>{if(!(!this.map||!this.mapContainer)){if(t.touches.length===1)this.isTouchPanning=!0,this.touchStartPos={x:t.touches[0].clientX,y:t.touches[0].clientY};else if(t.touches.length===2){this.isTouchPanning=!1;const e=t.touches[0].clientX-t.touches[1].clientX,o=t.touches[0].clientY-t.touches[1].clientY;this.touchStartDist=Math.hypot(e,o)}}});u(this,"handleTouchMove",t=>{if(!(!this.map||!this.mapContainer)){if(t.touches.length===1&&this.isTouchPanning){t.preventDefault(),this.panHappened=!0;const e=this.touchStartPos.x-t.touches[0].clientX,o=this.touchStartPos.y-t.touches[0].clientY;this.map.panBy([e,o],{animate:!1}),this.touchStartPos={x:t.touches[0].clientX,y:t.touches[0].clientY}}else if(t.touches.length===2&&this.touchStartDist>0){t.preventDefault(),this.panHappened=!0;const e=t.touches[0].clientX-t.touches[1].clientX,o=t.touches[0].clientY-t.touches[1].clientY,i=Math.hypot(e,o);Math.abs(i-this.touchStartDist)>25&&(i>this.touchStartDist?this.map.zoomIn(1):this.map.zoomOut(1),this.touchStartDist=i)}}});u(this,"handleTouchEnd",()=>{this.isTouchPanning=!1,this.touchStartDist=0,setTimeout(()=>{this.panHappened=!1},120)});u(this,"handleContextMenu",t=>{t.preventDefault()});u(this,"handleMouseDown",t=>{var e;if(!(!this.map||!this.mapContainer)){if(t.button===1){t.preventDefault();const o=Date.now();if(o-this.lastMiddleClickTime<300){this.zoomExtents();return}this.lastMiddleClickTime=o,this.isPanning=!0,this.panHappened=!1,this.lastMousePos={x:t.clientX,y:t.clientY},this.mapContainer.style.cursor="grabbing";return}if(t.button===0){if(this.selectionHappened=!1,this.ctx.mapaController&&this.ctx.mapaController.modoCliqueSequencialAtivo)return;(e=this.selecaoBox)==null||e.iniciarSelecao(t)}}});u(this,"handleMouseMove",t=>{var e;if(!(!this.map||!this.mapContainer)){if(this.isPanning){const o=this.lastMousePos.x-t.clientX,i=this.lastMousePos.y-t.clientY;(Math.abs(o)>1||Math.abs(i)>1)&&(this.panHappened=!0),this.map.panBy([o,i],{animate:!1}),this.lastMousePos={x:t.clientX,y:t.clientY};return}(e=this.selecaoBox)==null||e.atualizarSelecao(t)}});u(this,"handleMouseUp",t=>{this.isPanning&&(this.isPanning=!1,this.mapContainer&&(this.mapContainer.style.cursor="grab"),setTimeout(()=>{this.panHappened=!1},120)),this.selecaoBox&&this.selecaoBox.isSelecting&&this.selecaoBox.finalizarSelecao(t,()=>this.notificarSelecao(),()=>this.limparSelecao())&&(this.selectionHappened=!0,setTimeout(()=>{this.selectionHappened=!1},120))});u(this,"handleKeyDown",t=>{var e;if(t.key==="Escape"){const o=document.activeElement;if(o&&(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"||o.isContentEditable))return;(e=this.selecaoBox)==null||e.cancelarSelecao(),this.limparSelecao()}});this.ctx={selectedPontoIds:[],selectedVizinhoPontoIds:[],lastSelectedPontoId:null,pontosList:[],...t}}ativar(t,e){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.selecaoBox=new Et(this.map,this.mapContainer,this.ctx),this.mapContainer.addEventListener("mousedown",this.handleMouseDown),this.mapContainer.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.handleMouseUp),this.mapContainer.addEventListener("contextmenu",this.handleContextMenu),window.addEventListener("keydown",this.handleKeyDown),this.mapContainer.addEventListener("touchstart",this.handleTouchStart,{passive:!1}),this.mapContainer.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.mapContainer.addEventListener("touchend",this.handleTouchEnd),this.mapContainer.addEventListener("touchcancel",this.handleTouchEnd)))}desativar(){this.mapContainer&&(this.mapContainer.removeEventListener("mousedown",this.handleMouseDown),this.mapContainer.removeEventListener("mousemove",this.handleMouseMove),this.mapContainer.removeEventListener("contextmenu",this.handleContextMenu),this.mapContainer.removeEventListener("touchstart",this.handleTouchStart),this.mapContainer.removeEventListener("touchmove",this.handleTouchMove),this.mapContainer.removeEventListener("touchend",this.handleTouchEnd),this.mapContainer.removeEventListener("touchcancel",this.handleTouchEnd)),window.removeEventListener("mouseup",this.handleMouseUp),window.removeEventListener("keydown",this.handleKeyDown),this.selecaoBox&&(this.selecaoBox.destruir(),this.selecaoBox=null),this.map&&(this.map.dragging.enable(),this.map.doubleClickZoom.enable())}limparSelecao(){var t,e;(this.ctx.selectedPontoIds.length>0||this.ctx.selectedVizinhoPontoIds.length>0)&&(this.ctx.selectedPontoIds=[],this.ctx.selectedVizinhoPontoIds=[],this.ctx.lastSelectedPontoId=null,this.ctx.mapaController&&(this.ctx.mapaController.context.selectedPontoIds=[],(e=(t=this.ctx.mapaController).atualizarDestaqueMarcadores)==null||e.call(t)),this.notificarSelecao())}notificarSelecao(){var t,e;this.ctx.mapaController&&(this.ctx.mapaController.context.selectedPontoIds=[...this.ctx.selectedPontoIds],(e=(t=this.ctx.mapaController).atualizarDestaqueMarcadores)==null||e.call(t)),this.ctx.atualizarDestaqueLinhasTabela&&this.ctx.atualizarDestaqueLinhasTabela(),this.ctx.onSelectionChange&&this.ctx.onSelectionChange(this.ctx.selectedPontoIds,this.ctx.selectedVizinhoPontoIds),window.dispatchEvent(new CustomEvent("gerencigeo:ponto-selecionado",{detail:{selectedPontoIds:this.ctx.selectedPontoIds,selectedVizinhoPontoIds:this.ctx.selectedVizinhoPontoIds,lastSelectedPontoId:this.ctx.lastSelectedPontoId}}))}zoomExtents(){if(!this.ctx.pontosList||this.ctx.pontosList.length===0)return;const t=this.ctx.pontosList.filter(e=>e.tipo_ponto!=="B"&&e.tipo!=="B");t.length>0&&this.ctx.mapaController&&this.ctx.mapaController.fitBounds(t)}destroy(){this.desativar()}}class G{static register(t,e){this.renderers.set(t.toLowerCase(),e)}static get(t){return this.renderers.get(t.toLowerCase())}static has(t){return this.renderers.has(t.toLowerCase())}static getRegisteredTypes(){return Array.from(this.renderers.keys())}}u(G,"renderers",new Map);class dt{render(t,e,o){var r,l,p;const i=((r=t.dados)==null?void 0:r.url)||"https://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}",s=((l=t.dados)==null?void 0:l.subdomains)||["mt0","mt1","mt2","mt3"],a=((p=t.dados)==null?void 0:p.attribution)||"Google Satélite";return y.tileLayer(i,{maxZoom:24,maxNativeZoom:20,subdomains:s,attribution:a,keepBuffer:16,updateWhenZooming:!1,updateWhenIdle:!0,className:"smooth-zoom-layer",opacity:t.opacidade!==void 0?t.opacidade:1,pane:`pane-${t.id}`})}update(t,e,o){e instanceof y.TileLayer&&o.opacidade!==void 0&&e.setOpacity(o.opacidade)}destroy(t,e){e.hasLayer(t)&&e.removeLayer(t)}}class pt{render(t,e,o){var l,p,d,f;const i=((l=t.dados)==null?void 0:l.url)||"https://acervofundiario.incra.gov.br/i3geo/ogc.php",s=((p=t.dados)==null?void 0:p.layers)||"certificada_sigef_particular_pr",a=((d=t.dados)==null?void 0:d.format)||"image/png",c=((f=t.dados)==null?void 0:f.attribution)||"INCRA/SIGEF";return y.tileLayer.wms(i,{layers:s,format:a,transparent:!0,version:"1.1.1",pane:`pane-${t.id}`,attribution:c,className:"sigef-wms-layer",keepBuffer:8,updateWhenZooming:!1,updateWhenIdle:!0,opacity:t.opacidade!==void 0?t.opacidade:.85})}update(t,e,o){e instanceof y.TileLayer.WMS&&o.opacidade!==void 0&&e.setOpacity(o.opacidade)}destroy(t,e){e.hasLayer(t)&&e.removeLayer(t)}}function ht(n,t,e){const o=n.estilo.espessuraLinha||e.config.perimetroWeight||2,i=e.graphicScale.lineScaleMultiplier||1;if(n.estilo.scaleMode==="world"){const s=n.estilo.dimensaoMetros||.3,a=t.getCenter(),c=t.getZoom(),r=40075016686e-3*Math.abs(Math.cos(a.lat*Math.PI/180))/Math.pow(2,c+8),l=s/(r>0?r:1);return Math.max(1,Math.round(l*i))}return Math.max(1,Math.round(o*i))}function et(n,t,e,o,i){var b,S,x,M,I,z,A,C;const s=n.id==="homologados",a=((b=n.dados)==null?void 0:b.conexoes)??(Array.isArray(n.dados)&&n.dados.length>0&&"origemId"in n.dados[0]?n.dados:null),c=((S=n.dados)==null?void 0:S.segmentos)||o.segmentos||[],r=((x=n.dados)==null?void 0:x.pontos)||(s?o.bancoPontos||[]:o.pontos)||[],l=ht(n,e,o),p=n.opacidade!==void 0?n.opacidade:1,d=n.interativo&&!n.bloqueada,f=[];r.forEach(m=>{const v=g.parseCoordenada(m.lat??m.latitude??m.y,m.lon??m.lng??m.longitude??m.x);v&&f.push({...m,lat:v.lat,lon:v.lon})});const h=m=>{const v=f.find(P=>String(P.id)===String(m));if(v)return v;if(o.pontos){const P=o.pontos.find(k=>String(k.id)===String(m));if(P){const k=g.parseCoordenada(P.lat,P.lon);if(k)return{...P,lat:k.lat,lon:k.lon}}}return null};if(a&&Array.isArray(a)){a.forEach(m=>{var k,_,L,N,q,H,w;const v=h(m.origemId),P=h(m.destinoId);if(v&&P&&v.lat&&v.lon&&P.lat&&P.lon){const $=m.tipoLinha==="tracejada"||((k=m.estilo)==null?void 0:k.tipoLinha)==="tracejada",T=((_=m.estilo)==null?void 0:_.cor)||((L=m.estilo)==null?void 0:L.color)||n.estilo.corPrimaria||"#00f5a0",B=((N=m.estilo)==null?void 0:N.espessura)||((q=m.estilo)==null?void 0:q.weight)||l,E=y.polyline([[v.lat,v.lon],[P.lat,P.lon]],{color:T,weight:B,opacity:((H=m.estilo)==null?void 0:H.opacidade)??p,dashArray:$?"6, 6":n.estilo.dashArray,pane:i,interactive:d});if(d){const V=m.acoes||n.acoes||((w=n.dados)==null?void 0:w.acoes)||[],O=`${m.origemId}-${m.destinoId}`,j=g.renderPopupAcoesHtml(V,O);E.bindPopup(`
51
+ <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3;">
52
+ <div style="font-weight:700; font-size:12px; margin-bottom:3px; color:#ffffff;">Conexão ${g.escapeHtml(String(m.origemId))} ↔ ${g.escapeHtml(String(m.destinoId))}</div>
53
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">Tipo: ${g.escapeHtml(m.tipoLinha||"contínua")}</div>
54
+ ${j}
55
+ </div>
56
+ `,{className:"compact-popup",maxWidth:220}),E.on("popupopen",D=>{if(o.modoSequencial){E.closePopup();return}g.bindPopupAcoesEvents(D.popup,m,o,E)})}E.addTo(t)}});return}if((M=n.dados)!=null&&M.polilinhaSequencial||((I=n.dados)==null?void 0:I.fechar)!==void 0&&f.length>=2){const m=((z=n.dados)==null?void 0:z.chaveGrupo)||o.chaveGrupo,v=g.agruparPontosPorChave(f,m),P=((A=n.dados)==null?void 0:A.fechar)!==!1,k=n.estilo.corPrimaria||"#00f5a0";Object.entries(v).forEach(([_,L])=>{const N=g.ordenarPontosPorSequencia(L);if(N.length<2)return;const q=N.map(w=>[w.lat,w.lon]),H=y.polyline(q,{color:k,weight:l,opacity:p,dashArray:n.estilo.dashArray,pane:i,interactive:d});if(d&&H.bindPopup(`
57
+ <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3;">
58
+ <div style="font-weight:700; font-size:12px; margin-bottom:3px; color:#ffffff;">Polilinha: Grupo ${g.escapeHtml(_)}</div>
59
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">Vértices: ${N.length}</div>
60
+ </div>
61
+ `,{className:"compact-popup",maxWidth:220}),H.addTo(t),P&&q.length>=3){const w=q[q.length-1],$=q[0];y.polyline([w,$],{color:k,weight:l,opacity:p,dashArray:"4, 4",pane:i,interactive:d}).addTo(t)}});return}if(!s&&c&&c.length>0)c.forEach(m=>{var k;const v=f.find(_=>String(_.id)===String(m.ponto_inicio_id)),P=f.find(_=>String(_.id)===String(m.ponto_fim_id));if(v&&P&&v.lat&&v.lon&&P.lat&&P.lon){const _=m.tipo_limite_sigef||m.tipo_limite||"",L=m.metodo_posicionamento_sigef||m.metodo_posicionamento||"",N=_==="LA1"?"#10b981":_==="LN1"?"#3b82f6":"#00f5a0",q=n.estilo.corPrimaria||N,H=y.polyline([[v.lat,v.lon],[P.lat,P.lon]],{color:q,weight:l,opacity:p,dashArray:_==="LN1"?"6, 6":n.estilo.dashArray,pane:i,interactive:d});if(d){const w=m.acoes||n.acoes||((k=n.dados)==null?void 0:k.acoes)||[],$=`${m.ponto_inicio_id}-${m.ponto_fim_id}`,T=g.renderPopupAcoesHtml(w,$);H.bindPopup(`
62
+ <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3;">
63
+ <div style="font-weight:700; font-size:12px; margin-bottom:3px; color:#ffffff;">${g.escapeHtml(v.nome_vertice)} ↔ ${g.escapeHtml(P.nome_vertice)}</div>
64
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">Limite: ${g.escapeHtml(_||"N/A")} · ${g.escapeHtml(L||"N/A")}</div>
65
+ ${T}
66
+ </div>
67
+ `,{className:"compact-popup",maxWidth:220}),H.on("popupopen",B=>{if(o.modoSequencial){H.closePopup();return}g.bindPopupAcoesEvents(B.popup,m,o,H)})}H.addTo(t)}});else if(f&&f.length>=2){const m=f.filter(L=>L.lat&&L.lon&&L.tipo_ponto!=="B"&&L.tipo!=="B"&&L.ignorar_poligono!==1),v=((C=n.dados)==null?void 0:C.chaveGrupo)||o.chaveGrupo,P=g.agruparPontosPorChave(m,v),k=n.estilo.corPrimaria||(s?"#f59e0b":"#10b981"),_=n.estilo.dashArray||(s?"6, 8":void 0);Object.values(P).forEach(L=>{const N=g.ordenarPontosPorSequencia(L);if(N.length<2)return;const q=N.map(w=>[w.lat,w.lon]);if(y.polyline(q,{color:k,weight:l,opacity:p,dashArray:_,pane:i,interactive:d}).addTo(t),q.length>=3){const w=q[q.length-1],$=q[0];y.polyline([w,$],{color:k,weight:l,opacity:p,dashArray:s?"6, 8":"4, 4",pane:i,interactive:d}).addTo(t)}})}}class ft{constructor(){u(this,"zoomListenerMap",new WeakMap)}render(t,e,o){const i=y.layerGroup(),s=`pane-${t.id}`;et(t,i,e,o,s);const a=()=>{if(t.estilo.scaleMode==="world"){const c=ht(t,e,o);i.eachLayer(r=>{r.setStyle&&r.setStyle({weight:c})})}};return e.on("zoomend",a),this.zoomListenerMap.set(i,a),i}update(t,e,o,i,s){(o.opacidade!==void 0||o.estilo!==void 0||o.dados!==void 0||o.interativo!==void 0||o.bloqueada!==void 0)&&(e.clearLayers(),et(t,e,s,i,`pane-${t.id}`))}destroy(t,e){const o=this.zoomListenerMap.get(t);o&&(e.off("zoomend",o),this.zoomListenerMap.delete(t)),t.clearLayers(),e.hasLayer(t)&&e.removeLayer(t)}}function ut(n){if(!n)return"#00f5a0";const t=n.trim();if(t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")||t.startsWith("var("))return t;if(t.includes("bg-[#")&&t.includes("]")){const o=t.match(/bg-\[(#[a-fA-F0-9]+)\]/);if(o)return o[1]}const e={"bg-mint-vibrant":"#00f5a0","bg-indigo-500":"#6366f1","bg-rose-500":"#f43f5e","bg-amber-500":"#f59e0b","bg-forest-deep":"#06130b","bg-purple-500":"#a855f7","bg-blue-500":"#3b82f6","bg-emerald-500":"#10b981"};for(const[o,i]of Object.entries(e))if(t.includes(o))return i;return"#00f5a0"}function F(n,t,e,o="",i="",s=!1){const a=s||o.includes("ponto-selecionado")||o.includes("cad-marker-selected"),c=ut(e),r=t+6,l=t,p=a?`box-shadow: 0 0 0 2px #ffffff, 0 0 0 4.5px ${c}, 0 0 16px ${c}; filter: drop-shadow(0 0 4px ${c});`:"box-shadow: 0 1px 4px rgba(0, 0, 0, 0.65), 0 0 1px rgba(0, 0, 0, 0.9);",f=`display:flex; align-items:center; justify-content:center; width:${r}px; height:${r}px; position:relative; pointer-events:auto; ${a?"transform: scale(1.35); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);":"transition: transform 0.15s ease, filter 0.15s ease;"}`,h=`${e} ${o} ${a?"ponto-selecionado":""}`.trim();switch(n){case"square":return`
68
+ <div id="${i}" class="${h}" style="${f}">
69
+ <div style="width:${l}px; height:${l}px; background-color:${c}; border-radius:2px; border:1px solid rgba(0,0,0,0.4); box-sizing:border-box; ${p}"></div>
70
+ </div>
71
+ `;case"circle-dot":{const b=Math.max(3,Math.floor(l/3));return`
72
+ <div id="${i}" class="${h}" style="${f}">
73
+ <div style="width:${l}px; height:${l}px; background-color:${c}; border-radius:50%; display:flex; align-items:center; justify-content:center; border:1px solid rgba(0,0,0,0.3); box-sizing:border-box; ${p}">
74
+ <div style="width:${b}px; height:${b}px; background-color:#ffffff; border-radius:50%; box-shadow:0 0 2px rgba(0,0,0,0.8);"></div>
75
+ </div>
76
+ </div>
77
+ `}case"diamond":return`
78
+ <div id="${i}" class="${h}" style="${f}">
79
+ <svg width="${l+2}" height="${l+2}" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" style="overflow:visible; ${a?`filter: drop-shadow(0 0 3px #ffffff) drop-shadow(0 0 6px ${c});`:"filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));"}">
80
+ <polygon points="6,1 11,6 6,11 1,6" fill="${c}" stroke="#000000" stroke-width="1.2" stroke-linejoin="round" />
81
+ ${a?'<polygon points="6,2.5 9.5,6 6,9.5 2.5,6" fill="none" stroke="#ffffff" stroke-width="1" />':""}
82
+ </svg>
83
+ </div>
84
+ `;case"cross":return`
85
+ <div id="${i}" class="${h}" style="${f}">
86
+ <svg width="${l+4}" height="${l+4}" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" style="overflow:visible; ${a?`filter: drop-shadow(0 0 3px #ffffff) drop-shadow(0 0 6px ${c});`:"filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));"}">
87
+ ${a?'<circle cx="6" cy="6" r="5.5" stroke="#ffffff" stroke-width="1.2" stroke-dasharray="2 2" fill="none" />':""}
88
+ <!-- Halo escuro de contraste para satélite -->
89
+ <line x1="6" y1="1" x2="6" y2="11" stroke="#000000" stroke-width="3" stroke-linecap="round" />
90
+ <line x1="1" y1="6" x2="11" y2="6" stroke="#000000" stroke-width="3" stroke-linecap="round" />
91
+ <!-- Traço colorido do marcador -->
92
+ <line x1="6" y1="1" x2="6" y2="11" stroke="${c}" stroke-width="${a?"2.2":"1.6"}" stroke-linecap="round" />
93
+ <line x1="1" y1="6" x2="11" y2="6" stroke="${c}" stroke-width="${a?"2.2":"1.6"}" stroke-linecap="round" />
94
+ </svg>
95
+ </div>
96
+ `;case"x":return`
97
+ <div id="${i}" class="${h}" style="${f}">
98
+ <svg width="${l+4}" height="${l+4}" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" style="overflow:visible; ${a?`filter: drop-shadow(0 0 3px #ffffff) drop-shadow(0 0 6px ${c});`:"filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));"}">
99
+ ${a?'<circle cx="6" cy="6" r="5.5" stroke="#ffffff" stroke-width="1.2" stroke-dasharray="2 2" fill="none" />':""}
100
+ <!-- Halo escuro de contraste para satélite -->
101
+ <line x1="2" y1="2" x2="10" y2="10" stroke="#000000" stroke-width="3" stroke-linecap="round" />
102
+ <line x1="10" y1="2" x2="2" y2="10" stroke="#000000" stroke-width="3" stroke-linecap="round" />
103
+ <!-- Traço colorido do marcador -->
104
+ <line x1="2" y1="2" x2="10" y2="10" stroke="${c}" stroke-width="${a?"2.2":"1.6"}" stroke-linecap="round" />
105
+ <line x1="10" y1="2" x2="2" y2="10" stroke="${c}" stroke-width="${a?"2.2":"1.6"}" stroke-linecap="round" />
106
+ </svg>
107
+ </div>
108
+ `;case"triangle":return`
109
+ <div id="${i}" class="${h}" style="${f}">
110
+ <svg width="${l+2}" height="${l+2}" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" style="overflow:visible; ${a?`filter: drop-shadow(0 0 3px #ffffff) drop-shadow(0 0 6px ${c});`:"filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));"}">
111
+ <polygon points="6,1.5 11,10.5 1,10.5" fill="${c}" stroke="#000000" stroke-width="1.2" stroke-linejoin="round" />
112
+ ${a?'<polygon points="6,3.5 9.5,9.5 2.5,9.5" fill="none" stroke="#ffffff" stroke-width="1" />':""}
113
+ </svg>
114
+ </div>
115
+ `;case"circle":default:return`
116
+ <div id="${i}" class="${h}" style="${f}">
117
+ <div style="width:${l}px; height:${l}px; background-color:${c}; border-radius:50%; border:1px solid rgba(0,0,0,0.35); box-sizing:border-box; ${p}"></div>
118
+ </div>
119
+ `}}class gt{constructor(){u(this,"zoomListenerMap",new WeakMap)}render(t,e,o){const i=y.layerGroup(),s=`pane-${t.id}`;this.rebuildPoints(t,i,e,o,s);const a=()=>{t.estilo.scaleMode==="world"&&i.eachLayer(c=>{if(c.setIcon&&c.baseSize&&c.shapeStyle&&c.markerBg&&c.pontoId!==void 0){const r=this.calculateSize(t,e,o,c.baseSize),l=o.config.enableAnimations?"transition-all duration-150":"",p=F(c.shapeStyle,r,c.markerBg,l,`map-marker-${t.id}-${c.pontoId}`,!!c.isSelected),d=y.divIcon({html:p,className:"custom-leaflet-marker flex items-center justify-center",iconSize:[r+6,r+6]});c.setIcon(d)}})};return e.on("zoomend",a),this.zoomListenerMap.set(i,a),i}calculateSize(t,e,o,i){const s=o.graphicScale.markerScaleMultiplier||1;if(t.estilo.scaleMode==="world"){const a=t.estilo.dimensaoMetros||.25,c=e.getCenter(),r=e.getZoom(),l=40075016686e-3*Math.abs(Math.cos(c.lat*Math.PI/180))/Math.pow(2,r+8),p=a/(l>0?l:1);return Math.max(3,Math.round(p*s))}return Math.max(4,Math.round(i*s))}rebuildPoints(t,e,o,i,s){var f;const c=t.id==="homologados-pontos"?i.bancoPontos||[]:((f=t.dados)==null?void 0:f.pontos)||i.pontos||[],r=t.interativo&&!t.bloqueada,l=t.id==="vizinhos",p=t.id==="homologados"||t.id==="homologados-pontos",d=i.selectedPontoIds||[];c.forEach(h=>{var x;const b=h.lat??h.latitude,S=h.lon??h.lng??h.longitude;if(b!==void 0&&S!==void 0&&b!==0&&S!==0&&!isNaN(Number(b))&&!isNaN(Number(S))){const M=h.tipo_ponto==="B"||h.tipo==="B",I=h.tipo_ponto==="M"||h.tipo==="M";let z=t.estilo.estiloMarcador||"x",A=t.estilo.corPrimaria||"bg-mint-vibrant",C=t.estilo.tamanhoMarcador||7;p?(z="circle",A=t.estilo.corPrimaria||"#f59e0b",C=8):l?(z=I?"circle-dot":t.estilo.estiloMarcador||"cross",A=t.estilo.corPrimaria||"#a855f7",C=I?10:8):I?(A="#6366f1",z="circle-dot",C=10):M&&(A="#f43f5e",z="square",C=9);const m=!!(h.selecionado||d.length>0&&(d.includes(h.id)||d.includes(String(h.id))||d.includes(Number(h.id)))),v=this.calculateSize(t,o,i,C),P=i.config.enableAnimations?"transition-all duration-150":"",k=F(z,v,A,P,`map-marker-${t.id}-${h.id}`,m),_=y.divIcon({html:k,className:`custom-leaflet-marker flex items-center justify-center ${m?"cad-marker-selected":""}`,iconSize:[v+6,v+6]}),L=y.marker([Number(b),Number(S)],{icon:_,pane:s,interactive:r});if(m&&L.setZIndexOffset(2e3),L.pontoId=h.id,L.layerId=t.id,L.isVizinho=l,L.baseSize=C,L.shapeStyle=z,L.markerBg=A,L.isSelected=m,r){const N=p?"Vértice Homologado SIGEF":l?"Confrontante (Importado)":I?"Base Homologada PPP":M?"Base de Campo (Translação)":"Vértice de Perímetro",q=h.acoes||t.acoes||((x=t.dados)==null?void 0:x.acoes)||[],H=g.renderPopupAcoesHtml(q,h.id);L.bindPopup(`
120
+ <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3;">
121
+ <div style="font-weight:700; font-size:13px; margin-bottom:4px; color:#ffffff;">${g.escapeHtml(h.nome_vertice||String(h.id))}</div>
122
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">${g.escapeHtml(N)} · ${g.escapeHtml(h.tipo_ponto||h.tipo||"Vértice")}</div>
123
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.45); font-family:monospace; margin-top:4px;">Lat ${Number(b).toFixed(6)} &nbsp; Lon ${Number(S).toFixed(6)}</div>
124
+ ${H}
125
+ </div>
126
+ `,{className:"compact-popup",maxWidth:240}),q&&q.length>0&&L.on("popupopen",w=>{g.bindPopupAcoesEvents(w.popup,h,i,L)}),L.on("click",()=>{i.onMarkerClick&&i.onMarkerClick(h.id,l,h,{lat:Number(b),lon:Number(S)})})}L.addTo(e)}})}update(t,e,o,i,s){(o.opacidade!==void 0||o.estilo!==void 0||o.dados!==void 0||o.interativo!==void 0||o.bloqueada!==void 0)&&(e.clearLayers(),this.rebuildPoints(t,e,s,i,`pane-${t.id}`))}destroy(t,e){const o=this.zoomListenerMap.get(t);o&&(e.off("zoomend",o),this.zoomListenerMap.delete(t)),t.clearLayers(),e.hasLayer(t)&&e.removeLayer(t)}}class mt{render(t,e,o){const i=y.layerGroup(),s=`pane-${t.id}`;return this.rebuildPolygons(t,i,o,s),i}rebuildPolygons(t,e,o,i){var d,f;const a=(((d=t.dados)==null?void 0:d.poligonos)??(Array.isArray(t.dados)?t.dados:null))||((f=t.dados)==null?void 0:f.confrontantes)||o.confrontantes||[],c=t.interativo&&!t.bloqueada,r=t.estilo.corPrimaria||"#a855f7",l=t.estilo.espessuraLinha||1.5,p=t.opacidade!==void 0?t.opacidade:.8;a.forEach(h=>{var C,m,v,P,k,_,L,N,q,H;if(!h)return;const b=((C=h.estilo)==null?void 0:C.cor)||((m=h.estilo)==null?void 0:m.color)||r,S=((v=h.estilo)==null?void 0:v.espessura)||((P=h.estilo)==null?void 0:P.weight)||l,x=((k=h.estilo)==null?void 0:k.opacidade)??p,M=((_=h.estilo)==null?void 0:_.fillColor)||b,I=((L=h.estilo)==null?void 0:L.fillOpacity)??Math.min(.2,x*.15),z=((N=h.estilo)==null?void 0:N.dashArray)||t.estilo.dashArray||"4, 6";if(h.coordenadas&&Array.isArray(h.coordenadas)&&h.coordenadas.length>=3){const w=Array.isArray(h.coordenadas[0])&&Array.isArray(h.coordenadas[0][0]);let $;if(w?$=h.coordenadas.map(T=>T.map(B=>{const E=g.parseCoordenada(B[0],B[1]);return E?[E.lat,E.lon]:null}).filter(Boolean)):$=h.coordenadas.map(T=>{const B=g.parseCoordenada(T[0],T[1]);return B?[B.lat,B.lon]:null}).filter(Boolean),$&&(w?((q=$[0])==null?void 0:q.length)>=3:$.length>=3)){const T=y.polygon($,{color:b,weight:S,opacity:x,dashArray:z,fillColor:M,fillOpacity:I,pane:i,interactive:c});if(T.poligonoId=h.id,T.layerId=t.id,c){let B="";h.metadados&&Object.keys(h.metadados).length>0&&(B=Object.entries(h.metadados).map(([E,V])=>`<div style="font-size:11px;"><strong>${g.escapeHtml(E)}:</strong> ${g.escapeHtml(String(V))}</div>`).join("")),T.bindPopup(`
127
+ <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3; min-width:180px;">
128
+ <div style="font-weight:700; font-size:12px; color:#c084fc; margin-bottom:3px; border-bottom:1px solid rgba(255,255,255,0.1); padding-bottom:3px;">Polígono ${g.escapeHtml(String(h.id??""))}</div>
129
+ ${B||`<div style="font-size:11px;">Área vetorial definida por ${h.coordenadas.length} vértices</div>`}
130
+ </div>
131
+ `,{className:"compact-popup",maxWidth:220}),T.on("popupopen",()=>{o.modoSequencial&&T.closePopup()})}T.addTo(e);return}}const A=h.wkt||h.poligono_wkt;if(A){const w=[...A.matchAll(/\(([^()]+)\)/g)];if(w.length>0){const $=g.escapeHtml(h.nome_propriedade||`Polígono ${String(h.id||"")}`),T=g.escapeHtml(h.nome||"Proprietário"),B=[];if(w.forEach(E=>{const V=E[1].split(",").map(O=>{const j=O.trim().split(/\s+/);if(j.length<2)return null;const D=g.parseCoordenada(j[1],j[0]);return D?[D.lat,D.lon]:null}).filter(O=>O!==null);V.length>=3&&B.push(V)}),B.length>0){const E=B.length===1?B[0]:B,V=y.polygon(E,{color:b,weight:S,opacity:x,dashArray:z,fillColor:M,fillOpacity:I,pane:i,interactive:c});if(V.poligonoId=h.id,V.layerId=t.id,c){const O=h.acoes||t.acoes||((H=t.dados)==null?void 0:H.acoes)||[],j=g.renderPopupAcoesHtml(O,h.id);V.bindPopup(`
132
+ <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3; min-width:180px;">
133
+ <div style="font-weight:700; font-size:12px; color:#c084fc; margin-bottom:3px; border-bottom:1px solid rgba(255,255,255,0.1); padding-bottom:3px;">${$}</div>
134
+ <div style="font-size:11px; margin-bottom:2px;"><strong>Identificador:</strong> ${g.escapeHtml(String(h.id??""))}</div>
135
+ ${h.nome?`<div style="font-size:11px;"><strong>Proprietário:</strong> ${T}</div>`:""}
136
+ ${j}
137
+ </div>
138
+ `,{className:"compact-popup",maxWidth:220}),V.on("popupopen",D=>{if(o.modoSequencial){V.closePopup();return}g.bindPopupAcoesEvents(D.popup,h,o,V)})}V.addTo(e)}}}h.pontos&&h.pontos.length>0&&h.pontos.forEach(w=>{var T;const $=g.parseCoordenada(w.lat??w.latitude??w.y,w.lon??w.lng??w.longitude??w.x);if($){const B=y.divIcon({html:'<div style="width:8px; height:8px; background:#a855f7; border-radius:50%; border:1px solid #ffffff; box-shadow:0 0 4px rgba(168,85,247,0.8);"></div>',className:"custom-leaflet-marker flex items-center justify-center",iconSize:[12,12]}),E=y.marker([$.lat,$.lon],{icon:B,pane:i,interactive:c});if(E.pontoId=w.id,E.isVizinho=!0,E.layerId=t.id,c){const V=w.acoes||h.acoes||t.acoes||((T=t.dados)==null?void 0:T.acoes)||[],O=g.renderPopupAcoesHtml(V,w.id);E.bindPopup(`
139
+ <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3; min-width:170px;">
140
+ <div style="font-weight:700; font-size:12px; color:#c084fc; margin-bottom:3px;">${g.escapeHtml(w.nome_vertice||String(w.id))}</div>
141
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">Confrontante: ${g.escapeHtml(h.nome||"Desconhecido")}</div>
142
+ <div style="font-size:10px; color:rgba(255, 255, 255, 0.45); font-family:monospace; margin-top:3px;">Lat ${$.lat.toFixed(6)} &nbsp; Lon ${$.lon.toFixed(6)}</div>
143
+ ${O}
144
+ </div>
145
+ `,{className:"compact-popup",maxWidth:220}),E.on("click",()=>{o.modoSequencial&&E.closePopup(),o.onMarkerClick&&o.onMarkerClick(w.id,!0,w,{lat:$.lat,lon:$.lon})}),E.on("popupopen",j=>{if(o.modoSequencial){E.closePopup();return}g.bindPopupAcoesEvents(j.popup,w,o,E)})}E.addTo(e)}})})}update(t,e,o,i){o.opacidade!==void 0&&o.estilo===void 0&&o.dados===void 0&&o.interativo===void 0&&o.bloqueada===void 0||(o.opacidade!==void 0||o.estilo!==void 0||o.dados!==void 0||o.interativo!==void 0||o.bloqueada!==void 0)&&(e.clearLayers(),this.rebuildPolygons(t,e,i,`pane-${t.id}`))}destroy(t,e){t.clearLayers(),e.hasLayer(t)&&e.removeLayer(t)}}class vt{constructor(){u(this,"moveListenerMap",new WeakMap)}render(t,e,o){const i=y.layerGroup(),s=`pane-${t.id}`,a=()=>{if(i.clearLayers(),!t.visivel)return;if(e.getZoom()>20){const r=e.getBounds(),l=r.getSouth(),p=r.getNorth(),d=r.getWest(),f=r.getEast(),h=e.getCenter(),b=8999e-9,S=Math.cos(h.lat*Math.PI/180),x=b/(S>.1?S:1),M=Math.floor((p-l)/b),I=Math.floor((f-d)/x);if(M<200&&I<200){const z=Math.ceil(l/b)*b;for(let C=z;C<=p;C+=b)y.polyline([[C,d],[C,f]],{color:t.estilo.corPrimaria||"rgba(0, 245, 160, 0.18)",weight:t.estilo.espessuraLinha||.6,interactive:!1,pane:s}).addTo(i);const A=Math.ceil(d/x)*x;for(let C=A;C<=f;C+=x)y.polyline([[l,C],[p,C]],{color:t.estilo.corPrimaria||"rgba(0, 245, 160, 0.18)",weight:t.estilo.espessuraLinha||.6,interactive:!1,pane:s}).addTo(i)}}};return a(),e.on("zoomend moveend",a),this.moveListenerMap.set(i,a),i}update(t,e){t.visivel||e.clearLayers()}destroy(t,e){const o=this.moveListenerMap.get(t);o&&(e.off("zoomend moveend",o),this.moveListenerMap.delete(t)),t.clearLayers(),e.hasLayer(t)&&e.removeLayer(t)}}function _t(){G.register("tile",new dt),G.register("wms",new pt),G.register("vetorial-linhas",new ft),G.register("vetorial-pontos",new gt),G.register("vetorial-poligonos",new mt),G.register("grid",new vt)}_t();const yt=[{id:"satelite",nome:"Satélite Google Híbrido",categoria:"base",tipo:"tile",visivel:!0,opacidade:1,zIndex:200,interativo:!1,bloqueada:!1,estilo:{scaleMode:"screen"}},{id:"sigef",nome:"Acervo Fundiário SIGEF (INCRA)",categoria:"wms",tipo:"wms",visivel:!0,opacidade:.85,zIndex:390,interativo:!0,bloqueada:!1,estilo:{scaleMode:"screen"}},{id:"homologados",nome:"Poligonal Homologada (Banco)",categoria:"referencia",tipo:"vetorial-linhas",visivel:!0,opacidade:.9,zIndex:420,interativo:!0,bloqueada:!1,estilo:{corPrimaria:"#f59e0b",espessuraLinha:2,dashArray:"6, 8",scaleMode:"screen"}},{id:"homologados-pontos",nome:"Marcos Homologados (Banco)",categoria:"referencia",tipo:"vetorial-pontos",visivel:!0,opacidade:1,zIndex:430,interativo:!0,bloqueada:!1,estilo:{tamanhoMarcador:8,estiloMarcador:"circle",scaleMode:"screen"}},{id:"perimetro",nome:"Divisas e Poligonal do Imóvel",categoria:"levantamento",tipo:"vetorial-linhas",visivel:!0,opacidade:1,zIndex:450,interativo:!0,bloqueada:!1,estilo:{corPrimaria:"#00f5a0",espessuraLinha:2,scaleMode:"screen",dimensaoMetros:.3}},{id:"vizinhos",nome:"Imóveis Confrontantes (WKT/CSV)",categoria:"referencia",tipo:"vetorial-poligonos",visivel:!0,opacidade:.8,zIndex:500,interativo:!0,bloqueada:!1,estilo:{corPrimaria:"#a855f7",espessuraLinha:1.5,dashArray:"4, 6",scaleMode:"screen"}},{id:"vertices",nome:"Vértices e Marcos do Levantamento",categoria:"levantamento",tipo:"vetorial-pontos",visivel:!0,opacidade:1,zIndex:650,interativo:!0,bloqueada:!1,estilo:{tamanhoMarcador:8,scaleMode:"screen",dimensaoMetros:.25}},{id:"grade",nome:"Grade de Coordenadas UTM",categoria:"referencia",tipo:"grid",visivel:!0,opacidade:.5,zIndex:700,interativo:!1,bloqueada:!1,estilo:{corPrimaria:"rgba(0, 245, 160, 0.18)",espessuraLinha:.6,scaleMode:"screen"}}];function $t(n){return n.map(t=>({id:t.id,visivel:t.visivel,opacidade:t.opacidade,zIndex:t.zIndex,bloqueada:t.bloqueada,estilo:{...t.estilo}}))}function qt(n,t){!t||!Array.isArray(t)||t.forEach(e=>{const o=n.find(i=>i.id===e.id);o&&(e.visivel!==void 0&&(o.visivel=e.visivel),e.opacidade!==void 0&&(o.opacidade=e.opacidade),e.zIndex!==void 0&&(o.zIndex=e.zIndex),e.bloqueada!==void 0&&(o.bloqueada=e.bloqueada),e.estilo&&(o.estilo={...o.estilo,...e.estilo}))})}function Tt(n,t,e,o,i){n.dados=t;const s=i.get(n.id);if(s&&e&&o){const a=G.get(n.tipo);a&&a.update(n,s,{dados:t},o,e)}else if(e&&o&&n.visivel){const a=G.get(n.tipo);if(a){const c=a.render(n,e,o);c&&(c.addTo(e),i.set(n.id,c))}}}function W(n){return`pane-${n}`}function J(n){return n.visivel&&n.interativo&&!n.bloqueada?"auto":"none"}function Bt(n,t){t.forEach(e=>{const o=W(e.id),i=n.getPane(o)??n.createPane(o);i&&(i.style.zIndex=String(e.zIndex),i.style.pointerEvents=J(e))})}function Nt(n,t){const e=n.getPane(W(t.id));e&&(e.style.display=t.visivel?"":"none",e.style.pointerEvents=J(t))}function Ht(n,t){const e=n.getPane(W(t.id));e&&(e.style.opacity=String(t.opacidade))}function Vt(n,t){const e=n.getPane(W(t.id));e&&(e.style.zIndex=String(t.zIndex))}function Gt(n,t){const e=n.getPane(W(t.id));e&&(e.style.pointerEvents=J(t))}function ot(n,t,e,o){const i=G.get(n.tipo);if(!i)return;const s=i.render(n,t,e);s&&(s.addTo(t),o.set(n.id,s))}function U(n,t,e){const o=e.get(n.id);if(!o)return;const i=G.get(n.tipo);i&&i.destroy(o,t),e.delete(n.id)}function it(n,t,e,o,i){const s=i.get(n.id);if(!s)return;const a=G.get(n.tipo);a&&a.update(n,s,t,o,e)}class bt{constructor(t){u(this,"layers",[]);u(this,"layerInstances",new Map);u(this,"map",null);u(this,"context",null);u(this,"listeners",[]);this.layers=(t||yt).map(e=>({...e,estilo:{...e.estilo}}))}attachMap(t,e){this.map=t,this.context=e,this.ensurePanes(),this.renderAllLayers()}ensurePanes(){this.map&&Bt(this.map,this.layers)}renderAllLayers(){!this.map||!this.context||(this.layers.forEach(t=>{U(t,this.map,this.layerInstances),t.visivel&&ot(t,this.map,this.context,this.layerInstances)}),this.notifyChange())}setLayerVisibility(t,e){const o=this.layers.find(i=>i.id===t);!o||o.visivel===e||(o.visivel=e,!(!this.map||!this.context)&&(Nt(this.map,o),e?this.layerInstances.has(t)||ot(o,this.map,this.context,this.layerInstances):U(o,this.map,this.layerInstances),this.notifyChange()))}setLayerOpacity(t,e){const o=this.layers.find(i=>i.id===t);o&&(o.opacidade=Math.max(0,Math.min(1,e)),this.map&&(Ht(this.map,o),this.context&&it(o,{opacidade:o.opacidade},this.map,this.context,this.layerInstances)),this.notifyChange())}setLayerZIndex(t,e){const o=this.layers.find(i=>i.id===t);o&&(o.zIndex=e,this.map&&Vt(this.map,o),this.notifyChange())}setLayerBlocked(t,e){const o=this.layers.find(i=>i.id===t);o&&(o.bloqueada=e,this.map&&Gt(this.map,o),this.notifyChange())}setLayerScaleMode(t,e){const o=this.layers.find(i=>i.id===t);o&&(o.estilo.scaleMode=e,this.map&&this.context&&it(o,{estilo:o.estilo},this.map,this.context,this.layerInstances),this.notifyChange())}setGraphicScale(t){this.context&&(this.context.graphicScale={...this.context.graphicScale,...t},this.renderAllLayers())}updateContext(t){this.context&&(this.context={...this.context,...t},this.renderAllLayers())}getLayers(){return[...this.layers]}getActiveSelectableLayers(){return this.layers.filter(t=>t.visivel&&t.interativo&&!t.bloqueada)}isLayerActiveAndSelectable(t){const e=this.layers.find(o=>o.id===t);return!!(e&&e.visivel&&e.interativo&&!e.bloqueada)}exportState(){return $t(this.layers)}importState(t){!t||!Array.isArray(t)||(qt(this.layers,t),this.ensurePanes(),this.renderAllLayers())}onChange(t){return this.listeners.push(t),()=>{this.listeners=this.listeners.filter(e=>e!==t)}}notifyChange(){const t=this.getLayers();this.listeners.forEach(e=>{try{e(t)}catch(o){console.error("Erro no listener de camadas:",o)}})}getAllLayerInstances(){return Array.from(this.layerInstances.values())}getLayerInstance(t){return this.layerInstances.get(t)}getLayer(t){return this.layers.find(e=>e.id===t)}getLayerDef(t){return this.layers.find(e=>e.id===t)}getOrCreateLayer(t,e,o){let i=this.layers.find(s=>s.id===t);return i||(i={id:t,nome:o,categoria:"custom",tipo:e,visivel:!0,opacidade:1,zIndex:600,interativo:!0,bloqueada:!1,estilo:{scaleMode:"screen"}},this.layers.push(i),this.ensurePanes()),i}setLayerData(t,e){const o=this.layers.find(i=>i.id===t);o&&(Tt(o,e,this.map,this.context,this.layerInstances),this.notifyChange())}clearLayers(t){(t&&t.length>0?t:Array.from(this.layerInstances.keys())).forEach(o=>{const i=this.layers.find(s=>s.id===o);i?U(i,this.map,this.layerInstances):this.layerInstances.delete(o)}),this.notifyChange()}destroy(){this.map&&(this.layers.forEach(t=>U(t,this.map,this.layerInstances)),this.layerInstances.clear()),this.listeners=[]}}function xt(n,t){var a,c;if(t==null)return null;const e=String(t).trim(),o=r=>r?(r.lon=r.lng,r):null,s=n.getMarkers().find(r=>{var h,b,S,x;const l=r.pontoId,p=r.elementoId??r.id??((h=r.options)==null?void 0:h.pontoId)??((b=r.options)==null?void 0:b.id),d=(S=r.elemento)==null?void 0:S.nome_vertice,f=(x=r.elemento)==null?void 0:x.codigo_completo;return String(l)===e||String(p)===e||d&&String(d).toLowerCase()===e.toLowerCase()||f&&String(f).toLowerCase()===e.toLowerCase()});if(s&&typeof s.getLatLng=="function")return o(s.getLatLng());if(n.layerManager)for(const r of n.layerManager.getAllLayerInstances()){let l=null;const p=d=>{var b,S,x,M,I;if(l)return;const f=d.pontoId??d.elementoId??d.id??((b=d.options)==null?void 0:b.id)??((S=d.options)==null?void 0:S.pontoId),h=((x=d.elemento)==null?void 0:x.nome)??((M=d.elemento)==null?void 0:M.nome_vertice)??((I=d.options)==null?void 0:I.nome);(String(f)===e||h&&String(h).toLowerCase()===e.toLowerCase())&&(typeof d.getLatLng=="function"?l=d.getLatLng():typeof d.getBounds=="function"&&(l=d.getBounds().getCenter()))};if(p(r),typeof r.eachLayer=="function"&&r.eachLayer(p),l)return o(l)}if(n.context.pontos&&n.context.pontos.length>0){const r=n.context.pontos.find(l=>String(l.id)===e||l.nome_vertice&&String(l.nome_vertice).toLowerCase()===e.toLowerCase());if(r){const l=r.lat??r.latitude??r.y,p=r.lon??r.lng??r.longitude??r.x,d=g.parseCoordenada(l,p);if(d)return o(y.latLng(d.lat,d.lon))}}if(n.context.bancoPontos&&n.context.bancoPontos.length>0){const r=n.context.bancoPontos.find(l=>String(l.id)===e||l.codigo_completo&&String(l.codigo_completo).toLowerCase()===e.toLowerCase()||l.nome_vertice&&String(l.nome_vertice).toLowerCase()===e.toLowerCase());if(r){const l=r.lat??r.latitude??r.y,p=r.lon??r.lng??r.longitude??r.x,d=g.parseCoordenada(l,p);if(d)return o(y.latLng(d.lat,d.lon))}}if(n.context.confrontantes&&n.context.confrontantes.length>0){const r=n.context.confrontantes.find(l=>String(l.id)===e||l.nome&&String(l.nome).toLowerCase()===e.toLowerCase()||l.nome_propriedade&&String(l.nome_propriedade).toLowerCase()===e.toLowerCase());if(r){if(r.pontos&&r.pontos.length>0){let l=0,p=0,d=0;for(const f of r.pontos){const h=f.lat??f.latitude??f.y,b=f.lon??f.lng??f.longitude??f.x,S=g.parseCoordenada(h,b);S&&(l+=S.lat,p+=S.lon,d++)}if(d>0)return o(y.latLng(l/d,p/d))}if(r.poligono_wkt){const l=g.extrairCentroDeWkt(r.poligono_wkt);if(l)return o(y.latLng(l.lat,l.lon))}}}if(n.context.segmentos&&n.context.segmentos.length>0){const r=n.context.segmentos.find(l=>String(l.id)===e||`${l.ponto_inicio_id}-${l.ponto_fim_id}`===e);if(r){const l=(a=n.context.pontos)==null?void 0:a.find(d=>String(d.id)===String(r.ponto_inicio_id)),p=(c=n.context.pontos)==null?void 0:c.find(d=>String(d.id)===String(r.ponto_fim_id));if(l&&p){const d=g.parseCoordenada(l.lat??l.latitude,l.lon??l.longitude),f=g.parseCoordenada(p.lat??p.latitude,p.lon??p.longitude);if(d&&f)return o(y.latLng((d.lat+f.lat)/2,(d.lon+f.lon)/2))}}}if(n.layerManager){for(const r of n.layerManager.getLayers())if(r.dados){if(Array.isArray(r.dados.pontos)){const l=r.dados.pontos.find(p=>String(p.id)===e||p.nome_vertice&&String(p.nome_vertice)===e);if(l){const p=g.parseCoordenada(l.lat,l.lon);if(p)return o(y.latLng(p.lat,p.lon))}}if(Array.isArray(r.dados.poligonos)){const l=r.dados.poligonos.find(p=>String(p.id)===e);if(l){if(l.wkt){const p=g.extrairCentroDeWkt(l.wkt);if(p)return o(y.latLng(p.lat,p.lon))}if(Array.isArray(l.coordenadas)&&l.coordenadas.length>0){let p=0,d=0,f=0;for(const h of l.coordenadas){const b=g.parseCoordenada(h[0],h[1])||g.parseCoordenada(h[1],h[0]);b&&(p+=b.lat,d+=b.lon,f++)}if(f>0)return o(y.latLng(p/f,d/f))}}}}}return null}function Ot(n,t,e,o){var h,b;K(t,n.getMap());const i=n.getMap();if(!i)return;const s=xt(n,e);if(!s){console.warn(`[ui-canvas-cad] Elemento com identificador "${e}" não encontrado para destaque.`);return}const a=(o==null?void 0:o.pan)===!0,c=o==null?void 0:o.zoom;a?c!==void 0?typeof i.flyTo=="function"?i.flyTo(s,c,{animate:!0}):i.setView(s,c,{animate:!0}):typeof i.panTo=="function"?i.panTo(s,{animate:!0}):i.setView(s,i.getZoom(),{animate:!0}):c!==void 0&&i.setZoom(c,{animate:!0});const r=(o==null?void 0:o.cor)||"#00f5a0",l="pane-destaque";let p=i.getPane(l);p||(p=i.createPane(l)),p&&(p.style.zIndex="850",p.style.pointerEvents="none");const d=y.divIcon({className:"cad-destaque-marker-container",html:`
146
+ <div class="cad-pulse-highlight" style="--cad-pulse-cor: ${g.escapeHtml(r)};">
147
+ <div class="cad-pulse-core"></div>
148
+ <div class="cad-pulse-ring ring-1"></div>
149
+ <div class="cad-pulse-ring ring-2"></div>
150
+ </div>
151
+ `,iconSize:[52,52],iconAnchor:[26,26]});t.destaqueMarker=y.marker(s,{icon:d,pane:l,interactive:!1,keyboard:!1}),t.destaqueMarker.addTo(i);const f=(b=(h=t.destaqueMarker).getElement)==null?void 0:b.call(h);f&&(f.style.pointerEvents="none"),o!=null&&o.duracaoMs&&o.duracaoMs>0&&(t.destaqueTimeoutId=window.setTimeout(()=>{K(t,i)},o.duracaoMs))}function K(n,t){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)}function jt(n,t){const e=new Map;n.forEach(i=>{const s=i.lat??i.latitude??i.y,a=i.lon??i.lng??i.longitude??i.x,c=g.parseCoordenada(s,a);c&&(i.lat=c.lat,i.lon=c.lon);const r=i.confrontante_id??i.id_confrontante??0;e.has(r)||e.set(r,[]),e.get(r).push(i)});const o=new Map;return t.forEach(i=>{const s=i.id!==void 0&&i.id!==null?i.id:0;o.set(s,{...i,pontos:[]})}),e.forEach((i,s)=>{var a,c;if(o.has(s)){const r=o.get(s);r.pontos=i}else o.set(s,{id:s,nome:((a=i[0])==null?void 0:a.nome_confrontante)||"Confrontante",nome_propriedade:((c=i[0])==null?void 0:c.nome_propriedade)||"",pontos:i})}),Array.from(o.values()).filter(i=>i.pontos&&i.pontos.length>0||!!i.poligono_wkt)}function Dt(n,t){const e=new Map;return t.forEach(o=>{o.id!==void 0&&o.id!==null&&o.pontos&&o.pontos.length>0&&e.set(o.id,o.pontos)}),n.map(o=>{const i=o.id!==void 0&&o.id!==null?o.id:void 0;return i!==void 0&&(!o.pontos||o.pontos.length===0)&&e.has(i)?{...o,pontos:e.get(i)}:{...o}})}function Rt(n,t,e=!1){let o=[...n];e&&t&&t.forEach(s=>{s.pontos&&o.push(...s.pontos)});const i=o.map(s=>{const a=s.lat??s.latitude??s.y,c=s.lon??s.lng??s.longitude??s.x,r=g.parseCoordenada(a,c);return r?y.latLng(r.lat,r.lon):null}).filter(s=>s!==null);return i.length===1?{single:i[0]}:i.length>1?{bounds:y.latLngBounds(i)}:null}function Ft(n,t){const e=[],o=new Set,i=s=>{s instanceof y.Marker&&s.pontoId!==void 0&&!o.has(s)&&(o.add(s),e.push(s))};return n&&n.eachLayer(s=>{i(s),typeof s.eachLayer=="function"&&s.eachLayer(i)}),t&&t.getAllLayerInstances().forEach(s=>{i(s),typeof s.eachLayer=="function"&&s.eachLayer(i)}),e}function Wt(n,t,e="vertices",o){const i=t||[];n.layerManager.getOrCreateLayer(e,"vetorial-pontos","Pontos / Vértices"),e==="vertices"&&(n.context.pontos=i,n.canvasInteracao.ctx.pontosList=i,o&&(n.customMarkerClickCallback=s=>{const a=i.find(c=>String(c.id)===String(s))||{id:s,lat:0,lon:0};o(a)})),n.layerManager.setLayerData(e,{pontos:i,onClique:o}),n.layerManager.setLayerVisibility(e,!0)}function Ut(n,t,e="linhas"){const o=t||[];n.layerManager.getOrCreateLayer(e,"vetorial-linhas","Conexões / Linhas"),(e==="linhas"||e==="perimetro")&&(n.context.segmentos=o.map(i=>({ponto_inicio_id:Number(i.origemId)||0,ponto_fim_id:Number(i.destinoId)||0,tipo_limite_sigef:i.tipoLinha==="tracejada"?"LN1":"LA1"}))),n.layerManager.setLayerData(e,{conexoes:o}),n.layerManager.setLayerVisibility(e,!0)}function Yt(n,t,e=!0,o="polilinha",i){const s=t||[];n.layerManager.getOrCreateLayer(o,"vetorial-linhas","Polilinhas"),(o==="polilinha"||o==="perimetro")&&(n.context.pontos=s,n.context.segmentos=[],n.canvasInteracao.ctx.pontosList=s);const a=i||n.chaveGrupo||n.context.chaveGrupo;n.layerManager.setLayerData(o,{pontos:s,fechar:e!==!1,polilinhaSequencial:!0,chaveGrupo:a}),n.layerManager.setLayerVisibility(o,!0)}function Zt(n,t,e="poligonos"){const o=t||[];n.layerManager.getOrCreateLayer(e,"vetorial-poligonos","Polígonos"),n.layerManager.setLayerData(e,{poligonos:o}),n.layerManager.setLayerVisibility(e,!0)}function Xt(n,t,e){const o=t||[];if(e!=null){const i=e||[];n.context.pontos=i,n.canvasInteracao.ctx.pontosList=i}n.context.segmentos=o,n.layerManager.updateContext({segmentos:o,...e!=null?{pontos:n.context.pontos}:{}})}function Kt(n,t=!1){n.context.pontos=[],n.context.segmentos=[],n.context.confrontantes=[],n.canvasInteracao.ctx.pontosList=[],n.canvasInteracao.limparSelecao();const e={pontos:[],segmentos:[],confrontantes:[]};t||(n.context.bancoPontos=[],e.bancoPontos=[]),n.layerManager.updateContext(e)}function nt(n){return n!=null&&!isNaN(Number(n))&&String(n).trim()!==""?Number(n):n}function Jt(n,t){var a,c;const e=n.core.map,o=n.layerManager.getLayerDef(t.layerId),i=t.baseSize||8,s=((a=n.context.graphicScale)==null?void 0:a.markerScaleMultiplier)||1;if(e&&((c=o==null?void 0:o.estilo)==null?void 0:c.scaleMode)==="world"){const r=o.estilo.dimensaoMetros||.25,l=e.getCenter(),p=e.getZoom(),d=40075016686e-3*Math.abs(Math.cos(l.lat*Math.PI/180))/Math.pow(2,p+8),f=r/(d>0?d:1);return Math.max(3,Math.round(f*s))}return Math.max(4,Math.round(i*s))}function Qt(n,t,e,o,i){const s=Jt(n,e),a=n.context.config.enableAnimations?"transition-all duration-150":"",c=F(e.shapeStyle,s,e.markerBg,a,`map-marker-${e.layerId||"pts"}-${o}`,i);t.setIcon(y.divIcon({html:c,className:`custom-leaflet-marker flex items-center justify-center ${i?"cad-marker-selected ponto-selecionado":""}`,iconSize:[s+6,s+6]}))}function te(n){const t=n.context.selectedPontoIds||[],e=n.canvasInteracao.ctx.selectedVizinhoPontoIds||[],o=new Set([...t.map(String),...e.map(String)]);for(const i of n.getMarkers()){const s=i,a=s.pontoId;if(a==null)continue;const c=o.has(String(a));if(s.isSelected===c)continue;s.isSelected=c,i.setZIndexOffset(c?2e3:0),s.shapeStyle&&s.baseSize&&s.markerBg&&Qt(n,i,s,a,c);const r=i.getElement();r&&(c?r.classList.add("cad-marker-selected","ponto-selecionado"):r.classList.remove("cad-marker-selected","ponto-selecionado"))}}class Z{constructor(t){u(this,"core");u(this,"layerManager");u(this,"canvasInteracao");u(this,"context");u(this,"modoCliqueSequencialAtivo",!1);u(this,"chaveGrupo");u(this,"zonaProjecao",22);u(this,"levantamentoId",null);u(this,"customMarkerClickCallback");u(this,"customPopupActionCallback");u(this,"destaqueState",{destaqueMarker:null,destaqueTimeoutId:null});this.core=new rt(this),this.layerManager=new bt(t),this.canvasInteracao=new ct({mapaController:this,layerManager:this.layerManager}),this.context={pontos:[],segmentos:[],bancoPontos:[],confrontantes:[],zonaProjecao:22,config:this.core.config,graphicScale:{markerScaleMultiplier:1,lineScaleMultiplier:1,scaleModeGlobal:"screen"},onMarkerClick:(e,o)=>{if(this.modoCliqueSequencialAtivo||this.context.modoSequencial)return;const i=nt(e);if(this.customMarkerClickCallback)try{this.customMarkerClickCallback(i,o)}catch(s){console.error("Erro no customMarkerClickCallback:",s)}o?this.canvasInteracao.ctx.selectedVizinhoPontoIds=[i]:(this.canvasInteracao.ctx.selectedPontoIds=[i],this.canvasInteracao.ctx.lastSelectedPontoId=i),this.context.selectedPontoIds=[...this.canvasInteracao.ctx.selectedPontoIds],this.atualizarDestaqueMarcadores(),window.dispatchEvent(new CustomEvent("gerencigeo:ponto-selecionado",{detail:{selectedPontoIds:[i],lastSelectedPontoId:i,isVizinho:o}}))},onPopupAcao:(e,o,i)=>{if(this.customPopupActionCallback)try{this.customPopupActionCallback(e,o,i)}catch(s){console.error("Erro no customPopupActionCallback:",s)}}}}init(t,e){const o=this.core.init(t);return o&&(this.layerManager.attachMap(o,this.context),this.canvasInteracao.ativar(this,e)),o}invalidateSize(){try{this.core&&(typeof this.core.invalidateSize=="function"?this.core.invalidateSize():this.core.map&&typeof this.core.map.invalidateSize=="function"&&this.core.map.invalidateSize())}catch{}}setPontos(t){const e=t||[];this.context.pontos=e,this.canvasInteracao.ctx.pontosList=e,this.layerManager.updateContext({pontos:e})}setSegmentos(t){const e=t||[];this.context.segmentos=e,this.layerManager.updateContext({segmentos:e})}setBancoPontos(t){const e=t||[];this.context.bancoPontos=e,this.layerManager.updateContext({bancoPontos:e})}setConfrontantes(t){const e=t||[];this.context.confrontantes=e,this.layerManager.updateContext({confrontantes:e})}plotarPontos(t,e="vertices",o){Wt(this,t,e,o)}plotarConexoes(t,e="linhas"){Ut(this,t,e)}plotarPolilinhaSequencial(t,e=!0,o="polilinha",i){Yt(this,t,e,o,i)}plotarPoligonos(t,e="poligonos"){Zt(this,t,e)}limparCamadas(t){this.layerManager.clearLayers(t),(!t||t.length===0)&&this.canvasInteracao.limparSelecao()}obterMarcadores(t){if(t){const e=[],o=this.layerManager.getLayerInstance(t);if(o){const i=s=>{s instanceof y.Marker&&e.push(s)};i(o),typeof o.eachLayer=="function"&&o.eachLayer(i)}return e}return this.getMarkers()}plotPontos(t,e){e&&(this.customMarkerClickCallback=e),this.setPontos(t||[])}plotSegmentos(t,e){Xt(this,t,e)}plotPolilinhaTemporaria(t){const e=t||[];this.context.pontos=e,this.context.segmentos=[],this.canvasInteracao.ctx.pontosList=e,this.layerManager.updateContext({pontos:e,segmentos:[]})}plotPoligonalHomologada(t){const e=t||[];this.setBancoPontos(e),this.layerManager.setLayerVisibility("homologados",!0),this.layerManager.setLayerVisibility("homologados-pontos",!0)}plotPontosVizinhos(t){const e=jt(t||[],this.context.confrontantes||[]);this.setConfrontantes(e),this.layerManager.setLayerVisibility("vizinhos",!0)}plotPoligonosVizinhos(t){const e=Dt(t||[],this.context.confrontantes||[]);this.setConfrontantes(e),this.layerManager.setLayerVisibility("vizinhos",!0)}clearOverlays(t=!1){Kt(this,t)}setGraphicScale(t){this.layerManager.setGraphicScale(t)}exportState(){return this.layerManager.exportState()}importState(t){this.layerManager.importState(t)}selectPonto(t,e){if(!this.core.map)return;const o=String(t),i=this.getMarkers().find(a=>String(a.pontoId)===o);if(i){const a=e!==void 0?e:this.core.map.getZoom();this.core.map.setView(i.getLatLng(),a),i.openPopup()}const s=nt(t);this.canvasInteracao.ctx.selectedPontoIds=[s],this.canvasInteracao.ctx.lastSelectedPontoId=s,this.context.selectedPontoIds=[s],this.atualizarDestaqueMarcadores()}atualizarDestaqueMarcadores(){te(this)}fitBounds(t,e=[40,40],o=!1){if(!this.core.map)return;const i=Rt(t||this.context.pontos||[],this.context.confrontantes,o);if(i){i.single?this.core.map.setView(i.single,18):i.bounds&&(this.core.map.fitBounds(i.bounds,{padding:e}),this.core.map.once("moveend",()=>{this.core.preCarregarTilesRegiao(i.bounds)}));try{this.core.map.invalidateSize()}catch{}}}getMarkers(){return Ft(this.core.map,this.layerManager)}getVizinhosMarkers(){return this.getMarkers().filter(t=>!!t.isVizinho)}get destaqueAtivo(){return this.destaqueState.destaqueMarker!==null}localizarCoordenadasElemento(t){return xt(this,t)}destacarElemento(t,e){Ot(this,this.destaqueState,t,e)}limparDestaque(){K(this.destaqueState,this.getMap())}destroy(){if(this.limparDestaque(),this.canvasInteracao.desativar(),this.layerManager.destroy(),this.core.destroy(),this.core.map)try{this.core.map.off(),this.core.map.remove()}catch{}finally{this.core.map=null}}getMap(){return this.core.map}}function Pt(n,t,e,o){if(!n)return;if(n.querySelectorAll(".layer-item").length===t.length){t.forEach(s=>{var c,r;const a=n.querySelector(`.layer-item[data-layer-id="${s.id}"]`);if(a){const l=a.querySelector(".layer-chk-visibility");l&&l.checked!==s.visivel&&(l.checked=s.visivel);const p=a.querySelector(".layer-opacity-slider"),d=a.querySelector(".opacity-percent-label"),f=Math.round(s.opacidade*100);p&&parseInt(p.value,10)!==f&&(p.value=String(f)),d&&(d.textContent=`${f}%`);const h=a.querySelector(".btn-lock-layer");h&&(h.classList.toggle("active",!!s.bloqueada),h.title=s.bloqueada?"Desbloquear Camada":"Bloquear Camada");const b=a.querySelector(".btn-toggle-scale-mode");b&&((c=s.estilo)!=null&&c.scaleMode)&&(b.textContent=((r=s.estilo)==null?void 0:r.scaleMode)==="world"?"Métrico":"Tela")}});return}n.innerHTML=`
152
+ ${t.map(s=>{var a,c;return`
153
+ <div class="layer-item" data-layer-id="${s.id}">
154
+ <div class="layer-item-row">
155
+ <label class="layer-item-label">
156
+ <input type="checkbox" class="layer-chk-visibility" data-layer-id="${s.id}" ${s.visivel?"checked":""} />
157
+ <span>${s.nome}</span>
158
+ </label>
159
+ <div class="layer-item-actions">
160
+ <button class="btn-layer-action btn-lock-layer ${s.bloqueada?"active":""}" data-layer-id="${s.id}" type="button" title="${s.bloqueada?"Desbloquear Camada":"Bloquear Camada"}">
161
+ ${s.bloqueada?'<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>':'<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/></svg>'}
162
+ </button>
163
+ ${(a=s.estilo)!=null&&a.scaleMode?`
164
+ <span class="scale-mode-pill btn-toggle-scale-mode" data-layer-id="${s.id}" title="Alternar modo de escala">
165
+ ${((c=s.estilo)==null?void 0:c.scaleMode)==="world"?"Métrico":"Tela"}
166
+ </span>
167
+ `:""}
168
+ </div>
169
+ </div>
170
+ <div class="layer-controls-row">
171
+ <span>Opacidade</span>
172
+ <input type="range" min="0" max="100" value="${Math.round(s.opacidade*100)}" class="layer-opacity-slider" data-layer-id="${s.id}" />
173
+ <span class="opacity-percent-label" style="font-family:monospace; font-size:9px; width:28px; text-align:right;">${Math.round(s.opacidade*100)}%</span>
174
+ </div>
175
+ </div>
176
+ `}).join("")}
177
+ `,e.cleanup(),n.querySelectorAll(".layer-chk-visibility").forEach(s=>{e.add(s,"change",a=>{const c=a.target.getAttribute("data-layer-id"),r=a.target.checked;c&&o.setLayerVisibility(c,r)})}),n.querySelectorAll(".layer-opacity-slider").forEach(s=>{e.add(s,"input",a=>{const c=a.target.getAttribute("data-layer-id"),r=parseInt(a.target.value,10),l=r/100,p=a.target.closest(".layer-item"),d=p==null?void 0:p.querySelector(".opacity-percent-label");d&&(d.textContent=`${r}%`),c&&o.setLayerOpacity(c,l)})}),n.querySelectorAll(".btn-lock-layer").forEach(s=>{e.add(s,"click",a=>{const c=a.currentTarget.getAttribute("data-layer-id");if(c){const r=t.find(l=>l.id===c);r&&o.setLayerBlocked(c,!r.bloqueada)}})}),n.querySelectorAll(".btn-toggle-scale-mode").forEach(s=>{e.add(s,"click",a=>{var r;const c=a.currentTarget.getAttribute("data-layer-id");if(c){const l=t.find(p=>p.id===c);if(l){const p=((r=l.estilo)==null?void 0:r.scaleMode)==="world"?"screen":"world";o.setLayerScaleMode(c,p)}}})})}function Ct(n,t,e,o){var x,M,I,z,A,C;if(n.modoSequencial||n.controller.canvasInteracao.selectionHappened||n.controller.canvasInteracao.panHappened||n.mouseMovedSinceDown)return!1;const i=(t==null?void 0:t.originalEvent)||t,s=typeof(i==null?void 0:i.composedPath)=="function"?i.composedPath():[],a=s.length>0?s[0]:(i==null?void 0:i.target)||(t==null?void 0:t.target);if(a){const m='.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"]';if(((x=a.matches)==null?void 0:x.call(a,m))||((M=a.closest)==null?void 0:M.call(a,m)))return!1}const c=n.controller.getMap();if(!c||!n.mapContainer)return!1;let r,l;if(o)r=Math.round(o.x),l=Math.round(o.y);else if(t!=null&&t.containerPoint||t!=null&&t.layerPoint)r=Math.round(((I=t.containerPoint)==null?void 0:I.x)??((z=t.layerPoint)==null?void 0:z.x)??0),l=Math.round(((A=t.containerPoint)==null?void 0:A.y)??((C=t.layerPoint)==null?void 0:C.y)??0);else{const m=n.mapContainer.getBoundingClientRect(),v=(i==null?void 0:i.clientX)??0,P=(i==null?void 0:i.clientY)??0;r=Math.round(v-m.left),l=Math.round(P-m.top)}const p={x:r,y:l};let d,f;const h=e||(t==null?void 0:t.latlng);if(h&&typeof h.lat=="number")d=h.lat,f=h.lng??h.lon??0;else{const m=c.containerPointToLatLng(y.point(p.x,p.y));d=m.lat,f=m.lng}const b=n.controller.layerManager?n.controller.layerManager.getLayers().filter(m=>m.visivel).map(m=>m.id):[],S=i;return n.host.dispatchEvent(new CustomEvent("ui-canvas-clique",{detail:{coordenadas:{lat:d,lng:f},pontoPixel:p,eventoOriginal:S,lat:d,lon:f,lng:f,camadasAtivas:b},bubbles:!0,composed:!0})),!0}function wt(n,t,e,o){const i=o||n.obterElementoPorId(e);n.host.dispatchEvent(new CustomEvent("ui-acao-popup",{detail:{acaoId:t,elementoId:e,elemento:i??{id:e}},bubbles:!0,composed:!0})),n.fecharPopup()}function St(n,t,e,o,i,s,a){let c=o||n.obterElementoPorId(t),r=i;if(!r&&c){const l=c.lat??c.latitude??0,p=c.lon??c.lng??c.longitude??0;r={lat:Number(l),lon:Number(p)}}if(r||(r={lat:0,lon:0}),n.modoSequencial){n.fecharPopup(),n.host.dispatchEvent(new CustomEvent("ui-clique-sequencial",{detail:{id:t,elemento:c??{id:t,lat:r.lat,lon:r.lon},coordenadas:r},bubbles:!0,composed:!0}));return}if(a)try{const l=t!=null&&!isNaN(Number(t))&&String(t).trim()!==""?Number(t):t;a(l,e)}catch(l){console.error("Erro no callback de clique de marcador:",l)}if(s)try{s(t,e,c,r)}catch(l){console.error("Erro no handler anterior de marker click:",l)}n.host.dispatchEvent(new CustomEvent("ui-ponto-selecionado",{detail:{selectedIds:[t],lastSelectedId:t,isVizinho:e},bubbles:!0,composed:!0})),n.host.dispatchEvent(new CustomEvent("ui-elemento-selecionado",{detail:{id:t,elemento:c,tipo:e?"vizinho":"vertice",coordenadas:r},bubbles:!0,composed:!0}))}function Mt(n,t){let e=null,o=null,i=0,s=0;function a(){var p;try{if(!n.isConnected)return;const d=t.getMap();if(!d)return;const f=(p=d.getContainer)==null?void 0:p.call(d);if(!f||!f.parentNode)return;t.invalidateSize()}catch{}}function c(p=25){o!==null&&(window.clearTimeout(o),o=null),o=window.setTimeout(()=>{o=null,a()},p)}function r(){l(),!(typeof ResizeObserver>"u")&&(e=new ResizeObserver(p=>{for(const d of p){let f=0,h=0;d.contentRect?(f=d.contentRect.width,h=d.contentRect.height):d.borderBoxSize&&d.borderBoxSize.length>0?(f=d.borderBoxSize[0].inlineSize,h=d.borderBoxSize[0].blockSize):(f=n.clientWidth||n.offsetWidth,h=n.clientHeight||n.offsetHeight),f>0&&h>0&&(Math.abs(f-i)>=.5||Math.abs(h-s)>=.5)&&(i=f,s=h,c(25))}}),e.observe(n))}function l(){e&&(e.disconnect(),e=null),o!==null&&(window.clearTimeout(o),o=null)}return{observe:r,disconnect:l,invalidateSizeSafely:a}}class ee{constructor(t){u(this,"canal",null);u(this,"contexto");this.contexto=t}conectar(t){this.desconectar();const e=t!==void 0?t:this.contexto.host.getAttribute("canal-configuracao");if(!(!e||typeof BroadcastChannel>"u"))try{this.canal=new BroadcastChannel(e),this.canal.onmessage=o=>{this.processarMensagem(o.data)}}catch(o){console.warn(`[ui-canvas-cad] Erro ao conectar ao BroadcastChannel "${e}":`,o)}}processarMensagem(t){if(!t||typeof t!="object")return;const e=t.tipo||"ESTILOS_ALTERADOS",o=t.configuracoes||t;if(o.crosshair!==void 0){const i=!!o.crosshair;this.contexto.mapContainer&&(this.contexto.mapContainer.style.cursor=i?"crosshair":"");const s=this.contexto.controller.getMap();if(s){const a=s.getContainer();a&&(a.style.cursor=i?"crosshair":"")}this.contexto.controller.core.config.crosshair=i}if(o.opacidadeBase!==void 0){const i=parseFloat(o.opacidadeBase);isNaN(i)||this.contexto.setLayerOpacity("satelite",i)}if(o.satOpacity!==void 0){const i=parseFloat(o.satOpacity);isNaN(i)||this.contexto.setLayerOpacity("satelite",i)}o.opacidades&&typeof o.opacidades=="object"&&Object.entries(o.opacidades).forEach(([i,s])=>{const a=parseFloat(s);isNaN(a)||this.contexto.setLayerOpacity(i,a)}),this.contexto.host.dispatchEvent(new CustomEvent("ui-config-aplicada",{detail:{tipo:e,configuracoes:o},bubbles:!0,composed:!0}))}desconectar(){if(this.canal){try{this.canal.close()}catch{}this.canal=null}}}class oe{constructor(t){u(this,"contexto");u(this,"uiListeners",new st.ListenerBag);u(this,"isLayersPanelOpen",!1);u(this,"mouseMovedSinceDown",!1);u(this,"mouseDownPos",{x:0,y:0});this.contexto=t}get estaPainelAberto(){return this.isLayersPanelOpen}get houveMovimentoMouse(){return this.mouseMovedSinceDown}toggleLayersPanel(){this.isLayersPanelOpen=!this.isLayersPanelOpen,this.contexto.layersPanel&&(this.isLayersPanelOpen?this.contexto.layersPanel.classList.remove("collapsed"):this.contexto.layersPanel.classList.add("collapsed"));const t=this.contexto.shadow.getElementById("btn-toggle-layers");t==null||t.classList.toggle("active",this.isLayersPanelOpen)}closeLayersPanel(){var e;this.isLayersPanelOpen=!1,(e=this.contexto.layersPanel)==null||e.classList.add("collapsed");const t=this.contexto.shadow.getElementById("btn-toggle-layers");t==null||t.classList.remove("active")}vincularEventos(){this.uiListeners.cleanup();const t=this.contexto.shadow.getElementById("btn-toggle-layers"),e=this.contexto.shadow.getElementById("btn-close-layers"),o=this.contexto.shadow.getElementById("btn-zoom-extents"),i=this.contexto.shadow.getElementById("btn-clear-selection");this.uiListeners.add(t,"click",()=>{this.contexto.onToggleCamadas?this.contexto.onToggleCamadas():this.toggleLayersPanel()}),this.uiListeners.add(e,"click",()=>{this.contexto.onCloseCamadas?this.contexto.onCloseCamadas():this.closeLayersPanel()}),this.uiListeners.add(o,"click",()=>{var s,a;(a=(s=this.contexto).onZoomExtents)==null||a.call(s)}),this.uiListeners.add(i,"click",()=>{var s,a;(a=(s=this.contexto).onLimparSelecao)==null||a.call(s)}),this.contexto.mapContainer&&(this.uiListeners.add(this.contexto.mapContainer,"mousedown",s=>{s.button===0&&(this.mouseDownPos={x:s.clientX,y:s.clientY},this.mouseMovedSinceDown=!1)}),this.uiListeners.add(this.contexto.mapContainer,"mousemove",s=>{Math.hypot(s.clientX-this.mouseDownPos.x,s.clientY-this.mouseDownPos.y)>=4&&(this.mouseMovedSinceDown=!0)}),this.uiListeners.add(this.contexto.mapContainer,"click",s=>{var a,c;s.button===0&&(this.mouseMovedSinceDown||(c=(a=this.contexto).onTratarCliqueCanvas)==null||c.call(a,s))})),this.uiListeners.add(this.contexto.shadow,"click",s=>{var r,l,p;const a=s.composedPath?s.composedPath()[0]:s.target,c=(r=a==null?void 0:a.closest)==null?void 0:r.call(a,".ui-popup-btn");if(c){s.preventDefault(),s.stopPropagation();const d=c.getAttribute("data-acao-id"),f=c.getAttribute("data-elemento-id");d&&f!==null&&((p=(l=this.contexto).onDispararAcaoPopup)==null||p.call(l,d,f))}})}limpar(){this.uiListeners.cleanup()}}class ie{constructor(t){u(this,"contexto");u(this,"_pontos",[]);u(this,"_segmentos",[]);u(this,"_bancoPontos",[]);u(this,"_confrontantes",[]);u(this,"customMarkerClickHandler");this.contexto=t}get pontos(){return this._pontos}set pontos(t){this._pontos=t||[],this.contexto.obterController().setPontos(this._pontos)}get segmentos(){return this._segmentos}set segmentos(t){this._segmentos=t||[],this.contexto.obterController().setSegmentos(this._segmentos)}get bancoPontos(){return this._bancoPontos}set bancoPontos(t){this._bancoPontos=t||[],this.contexto.obterController().setBancoPontos(this._bancoPontos)}get confrontantes(){return this._confrontantes}set confrontantes(t){this._confrontantes=t||[],this.contexto.obterController().setConfrontantes(this._confrontantes)}sincronizarInicial(){const t=this.contexto.obterController();this._pontos.length>0&&t.setPontos(this._pontos),this._segmentos.length>0&&t.setSegmentos(this._segmentos),this._bancoPontos.length>0&&t.setBancoPontos(this._bancoPontos),this._confrontantes.length>0&&t.setConfrontantes(this._confrontantes)}obterElementoPorId(t){return this._pontos.find(e=>String(e.id)===String(t))||this._bancoPontos.find(e=>String(e.id)===String(t))||this._confrontantes.find(e=>String(e.id)===String(t))}plotarPontos(t,e="vertices",o){const i=t||[];e==="vertices"&&(this._pontos=i),this.contexto.obterController().plotarPontos(i,e,o)}plotarConexoes(t,e="linhas"){const o=t||[];this.contexto.obterController().plotarConexoes(o,e)}plotarPolilinhaSequencial(t,e=!0,o="polilinha",i){const s=t||[];(o==="polilinha"||o==="perimetro")&&(this._pontos=s,this._segmentos=[]);const a=i??this.contexto.obterChaveGrupo();this.contexto.obterController().plotarPolilinhaSequencial(s,e,o,a)}plotarPoligonos(t,e="poligonos"){const o=t||[];this.contexto.obterController().plotarPoligonos(o,e)}limparCamadas(t){!t||t.length===0?(this._pontos=[],this._segmentos=[],this._confrontantes=[]):(t.includes("vertices")&&(this._pontos=[]),(t.includes("linhas")||t.includes("perimetro")||t.includes("polilinha"))&&(this._segmentos=[]),(t.includes("poligonos")||t.includes("vizinhos"))&&(this._confrontantes=[])),this.contexto.obterController().limparCamadas(t)}obterMarcadores(t){return this.contexto.obterController().obterMarcadores(t)}plotPontos(t,e){e&&(this.customMarkerClickHandler=e);const o=t||[];this._pontos=o,this.contexto.obterController().plotPontos(o,e)}plotSegmentos(t,e){const o=t||[];e!=null&&(this._pontos=e||[]),this._segmentos=o,this.contexto.obterController().plotSegmentos(o,e)}plotPolilinhaTemporaria(t){const e=t||[];this._pontos=e,this._segmentos=[],this.contexto.obterController().plotPolilinhaTemporaria(e)}plotPoligonalHomologada(t){const e=t||[];this._bancoPontos=e,this.contexto.obterController().plotPoligonalHomologada(e),this.contexto.setLayerVisibility("homologados",!0),this.contexto.setLayerVisibility("homologados-pontos",!0)}plotPontosVizinhos(t){const e=t||[],o=this.contexto.obterController();o.plotPontosVizinhos(e),this._confrontantes=o.context.confrontantes||[]}plotPoligonosVizinhos(t){const e=t||[],o=this.contexto.obterController();o.plotPoligonosVizinhos(e),this._confrontantes=o.context.confrontantes||[]}clearOverlays(t=!1){this._pontos=[],this._segmentos=[],this._confrontantes=[],t||(this._bancoPontos=[]),this.contexto.obterController().clearOverlays(t)}getMarkers(){return this.contexto.obterController().getMarkers()}getVizinhosMarkers(){return this.contexto.obterController().getVizinhosMarkers()}}const ne=':host{display:block;width:100%;height:520px;position:relative;border-radius:var(--ui-radius-lg, 10px);overflow:hidden;box-shadow:0 10px 30px -5px #0009;border:1px solid rgba(255,255,255,.1);background:#080d0a;color:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Inter,sans-serif;user-select:none;-webkit-user-select:none}*,*:before,*:after{box-sizing:border-box}.cad-root{position:relative;width:100%;height:100%;display:flex;overflow:hidden}.cad-map-container{width:100%;height:100%;background:#080d0a;z-index:1}.qgis-layer-panel{position:absolute;top:12px;left:12px;z-index:var(--ui-z-workspace-hud, 500);width:290px;max-height:calc(100% - 24px);background:#0a120eeb;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border:1px solid rgba(255,255,255,.15);border-radius:8px;box-shadow:0 20px 40px #000000b3;display:flex;flex-direction:column;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .25s ease;overflow:hidden}.qgis-layer-panel.collapsed{transform:translate(-310px);opacity:0;pointer-events:none}.layer-panel-header{padding:10px 14px;background:#ffffff08;border-bottom:1px solid rgba(255,255,255,.08);display:flex;align-items:center;justify-content:space-between}.layer-panel-title{font-size:12px;font-weight:700;letter-spacing:.5px;color:#00f5a0;display:flex;align-items:center;gap:6px;text-transform:uppercase}.layer-panel-close{background:transparent;border:none;color:#ffffff80;cursor:pointer;padding:2px;border-radius: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: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: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}.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{filter:brightness(1.25);transform:scale(1.15);transition:transform .15s ease}.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, var(--ui-radius-sm, 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:14px;height:14px;border-radius:50%;background-color:var(--cad-pulse-cor, #00f5a0);box-shadow:0 0 10px var(--cad-pulse-cor, #00f5a0),0 0 20px var(--cad-pulse-cor, #00f5a0);pointer-events:none!important;animation:cad-pulse-glow 1.4s ease-in-out infinite alternate}.cad-pulse-ring{position:absolute;width:100%;height:100%;border-radius:50%;border:2.5px solid var(--cad-pulse-cor, #00f5a0);box-shadow:0 0 10px var(--cad-pulse-cor, #00f5a0);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:.6s}@keyframes cad-pulse-ping{0%{transform:scale(.35);opacity:.95}60%{opacity:.5}to{transform:scale(2.5);opacity:0}}@keyframes cad-pulse-glow{0%{transform:scale(.85);opacity:.8}to{transform:scale(1.15);opacity:1;box-shadow:0 0 14px var(--cad-pulse-cor, #00f5a0),0 0 26px var(--cad-pulse-cor, #00f5a0)}}.cad-marker-selected,.ponto-selecionado{z-index:2000!important}.cad-marker-selected>div,.ponto-selecionado>div{animation:cad-ponto-pulse 1.8s ease-in-out infinite alternate!important}@keyframes cad-ponto-pulse{0%{filter:drop-shadow(0 0 3px #ffffff) drop-shadow(0 0 6px #00f5a0)}to{filter:drop-shadow(0 0 6px #ffffff) drop-shadow(0 0 16px #00f5a0)}}.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: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}';function se(){return`
178
+ <style>
179
+ ${g.leafletCss}
180
+ ${ne}
181
+ </style>
182
+ <div class="cad-root" id="cad-root">
183
+ <div class="cad-map-container" id="cad-map-container"></div>
184
+ <div class="qgis-layer-panel collapsed" id="qgis-layer-panel">
185
+ <div class="layer-panel-header">
186
+ <div class="layer-panel-title">
187
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polygon points="12 2 2 7 12 12 22 7 12 2"/><polyline points="2 17 12 22 22 17"/><polyline points="2 12 12 17 22 12"/></svg>
188
+ Camadas
189
+ </div>
190
+ <button class="layer-panel-close" id="btn-close-layers" type="button" title="Fechar">
191
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
192
+ </button>
193
+ </div>
194
+ <div class="layer-panel-body" id="layers-list-container"></div>
195
+ </div>
196
+ <div class="cad-quick-toolbar">
197
+ <button class="cad-btn-tool" id="btn-toggle-layers" type="button" title="Camadas">
198
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 2 7 12 12 22 7 12 2"/><polyline points="2 17 12 22 22 17"/><polyline points="2 12 12 17 22 12"/></svg>
199
+ </button>
200
+ <button class="cad-btn-tool" id="btn-zoom-extents" type="button" title="Enquadrar">
201
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg>
202
+ </button>
203
+ <button class="cad-btn-tool" id="btn-clear-selection" type="button" title="Limpar seleção">
204
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" stroke-dasharray="3 3"/><line x1="9" y1="9" x2="15" y2="15"/><line x1="15" y1="9" x2="9" y2="15"/></svg>
205
+ </button>
206
+ </div>
207
+ </div>
208
+ `}function ae(n,t,e,o){if(e!==o){if(t==="sat-opacity"){const i=parseFloat(o);isNaN(i)||n.setLayerOpacity("satelite",i)}else if(t==="scale-mode")(o==="world"||o==="screen")&&(n.setLayerScaleMode("perimetro",o),n.setLayerScaleMode("vertices",o));else if(t==="modo-sequencial")n.host.modoSequencial=o!==null&&o!=="false";else if(t==="chave-grupo")n.host.chaveGrupo=o||void 0;else if(t==="zona-projecao"||t==="fuso"){const i=parseInt(o,10);!isNaN(i)&&i>0&&(n.atualizarZonaProjecao(i),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=i,n.controller.context.zonaProjecao=i)}else if(t==="canal-configuracao")n.broadcastConfig.conectar(o);else if(t==="crosshair"){const i=o!==null&&o!=="false";n.mapContainer&&(n.mapContainer.style.cursor=i?"crosshair":"");const s=n.controller.getMap();if(s){const a=s.getContainer();a&&(a.style.cursor=i?"crosshair":"")}n.controller.core.config.crosshair=i}}}function re(n){if(!n.mapContainer)return;if(n.mapContainer._leaflet_id&&!n.controller.getMap())try{delete n.mapContainer._leaflet_id}catch{n.mapContainer._leaflet_id=void 0}if(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")){const o=n.host.getAttribute("chave-grupo");o&&(n.host.chaveGrupo=o)}if(n.host.hasAttribute("zona-projecao")||n.host.hasAttribute("fuso")){const o=n.host.zonaProjecao;n.controller.zonaProjecao=o,n.controller.context.zonaProjecao=o}if(n.host.hasAttribute("crosshair")){const o=n.host.getAttribute("crosshair")!=="false";n.mapContainer&&(n.mapContainer.style.cursor=o?"crosshair":""),n.controller.core.config.crosshair=o}n.colecoesDados.sincronizarInicial(),n.controller.layerManager.onChange(o=>{n.renderLayersUI(),n.host.dispatchEvent(new CustomEvent("ui-camadas-alteradas",{detail:{layers:o},bubbles:!0,composed:!0}))});const t=n.controller.context.onMarkerClick;n.controller.context.onMarkerClick=(o,i,s,a)=>{St(n.obterContextoEventos(),o,i,s,a,t,n.colecoesDados.customMarkerClickHandler)},n.controller.context.onPopupAcao=(o,i,s)=>{n.dispararAcaoPopup(o,i,s)};const e=n.controller.getMap();e&&e.on("click",o=>{n.toolbarPainel.houveMovimentoMouse||n.tratarCliqueLivreCanvas(o,o.latlng,o.containerPoint)}),setTimeout(()=>{n.invalidateSizeSafely()},150)}class Lt extends at.SafeHTMLElement{constructor(){super();u(this,"shadow");u(this,"mapContainer",null);u(this,"layersPanel",null);u(this,"controller");u(this,"controladorTamanho");u(this,"toolbarPainel");u(this,"broadcastConfig");u(this,"colecoesDados");u(this,"layerItemListeners",new st.ListenerBag);u(this,"initTimeout");u(this,"lastPopupActionEmit");u(this,"lastCanvasClickTime",0);u(this,"_chaveGrupo");u(this,"_zonaProjecao",22);this.shadow=this.attachShadow({mode:"open"}),this.controller=new Z,this.controladorTamanho=Mt(this,this.controller),this.shadow.innerHTML=se(),this.mapContainer=this.shadow.getElementById("cad-map-container"),this.layersPanel=this.shadow.getElementById("qgis-layer-panel"),this.toolbarPainel=new oe({shadow:this.shadow,mapContainer:this.mapContainer,layersPanel:this.layersPanel,onToggleCamadas:()=>this.toggleLayersPanel(),onCloseCamadas:()=>this.closeLayersPanel(),onZoomExtents:()=>this.zoomExtents(),onLimparSelecao:()=>this.limparSelecao(),onTratarCliqueCanvas:e=>this.tratarCliqueLivreCanvas(e),onDispararAcaoPopup:(e,o)=>this.dispararAcaoPopup(e,o)}),this.broadcastConfig=new ee({host:this,controller:this.controller,mapContainer:this.mapContainer,setLayerOpacity:(e,o)=>this.setLayerOpacity(e,o)}),this.colecoesDados=new ie({obterController:()=>this.controller,obterChaveGrupo:()=>this.chaveGrupo,setLayerVisibility:(e,o)=>this.setLayerVisibility(e,o)})}static get observedAttributes(){return["sat-opacity","scale-mode","crosshair","modo-sequencial","chave-grupo","zona-projecao","fuso","canal-configuracao"]}connectedCallback(){const e=this.getAttribute("zona-projecao")||this.getAttribute("fuso");if(e){const o=parseInt(e,10);!isNaN(o)&&o>0&&(this._zonaProjecao=o,this.controller.zonaProjecao=o,this.controller.context.zonaProjecao=o)}this.controladorTamanho.observe(),this.broadcastConfig.conectar(),this.initTimeout=window.setTimeout(()=>this.initCAD(),0)}destroy(){if(this.initTimeout&&(window.clearTimeout(this.initTimeout),this.initTimeout=void 0),this.controladorTamanho.disconnect(),this.broadcastConfig.desconectar(),this.limparDestaque(),this.toolbarPainel.limpar(),this.layerItemListeners.cleanup(),this.controller.destroy(),this.mapContainer&&this.mapContainer._leaflet_id)try{delete this.mapContainer._leaflet_id}catch{this.mapContainer._leaflet_id=void 0}}disconnectedCallback(){this.destroy()}invalidateSizeSafely(){this.controladorTamanho.invalidateSizeSafely()}attributeChangedCallback(e,o,i){ae({host:this,controller:this.controller,mapContainer:this.mapContainer,broadcastConfig:this.broadcastConfig,setLayerOpacity:(s,a)=>this.setLayerOpacity(s,a),setLayerScaleMode:(s,a)=>this.setLayerScaleMode(s,a),atualizarZonaProjecao:s=>{this._zonaProjecao=s}},e,o,i)}initCAD(){re({host:this,shadow:this.shadow,mapContainer:this.mapContainer,controller:this.controller,toolbarPainel:this.toolbarPainel,colecoesDados:this.colecoesDados,obterContextoEventos:()=>this.obterContextoEventos(),renderLayersUI:()=>this.renderLayersUI(),invalidateSizeSafely:()=>this.invalidateSizeSafely(),tratarCliqueLivreCanvas:(e,o,i)=>this.tratarCliqueLivreCanvas(e,o,i),dispararAcaoPopup:(e,o,i)=>this.dispararAcaoPopup(e,o,i)})}obterContextoEventos(){return{host:this,controller:this.controller,mapContainer:this.mapContainer,modoSequencial:this.modoSequencial,mouseMovedSinceDown:this.toolbarPainel.houveMovimentoMouse,obterElementoPorId:e=>this.colecoesDados.obterElementoPorId(e),fecharPopup:()=>{var e;(e=this.controller.getMap())==null||e.closePopup()}}}tratarCliqueLivreCanvas(e,o,i){const s=Date.now();s-this.lastCanvasClickTime<50||(this.lastCanvasClickTime=s,Ct(this.obterContextoEventos(),e,o,i))}dispararAcaoPopup(e,o,i){const s=Date.now();this.lastPopupActionEmit&&this.lastPopupActionEmit.acaoId===e&&this.lastPopupActionEmit.elementoId===o&&s-this.lastPopupActionEmit.time<50||(this.lastPopupActionEmit={acaoId:e,elementoId:o,time:s},wt(this.obterContextoEventos(),e,o,i))}toggleLayersPanel(){this.toolbarPainel.toggleLayersPanel()}closeLayersPanel(){this.toolbarPainel.closeLayersPanel()}renderLayersUI(){const e=this.shadow.getElementById("layers-list-container");Pt(e,this.controller.layerManager.getLayers(),this.layerItemListeners,{setLayerVisibility:(o,i)=>this.setLayerVisibility(o,i),setLayerOpacity:(o,i)=>this.setLayerOpacity(o,i),setLayerBlocked:(o,i)=>this.controller.layerManager.setLayerBlocked(o,i),setLayerScaleMode:(o,i)=>this.setLayerScaleMode(o,i)})}get pontos(){return this.colecoesDados.pontos}set pontos(e){this.colecoesDados.pontos=e}get segmentos(){return this.colecoesDados.segmentos}set segmentos(e){this.colecoesDados.segmentos=e}get bancoPontos(){return this.colecoesDados.bancoPontos}set bancoPontos(e){this.colecoesDados.bancoPontos=e}get pontosHomologados(){return this.bancoPontos}set pontosHomologados(e){this.bancoPontos=e}get confrontantes(){return this.colecoesDados.confrontantes}set confrontantes(e){this.colecoesDados.confrontantes=e}get vizinhos(){return this.confrontantes}set vizinhos(e){this.confrontantes=e}get modoSequencial(){return this.hasAttribute("modo-sequencial")}set modoSequencial(e){var i;const o=!!e;o?this.hasAttribute("modo-sequencial")||this.setAttribute("modo-sequencial",""):this.hasAttribute("modo-sequencial")&&this.removeAttribute("modo-sequencial"),this.controller.modoCliqueSequencialAtivo=o,this.controller.context.modoSequencial=o,o&&((i=this.controller.getMap())==null||i.closePopup())}get chaveGrupo(){return this.getAttribute("chave-grupo")||this._chaveGrupo}set chaveGrupo(e){this._chaveGrupo=e,e?this.getAttribute("chave-grupo")!==e&&this.setAttribute("chave-grupo",e):this.hasAttribute("chave-grupo")&&this.removeAttribute("chave-grupo"),this.controller.chaveGrupo=e,this.controller.context.chaveGrupo=e,this.controller.layerManager.updateContext({chaveGrupo:e})}get zonaProjecao(){return this._zonaProjecao??22}set zonaProjecao(e){const o=typeof e=="number"?Math.floor(e):parseInt(String(e),10);if(!isNaN(o)&&o>0){this._zonaProjecao=o;const i=String(o);this.getAttribute("zona-projecao")!==i&&this.setAttribute("zona-projecao",i),this.hasAttribute("fuso")&&this.getAttribute("fuso")!==i&&this.setAttribute("fuso",i),this.controller.zonaProjecao=o,this.controller.context.zonaProjecao=o}}get canalConfiguracao(){return this.getAttribute("canal-configuracao")}set canalConfiguracao(e){e?this.setAttribute("canal-configuracao",e):this.removeAttribute("canal-configuracao")}fitBounds(e,o=[40,40],i=!1){this.controller.fitBounds(e,o,i)}zoomExtents(){this.controller.canvasInteracao.zoomExtents()}selectPonto(e,o){this.controller.selectPonto(e,o)}selecionarPonto(e,o){this.controller.selectPonto(e,o)}get pontosSelecionados(){return this.controller.context.selectedPontoIds||this.controller.canvasInteracao.ctx.selectedPontoIds||[]}set pontosSelecionados(e){const o=Array.isArray(e)?e:[];this.controller.canvasInteracao.ctx.selectedPontoIds=o,this.controller.context.selectedPontoIds=[...o],this.controller.atualizarDestaqueMarcadores()}atualizarDestaqueMarcadores(){this.controller.atualizarDestaqueMarcadores()}limparSelecao(){this.controller.canvasInteracao.limparSelecao()}setLayerVisibility(e,o){this.controller.layerManager.setLayerVisibility(e,o)}setLayerOpacity(e,o){this.controller.layerManager.setLayerOpacity(e,o)}setLayerScaleMode(e,o){this.controller.layerManager.setLayerScaleMode(e,o)}setGraphicScale(e){this.controller.setGraphicScale(e)}exportState(){return this.controller.exportState()}importState(e){this.controller.importState(e)}invalidateSize(){this.invalidateSizeSafely()}get destaqueAtivo(){return this.controller.destaqueAtivo}destacarElemento(e,o){!this.controller.getMap()&&this.mapContainer&&this.initCAD(),this.controller.destacarElemento(e,o)}limparDestaque(){this.controller.limparDestaque()}plotarPontos(e,o="vertices",i){this.colecoesDados.plotarPontos(e,o,i)}plotarConexoes(e,o="linhas"){this.colecoesDados.plotarConexoes(e,o)}plotarPolilinhaSequencial(e,o=!0,i="polilinha",s){this.colecoesDados.plotarPolilinhaSequencial(e,o,i,s)}plotarPoligonos(e,o="poligonos"){this.colecoesDados.plotarPoligonos(e,o)}limparCamadas(e){this.colecoesDados.limparCamadas(e)}obterMarcadores(e){return this.colecoesDados.obterMarcadores(e)}plotPontos(e,o){this.colecoesDados.plotPontos(e,o)}plotSegmentos(e,o){this.colecoesDados.plotSegmentos(e,o)}plotPolilinhaTemporaria(e){this.colecoesDados.plotPolilinhaTemporaria(e)}plotPoligonalHomologada(e){this.colecoesDados.plotPoligonalHomologada(e)}plotPontosVizinhos(e){this.colecoesDados.plotPontosVizinhos(e)}plotPoligonosVizinhos(e){this.colecoesDados.plotPoligonosVizinhos(e)}clearOverlays(e=!1){this.colecoesDados.clearOverlays(e)}getMarkers(){return this.colecoesDados.getMarkers()}getVizinhosMarkers(){return this.colecoesDados.getVizinhosMarkers()}getMap(){return this.controller.getMap()}getController(){return this.controller}getLayerManager(){return this.controller.layerManager}}at.definirCustomElement("ui-canvas-cad",Lt);class le{constructor(t,e){u(this,"polylines",[]);u(this,"bancoPontosAtivo",!1);u(this,"core");this.core=t}setBancoPontosAtivo(t){this.bancoPontosAtivo=t}plotSegmentos(t,e){this.core.map&&t.forEach(o=>{const i=e.find(a=>String(a.id)===String(o.ponto_inicio_id)),s=e.find(a=>String(a.id)===String(o.ponto_fim_id));if(i&&s&&i.lat&&i.lon&&s.lat&&s.lon){const a=o.tipo_limite_sigef||o.tipo_limite||"",c=o.metodo_posicionamento_sigef||o.metodo_posicionamento||"",r=this.bancoPontosAtivo?"#94a3b8":a==="LA1"?"#10b981":"#3b82f6",l=this.core.config.perimetroWeight,p=this.bancoPontosAtivo?.4:1,d=y.polyline([[i.lat,i.lon],[s.lat,s.lon]],{color:r,weight:l,opacity:p,dashArray:a==="LN1"?"6, 6":void 0,pane:"perimetroPane"}).bindPopup(`
209
+ <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3;">
210
+ <div style="font-weight:700; font-size:12px; margin-bottom:3px; color:#ffffff;">${g.escapeHtml(i.nome_vertice)} ↔ ${g.escapeHtml(s.nome_vertice)}</div>
211
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">Limite: ${g.escapeHtml(a)} · ${g.escapeHtml(c)}</div>
212
+ </div>
213
+ `,{className:"compact-popup",maxWidth:220}).addTo(this.core.map);this.polylines.push(d)}})}plotPolilinhaTemporaria(t){var r,l,p;if(!this.core.map)return;const e=t.filter(d=>d.lat&&d.lon&&d.lat!==0&&d.lon!==0&&d.tipo_ponto!=="B"&&d.tipo!=="B"&&d.ignorar_poligono!==1);if(e.length<2)return;const o=((r=this.core.controller)==null?void 0:r.chaveGrupo)||((p=(l=this.core.controller)==null?void 0:l.context)==null?void 0:p.chaveGrupo),i=g.agruparPontosPorChave(e,o),s=this.bancoPontosAtivo?"#94a3b8":"#10b981",a=this.core.config.fechamentoWeight||2,c=this.bancoPontosAtivo?.4:1;Object.values(i).forEach(d=>{const f=g.ordenarPontosPorSequencia(d);if(f.length<2)return;for(let x=0;x<f.length-1;x++){const M=f[x],I=f[x+1],z=y.polyline([[M.lat,M.lon],[I.lat,I.lon]],{color:s,weight:a,opacity:c,pane:"perimetroPane"}).addTo(this.core.map);this.polylines.push(z)}const h=f[f.length-1],b=f[0],S=y.polyline([[h.lat,h.lon],[b.lat,b.lon]],{color:s,weight:a,opacity:c,dashArray:"4, 4",pane:"perimetroPane"}).addTo(this.core.map);this.polylines.push(S)})}plotPoligonalHomologada(t){var s,a,c;if(!this.core.map||!this.core.bancoPontosGroup)return;this.core.bancoPontosGroup.clearLayers();const e=t.filter(r=>r.lat&&r.lon&&r.lat!==0&&r.lon!==0);if(e.length===0)return;this.bancoPontosAtivo=!0,e.forEach(r=>{const l=`
214
+ <div class="w-4.5 h-4.5 bg-amber-500 text-slate-950 border-2 border-slate-900 rounded-full flex items-center justify-center text-[7px] font-black font-mono shadow-md hover:scale-125 transition-transform" id="banco-marker-${r.id}">
215
+ H
216
+ </div>
217
+ `,p=y.divIcon({html:l,className:"banco-leaflet-marker",iconSize:[18,18]}),d=`
218
+ <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.35; min-width:180px;">
219
+ <div style="font-weight:800; font-size:11px; color:#fbbf24; text-transform:uppercase; letter-spacing:0.5px; border-bottom:1px solid rgba(255, 255, 255, 0.1); padding-bottom:3px; margin-bottom:5px;">Vértice Homologado SIGEF</div>
220
+ <div style="font-weight:700; font-size:13px; margin-bottom:3px; color:#ffffff;">${g.escapeHtml(r.codigo_completo||r.nome_vertice)}</div>
221
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.7); font-family:monospace;">Este (E): ${r.este?r.este.toFixed(2):"N/A"} m</div>
222
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.7); font-family:monospace; margin-bottom:3px;">Norte (N): ${r.norte?r.norte.toFixed(2):"N/A"} m</div>
223
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.7); margin-bottom:2px;">Alt (h): <strong>${r.altitude?r.altitude.toFixed(2):"N/A"} m</strong></div>
224
+ <div style="font-size:10px; color:rgba(255, 255, 255, 0.45);">Método: ${g.escapeHtml(r.metodo_posicionamento)||"N/A"} · Limite: ${g.escapeHtml(r.tipo_limite)||"N/A"}</div>
225
+ ${r.confrontante_descritivo?`<div style="font-size:10px; color:rgba(255, 255, 255, 0.65); border-top:1px solid rgba(255, 255, 255, 0.1); padding-top:4px; margin-top:4px; word-break:break-word;"><strong>Conf:</strong> ${g.escapeHtml(r.confrontante_descritivo)}</div>`:""}
226
+ </div>
227
+ `;y.marker([r.lat,r.lon],{icon:p,pane:"verticesPane"}).bindPopup(d,{className:"compact-popup",maxWidth:220}).addTo(this.core.bancoPontosGroup)});const o=((s=this.core.controller)==null?void 0:s.chaveGrupo)||((c=(a=this.core.controller)==null?void 0:a.context)==null?void 0:c.chaveGrupo),i=g.agruparPontosPorChave(e,o);for(const r in i){const l=g.ordenarPontosPorSequencia(i[r]);if(l.length>=2){const p=l.map(d=>y.latLng(d.lat,d.lon));p.push(y.latLng(l[0].lat,l[0].lon)),y.polyline(p,{color:"#f59e0b",weight:this.core.config.bancoWeight,dashArray:"6, 8",pane:"perimetroPane"}).addTo(this.core.bancoPontosGroup)}}}clearLinhas(){this.core.map&&this.polylines.forEach(t=>this.core.map.removeLayer(t)),this.core.bancoPontosGroup&&this.core.bancoPontosGroup.clearLayers(),this.polylines=[]}}class ce{constructor(t,e){u(this,"markers",[]);u(this,"vizinhosMarkers",[]);u(this,"vizinhosPoligonos",[]);u(this,"core");u(this,"controller");this.core=t,this.controller=e}plotPontos(t,e){this.core.map&&t.forEach(o=>{var i,s,a;if(o.lat&&o.lon&&o.lat!==0&&o.lon!==0){const c=o.tipo_ponto==="B"||o.tipo==="B",r=o.tipo_ponto==="M"||o.tipo==="M";let l="bg-mint-vibrant",p="x",d=7;r?(l="bg-indigo-500",d=9):c&&(l="bg-rose-500",d=9);const f=this.core.config.enableAnimations?"transition-all duration-150":"",h=(s=(i=this.controller)==null?void 0:i.linhas)!=null&&s.bancoPontosAtivo?"opacity-40 hover:opacity-100":"",b=F(p,d,l,`${f} ${h}`,`map-marker-${o.id}`),S=y.divIcon({html:b,className:"custom-leaflet-marker flex items-center justify-center",iconSize:[d+6,d+6]}),x=r?"Base Homologada PPP":c?"Base de Campo (Translação)":"Vértice de Perímetro",M=y.marker([o.lat,o.lon],{icon:S,pane:"verticesPane"});M.pontoId=o.id,(a=this.controller)!=null&&a.modoCliqueSequencialAtivo||M.bindPopup(`
228
+ <div style="font-family:sans-serif; color:rgba(255, 255, 255, 0.9); line-height:1.3;">
229
+ <div style="font-weight:700; font-size:13px; margin-bottom:4px; color:#ffffff;">${g.escapeHtml(o.nome_vertice)}</div>
230
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.65);">${g.escapeHtml(x)} · ${g.escapeHtml(o.tipo_ponto||o.tipo)}</div>
231
+ <div style="font-size:11px; color:rgba(255, 255, 255, 0.45); font-family:monospace; margin-top:4px;">Lat ${o.lat.toFixed(6)} &nbsp; Lon ${o.lon.toFixed(6)}</div>
232
+ </div>
233
+ `,{className:"compact-popup",maxWidth:220}),M.addTo(this.core.map),M.setZIndexOffset(1e3),M.on("click",()=>{e(o.id)}),this.markers.push(M)}})}plotPontosVizinhos(t){if(!this.core.map||!this.core.pontosVizinhosGroup)return;this.core.map.hasLayer(this.core.pontosVizinhosGroup)||this.core.pontosVizinhosGroup.addTo(this.core.map),this.vizinhosMarkers&&this.vizinhosMarkers.length>0&&(this.vizinhosMarkers.forEach(o=>{o.off(),o.unbindPopup()}),this.vizinhosMarkers=[]),this.core.pontosVizinhosGroup.clearLayers();const e=new Map;(t||[]).forEach(o=>{const i=o.lat??o.latitude??o.y,s=o.lon??o.lng??o.longitude??o.x,a=typeof i=="string"?parseFloat(i.replace(",",".")):Number(i),c=typeof s=="string"?parseFloat(s.replace(",",".")):Number(s);if(a!==void 0&&c!==void 0&&!isNaN(a)&&!isNaN(c)&&a!==0&&c!==0){o.lat=a,o.lon=c;const r=o.confrontante_id!==void 0&&o.confrontante_id!==null?String(o.confrontante_id):"0";e.has(r)||e.set(r,[]),e.get(r).push(o)}}),e.forEach(o=>{if(o.length>=2){o.sort((s,a)=>Number(s.id)-Number(a.id));const i=o.map(s=>y.latLng(s.lat,s.lon));o.length>2&&i.push(y.latLng(o[0].lat,o[0].lon)),y.polyline(i,{color:"#a855f7",weight:this.core.config.vizinhoWeight,dashArray:"4, 6",pane:"overlayPane"}).addTo(this.core.pontosVizinhosGroup)}o.forEach(i=>{var f,h;const s=document.createElement("div");s.className="p-2 font-sans text-xs bg-[#0c1510] text-white min-w-[200px] rounded",s.innerHTML=`
234
+ <div class="font-bold text-purple-400 mb-1 border-b border-white/10 pb-1">Confrontante (Importado)</div>
235
+ <div class="mb-1"><strong>Vértice:</strong> <span class="font-mono">${g.escapeHtml(i.nome_vertice||"")}</span></div>
236
+ <div class="mb-1"><strong>Proprietário:</strong> ${g.escapeHtml(i.nome_confrontante||"")||"Desconhecido"}</div>
237
+ <div class="mb-1"><strong>Propriedade:</strong> ${g.escapeHtml(i.nome_propriedade||"")||"Desconhecida"}</div>
238
+ <div class="mb-1"><strong>Coordenadas:</strong> ${i.lat.toFixed(7)}, ${i.lon.toFixed(7)}</div>
239
+ <div class="text-[10px] text-white/50 border-t border-white/5 pt-1 mt-1 font-mono uppercase tracking-wider mb-2">Pontos Imutáveis do Vizinho</div>
240
+ <div style="display:flex; gap:6px; border-top:1px solid rgba(255,255,255,0.1); padding-top:6px;">
241
+ <button class="btn-integrar" style="padding:3px 8px; font-size:10px; font-weight:700; border-radius:4px; background:#00f5a0; color:#04150c; border:none; cursor:pointer;" type="button">
242
+ Integrar
243
+ </button>
244
+ <button class="btn-ocultar" style="padding:3px 8px; font-size:10px; font-weight:700; border-radius:4px; background:rgba(255,255,255,0.1); color:rgba(255,255,255,0.8); border:1px solid rgba(255,255,255,0.15); cursor:pointer;" type="button">
245
+ Ocultar
246
+ </button>
247
+ </div>
248
+ `,(f=s.querySelector(".btn-integrar"))==null||f.addEventListener("click",()=>{window.dispatchEvent(new CustomEvent("gerencigeo:integrar_vizinho",{detail:{pontoId:i.id}}))}),(h=s.querySelector(".btn-ocultar"))==null||h.addEventListener("click",()=>{window.dispatchEvent(new CustomEvent("gerencigeo:ocultar_vizinho",{detail:{pontoId:i.id}}))});let a=this.core.config.markerStyleV||"cross",c=this.core.config.markerSizeV||8;i.tipo_ponto==="M"||i.tipo==="M"||i.tipo==="B"?(a=this.core.config.markerStyleM||"circle-dot",c=this.core.config.markerSizeM||14):(i.tipo_ponto==="P"||i.tipo==="P"||i.tipo==="O")&&(a=this.core.config.markerStyleP||"circle",c=this.core.config.markerSizeP||10);const r=this.core.config.enableAnimations?"transition-all duration-150":"",l=F(a,c,"bg-[#a855f7]",r,`map-marker-vizinho-${i.id}`),p=y.divIcon({html:l,className:"custom-leaflet-marker flex items-center justify-center",iconSize:[c+4,c+4]}),d=y.marker([i.lat,i.lon],{icon:p,pane:"overlayPane"}).bindPopup(s,{className:"custom-leaflet-popup"});d.pontoId=i.id,d.isVizinho=!0,d.addTo(this.core.pontosVizinhosGroup),this.vizinhosMarkers.push(d)})})}plotPoligonosVizinhos(t){!this.core.map||!this.core.pontosVizinhosGroup||(this.core.map.hasLayer(this.core.pontosVizinhosGroup)||this.core.pontosVizinhosGroup.addTo(this.core.map),this.vizinhosPoligonos.length>0&&(this.vizinhosPoligonos.forEach(e=>e.off()),this.vizinhosPoligonos=[]),(t||[]).forEach(e=>{if(!e||!e.poligono_wkt)return;const o=/POLYGON\s*\(\s*\(\s*(.*?)\s*\)\s*\)/i.exec(e.poligono_wkt);if(!o)return;const i=o[1].split(",").map(r=>{const l=r.trim().split(/\s+/),p=parseFloat(l[0]),d=parseFloat(l[1]);return!isNaN(d)&&!isNaN(p)?[d,p]:null}).filter(r=>r!==null);if(i.length<3)return;const s=g.escapeHtml(e.nome_propriedade||"Propriedade Vizinha"),a=g.escapeHtml(e.nome||"Desconhecido"),c=y.polygon(i,{color:"#a855f7",weight:this.core.config.vizinhoWeight,dashArray:"4, 6",fillColor:"#a855f7",fillOpacity:.05,pane:"overlayPane"}).bindPopup(`
249
+ <div class="p-2 font-sans text-xs bg-[#0c1510] text-white min-w-[200px] rounded">
250
+ <div class="font-bold text-purple-400 mb-1 border-b border-white/10 pb-1">Limite do Vizinho (Importado)</div>
251
+ <div class="mb-1"><strong>Propriedade:</strong> ${s}</div>
252
+ <div class="mb-1"><strong>Proprietário:</strong> ${a}</div>
253
+ </div>
254
+ `,{className:"custom-leaflet-popup"});c.addTo(this.core.pontosVizinhosGroup),this.vizinhosPoligonos.push(c)}))}clearMarkers(){this.markers&&(this.markers.forEach(t=>{t.off(),t.unbindPopup(),this.core.map&&this.core.map.removeLayer(t)}),this.markers=[]),this.vizinhosMarkers&&(this.vizinhosMarkers.forEach(t=>{t.off(),t.unbindPopup()}),this.vizinhosMarkers=[]),this.vizinhosPoligonos&&(this.vizinhosPoligonos.forEach(t=>t.off()),this.vizinhosPoligonos=[]),this.core.pontosVizinhosGroup&&this.core.pontosVizinhosGroup.clearLayers()}}exports.agruparPontosPorChave=g.agruparPontosPorChave;exports.bindPopupAcoesEvents=g.bindPopupAcoesEvents;exports.escapeHtml=g.escapeHtml;exports.extrairCentroDeWkt=g.extrairCentroDeWkt;exports.formatUTM=g.formatUTM;exports.ordenarPontosPorSequencia=g.ordenarPontosPorSequencia;exports.parseCoordenada=g.parseCoordenada;exports.renderPopupAcoesHtml=g.renderPopupAcoesHtml;exports.CADMapaController=Z;exports.CAD_INTERACTIVE_PANES=lt;exports.CanvasCADController=Z;exports.CanvasInteracao=ct;exports.CanvasLayerManager=bt;exports.DEFAULT_CONFIG=X;exports.DEFAULT_LAYERS=yt;exports.GerenciGeoMapaController=Z;exports.GridLayerRenderer=vt;exports.LayerRendererFactory=G;exports.MapaConfigManager=Y;exports.MapaCore=rt;exports.MapaLinhas=le;exports.MapaMarcadores=ce;exports.TileLayerRenderer=dt;exports.UICanvasCAD=Lt;exports.VectorLinesLayerRenderer=ft;exports.VectorPointsLayerRenderer=gt;exports.VectorPolygonsLayerRenderer=mt;exports.WmsLayerRenderer=pt;exports.criarControladorTamanho=Mt;exports.extrairCorPonto=ut;exports.getPointShapeHtml=F;exports.processarAcaoPopup=wt;exports.processarCliqueLivreCanvas=Ct;exports.renderizarPainelCamadas=Pt;exports.tratarCliqueMarcador=St;
@@ -0,0 +1,8 @@
1
+ import { UICanvasCAD } from './components/ui-canvas-cad';
2
+ export * from './components/ui-canvas-cad';
3
+ export * from './gerencigeo-canvas';
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'ui-canvas-cad': UICanvasCAD;
7
+ }
8
+ }