'use strict'; /* ═══════════════════════════════════════════════════════════ 1. HELPERS ═══════════════════════════════════════════════════════════ */ const H = { uid: () => Math.random().toString(36).slice(2,9) + Date.now().toString(36), esc: s => String(s||'').replace(/[&<>"']/g, c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])), fmDist: m => m==null?'-': m>=1000? (m/1000).toFixed(2)+' km': Math.round(m).toLocaleString('id-ID')+' m', fmArea: m => m==null?'-': m>=10000? (m/10000).toFixed(4)+' ha': Math.round(m).toLocaleString('id-ID')+' m²', fmNum: n => (n||0).toLocaleString('id-ID'), today: () => new Date().toISOString().slice(0,10), geoLen: lls => { let t=0; for(let i=0;i { const R=6371008.8; let a=0,n=lls.length; for(let i=0;i