cern-map-overlay
Version:
A web component for CERN map overlay built with Vite
13,855 lines • 587 kB
JavaScript
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const os = globalThis, hr = os.ShadowRoot && (os.ShadyCSS === void 0 || os.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ka = Symbol(), _a = /* @__PURE__ */ new WeakMap();
let $h = class {
constructor(i, s, r) {
if (this._$cssResult$ = !0, r !== Ka)
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
this.cssText = i, this.t = s;
}
get styleSheet() {
let i = this.o;
const s = this.t;
if (hr && i === void 0) {
const r = s !== void 0 && s.length === 1;
r && (i = _a.get(s)), i === void 0 && ((this.o = i = new CSSStyleSheet()).replaceSync(this.cssText), r && _a.set(s, i));
}
return i;
}
toString() {
return this.cssText;
}
};
const Fh = (e) => new $h(typeof e == "string" ? e : e + "", void 0, Ka), Hh = (e, i) => {
if (hr)
e.adoptedStyleSheets = i.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
else
for (const s of i) {
const r = document.createElement("style"), o = os.litNonce;
o !== void 0 && r.setAttribute("nonce", o), r.textContent = s.cssText, e.appendChild(r);
}
}, pa = hr ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((i) => {
let s = "";
for (const r of i.cssRules)
s += r.cssText;
return Fh(s);
})(e) : e;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const { is: Wh, defineProperty: jh, getOwnPropertyDescriptor: Kh, getOwnPropertyNames: Vh, getOwnPropertySymbols: Jh, getPrototypeOf: Xh } = Object, Fe = globalThis, ma = Fe.trustedTypes, Qh = ma ? ma.emptyScript : "", Ks = Fe.reactiveElementPolyfillSupport, gn = (e, i) => e, us = { toAttribute(e, i) {
switch (i) {
case Boolean:
e = e ? Qh : null;
break;
case Object:
case Array:
e = e == null ? e : JSON.stringify(e);
}
return e;
}, fromAttribute(e, i) {
let s = e;
switch (i) {
case Boolean:
s = e !== null;
break;
case Number:
s = e === null ? null : Number(e);
break;
case Object:
case Array:
try {
s = JSON.parse(e);
} catch {
s = null;
}
}
return s;
} }, lr = (e, i) => !Wh(e, i), ga = { attribute: !0, type: String, converter: us, reflect: !1, useDefault: !1, hasChanged: lr };
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), Fe.litPropertyMetadata ?? (Fe.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
let Ti = class extends HTMLElement {
static addInitializer(i) {
this._$Ei(), (this.l ?? (this.l = [])).push(i);
}
static get observedAttributes() {
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
}
static createProperty(i, s = ga) {
if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(i) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(i, s), !s.noAccessor) {
const r = Symbol(), o = this.getPropertyDescriptor(i, r, s);
o !== void 0 && jh(this.prototype, i, o);
}
}
static getPropertyDescriptor(i, s, r) {
const { get: o, set: h } = Kh(this.prototype, i) ?? { get() {
return this[s];
}, set(l) {
this[s] = l;
} };
return { get: o, set(l) {
const u = o == null ? void 0 : o.call(this);
h == null || h.call(this, l), this.requestUpdate(i, u, r);
}, configurable: !0, enumerable: !0 };
}
static getPropertyOptions(i) {
return this.elementProperties.get(i) ?? ga;
}
static _$Ei() {
if (this.hasOwnProperty(gn("elementProperties")))
return;
const i = Xh(this);
i.finalize(), i.l !== void 0 && (this.l = [...i.l]), this.elementProperties = new Map(i.elementProperties);
}
static finalize() {
if (this.hasOwnProperty(gn("finalized")))
return;
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(gn("properties"))) {
const s = this.properties, r = [...Vh(s), ...Jh(s)];
for (const o of r)
this.createProperty(o, s[o]);
}
const i = this[Symbol.metadata];
if (i !== null) {
const s = litPropertyMetadata.get(i);
if (s !== void 0)
for (const [r, o] of s)
this.elementProperties.set(r, o);
}
this._$Eh = /* @__PURE__ */ new Map();
for (const [s, r] of this.elementProperties) {
const o = this._$Eu(s, r);
o !== void 0 && this._$Eh.set(o, s);
}
this.elementStyles = this.finalizeStyles(this.styles);
}
static finalizeStyles(i) {
const s = [];
if (Array.isArray(i)) {
const r = new Set(i.flat(1 / 0).reverse());
for (const o of r)
s.unshift(pa(o));
} else
i !== void 0 && s.push(pa(i));
return s;
}
static _$Eu(i, s) {
const r = s.attribute;
return r === !1 ? void 0 : typeof r == "string" ? r : typeof i == "string" ? i.toLowerCase() : void 0;
}
constructor() {
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
}
_$Ev() {
var i;
this._$ES = new Promise((s) => this.enableUpdating = s), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (i = this.constructor.l) == null || i.forEach((s) => s(this));
}
addController(i) {
var s;
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(i), this.renderRoot !== void 0 && this.isConnected && ((s = i.hostConnected) == null || s.call(i));
}
removeController(i) {
var s;
(s = this._$EO) == null || s.delete(i);
}
_$E_() {
const i = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
for (const r of s.keys())
this.hasOwnProperty(r) && (i.set(r, this[r]), delete this[r]);
i.size > 0 && (this._$Ep = i);
}
createRenderRoot() {
const i = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return Hh(i, this.constructor.elementStyles), i;
}
connectedCallback() {
var i;
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (i = this._$EO) == null || i.forEach((s) => {
var r;
return (r = s.hostConnected) == null ? void 0 : r.call(s);
});
}
enableUpdating(i) {
}
disconnectedCallback() {
var i;
(i = this._$EO) == null || i.forEach((s) => {
var r;
return (r = s.hostDisconnected) == null ? void 0 : r.call(s);
});
}
attributeChangedCallback(i, s, r) {
this._$AK(i, r);
}
_$ET(i, s) {
var h;
const r = this.constructor.elementProperties.get(i), o = this.constructor._$Eu(i, r);
if (o !== void 0 && r.reflect === !0) {
const l = (((h = r.converter) == null ? void 0 : h.toAttribute) !== void 0 ? r.converter : us).toAttribute(s, r.type);
this._$Em = i, l == null ? this.removeAttribute(o) : this.setAttribute(o, l), this._$Em = null;
}
}
_$AK(i, s) {
var h, l;
const r = this.constructor, o = r._$Eh.get(i);
if (o !== void 0 && this._$Em !== o) {
const u = r.getPropertyOptions(o), f = typeof u.converter == "function" ? { fromAttribute: u.converter } : ((h = u.converter) == null ? void 0 : h.fromAttribute) !== void 0 ? u.converter : us;
this._$Em = o, this[o] = f.fromAttribute(s, u.type) ?? ((l = this._$Ej) == null ? void 0 : l.get(o)) ?? null, this._$Em = null;
}
}
requestUpdate(i, s, r) {
var o;
if (i !== void 0) {
const h = this.constructor, l = this[i];
if (r ?? (r = h.getPropertyOptions(i)), !((r.hasChanged ?? lr)(l, s) || r.useDefault && r.reflect && l === ((o = this._$Ej) == null ? void 0 : o.get(i)) && !this.hasAttribute(h._$Eu(i, r))))
return;
this.C(i, s, r);
}
this.isUpdatePending === !1 && (this._$ES = this._$EP());
}
C(i, s, { useDefault: r, reflect: o, wrapped: h }, l) {
r && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(i) && (this._$Ej.set(i, l ?? s ?? this[i]), h !== !0 || l !== void 0) || (this._$AL.has(i) || (this.hasUpdated || r || (s = void 0), this._$AL.set(i, s)), o === !0 && this._$Em !== i && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(i));
}
async _$EP() {
this.isUpdatePending = !0;
try {
await this._$ES;
} catch (s) {
Promise.reject(s);
}
const i = this.scheduleUpdate();
return i != null && await i, !this.isUpdatePending;
}
scheduleUpdate() {
return this.performUpdate();
}
performUpdate() {
var r;
if (!this.isUpdatePending)
return;
if (!this.hasUpdated) {
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
for (const [h, l] of this._$Ep)
this[h] = l;
this._$Ep = void 0;
}
const o = this.constructor.elementProperties;
if (o.size > 0)
for (const [h, l] of o) {
const { wrapped: u } = l, f = this[h];
u !== !0 || this._$AL.has(h) || f === void 0 || this.C(h, void 0, l, f);
}
}
let i = !1;
const s = this._$AL;
try {
i = this.shouldUpdate(s), i ? (this.willUpdate(s), (r = this._$EO) == null || r.forEach((o) => {
var h;
return (h = o.hostUpdate) == null ? void 0 : h.call(o);
}), this.update(s)) : this._$EM();
} catch (o) {
throw i = !1, this._$EM(), o;
}
i && this._$AE(s);
}
willUpdate(i) {
}
_$AE(i) {
var s;
(s = this._$EO) == null || s.forEach((r) => {
var o;
return (o = r.hostUpdated) == null ? void 0 : o.call(r);
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(i)), this.updated(i);
}
_$EM() {
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
}
get updateComplete() {
return this.getUpdateComplete();
}
getUpdateComplete() {
return this._$ES;
}
shouldUpdate(i) {
return !0;
}
update(i) {
this._$Eq && (this._$Eq = this._$Eq.forEach((s) => this._$ET(s, this[s]))), this._$EM();
}
updated(i) {
}
firstUpdated(i) {
}
};
Ti.elementStyles = [], Ti.shadowRootOptions = { mode: "open" }, Ti[gn("elementProperties")] = /* @__PURE__ */ new Map(), Ti[gn("finalized")] = /* @__PURE__ */ new Map(), Ks == null || Ks({ ReactiveElement: Ti }), (Fe.reactiveElementVersions ?? (Fe.reactiveElementVersions = [])).push("2.1.0");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const vn = globalThis, fs = vn.trustedTypes, va = fs ? fs.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Va = "$lit$", qe = `lit$${Math.random().toFixed(9).slice(2)}$`, Ja = "?" + qe, Yh = `<${Ja}>`, ci = document, Pn = () => ci.createComment(""), Sn = (e) => e === null || typeof e != "object" && typeof e != "function", cr = Array.isArray, tl = (e) => cr(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", Vs = `[
\f\r]`, fn = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ya = /-->/g, Ma = />/g, ai = RegExp(`>|${Vs}(?:([^\\s"'>=/]+)(${Vs}*=${Vs}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), wa = /'/g, xa = /"/g, Xa = /^(?:script|style|textarea|title)$/i, el = (e) => (i, ...s) => ({ _$litType$: e, strings: i, values: s }), il = el(1), Di = Symbol.for("lit-noChange"), Zt = Symbol.for("lit-nothing"), ba = /* @__PURE__ */ new WeakMap(), hi = ci.createTreeWalker(ci, 129);
function Qa(e, i) {
if (!cr(e) || !e.hasOwnProperty("raw"))
throw Error("invalid template strings array");
return va !== void 0 ? va.createHTML(i) : i;
}
const nl = (e, i) => {
const s = e.length - 1, r = [];
let o, h = i === 2 ? "<svg>" : i === 3 ? "<math>" : "", l = fn;
for (let u = 0; u < s; u++) {
const f = e[u];
let _, v, m = -1, g = 0;
for (; g < f.length && (l.lastIndex = g, v = l.exec(f), v !== null); )
g = l.lastIndex, l === fn ? v[1] === "!--" ? l = ya : v[1] !== void 0 ? l = Ma : v[2] !== void 0 ? (Xa.test(v[2]) && (o = RegExp("</" + v[2], "g")), l = ai) : v[3] !== void 0 && (l = ai) : l === ai ? v[0] === ">" ? (l = o ?? fn, m = -1) : v[1] === void 0 ? m = -2 : (m = l.lastIndex - v[2].length, _ = v[1], l = v[3] === void 0 ? ai : v[3] === '"' ? xa : wa) : l === xa || l === wa ? l = ai : l === ya || l === Ma ? l = fn : (l = ai, o = void 0);
const M = l === ai && e[u + 1].startsWith("/>") ? " " : "";
h += l === fn ? f + Yh : m >= 0 ? (r.push(_), f.slice(0, m) + Va + f.slice(m) + qe + M) : f + qe + (m === -2 ? u : M);
}
return [Qa(e, h + (e[s] || "<?>") + (i === 2 ? "</svg>" : i === 3 ? "</math>" : "")), r];
};
class An {
constructor({ strings: i, _$litType$: s }, r) {
let o;
this.parts = [];
let h = 0, l = 0;
const u = i.length - 1, f = this.parts, [_, v] = nl(i, s);
if (this.el = An.createElement(_, r), hi.currentNode = this.el.content, s === 2 || s === 3) {
const m = this.el.content.firstChild;
m.replaceWith(...m.childNodes);
}
for (; (o = hi.nextNode()) !== null && f.length < u; ) {
if (o.nodeType === 1) {
if (o.hasAttributes())
for (const m of o.getAttributeNames())
if (m.endsWith(Va)) {
const g = v[l++], M = o.getAttribute(m).split(qe), E = /([.?@])?(.*)/.exec(g);
f.push({ type: 1, index: h, name: E[2], strings: M, ctor: E[1] === "." ? rl : E[1] === "?" ? al : E[1] === "@" ? ol : Ms }), o.removeAttribute(m);
} else
m.startsWith(qe) && (f.push({ type: 6, index: h }), o.removeAttribute(m));
if (Xa.test(o.tagName)) {
const m = o.textContent.split(qe), g = m.length - 1;
if (g > 0) {
o.textContent = fs ? fs.emptyScript : "";
for (let M = 0; M < g; M++)
o.append(m[M], Pn()), hi.nextNode(), f.push({ type: 2, index: ++h });
o.append(m[g], Pn());
}
}
} else if (o.nodeType === 8)
if (o.data === Ja)
f.push({ type: 2, index: h });
else {
let m = -1;
for (; (m = o.data.indexOf(qe, m + 1)) !== -1; )
f.push({ type: 7, index: h }), m += qe.length - 1;
}
h++;
}
}
static createElement(i, s) {
const r = ci.createElement("template");
return r.innerHTML = i, r;
}
}
function Bi(e, i, s = e, r) {
var l, u;
if (i === Di)
return i;
let o = r !== void 0 ? (l = s._$Co) == null ? void 0 : l[r] : s._$Cl;
const h = Sn(i) ? void 0 : i._$litDirective$;
return (o == null ? void 0 : o.constructor) !== h && ((u = o == null ? void 0 : o._$AO) == null || u.call(o, !1), h === void 0 ? o = void 0 : (o = new h(e), o._$AT(e, s, r)), r !== void 0 ? (s._$Co ?? (s._$Co = []))[r] = o : s._$Cl = o), o !== void 0 && (i = Bi(e, o._$AS(e, i.values), o, r)), i;
}
let sl = class {
constructor(i, s) {
this._$AV = [], this._$AN = void 0, this._$AD = i, this._$AM = s;
}
get parentNode() {
return this._$AM.parentNode;
}
get _$AU() {
return this._$AM._$AU;
}
u(i) {
const { el: { content: s }, parts: r } = this._$AD, o = ((i == null ? void 0 : i.creationScope) ?? ci).importNode(s, !0);
hi.currentNode = o;
let h = hi.nextNode(), l = 0, u = 0, f = r[0];
for (; f !== void 0; ) {
if (l === f.index) {
let _;
f.type === 2 ? _ = new Gn(h, h.nextSibling, this, i) : f.type === 1 ? _ = new f.ctor(h, f.name, f.strings, this, i) : f.type === 6 && (_ = new hl(h, this, i)), this._$AV.push(_), f = r[++u];
}
l !== (f == null ? void 0 : f.index) && (h = hi.nextNode(), l++);
}
return hi.currentNode = ci, o;
}
p(i) {
let s = 0;
for (const r of this._$AV)
r !== void 0 && (r.strings !== void 0 ? (r._$AI(i, r, s), s += r.strings.length - 2) : r._$AI(i[s])), s++;
}
};
class Gn {
get _$AU() {
var i;
return ((i = this._$AM) == null ? void 0 : i._$AU) ?? this._$Cv;
}
constructor(i, s, r, o) {
this.type = 2, this._$AH = Zt, this._$AN = void 0, this._$AA = i, this._$AB = s, this._$AM = r, this.options = o, this._$Cv = (o == null ? void 0 : o.isConnected) ?? !0;
}
get parentNode() {
let i = this._$AA.parentNode;
const s = this._$AM;
return s !== void 0 && (i == null ? void 0 : i.nodeType) === 11 && (i = s.parentNode), i;
}
get startNode() {
return this._$AA;
}
get endNode() {
return this._$AB;
}
_$AI(i, s = this) {
i = Bi(this, i, s), Sn(i) ? i === Zt || i == null || i === "" ? (this._$AH !== Zt && this._$AR(), this._$AH = Zt) : i !== this._$AH && i !== Di && this._(i) : i._$litType$ !== void 0 ? this.$(i) : i.nodeType !== void 0 ? this.T(i) : tl(i) ? this.k(i) : this._(i);
}
O(i) {
return this._$AA.parentNode.insertBefore(i, this._$AB);
}
T(i) {
this._$AH !== i && (this._$AR(), this._$AH = this.O(i));
}
_(i) {
this._$AH !== Zt && Sn(this._$AH) ? this._$AA.nextSibling.data = i : this.T(ci.createTextNode(i)), this._$AH = i;
}
$(i) {
var h;
const { values: s, _$litType$: r } = i, o = typeof r == "number" ? this._$AC(i) : (r.el === void 0 && (r.el = An.createElement(Qa(r.h, r.h[0]), this.options)), r);
if (((h = this._$AH) == null ? void 0 : h._$AD) === o)
this._$AH.p(s);
else {
const l = new sl(o, this), u = l.u(this.options);
l.p(s), this.T(u), this._$AH = l;
}
}
_$AC(i) {
let s = ba.get(i.strings);
return s === void 0 && ba.set(i.strings, s = new An(i)), s;
}
k(i) {
cr(this._$AH) || (this._$AH = [], this._$AR());
const s = this._$AH;
let r, o = 0;
for (const h of i)
o === s.length ? s.push(r = new Gn(this.O(Pn()), this.O(Pn()), this, this.options)) : r = s[o], r._$AI(h), o++;
o < s.length && (this._$AR(r && r._$AB.nextSibling, o), s.length = o);
}
_$AR(i = this._$AA.nextSibling, s) {
var r;
for ((r = this._$AP) == null ? void 0 : r.call(this, !1, !0, s); i && i !== this._$AB; ) {
const o = i.nextSibling;
i.remove(), i = o;
}
}
setConnected(i) {
var s;
this._$AM === void 0 && (this._$Cv = i, (s = this._$AP) == null || s.call(this, i));
}
}
class Ms {
get tagName() {
return this.element.tagName;
}
get _$AU() {
return this._$AM._$AU;
}
constructor(i, s, r, o, h) {
this.type = 1, this._$AH = Zt, this._$AN = void 0, this.element = i, this.name = s, this._$AM = o, this.options = h, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = Zt;
}
_$AI(i, s = this, r, o) {
const h = this.strings;
let l = !1;
if (h === void 0)
i = Bi(this, i, s, 0), l = !Sn(i) || i !== this._$AH && i !== Di, l && (this._$AH = i);
else {
const u = i;
let f, _;
for (i = h[0], f = 0; f < h.length - 1; f++)
_ = Bi(this, u[r + f], s, f), _ === Di && (_ = this._$AH[f]), l || (l = !Sn(_) || _ !== this._$AH[f]), _ === Zt ? i = Zt : i !== Zt && (i += (_ ?? "") + h[f + 1]), this._$AH[f] = _;
}
l && !o && this.j(i);
}
j(i) {
i === Zt ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, i ?? "");
}
}
class rl extends Ms {
constructor() {
super(...arguments), this.type = 3;
}
j(i) {
this.element[this.name] = i === Zt ? void 0 : i;
}
}
let al = class extends Ms {
constructor() {
super(...arguments), this.type = 4;
}
j(i) {
this.element.toggleAttribute(this.name, !!i && i !== Zt);
}
}, ol = class extends Ms {
constructor(i, s, r, o, h) {
super(i, s, r, o, h), this.type = 5;
}
_$AI(i, s = this) {
if ((i = Bi(this, i, s, 0) ?? Zt) === Di)
return;
const r = this._$AH, o = i === Zt && r !== Zt || i.capture !== r.capture || i.once !== r.once || i.passive !== r.passive, h = i !== Zt && (r === Zt || o);
o && this.element.removeEventListener(this.name, this, r), h && this.element.addEventListener(this.name, this, i), this._$AH = i;
}
handleEvent(i) {
var s;
typeof this._$AH == "function" ? this._$AH.call(((s = this.options) == null ? void 0 : s.host) ?? this.element, i) : this._$AH.handleEvent(i);
}
};
class hl {
constructor(i, s, r) {
this.element = i, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = r;
}
get _$AU() {
return this._$AM._$AU;
}
_$AI(i) {
Bi(this, i);
}
}
const Js = vn.litHtmlPolyfillSupport;
Js == null || Js(An, Gn), (vn.litHtmlVersions ?? (vn.litHtmlVersions = [])).push("3.3.0");
const ll = (e, i, s) => {
const r = (s == null ? void 0 : s.renderBefore) ?? i;
let o = r._$litPart$;
if (o === void 0) {
const h = (s == null ? void 0 : s.renderBefore) ?? null;
r._$litPart$ = o = new Gn(i.insertBefore(Pn(), h), h, void 0, s ?? {});
}
return o._$AI(e), o;
};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const li = globalThis;
class yn extends Ti {
constructor() {
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
}
createRenderRoot() {
var s;
const i = super.createRenderRoot();
return (s = this.renderOptions).renderBefore ?? (s.renderBefore = i.firstChild), i;
}
update(i) {
const s = this.render();
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(i), this._$Do = ll(s, this.renderRoot, this.renderOptions);
}
connectedCallback() {
var i;
super.connectedCallback(), (i = this._$Do) == null || i.setConnected(!0);
}
disconnectedCallback() {
var i;
super.disconnectedCallback(), (i = this._$Do) == null || i.setConnected(!1);
}
render() {
return Di;
}
}
var ja;
yn._$litElement$ = !0, yn.finalized = !0, (ja = li.litElementHydrateSupport) == null || ja.call(li, { LitElement: yn });
const Xs = li.litElementPolyfillSupport;
Xs == null || Xs({ LitElement: yn });
(li.litElementVersions ?? (li.litElementVersions = [])).push("4.2.0");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const cl = (e) => (i, s) => {
s !== void 0 ? s.addInitializer(() => {
customElements.define(e, i);
}) : customElements.define(e, i);
};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const ul = { attribute: !0, type: String, converter: us, reflect: !1, hasChanged: lr }, fl = (e = ul, i, s) => {
const { kind: r, metadata: o } = s;
let h = globalThis.litPropertyMetadata.get(o);
if (h === void 0 && globalThis.litPropertyMetadata.set(o, h = /* @__PURE__ */ new Map()), r === "setter" && ((e = Object.create(e)).wrapped = !0), h.set(s.name, e), r === "accessor") {
const { name: l } = s;
return { set(u) {
const f = i.get.call(this);
i.set.call(this, u), this.requestUpdate(l, f, e);
}, init(u) {
return u !== void 0 && this.C(l, void 0, e, u), u;
} };
}
if (r === "setter") {
const { name: l } = s;
return function(u) {
const f = this[l];
i.call(this, u), this.requestUpdate(l, f, e);
};
}
throw Error("Unsupported decorator location: " + r);
};
function Zi(e) {
return (i, s) => typeof s == "object" ? fl(e, i, s) : ((r, o, h) => {
const l = o.hasOwnProperty(h);
return o.constructor.createProperty(h, r), l ? Object.getOwnPropertyDescriptor(o, h) : void 0;
})(e, i, s);
}
var dl = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function _l(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var ir = { exports: {} };
/* @preserve
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/
(function(e, i) {
(function(s, r) {
r(i);
})(dl, function(s) {
var r = "1.9.4";
function o(t) {
var n, a, c, d;
for (a = 1, c = arguments.length; a < c; a++) {
d = arguments[a];
for (n in d)
t[n] = d[n];
}
return t;
}
var h = Object.create || function() {
function t() {
}
return function(n) {
return t.prototype = n, new t();
};
}();
function l(t, n) {
var a = Array.prototype.slice;
if (t.bind)
return t.bind.apply(t, a.call(arguments, 1));
var c = a.call(arguments, 2);
return function() {
return t.apply(n, c.length ? c.concat(a.call(arguments)) : arguments);
};
}
var u = 0;
function f(t) {
return "_leaflet_id" in t || (t._leaflet_id = ++u), t._leaflet_id;
}
function _(t, n, a) {
var c, d, p, y;
return y = function() {
c = !1, d && (p.apply(a, d), d = !1);
}, p = function() {
c ? d = arguments : (t.apply(a, arguments), setTimeout(y, n), c = !0);
}, p;
}
function v(t, n, a) {
var c = n[1], d = n[0], p = c - d;
return t === c && a ? t : ((t - d) % p + p) % p + d;
}
function m() {
return !1;
}
function g(t, n) {
if (n === !1)
return t;
var a = Math.pow(10, n === void 0 ? 6 : n);
return Math.round(t * a) / a;
}
function M(t) {
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
}
function E(t) {
return M(t).split(/\s+/);
}
function x(t, n) {
Object.prototype.hasOwnProperty.call(t, "options") || (t.options = t.options ? h(t.options) : {});
for (var a in n)
t.options[a] = n[a];
return t.options;
}
function C(t, n, a) {
var c = [];
for (var d in t)
c.push(encodeURIComponent(a ? d.toUpperCase() : d) + "=" + encodeURIComponent(t[d]));
return (!n || n.indexOf("?") === -1 ? "?" : "&") + c.join("&");
}
var D = /\{ *([\w_ -]+) *\}/g;
function U(t, n) {
return t.replace(D, function(a, c) {
var d = n[c];
if (d === void 0)
throw new Error("No value provided for variable " + a);
return typeof d == "function" && (d = d(n)), d;
});
}
var $ = Array.isArray || function(t) {
return Object.prototype.toString.call(t) === "[object Array]";
};
function lt(t, n) {
for (var a = 0; a < t.length; a++)
if (t[a] === n)
return a;
return -1;
}
var mt = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
function Mt(t) {
return window["webkit" + t] || window["moz" + t] || window["ms" + t];
}
var Rt = 0;
function zt(t) {
var n = +/* @__PURE__ */ new Date(), a = Math.max(0, 16 - (n - Rt));
return Rt = n + a, window.setTimeout(t, a);
}
var Wt = window.requestAnimationFrame || Mt("RequestAnimationFrame") || zt, Kt = window.cancelAnimationFrame || Mt("CancelAnimationFrame") || Mt("CancelRequestAnimationFrame") || function(t) {
window.clearTimeout(t);
};
function gt(t, n, a) {
if (a && Wt === zt)
t.call(n);
else
return Wt.call(window, l(t, n));
}
function bt(t) {
t && Kt.call(window, t);
}
var re = {
__proto__: null,
extend: o,
create: h,
bind: l,
get lastId() {
return u;
},
stamp: f,
throttle: _,
wrapNum: v,
falseFn: m,
formatNum: g,
trim: M,
splitWords: E,
setOptions: x,
getParamString: C,
template: U,
isArray: $,
indexOf: lt,
emptyImageUrl: mt,
requestFn: Wt,
cancelFn: Kt,
requestAnimFrame: gt,
cancelAnimFrame: bt
};
function Dt() {
}
Dt.extend = function(t) {
var n = function() {
x(this), this.initialize && this.initialize.apply(this, arguments), this.callInitHooks();
}, a = n.__super__ = this.prototype, c = h(a);
c.constructor = n, n.prototype = c;
for (var d in this)
Object.prototype.hasOwnProperty.call(this, d) && d !== "prototype" && d !== "__super__" && (n[d] = this[d]);
return t.statics && o(n, t.statics), t.includes && (Me(t.includes), o.apply(null, [c].concat(t.includes))), o(c, t), delete c.statics, delete c.includes, c.options && (c.options = a.options ? h(a.options) : {}, o(c.options, t.options)), c._initHooks = [], c.callInitHooks = function() {
if (!this._initHooksCalled) {
a.callInitHooks && a.callInitHooks.call(this), this._initHooksCalled = !0;
for (var p = 0, y = c._initHooks.length; p < y; p++)
c._initHooks[p].call(this);
}
}, n;
}, Dt.include = function(t) {
var n = this.prototype.options;
return o(this.prototype, t), t.options && (this.prototype.options = n, this.mergeOptions(t.options)), this;
}, Dt.mergeOptions = function(t) {
return o(this.prototype.options, t), this;
}, Dt.addInitHook = function(t) {
var n = Array.prototype.slice.call(arguments, 1), a = typeof t == "function" ? t : function() {
this[t].apply(this, n);
};
return this.prototype._initHooks = this.prototype._initHooks || [], this.prototype._initHooks.push(a), this;
};
function Me(t) {
if (!(typeof L > "u" || !L || !L.Mixin)) {
t = $(t) ? t : [t];
for (var n = 0; n < t.length; n++)
t[n] === L.Mixin.Events && console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.", new Error().stack);
}
}
var Gt = {
/* @method on(type: String, fn: Function, context?: Object): this
* Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).
*
* @alternative
* @method on(eventMap: Object): this
* Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`
*/
on: function(t, n, a) {
if (typeof t == "object")
for (var c in t)
this._on(c, t[c], n);
else {
t = E(t);
for (var d = 0, p = t.length; d < p; d++)
this._on(t[d], n, a);
}
return this;
},
/* @method off(type: String, fn?: Function, context?: Object): this
* Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener.
*
* @alternative
* @method off(eventMap: Object): this
* Removes a set of type/listener pairs.
*
* @alternative
* @method off: this
* Removes all listeners to all events on the object. This includes implicitly attached events.
*/
off: function(t, n, a) {
if (!arguments.length)
delete this._events;
else if (typeof t == "object")
for (var c in t)
this._off(c, t[c], n);
else {
t = E(t);
for (var d = arguments.length === 1, p = 0, y = t.length; p < y; p++)
d ? this._off(t[p]) : this._off(t[p], n, a);
}
return this;
},
// attach listener (without syntactic sugar now)
_on: function(t, n, a, c) {
if (typeof n != "function") {
console.warn("wrong listener type: " + typeof n);
return;
}
if (this._listens(t, n, a) === !1) {
a === this && (a = void 0);
var d = { fn: n, ctx: a };
c && (d.once = !0), this._events = this._events || {}, this._events[t] = this._events[t] || [], this._events[t].push(d);
}
},
_off: function(t, n, a) {
var c, d, p;
if (this._events && (c = this._events[t], !!c)) {
if (arguments.length === 1) {
if (this._firingCount)
for (d = 0, p = c.length; d < p; d++)
c[d].fn = m;
delete this._events[t];
return;
}
if (typeof n != "function") {
console.warn("wrong listener type: " + typeof n);
return;
}
var y = this._listens(t, n, a);
if (y !== !1) {
var b = c[y];
this._firingCount && (b.fn = m, this._events[t] = c = c.slice()), c.splice(y, 1);
}
}
},
// @method fire(type: String, data?: Object, propagate?: Boolean): this
// Fires an event of the specified type. You can optionally provide a data
// object — the first argument of the listener function will contain its
// properties. The event can optionally be propagated to event parents.
fire: function(t, n, a) {
if (!this.listens(t, a))
return this;
var c = o({}, n, {
type: t,
target: this,
sourceTarget: n && n.sourceTarget || this
});
if (this._events) {
var d = this._events[t];
if (d) {
this._firingCount = this._firingCount + 1 || 1;
for (var p = 0, y = d.length; p < y; p++) {
var b = d[p], S = b.fn;
b.once && this.off(t, S, b.ctx), S.call(b.ctx || this, c);
}
this._firingCount--;
}
}
return a && this._propagateEvent(c), this;
},
// @method listens(type: String, propagate?: Boolean): Boolean
// @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean
// Returns `true` if a particular event type has any listeners attached to it.
// The verification can optionally be propagated, it will return `true` if parents have the listener attached to it.
listens: function(t, n, a, c) {
typeof t != "string" && console.warn('"string" type argument expected');
var d = n;
typeof n != "function" && (c = !!n, d = void 0, a = void 0);
var p = this._events && this._events[t];
if (p && p.length && this._listens(t, d, a) !== !1)
return !0;
if (c) {
for (var y in this._eventParents)
if (this._eventParents[y].listens(t, n, a, c))
return !0;
}
return !1;
},
// returns the index (number) or false
_listens: function(t, n, a) {
if (!this._events)
return !1;
var c = this._events[t] || [];
if (!n)
return !!c.length;
a === this && (a = void 0);
for (var d = 0, p = c.length; d < p; d++)
if (c[d].fn === n && c[d].ctx === a)
return d;
return !1;
},
// @method once(…): this
// Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.
once: function(t, n, a) {
if (typeof t == "object")
for (var c in t)
this._on(c, t[c], n, !0);
else {
t = E(t);
for (var d = 0, p = t.length; d < p; d++)
this._on(t[d], n, a, !0);
}
return this;
},
// @method addEventParent(obj: Evented): this
// Adds an event parent - an `Evented` that will receive propagated events
addEventParent: function(t) {
return this._eventParents = this._eventParents || {}, this._eventParents[f(t)] = t, this;
},
// @method removeEventParent(obj: Evented): this
// Removes an event parent, so it will stop receiving propagated events
removeEventParent: function(t) {
return this._eventParents && delete this._eventParents[f(t)], this;
},
_propagateEvent: function(t) {
for (var n in this._eventParents)
this._eventParents[n].fire(t.type, o({
layer: t.target,
propagatedFrom: t.target
}, t), !0);
}
};
Gt.addEventListener = Gt.on, Gt.removeEventListener = Gt.clearAllEventListeners = Gt.off, Gt.addOneTimeEventListener = Gt.once, Gt.fireEvent = Gt.fire, Gt.hasEventListeners = Gt.listens;
var ae = Dt.extend(Gt);
function P(t, n, a) {
this.x = a ? Math.round(t) : t, this.y = a ? Math.round(n) : n;
}
var k = Math.trunc || function(t) {
return t > 0 ? Math.floor(t) : Math.ceil(t);
};
P.prototype = {
// @method clone(): Point
// Returns a copy of the current point.
clone: function() {
return new P(this.x, this.y);
},
// @method add(otherPoint: Point): Point
// Returns the result of addition of the current and the given points.
add: function(t) {
return this.clone()._add(T(t));
},
_add: function(t) {
return this.x += t.x, this.y += t.y, this;
},
// @method subtract(otherPoint: Point): Point
// Returns the result of subtraction of the given point from the current.
subtract: function(t) {
return this.clone()._subtract(T(t));
},
_subtract: function(t) {
return this.x -= t.x, this.y -= t.y, this;
},
// @method divideBy(num: Number): Point
// Returns the result of division of the current point by the given number.
divideBy: function(t) {
return this.clone()._divideBy(t);
},
_divideBy: function(t) {
return this.x /= t, this.y /= t, this;
},
// @method multiplyBy(num: Number): Point
// Returns the result of multiplication of the current point by the given number.
multiplyBy: function(t) {
return this.clone()._multiplyBy(t);
},
_multiplyBy: function(t) {
return this.x *= t, this.y *= t, this;
},
// @method scaleBy(scale: Point): Point
// Multiply each coordinate of the current point by each coordinate of
// `scale`. In linear algebra terms, multiply the point by the
// [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation)
// defined by `scale`.
scaleBy: function(t) {
return new P(this.x * t.x, this.y * t.y);
},
// @method unscaleBy(scale: Point): Point
// Inverse of `scaleBy`. Divide each coordinate of the current point by
// each coordinate of `scale`.
unscaleBy: function(t) {
return new P(this.x / t.x, this.y / t.y);
},
// @method round(): Point
// Returns a copy of the current point with rounded coordinates.
round: function() {
return this.clone()._round();
},
_round: function() {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this;
},
// @method floor(): Point
// Returns a copy of the current point with floored coordinates (rounded down).
floor: function() {
return this.clone()._floor();
},
_floor: function() {
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this;
},
// @method ceil(): Point
// Returns a copy of the current point with ceiled coordinates (rounded up).
ceil: function() {
return this.clone()._ceil();
},
_ceil: function() {
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this;
},
// @method trunc(): Point
// Returns a copy of the current point with truncated coordinates (rounded towards zero).
trunc: function() {
return this.clone()._trunc();
},
_trunc: function() {
return this.x = k(this.x), this.y = k(this.y), this;
},
// @method distanceTo(otherPoint: Point): Number
// Returns the cartesian distance between the current and the given points.
distanceTo: function(t) {
t = T(t);
var n = t.x - this.x, a = t.y - this.y;
return Math.sqrt(n * n + a * a);
},
// @method equals(otherPoint: Point): Boolean
// Returns `true` if the given point has the same coordinates.
equals: function(t) {
return t = T(t), t.x === this.x && t.y === this.y;
},
// @method contains(otherPoint: Point): Boolean
// Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
contains: function(t) {
return t = T(t), Math.abs(t.x) <= Math.abs(this.x) && Math.abs(t.y) <= Math.abs(this.y);
},
// @method toString(): String
// Returns a string representation of the point for debugging purposes.
toString: function() {
return "Point(" + g(this.x) + ", " + g(this.y) + ")";
}
};
function T(t, n, a) {
return t instanceof P ? t : $(t) ? new P(t[0], t[1]) : t == null ? t : typeof t == "object" && "x" in t && "y" in t ? new P(t.x, t.y) : new P(t, n, a);
}
function G(t, n) {
if (t)
for (var a = n ? [t, n] : t, c = 0, d = a.length; c < d; c++)
this.extend(a[c]);
}
G.prototype = {
// @method extend(point: Point): this
// Extends the bounds to contain the given point.
// @alternative
// @method extend(otherBounds: Bounds): this
// Extend the bounds to contain the given bounds
extend: function(t) {
var n, a;
if (!t)
return this;
if (t instanceof P || typeof t[0] == "number" || "x" in t)
n = a = T(t);
else if (t = A(t), n = t.min, a = t.max, !n || !a)
return this;
return !this.min && !this.max ? (this.min = n.clone(), this.max = a.clone()) : (this.min.x = Math.min(n.x, this.min.x), this.max.x = Math.max(a.x, this.max.x), this.min.y = Math.min(n.y, this.min.y), this.max.y = Math.max(a.y, this.max.y)), this;
},
// @method getCenter(round?: Boolean): Point
// Returns the center point of the bounds.
getCenter: function(t) {
return T(
(this.min.x + this.max.x) / 2,
(this.min.y + this.max.y) / 2,
t
);
},
// @method getBottomLeft(): Point
// Returns the bottom-left point of the bounds.
getBottomLeft: function() {
return T(this.min.x, this.max.y);
},
// @method getTopRight(): Point
// Returns the top-right point of the bounds.
getTopRight: function() {
return T(this.max.x, this.min.y);
},
// @method getTopLeft(): Point
// Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)).
getTopLeft: function() {
return this.min;
},
// @method getBottomRight(): Point
// Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)).
getBottomRight: function() {
return this.max;
},
// @method getSize(): Point
// Returns the size of the given bounds
getSize: function() {
return this.max.subtract(this.min);
},
// @method contains(otherBounds: Bounds): Boolean
// Returns `true` if the rectangle contains the given one.
// @alternative
// @method contains(point: Point): Boolean
// Returns `true` if the rectangle contains the given point.
contains: function(t) {
var n, a;
return typeof t[0] == "number" || t instanceof P ? t = T(t) : t = A(t), t instanceof G ? (n = t.min, a = t.max) : n = a = t, n.x >= this.min.x && a.x <= this.max.x && n.y >= this.min.y && a.y <= this.max.y;
},
// @method intersects(otherBounds: Bounds): Boolean
// Returns `true` if the rectangle intersects the given bounds. Two bounds
// intersect if they have at least one point in common.
intersects: function(t) {
t = A(t);
var n = this.min, a = this.max, c = t.min, d = t.max, p = d.x >= n.x && c.x <= a.x, y = d.y >= n.y && c.y <= a.y;
return p && y;
},
// @method overlaps(otherBounds: Bounds): Boolean
// Returns `true` if the rectangle overlaps the given bounds. Two bounds
// overlap if their intersection is an area.
overlaps: function(t) {
t = A(t);
var n = this.min, a = this.max, c = t.min, d = t.max, p = d.x > n.x && c.x < a.x, y = d.y > n.y && c.y < a.y;
return p && y;
},
// @method isValid(): Boolean
// Returns `true` if the bounds are properly initialized.
isValid: function() {
return !!(this.min && this.max);
},
// @method pad(bufferRatio: Number): Bounds
// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
// For example, a ratio of 0.5 extends the bounds by 50% in each direction.
// Negative values will retract the bounds.
pad: function(t) {
var n = this.min, a = this.max, c = Math.abs(n.x - a.x) * t, d = Math.abs(n.y - a.y) * t;
return A(
T(n.x - c, n.y - d),
T(a.x + c, a.y + d)
);
},
// @method equals(otherBounds: Bounds): Boolean
// Returns `true` if the rectangle is equivalent to the given bounds.
equals: function(t) {
return t ? (t = A(t), this.min.equals(t.getTopLeft()) && this.max.equals(t.getBottomRight())) : !1;
}
};
function A(t, n) {
return !t || t instanceof G ? t : new G(t, n);
}
function N(t, n) {
if (t)
for (var a = n ? [t, n] : t, c = 0, d = a.length; c < d; c++)
this.extend(a[c]);
}
N.prototype = {
// @method extend(latlng: LatLng): this
// Extend the bounds to contain the given point
// @alternative
// @method extend(otherBounds: LatLngBounds): this
// Extend the bounds to contain the given bounds
extend: function(t) {
var n = this._southWest, a = this._northEast, c, d;
if (t instanceof F)
c = t, d = t;
else if (t instanceof N) {
if (c = t._southWest, d = t._northEast, !c || !d)
return this;
} else
return t ? this.extend(H(t) || R(t)) : this;
return !n && !a ? (this._southWest = new F(c.lat, c.lng), this._northEast = new F(d.lat, d.lng)) : (n.lat = Math.min(c.lat, n.lat), n.lng = Math.min(c.lng, n.lng), a.lat = Math.max(d.lat, a.lat), a.lng = Math.max(d.lng, a.lng)), this;
},
// @method pad(bufferRatio: Number): LatLngBounds
// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
// For example, a ratio of 0.5 extends the bounds by 50% in each direction.
// Negative values will retract the bounds.
pad: function(t) {
var n = this._southWest, a = this._northEast, c = Math.abs(n.lat - a.lat) * t, d = Math.abs(n.lng - a.lng) * t;
return new N(
new F(n.lat - c, n.lng - d),
new F(a.lat + c, a.lng + d)
);
},
// @method getCenter(): LatLng
// Returns the center point of the bounds.
getCenter: function() {
return new F(
(this._southWest.lat + this._northEast.lat) / 2,
(this._southWest.lng + this._northEast.lng) / 2
);
},
// @method getSouthWest(): LatLng
// Returns the south-west point of the bounds.
getSouthWest: function() {
return this._southWest;
},
// @method getNorthEast(): LatLng
// Returns the north-east point of the bounds.
getNorthEast: function() {
return this._northEast;
},
// @method getNorthWest(): LatLng
// Returns the north-west point of the bounds.
getNorthWest: function() {
return new F(this.getNorth(), this.getWest());
},
// @method getSouthEast(): LatLng
// Returns the south-east point of the bounds.
getSouthEast: function() {
return new F(this.getSouth(), this.getEast());
},
// @method getWest(): Number
// Returns the west longitude of the bounds
getWest: function() {
return this._southWest.lng;
},
// @method getSouth(): Number
// Returns the south latitude of the bounds
getSouth: function() {
return this._southWest.lat;
},
// @method getEast(): Number
// Returns the east longitude of the bounds
getEast: function() {
return this._northEast.lng;
},
// @method getNorth(): Number
// Returns the north latitude of the bounds
getNorth: function() {
return this._northEast.lat;
},
// @method contains(otherBounds: LatLngBounds): Boolean
// Returns `true` if the rectangle contains the given one.
// @alternative
// @method contains (latlng: LatLng): Boolean
// Returns `true` if the rectangle contains the given point.
contains: function(t) {
typeof t[0] == "number" || t instanceof F || "lat" in t ? t = H(t) : t = R(t);
var n = this._southWest, a = this._northEast, c, d;
return t instanceof N ? (c = t.getSouthWest(), d = t.getNorthEast()) : c = d = t, c.lat >= n.lat && d.lat <= a.lat && c.lng >= n.lng && d.lng <= a.lng;
},
// @method intersects(otherBounds: LatLngBounds): Boolean
// Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
intersects: function(t) {
t = R(t);
var n = this._southWest, a = this._northEast, c = t.getSouthWest(), d = t.getNorthEast(), p = d.lat >= n.lat && c.lat <= a.lat, y = d.lng >= n.lng && c.lng <= a.lng;
return p && y;
},
// @method overlaps(otherBounds: LatLngBounds): Boolean
// Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
overlaps: function(t) {
t = R(t);
var n = this._southWest, a = this._northEast, c = t.getSouthWest(), d = t.getNorthEast(), p = d.lat > n.lat && c.lat < a.lat, y = d.lng > n.lng && c.lng < a.lng;
return p && y;
},
// @method toBBoxString(): String
// Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
toBBoxString: function() {
return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(",");
},
// @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean
// Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number.
equals: function(t, n) {
return t ? (t = R(t), this._southWest.equals(t.getSouthWest(), n) && this._northEast.equals(t.getNorthEast(), n)) : !1;
},
// @method isValid(): Boolean
// Returns `true` if the bounds are properly initialized.
isValid: function() {
return !!(this._southWest && this._northEast);
}
};
function R(t, n) {
return t instanceof N ? t : new N(t, n);
}
function F(t, n, a) {
if (isNaN(t) || isNaN(n))
throw new Error("Invalid LatLng object: (" + t + ", " + n + ")");
this.lat = +t, this.lng = +n, a !== void 0 && (this.alt = +a);
}
F.prototype = {
// @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean
// Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number.
equals: function(t, n) {
if (!t)
return !1;
t = H(t);
var a = Math.max(
Math.abs(this.lat - t.lat),
Math.abs(this.lng - t.lng)
);
return a <= (n === void 0 ? 1e-9 : n);
},
// @method toString(): String
// Returns a string representation of the point (for debugging purposes).
toString: function(t) {
return "LatLng(" + g(this.lat, t) + ", " + g(this.lng, t) + ")";
},
// @method distanceTo(otherLatLng: LatLng): Number
// Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines).
distanceTo: function(t) {
return it.distance(this, H(t));
},
// @method wrap(): LatLng
// Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees.
wrap: function() {
return it.wrapLatLng(this);
},
// @method toBounds(sizeInMeters: Number): LatLngBounds
// Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.
toBounds: function(t) {
var n = 180 * t / 40075017, a = n / Math.cos(Math.PI / 180 * this.lat);
return R(
[this.lat - n, this.lng - a],
[this.lat + n, this.lng + a]
);
},
clone: function() {
return new F(this.lat, this.lng, this.alt);
}
};
function H(t, n, a) {
return t instanceof F ? t : $(t) && typeof t[0] != "object" ? t.length === 3 ? new F(t[0], t[1], t[2]) : t.length === 2 ? new F(t[0], t[1]) : null : t == null ? t : typeof t == "object" && "lat" in t ? new F(t.lat, "lng" in t ? t.lng : t.lon, t.alt) : n === void 0 ? null : new F(t, n, a);
}
var K = {
// @method latLngToPoint(latlng: LatLng, zoom: Number): Point
// Projects geographical coordinates into pixel coordinates for a given zoom.
latLngToPoint: function(t, n) {
var a = this.projection.project(t), c = this.scale(n);
return this.transformation._transform(a, c);
},
// @method pointToLatLng(point: Point, zoom: Number): LatLng
// The inverse of `latLngToPoint`. Projects pixel coordinates on a given
// zoom into geographical coordinates.
pointToLatLng: function(t, n) {
var a = this.scale(n), c = this.transformation.untransform(t, a);
return this.projection.unproject(c);
},
// @method project(latlng: LatLng): Point
// Projects geographical coordinates into coordinates in units accepted for
// this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
project: function(t) {
return this.projection.project(t);
},
// @method unproject(point: Point): LatLng
// Given a projected coordinate returns the corresponding LatLng.
// The inverse of `project`.
unproject: function(t) {
return this.projection.unproject(t);
},
// @method scale(zoom: Number): Number
// Returns the scale used when transforming projected coordinates into
// pixel coordinates for a particular zoom. For example, it returns
// `256 * 2^zoom` for Mercator-based CRS.
scale: function(t) {
return 256 * Math.pow(2, t);
},
// @method zoom(scale: Number): Number
// Inverse of `scale()`, returns the zoom level corresponding to a scale
// factor of `scale`.
zoom: function(t) {
return Math.log(t / 256) / Math.LN2;
},
// @method getProjectedBounds(zoom: Number): Bounds
// Returns the projection's bounds scaled and transformed for the provided `zoom`.
getProjectedBounds: function(t) {
if (this.infinite)
return null;
var n = this.projection.bounds, a = this.scale(t), c = this.transformation.transform(n.min, a), d = this.transformation.transform(n.max, a);
return new G(c, d);
},
// @method distance(latlng1: LatLng, latlng2: LatLng): Number
// Returns the distance between two geographical coordinates.
// @property code: String
// Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`)
//
// @property wrapLng: Number[]
// An array of two numbers defining whether the longitude (horizontal) coordinate
// axis wraps around a given range and how. Defaults to `[-180, 180]` in most
// geographical CRSs. If `undefined`, the longitude axis does not wrap around.
//
// @property wrapLat: Number[]
// Like `wrapLng`, but for the latitude (vertical) axis.
// wrapLng: [min, max],
// wrapLat: [min, max],
// @property infinite: Boolean
// If true, the coordinate space will be unbounded (infinite in both axes)
infinite: !1,
// @method wrapLatLng(latlng: LatLng): LatLng
// Returns a `LatLng` where lat and lng has been wrapped according to the
// CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds.
wrapLatLng: function(t) {
var n = this.wrapLng ? v(t.lng, this.wrapLng, !0) : t.lng, a = this.wrapLat ? v(t.lat, this.wrapLat, !0) : t.lat, c = t.alt;
return new F(a, n, c);
},
// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds
// Returns a `LatLngBounds` with the same size as the given one, ensuring
// that its center is within the CRS's bounds.
// Only accepts actual `L.LatLngBounds` instances, not arrays.
wrapLatLngBounds: function(t) {
var n = t.getCenter(), a = this.wrapLatLng(n), c = n.lat - a.lat, d = n.lng - a.lng;
if (c === 0 && d === 0)
return t;
var p = t.getSouthWest(), y = t.getNorthEast(), b = new F(p.lat - c, p.lng - d), S = new F(y.lat - c, y.lng - d);
return new N(b, S);
}
}, it = o({}, K, {
wrapLng: [-180, 180],
// Mean Earth Radius, as recommended for use by
// the International Union of Geodesy and Geophysics,
// see https://rosettacode.org/wiki/Haversine_formula
R: 6371e3,
// distance between two geographical points using spherical law of cosines approximation
distance: function(t, n) {
var a = Math.PI / 180, c = t.lat * a, d = n.lat * a, p = Math.sin((n.lat - t.lat) * a / 2), y = Math.sin((n.lng - t.lng) * a / 2), b = p * p + Math.cos(c) * Math.cos(d) * y * y, S = 2 * Math.atan2(Math.sqrt(b), Math.sqrt(1 - b));
return this.R * S;
}
}), j = 6378137, tt = {
R: j,
MAX_LATITUDE: 85.0511287798,
project: function(t) {
var n = Math.PI / 180, a = this.MAX_LATITUDE, c = Math.max(Math.min(a, t.lat), -a), d = Math.sin(c * n);
return new P(
this.R * t.lng * n,
this.R * Math.log((1 + d) / (1 - d)) / 2
);
},
unproject: function(t) {
var n = 180 / Math.PI;
return new F(
(2 * Math.atan(Math.exp(t.y / this.R)) - Math.PI / 2) * n,
t.x * n / this.R
);
},
bounds: function() {
var t = j * Math.PI;
return new G([-t, -t], [t, t]);
}()
};
function rt(t, n, a, c) {
if ($(t)) {
this._a = t[0], this._b = t[1], this._c = t[2], this._d = t[3];
return;
}
this._a = t, this._b = n, this._c = a, this._d = c;
}
rt.prototype = {
// @method transform(point: Point, scale?: Number): Point
// Returns a transformed point, optionally multiplied by the given scale.
// Only accepts actual `L.Point` instances, not arrays.
transform: function(t, n) {
return this._transform(t.clone(), n);
},
// destructive transform (faster)
_transform: function(t, n) {
return n = n || 1, t.x = n * (this._a * t.x + this._b), t.y = n * (this._c * t.y + this._d), t;
},
// @method untransform(point: Point, scale?: Number): Point
// Returns the reverse transformation of the given point, optionally divided
// by the given scale. Only accepts actual `L.Point` instances, not arrays.
untransform: function(t, n) {
return n = n || 1, new P(
(t.x / n - this._b) / this._a,
(t.y / n - this._d) / this._c
);
}
};
function z(t, n, a, c) {
return new rt(t, n, a, c);
}
var X = o({}, it, {
code: "EPSG:3857",
projection: tt,
transformation: function() {
var t = 0.5 / (Math.PI * tt.R);
return z(t, 0.5, -t, 0.5);
}()
}), ht = o({}, X, {
code: "EPSG:900913"
});
function dt(t) {
return document.createElementNS("http://www.w3.org/2000/svg", t);
}
function vt(t, n) {
var a = "", c, d, p, y, b, S;
for (c = 0, p = t.length; c < p; c++) {
for (b = t[c], d = 0, y = b.length; d < y; d++)
S = b[d], a += (d ? "L" : "M") + S.x + " " + S.y;
a += n ? W.svg ? "z" : "x" : "";
}
return a || "M0 0";
}
var _t = document.documentElement.style, pt = "ActiveXObject" in window, At = pt && !document.addEventListener, Lt = "msLaunchUri" in navigator && !("documentMode" in document), nt = Yt("webkit"), Q = Yt("android"), et = Yt("android 2") || Yt("android 3"), xt = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10), It = Q && Yt("Google") && xt < 537 && !("AudioNode" in window), oe = !!window.opera, pe = !Lt && Yt("chrome"), ke = Yt("gecko") && !nt && !oe && !pt, he = !pe && Yt("safari"), at = Yt("phantom"), qt = "OTransition" in _t, Bt = navigator.platform.indexOf("Win") === 0, $t = pt && "transition" in _t, Ft = "WebKitCSSMatrix" in window && "m11" in new window.WebKitCSSMatrix() && !et, Je = "MozPerspective" in _t, _i = !window.L_DISABLE_3D && ($t || Ft || Je) && !qt && !at, le = typeof orientation < "u" || Yt("mobile"), Ae = le && nt, Xe = le && Ft, Re = !window.PointerEvent && window.MSPointerEvent, ze = !!(window.PointerEvent || Re), De = "ontouchstart" in window || !!window.TouchEvent, pi = !window.L_NO_TOUCH && (De || ze), $i = le && oe, Be = le && ke, Fi = (window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI) > 1, mi = function() {
var t = !1;
try {
var n = Object.defineProperty({}, "passive", {
get: function() {
t = !0;
}
});
window.addEventListener("testPassiveEventSupport", m, n), window.removeEventListener("testPassiveEventSupport", m, n);
} catch {
}
return t;
}(), Hi = function() {
return !!document.createElement("canvas").getContext;
}(), Qe = !!(document.createElementNS && dt("svg").createSVGRect), Wi = !!Qe && function() {
var t = document.createElement("div");
return t.innerHTML = "<svg/>", (t.firstChild && t.firstChild.namespaceURI) === "http://www.w3.org/2000/svg";
}(), Un = !Qe && function() {
try {
var t = document.createElement("div");
t.innerHTML = '<v:shape adj="1"/>';
var n = t.firstChild;
return n.style.behavior = "url(#default#VML)", n && typeof n.adj == "object";
} catch {
return !1;
}
}(), ji = navigator.platform.indexOf("Mac") === 0, gi = navigator.platform.indexOf("Linux") === 0;
function Yt(t) {
return navigator.userAgent.toLowerCase().indexOf(t) >= 0;
}
var W = {
ie: pt,
ielt9: At,
edge: Lt,
webkit: nt,
android: Q,
android23: et,
androidStock: It,
opera: oe,
chrome: pe,
gecko: ke,
safari: he,
phantom: at,
opera12: qt,
win: Bt,
ie3d: $t,
webkit3d: Ft,
gecko3d: Je,
any3d: _i,
mobile: le,
mobileWebkit: Ae,
mobileWebkit3d: Xe,
msPointer: Re,
pointer: ze,
touch: pi,
touchNative: De,
mobileOpera: $i,
mobileGecko: Be,
retina: Fi,
passiveEvents: mi,
canvas: Hi,
svg: Qe,
vml: Un,
inlineSvg: Wi,
mac: ji,
linux: gi
}, Ki = W.msPointer ? "MSPointerDown" : "pointerdown", Ye = W.msPointer ? "MSPointerMove" : "pointermove", Vi = W.msPointer ? "MSPointerUp" : "pointerup", Ji = W.msPointer ? "MSPointerCancel" : "pointercancel", Le = {
touchstart: Ki,
touchmove: Ye,
touchend: Vi,
touchcancel: Ji
}, ti = {
touchstart: $o,
touchmove: Zn,
touchend: Zn,
touchcancel: Zn
}, ce = {}, vi = !1;
function Xi(t, n, a) {
return n === "touchstart" && qo(), ti[n] ? (a = ti[n].bind(this, a), t.addEventListener(Le[n], a, !1), a) : (console.warn("wrong event specified:", n), m);
}
function yi(t, n, a) {
if (!Le[n]) {
console.warn("wrong event specified:", n);
return;
}
t.removeEventListener(Le[n], a, !1);
}
function Mi(t) {
ce[t.pointerId] = t;
}
function Qi(t) {
ce[t.pointerId] && (ce[t.pointerId] = t);
}
function wi(t) {
delete ce[t.pointerId];
}
function qo() {
vi || (document.addEventListener(Ki, Mi, !0), document.addEventListener(Ye, Qi, !0), document.addEventListener(Vi, wi, !0), document.addEventListener(Ji, wi, !0), vi = !0);
}
function Zn(t, n) {
if (n.pointerType !== (n.MSPOINTER_TYPE_MOUSE || "mouse")) {
n.touches = [];
for (var a in ce)
n.touches.push(ce[a]);
n.changedTouches = [n], t(n);
}
}
function $o(t, n) {
n.MSPOINTER_TYPE_TOUCH && n.pointerType === n.MSPOINTER_TYPE_TOUCH && Ht(n), Zn(t, n);
}
function Fo(t) {
var n = {}, a, c;
for (c in t)
a = t[c], n[c] = a && a.bind ? a.bind(t) : a;
return t = n, n.type = "dblclick", n.detail = 2, n.isTrusted = !1, n._simulated = !0, n;
}
var Ho = 200;
function Wo(t, n) {
t.addEventListener("dblclick", n);
var a = 0, c;
function d(p) {
if (p.detail !== 1) {
c = p.detail;
return;
}
if (!(p.pointerType === "mouse" || p.sourceCapabilities && !p.sourceCapabilities.firesTouchEvents)) {
var y = Tr(p);
if (!(y.some(function(S) {
return S instanceof HTMLLabelElement && S.attributes.for;
}) && !y.some(function(S) {
return S instanceof HTMLInputElement || S instanceof HTMLSelectElement;
}))) {
var b = Date.now();
b - a <= Ho ? (c++, c === 2 && n(Fo(p))) : c = 1, a = b;
}
}
}
return t.addEventListener("click", d), {
dblclick: n,
simDblclick: d
};
}
function jo(t, n) {
t.removeEventListener("dblclick", n.dblclick), t.removeEventListener("click", n.simDblclick);
}
var bs = Fn(
["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]
), Yi = Fn(
["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]
), Sr = Yi === "webkitTransition" || Yi === "OTransition" ? Yi + "End" : "transitionend";
function Ar(t) {
return typeof t == "string" ? document.getElementById(t) : t;
}
function tn(t, n) {
var a = t.style[n] || t.currentStyle && t.currentStyle[n];
if ((!a || a === "auto") && document.defaultView) {
var c = document.defaultView.getComputedStyle(t, null);
a = c ? c[n] : null;
}
return a === "auto" ? null : a;
}
function ct(t, n, a) {
var c = document.createElement(t);
return c.className = n || "", a && a.appendChild(c), c;
}
function Et(t) {
var n = t.parentNode;
n && n.removeChild(t);
}
function qn(t) {
for (; t.firstChild; )
t.removeChild(t.firstChild);
}
function xi(t) {
var n = t.parentNode;
n && n.lastChild !== t && n.appendChild(t);
}
function bi(t) {
var n = t.parentNode;
n && n.firstChild !== t && n.insertBefore(t, n.firstChild);
}
function Es(t, n) {
if (t.classList !== void 0)
return t.classList.contains(n);
var a = $n(t);
return a.length > 0 && new RegExp("(^|\\s)" + n + "(\\s|$)").test(a);
}
function Y(t, n) {
if (t.classList !== void 0)
for (var a = E(n), c = 0, d = a.length; c < d; c++)
t.classList.add(a[c]);
else if (!Es(t, n)) {
var p = $n(t);
Ps(t, (p ? p + " " : "") + n);
}
}
function Ct(t, n) {
t.classList !== void 0 ? t.classList.remove(n) : Ps(t, M((" " + $n(t) + " ").replace(" " + n + " ", " ")));
}
function Ps(t, n) {
t.className.baseVal === void 0 ? t.className = n : t.className.baseVal = n;
}
function $n(t) {
return t.correspondingElement && (t = t.correspondingElement), t.className.baseVal === void 0 ? t.className : t.className.baseVal;
}
function ue(t, n) {
"opacity" in t.style ? t.style.opacity = n : "filter" in t.style && Ko(t, n);
}
function Ko(t, n) {
var a = !1, c = "DXImageTransform.Microsoft.Alpha";
try {
a = t.filters.item(c);
} catch {
if (n === 1)
return;
}
n = Math.round(n * 100), a ? (a.Enabled = n !== 100, a.Opacity = n) : t.style.filter += " progid:" + c + "(opacity=" + n + ")";
}
function Fn(t) {
for (var n = document.documentElement.style, a = 0; a < t.length; a++)
if (t[a] in n)
return t[a];
return !1;
}
function ei(t, n, a) {
var c = n || new P(0, 0);
t.style[bs] = (W.ie3d ? "translate(" + c.x + "px," + c.y + "px)" : "translate3d(" + c.x + "px," + c.y + "px,0)") + (a ? " scale(" + a + ")" : "");
}
function Ot(t, n) {
t._leaflet_pos = n, W.any3d ? ei(t, n) : (t.style.left = n.x + "px", t.style.top = n.y + "px");
}
function ii(t) {
return t._leaflet_pos || new P(0, 0);
}
var en, nn, Ss;
if ("onselectstart" in document)
en = function() {
J(window, "selectstart", Ht);
}, nn = function() {
wt(window, "selectstart", Ht);
};
else {
var sn = Fn(
["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"]
);
en = function() {
if (sn) {
var t = document.documentElement.style;
Ss = t[sn], t[sn] = "none";
}
}, nn = function() {
sn && (document.documentElement.style[sn] = Ss, Ss = void 0);
};
}
function As() {
J(window, "dragstart", Ht);
}
function Ls() {
wt(window, "dragstart", Ht);
}
var Hn, Cs;
function Ts(t) {
for (; t.tabIndex === -1; )
t = t.parentNode;
t.style && (Wn(), Hn = t, Cs = t.style.outlineStyle, t.style.outlineStyle = "none", J(window, "keydown", Wn));
}
function Wn() {
Hn && (Hn.style.outlineStyle = Cs, Hn = void 0, Cs = void 0, wt(window, "keydown", Wn));
}
function Lr(t) {
do
t = t.parentNode;
while ((!t.offsetWidth || !t.offsetHeight) && t !== document.body);
return t;
}
function Ns(t) {
var n = t.getBoundingClientRect();
return {
x: n.width / t.offsetWidth || 1,
y: n.height / t.offsetHeight || 1,
boundingClientRect: n
};
}
var Vo = {
__proto__: null,
TRANSFORM: bs,
TRANSITION: Yi,
TRANSITION_END: Sr,
get: Ar,
getStyle: tn,
create: ct,
remove: Et,
empty: qn,
toFront: xi,
toBack: bi,
hasClass: Es,
addClass: Y,
removeClass: Ct,
setClass: Ps,
getClass: $n,
setOpacity: ue,
testProp: Fn,
setTransform: ei,
setPosition: Ot,
getPosition: ii,
get disableTextSelection() {
return en;
},
get enableTextSelection() {
return nn;
},
disableImageDrag: As,
enableImageDrag: Ls,
preventOutline: Ts,
restoreOutline: Wn,
getSizedParentNode: Lr,
getScale: Ns
};
function J(t, n, a, c) {
if (n && typeof n == "object")
for (var d in n)
Is(t, d, n[d], a);
else {
n = E(n);
for (var p = 0, y = n.length; p < y; p++)
Is(t, n[p], a, c);
}
return this;
}
var we = "_leaflet_events";
function wt(t, n, a, c) {
if (arguments.length === 1)
Cr(t), delete t[we];
else if (n && typeof n == "object")
for (var d in n)
Os(t, d, n[d], a);
else if (n = E(n), arguments.length === 2)
Cr(t, function(b) {
return lt(n, b) !== -1;
});
else
for (var p = 0, y = n.length; p < y; p++)
Os(t, n[p], a, c);
return this;
}
function Cr(t, n) {
for (var a in t[we]) {
var c = a.split(/\d/)[0];
(!n || n(c)) && Os(t, c, null, null, a);
}
}
var Gs = {
mouseenter: "mouseover",
mouseleave: "mouseout",
wheel: !("onwheel" in window) && "mousewheel"
};
function Is(t, n, a, c) {
var d = n + f(a) + (c ? "_" + f(c) : "");
if (t[we] && t[we][d])
return this;
var p = function(b) {
return a.call(c || t, b || window.event);
}, y = p;
!W.touchNative && W.pointer && n.indexOf("touch") === 0 ? p = Xi(t, n, p) : W.touch && n === "dblclick" ? p = Wo(t, p) : "addEventListener" in t ? n === "touchstart" || n === "touchmove" || n === "wheel" || n === "mousewheel" ? t.addEventListener(Gs[n] || n, p, W.passiveEvents ? { passive: !1 } : !1) : n === "mouseenter" || n === "mouseleave" ? (p = function(b) {
b = b || window.event, Rs(t, b) && y(b);
}, t.addEventListener(Gs[n], p, !1)) : t.addEventListener(n, y, !1) : t.attachEvent("on" + n, p), t[we] = t[we] || {}, t[we][d] = p;
}
function Os(t, n, a, c, d) {
d = d || n + f(a) + (c ? "_" + f(c) : "");
var p = t[we] && t[we][d];
if (!p)
return this;
!W.touchNative && W.pointer && n.indexOf("touch") === 0 ? yi(t, n, p) : W.touch && n === "dblclick" ? jo(t, p) : "removeEventListener" in t ? t.removeEventListener(Gs[n] || n, p, !1) : t.detachEvent("on" + n, p), t[we][d] = null;
}
function ni(t) {
return t.stopPropagation ? t.stopPropagation() : t.originalEvent ? t.originalEvent._stopped = !0 : t.cancelBubble = !0, this;
}
function ks(t) {
return Is(t, "wheel", ni), this;
}
function rn(t) {
return J(t, "mousedown touchstart dblclick contextmenu", ni), t._leaflet_disable_click = !0, this;
}
function Ht(t) {
return t.preventDefault ? t.preventDefault() : t.returnValue = !1, this;
}
function si(t) {
return Ht(t), ni(t), this;
}
function Tr(t) {
if (t.composedPath)
return t.composedPath();
for (var n = [], a = t.target; a; )
n.push(a), a = a.parentNode;
return n;
}
function Nr(t, n) {
if (!n)
return new P(t.clientX, t.clientY);
var a = Ns(n), c = a.boundingClientRect;
return new P(
// offset.left/top values are in page scale (like clientX/Y),
// whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).
(t.clientX - c.left) / a.x - n.clientLeft,
(t.clientY - c.top) / a.y - n.clientTop
);
}
var Jo = W.linux && W.chrome ? window.devicePixelRatio : W.mac ? window.devicePixelRatio * 3 : window.devicePixelRatio > 0 ? 2 * window.devicePixelRatio : 1;
function Gr(t) {
return W.edge ? t.wheelDeltaY / 2 : (
// Don't trust window-geometry-based delta
t.deltaY && t.deltaMode === 0 ? -t.deltaY / Jo : (
// Pixels
t.deltaY && t.deltaMode === 1 ? -t.deltaY * 20 : (
// Lines
t.deltaY && t.deltaMode === 2 ? -t.deltaY * 60 : (
// Pages
t.deltaX || t.deltaZ ? 0 : (
// Skip horizontal/depth wheel events
t.wheelDelta ? (t.wheelDeltaY || t.wheelDelta) / 2 : (
// Legacy IE pixels
t.detail && Math.abs(t.detail) < 32765 ? -t.detail * 20 : (
// Legacy Moz lines
t.detail ? t.detail / -32765 * 60 : (
// Legacy Moz pages
0
)
)
)
)
)
)
)
);
}
function Rs(t, n) {
var a = n.relatedTarget;
if (!a)
return !0;
try {
for (; a && a !== t; )
a = a.parentNode;
} catch {
return !1;
}
return a !== t;
}
var Xo = {
__proto__: null,
on: J,
off: wt,
stopPropagation: ni,
disableScrollPropagation: ks,
disableClickPropagation: rn,
preventDefault: Ht,
stop: si,
getPropagationPath: Tr,
getMousePosition: Nr,
getWheelDelta: Gr,
isExternalTarget: Rs,
addListener: J,
removeListener: wt
}, Ir = ae.extend({
// @method run(el: HTMLElement, newPos: Point, duration?: Number, easeLinearity?: Number)
// Run an animation of a given element to a new position, optionally setting
// duration in seconds (`0.25` by default) and easing linearity factor (3rd
// argument of the [cubic bezier curve](https://cubic-bezier.com/#0,0,.5,1),
// `0.5` by default).
run: function(t, n, a, c) {
this.stop(), this._el = t, this._inProgress = !0, this._duration = a || 0.25, this._easeOutPower = 1 / Math.max(c || 0.5, 0.2), this._startPos = ii(t), this._offset = n.subtract(this._startPos), this._startTime = +/* @__PURE__ */ new Date(), this.fire("start"), this._animate();
},
// @method stop()
// Stops the animation (if currently running).
stop: function() {
this._inProgress && (this._step(!0), this._complete());
},
_animate: function() {
this._animId = gt(this._animate, this), this._step();
},
_step: function(t) {
var n = +/* @__PURE__ */ new Date() - this._startTime, a = this._duration * 1e3;
n < a ? this._runFrame(this._easeOut(n / a), t) : (this._runFrame(1), this._complete());
},
_runFrame: function(t, n) {
var a = this._startPos.add(this._offset.multiplyBy(t));
n && a._round(), Ot(this._el, a), this.fire("step");
},
_complete: function() {
bt(this._animId), this._inProgress = !1, this.fire("end");
},
_easeOut: function(t) {
return 1 - Math.pow(1 - t, this._easeOutPower);
}
}), ot = ae.extend({
options: {
// @section Map State Options
// @option crs: CRS = L.CRS.EPSG3857
// The [Coordinate Reference System](#crs) to use. Don't change this if you're not
// sure what it means.
crs: X,
// @option center: LatLng = undefined
// Initial geographic center of the map
center: void 0,
// @option zoom: Number = undefined
// Initial map zoom level
zoom: void 0,
// @option minZoom: Number = *
// Minimum zoom level of the map.
// If not specified and at least one `GridLayer` or `TileLayer` is in the map,
// the lowest of their `minZoom` options will be used instead.
minZoom: void 0,
// @option maxZoom: Number = *
// Maximum zoom level of the map.
// If not specified and at least one `GridLayer` or `TileLayer` is in the map,
// the highest of their `maxZoom` options will be used instead.
maxZoom: void 0,
// @option layers: Layer[] = []
// Array of layers that will be added to the map initially
layers: [],
// @option maxBounds: LatLngBounds = null
// When this option is set, the map restricts the view to the given
// geographical bounds, bouncing the user back if the user tries to pan
// outside the view. To set the restriction dynamically, use
// [`setMaxBounds`](#map-setmaxbounds) method.
maxBounds: void 0,
// @option renderer: Renderer = *
// The default method for drawing vector layers on the map. `L.SVG`
// or `L.Canvas` by default depending on browser support.
renderer: void 0,
// @section Animation Options
// @option zoomAnimation: Boolean = true
// Whether the map zoom animation is enabled. By default it's enabled
// in all browsers that support CSS3 Transitions except Android.
zoomAnimation: !0,
// @option zoomAnimationThreshold: Number = 4
// Won't animate zoom if the zoom difference exceeds this value.
zoomAnimationThreshold: 4,
// @option fadeAnimation: Boolean = true
// Whether the tile fade animation is enabled. By default it's enabled
// in all browsers that support CSS3 Transitions except Android.
fadeAnimation: !0,
// @option markerZoomAnimation: Boolean = true
// Whether markers animate their zoom with the zoom animation, if disabled
// they will disappear for the length of the animation. By default it's
// enabled in all browsers that support CSS3 Transitions except Android.
markerZoomAnimation: !0,
// @option transform3DLimit: Number = 2^23
// Defines the maximum size of a CSS translation transform. The default
// value should not be changed unless a web browser positions layers in
// the wrong place after doing a large `panBy`.
transform3DLimit: 8388608,
// Precision limit of a 32-bit float
// @section Interaction Options
// @option zoomSnap: Number = 1
// Forces the map's zoom level to always be a multiple of this, particularly
// right after a [`fitBounds()`](#map-fitbounds) or a pinch-zoom.
// By default, the zoom level snaps to the nearest integer; lower values
// (e.g. `0.5` or `0.1`) allow for greater granularity. A value of `0`
// means the zoom level will not be snapped after `fitBounds` or a pinch-zoom.
zoomSnap: 1,
// @option zoomDelta: Number = 1
// Controls how much the map's zoom level will change after a
// [`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+`
// or `-` on the keyboard, or using the [zoom controls](#control-zoom).
// Values smaller than `1` (e.g. `0.5`) allow for greater granularity.
zoomDelta: 1,
// @option trackResize: Boolean = true
// Whether the map automatically handles browser window resize to update itself.
trackResize: !0
},
initialize: function(t, n) {
n = x(this, n), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._sizeChanged = !0, this._initContainer(t), this._initLayout(), this._onResize = l(this._onResize, this), this._initEvents(), n.maxBounds && this.setMaxBounds(n.maxBounds), n.zoom !== void 0 && (this._zoom = this._limitZoom(n.zoom)), n.center && n.zoom !== void 0 && this.setView(H(n.center), n.zoom, { reset: !0 }), this.callInitHooks(), this._zoomAnimated = Yi && W.any3d && !W.mobileOpera && this.options.zoomAnimation, this._zoomAnimated && (this._createAnimProxy(), J(this._proxy, Sr, this._catchTransitionEnd, this)), this._addLayers(this.options.layers);
},
// @section Methods for modifying map state
// @method setView(center: LatLng, zoom: Number, options?: Zoom/pan options): this
// Sets the view of the map (geographical center and zoom) with the given
// animation options.
setView: function(t, n, a) {
if (n = n === void 0 ? this._zoom : this._limitZoom(n), t = this._limitCenter(H(t), n, this.options.maxBounds), a = a || {}, this._stop(), this._loaded && !a.reset && a !== !0) {
a.animate !== void 0 && (a.zoom = o({ animate: a.animate }, a.zoom), a.pan = o({ animate: a.animate, duration: a.duration }, a.pan));
var c = this._zoom !== n ? this._tryAnimatedZoom && this._tryAnimatedZoom(t, n, a.zoom) : this._tryAnimatedPan(t, a.pan);
if (c)
return clearTimeout(this._sizeTimer), this;
}
return this._resetView(t, n, a.pan && a.pan.noMoveStart), this;
},
// @method setZoom(zoom: Number, options?: Zoom/pan options): this
// Sets the zoom of the map.
setZoom: function(t, n) {
return this._loaded ? this.setView(this.getCenter(), t, { zoom: n }) : (this._zoom = t, this);
},
// @method zoomIn(delta?: Number, options?: Zoom options): this
// Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).
zoomIn: function(t, n) {
return t = t || (W.any3d ? this.options.zoomDelta : 1), this.setZoom(this._zoom + t, n);
},
// @method zoomOut(delta?: Number, options?: Zoom options): this
// Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).
zoomOut: function(t, n) {
return t = t || (W.any3d ? this.options.zoomDelta : 1), this.setZoom(this._zoom - t, n);
},
// @method setZoomAround(latlng: LatLng, zoom: Number, options: Zoom options): this
// Zooms the map while keeping a specified geographical point on the map
// stationary (e.g. used internally for scroll zoom and double-click zoom).
// @alternative
// @method setZoomAround(offset: Point, zoom: Number, options: Zoom options): this
// Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.
setZoomAround: function(t, n, a) {
var c = this.getZoomScale(n), d = this.getSize().divideBy(2), p = t instanceof P ? t : this.latLngToContainerPoint(t), y = p.subtract(d).multiplyBy(1 - 1 / c), b = this.containerPointToLatLng(d.add(y));
return this.setView(b, n, { zoom: a });
},
_getBoundsCenterZoom: function(t, n) {
n = n || {}, t = t.getBounds ? t.getBounds() : R(t);
var a = T(n.paddingTopLeft || n.padding || [0, 0]), c = T(n.paddingBottomRight || n.padding || [0, 0]), d = this.getBoundsZoom(t, !1, a.add(c));
if (d = typeof n.maxZoom == "number" ? Math.min(n.maxZoom, d) : d, d === 1 / 0)
return {
center: t.getCenter(),
zoom: d
};
var p = c.subtract(a).divideBy(2), y = this.project(t.getSouthWest(), d), b = this.project(t.getNorthEast(), d), S = this.unproject(y.add(b).divideBy(2).add(p), d);
return {
center: S,
zoom: d
};
},
// @method fitBounds(bounds: LatLngBounds, options?: fitBounds options): this
// Sets a map view that contains the given geographical bounds with the
// maximum zoom level possible.
fitBounds: function(t, n) {
if (t = R(t), !t.isValid())
throw new Error("Bounds are not valid.");
var a = this._getBoundsCenterZoom(t, n);
return this.setView(a.center, a.zoom, n);
},
// @method fitWorld(options?: fitBounds options): this
// Sets a map view that mostly contains the whole world with the maximum
// zoom level possible.
fitWorld: function(t) {
return this.fitBounds([[-90, -180], [90, 180]], t);
},
// @method panTo(latlng: LatLng, options?: Pan options): this
// Pans the map to a given center.
panTo: function(t, n) {
return this.setView(t, this._zoom, { pan: n });
},
// @method panBy(offset: Point, options?: Pan options): this
// Pans the map by a given number of pixels (animated).
panBy: function(t, n) {
if (t = T(t).round(), n = n || {}, !t.x && !t.y)
return this.fire("moveend");
if (n.animate !== !0 && !this.getSize().contains(t))
return this._resetView(this.unproject(this.project(this.getCenter()).add(t)), this.getZoom()), this;
if (this._panAnim || (this._panAnim = new Ir(), this._panAnim.on({
step: this._onPanTransitionStep,
end: this._onPanTransitionEnd
}, this)), n.noMoveStart || this.fire("movestart"), n.animate !== !1) {
Y(this._mapPane, "leaflet-pan-anim");
var a = this._getMapPanePos().subtract(t).round();
this._panAnim.run(this._mapPane, a, n.duration || 0.25, n.easeLinearity);
} else
this._rawPanBy(t), this.fire("move").fire("moveend");
return this;
},
// @method flyTo(latlng: LatLng, zoom?: Number, options?: Zoom/pan options): this
// Sets the view of the map (geographical center and zoom) performing a smooth
// pan-zoom animation.
flyTo: function(t, n, a) {
if (a = a || {}, a.animate === !1 || !W.any3d)
return this.setView(t, n, a);
this._stop();
var c = this.project(this.getCenter()), d = this.project(t), p = this.getSize(), y = this._zoom;
t = H(t), n = n === void 0 ? y : n;
var b = Math.max(p.x, p.y), S = b * this.getZoomScale(y, n), I = d.distanceTo(c) || 1, q = 1.42, V = q * q;
function st(kt) {
var ss = kt ? -1 : 1, Bh = kt ? S : b, Uh = S * S - b * b + ss * V * V * I * I, Zh = 2 * Bh * V * I, js = Uh / Zh, da = Math.sqrt(js * js + 1) - js, qh = da < 1e-9 ? -18 : Math.log(da);
return qh;
}
function Vt(kt) {
return (Math.exp(kt) - Math.exp(-kt)) / 2;
}
function Ut(kt) {
return (Math.exp(kt) + Math.exp(-kt)) / 2;
}
function de(kt) {
return Vt(kt) / Ut(kt);
}
var te = st(0);
function Ci(kt) {
return b * (Ut(te) / Ut(te + q * kt));
}
function kh(kt) {
return b * (Ut(te) * de(te + q * kt) - Vt(te)) / V;
}
function Rh(kt) {
return 1 - Math.pow(1 - kt, 1.5);
}
var zh = Date.now(), ua = (st(1) - te) / q, Dh = a.duration ? 1e3 * a.duration : 1e3 * ua * 0.8;
function fa() {
var kt = (Date.now() - zh) / Dh, ss = Rh(kt) * ua;
kt <= 1 ? (this._flyToFrame = gt(fa, this), this._move(
this.unproject(c.add(d.subtract(c).multiplyBy(kh(ss) / I)), y),
this.getScaleZoom(b / Ci(ss), y),
{ flyTo: !0 }
)) : this._move(t, n)._moveEnd(!0);
}
return this._moveStart(!0, a.noMoveStart), fa.call(this), this;
},
// @method flyToBounds(bounds: LatLngBounds, options?: fitBounds options): this
// Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),
// but takes a bounds parameter like [`fitBounds`](#map-fitbounds).
flyToBounds: function(t, n) {
var a = this._getBoundsCenterZoom(t, n);
return this.flyTo(a.center, a.zoom, n);
},
// @method setMaxBounds(bounds: LatLngBounds): this
// Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option).
setMaxBounds: function(t) {
return t = R(t), this.listens("moveend", this._panInsideMaxBounds) && this.off("moveend", this._panInsideMaxBounds), t.isValid() ? (this.options.maxBounds = t, this._loaded && this._panInsideMaxBounds(), this.on("moveend", this._panInsideMaxBounds)) : (this.options.maxBounds = null, this);
},
// @method setMinZoom(zoom: Number): this
// Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option).
setMinZoom: function(t) {
var n = this.options.minZoom;
return this.options.minZoom = t, this._loaded && n !== t && (this.fire("zoomlevelschange"), this.getZoom() < this.options.minZoom) ? this.setZoom(t) : this;
},
// @method setMaxZoom(zoom: Number): this
// Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option).
setMaxZoom: function(t) {
var n = this.options.maxZoom;
return this.options.maxZoom = t, this._loaded && n !== t && (this.fire("zoomlevelschange"), this.getZoom() > this.options.maxZoom) ? this.setZoom(t) : this;
},
// @method panInsideBounds(bounds: LatLngBounds, options?: Pan options): this
// Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.
panInsideBounds: function(t, n) {
this._enforcingBounds = !0;
var a = this.getCenter(), c = this._limitCenter(a, this._zoom, R(t));
return a.equals(c) || this.panTo(c, n), this._enforcingBounds = !1, this;
},
// @method panInside(latlng: LatLng, options?: padding options): this
// Pans the map the minimum amount to make the `latlng` visible. Use
// padding options to fit the display to more restricted bounds.
// If `latlng` is already within the (optionally padded) display bounds,
// the map will not be panned.
panInside: function(t, n) {
n = n || {};
var a = T(n.paddingTopLeft || n.padding || [0, 0]), c = T(n.paddingBottomRight || n.padding || [0, 0]), d = this.project(this.getCenter()), p = this.project(t), y = this.getPixelBounds(), b = A([y.min.add(a), y.max.subtract(c)]), S = b.getSize();
if (!b.contains(p)) {
this._enforcingBounds = !0;
var I = p.subtract(b.getCenter()), q = b.extend(p).getSize().subtract(S);
d.x += I.x < 0 ? -q.x : q.x, d.y += I.y < 0 ? -q.y : q.y, this.panTo(this.unproject(d), n), this._enforcingBounds = !1;
}
return this;
},
// @method invalidateSize(options: Zoom/pan options): this
// Checks if the map container size changed and updates the map if so —
// call it after you've changed the map size dynamically, also animating
// pan by default. If `options.pan` is `false`, panning will not occur.
// If `options.debounceMoveend` is `true`, it will delay `moveend` event so
// that it doesn't happen often even if the method is called many
// times in a row.
// @alternative
// @method invalidateSize(animate: Boolean): this
// Checks if the map container size changed and updates the map if so —
// call it after you've changed the map size dynamically, also animating
// pan by default.
invalidateSize: function(t) {
if (!this._loaded)
return this;
t = o({
animate: !1,
pan: !0
}, t === !0 ? { animate: !0 } : t);
var n = this.getSize();
this._sizeChanged = !0, this._lastCenter = null;
var a = this.getSize(), c = n.divideBy(2).round(), d = a.divideBy(2).round(), p = c.subtract(d);
return !p.x && !p.y ? this : (t.animate && t.pan ? this.panBy(p) : (t.pan && this._rawPanBy(p), this.fire("move"), t.debounceMoveend ? (clearTimeout(this._sizeTimer), this._sizeTimer = setTimeout(l(this.fire, this, "moveend"), 200)) : this.fire("moveend")), this.fire("resize", {
oldSize: n,
newSize: a
}));
},
// @section Methods for modifying map state
// @method stop(): this
// Stops the currently running `panTo` or `flyTo` animation, if any.
stop: function() {
return this.setZoom(this._limitZoom(this._zoom)), this.options.zoomSnap || this.fire("viewreset"), this._stop();
},
// @section Geolocation methods
// @method locate(options?: Locate options): this
// Tries to locate the user using the Geolocation API, firing a [`locationfound`](#map-locationfound)
// event with location data on success or a [`locationerror`](#map-locationerror) event on failure,
// and optionally sets the map view to the user's location with respect to
// detection accuracy (or to the world view if geolocation failed).
// Note that, if your page doesn't use HTTPS, this method will fail in
// modern browsers ([Chrome 50 and newer](https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins))
// See `Locate options` for more details.
locate: function(t) {
if (t = this._locateOptions = o({
timeout: 1e4,
watch: !1
// setView: false
// maxZoom: <Number>
// maximumAge: 0
// enableHighAccuracy: false
}, t), !("geolocation" in navigator))
return this._handleGeolocationError({
code: 0,
message: "Geolocation not supported."
}), this;
var n = l(this._handleGeolocationResponse, this), a = l(this._handleGeolocationError, this);
return t.watch ? this._locationWatchId = navigator.geolocation.watchPosition(n, a, t) : navigator.geolocation.getCurrentPosition(n, a, t), this;
},
// @method stopLocate(): this
// Stops watching location previously initiated by `map.locate({watch: true})`
// and aborts resetting the map view if map.locate was called with
// `{setView: true}`.
stopLocate: function() {
return navigator.geolocation && navigator.geolocation.clearWatch && navigator.geolocation.clearWatch(this._locationWatchId), this._locateOptions && (this._locateOptions.setView = !1), this;
},
_handleGeolocationError: function(t) {
if (this._container._leaflet_id) {
var n = t.code, a = t.message || (n === 1 ? "permission denied" : n === 2 ? "position unavailable" : "timeout");
this._locateOptions.setView && !this._loaded && this.fitWorld(), this.fire("locationerror", {
code: n,
message: "Geolocation error: " + a + "."
});
}
},
_handleGeolocationResponse: function(t) {
if (this._container._leaflet_id) {
var n = t.coords.latitude, a = t.coords.longitude, c = new F(n, a), d = c.toBounds(t.coords.accuracy * 2), p = this._locateOptions;
if (p.setView) {
var y = this.getBoundsZoom(d);
this.setView(c, p.maxZoom ? Math.min(y, p.maxZoom) : y);
}
var b = {
latlng: c,
bounds: d,
timestamp: t.timestamp
};
for (var S in t.coords)
typeof t.coords[S] == "number" && (b[S] = t.coords[S]);
this.fire("locationfound", b);
}
},
// TODO Appropriate docs section?
// @section Other Methods
// @method addHandler(name: String, HandlerClass: Function): this
// Adds a new `Handler` to the map, given its name and constructor function.
addHandler: function(t, n) {
if (!n)
return this;
var a = this[t] = new n(this);
return this._handlers.push(a), this.options[t] && a.enable(), this;
},
// @method remove(): this
// Destroys the map and clears all related event listeners.
remove: function() {
if (this._initEvents(!0), this.options.maxBounds && this.off("moveend", this._panInsideMaxBounds), this._containerId !== this._container._leaflet_id)
throw new Error("Map container is being reused by another instance");
try {
delete this._container._leaflet_id, delete this._containerId;
} catch {
this._container._leaflet_id = void 0, this._containerId = void 0;
}
this._locationWatchId !== void 0 && this.stopLocate(), this._stop(), Et(this._mapPane), this._clearControlPos && this._clearControlPos(), this._resizeRequest && (bt(this._resizeRequest), this._resizeRequest = null), this._clearHandlers(), this._loaded && this.fire("unload");
var t;
for (t in this._layers)
this._layers[t].remove();
for (t in this._panes)
Et(this._panes[t]);
return this._layers = [], this._panes = [], delete this._mapPane, delete this._renderer, this;
},
// @section Other Methods
// @method createPane(name: String, container?: HTMLElement): HTMLElement
// Creates a new [map pane](#map-pane) with the given name if it doesn't exist already,
// then returns it. The pane is created as a child of `container`, or
// as a child of the main map pane if not set.
createPane: function(t, n) {
var a = "leaflet-pane" + (t ? " leaflet-" + t.replace("Pane", "") + "-pane" : ""), c = ct("div", a, n || this._mapPane);
return t && (this._panes[t] = c), c;
},
// @section Methods for Getting Map State
// @method getCenter(): LatLng
// Returns the geographical center of the map view
getCenter: function() {
return this._checkIfLoaded(), this._lastCenter && !this._moved() ? this._lastCenter.clone() : this.layerPointToLatLng(this._getCenterLayerPoint());
},
// @method getZoom(): Number
// Returns the current zoom level of the map view
getZoom: function() {
return this._zoom;
},
// @method getBounds(): LatLngBounds
// Returns the geographical bounds visible in the current map view
getBounds: function() {
var t = this.getPixelBounds(), n = this.unproject(t.getBottomLeft()), a = this.unproject(t.getTopRight());
return new N(n, a);
},
// @method getMinZoom(): Number
// Returns the minimum zoom level of the map (if set in the `minZoom` option of the map or of any layers), or `0` by default.
getMinZoom: function() {
return this.options.minZoom === void 0 ? this._layersMinZoom || 0 : this.options.minZoom;
},
// @method getMaxZoom(): Number
// Returns the maximum zoom level of the map (if set in the `maxZoom` option of the map or of any layers).
getMaxZoom: function() {
return this.options.maxZoom === void 0 ? this._layersMaxZoom === void 0 ? 1 / 0 : this._layersMaxZoom : this.options.maxZoom;
},
// @method getBoundsZoom(bounds: LatLngBounds, inside?: Boolean, padding?: Point): Number
// Returns the maximum zoom level on which the given bounds fit to the map
// view in its entirety. If `inside` (optional) is set to `true`, the method
// instead returns the minimum zoom level on which the map view fits into
// the given bounds in its entirety.
getBoundsZoom: function(t, n, a) {
t = R(t), a = T(a || [0, 0]);
var c = this.getZoom() || 0, d = this.getMinZoom(), p = this.getMaxZoom(), y = t.getNorthWest(), b = t.getSouthEast(), S = this.getSize().subtract(a), I = A(this.project(b, c), this.project(y, c)).getSize(), q = W.any3d ? this.options.zoomSnap : 1, V = S.x / I.x, st = S.y / I.y, Vt = n ? Math.max(V, st) : Math.min(V, st);
return c = this.getScaleZoom(Vt, c), q && (c = Math.round(c / (q / 100)) * (q / 100), c = n ? Math.ceil(c / q) * q : Math.floor(c / q) * q), Math.max(d, Math.min(p, c));
},
// @method getSize(): Point
// Returns the current size of the map container (in pixels).
getSize: function() {
return (!this._size || this._sizeChanged) && (this._size = new P(
this._container.clientWidth || 0,
this._container.clientHeight || 0
), this._sizeChanged = !1), this._size.clone();
},
// @method getPixelBounds(): Bounds
// Returns the bounds of the current map view in projected pixel
// coordinates (sometimes useful in layer and overlay implementations).
getPixelBounds: function(t, n) {
var a = this._getTopLeftPoint(t, n);
return new G(a, a.add(this.getSize()));
},
// TODO: Check semantics - isn't the pixel origin the 0,0 coord relative to
// the map pane? "left point of the map layer" can be confusing, specially
// since there can be negative offsets.
// @method getPixelOrigin(): Point
// Returns the projected pixel coordinates of the top left point of
// the map layer (useful in custom layer and overlay implementations).
getPixelOrigin: function() {
return this._checkIfLoaded(), this._pixelOrigin;
},
// @method getPixelWorldBounds(zoom?: Number): Bounds
// Returns the world's bounds in pixel coordinates for zoom level `zoom`.
// If `zoom` is omitted, the map's current zoom level is used.
getPixelWorldBounds: function(t) {
return this.options.crs.getProjectedBounds(t === void 0 ? this.getZoom() : t);
},
// @section Other Methods
// @method getPane(pane: String|HTMLElement): HTMLElement
// Returns a [map pane](#map-pane), given its name or its HTML element (its identity).
getPane: function(t) {
return typeof t == "string" ? this._panes[t] : t;
},
// @method getPanes(): Object
// Returns a plain object containing the names of all [panes](#map-pane) as keys and
// the panes as values.
getPanes: function() {
return this._panes;
},
// @method getContainer: HTMLElement
// Returns the HTML element that contains the map.
getContainer: function() {
return this._container;
},
// @section Conversion Methods
// @method getZoomScale(toZoom: Number, fromZoom: Number): Number
// Returns the scale factor to be applied to a map transition from zoom level
// `fromZoom` to `toZoom`. Used internally to help with zoom animations.
getZoomScale: function(t, n) {
var a = this.options.crs;
return n = n === void 0 ? this._zoom : n, a.scale(t) / a.scale(n);
},
// @method getScaleZoom(scale: Number, fromZoom: Number): Number
// Returns the zoom level that the map would end up at, if it is at `fromZoom`
// level and everything is scaled by a factor of `scale`. Inverse of
// [`getZoomScale`](#map-getZoomScale).
getScaleZoom: function(t, n) {
var a = this.options.crs;
n = n === void 0 ? this._zoom : n;
var c = a.zoom(t * a.scale(n));
return isNaN(c) ? 1 / 0 : c;
},
// @method project(latlng: LatLng, zoom: Number): Point
// Projects a geographical coordinate `LatLng` according to the projection
// of the map's CRS, then scales it according to `zoom` and the CRS's
// `Transformation`. The result is pixel coordinate relative to
// the CRS origin.
project: function(t, n) {
return n = n === void 0 ? this._zoom : n, this.options.crs.latLngToPoint(H(t), n);
},
// @method unproject(point: Point, zoom: Number): LatLng
// Inverse of [`project`](#map-project).
unproject: function(t, n) {
return n = n === void 0 ? this._zoom : n, this.options.crs.pointToLatLng(T(t), n);
},
// @method layerPointToLatLng(point: Point): LatLng
// Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),
// returns the corresponding geographical coordinate (for the current zoom level).
layerPointToLatLng: function(t) {
var n = T(t).add(this.getPixelOrigin());
return this.unproject(n);
},
// @method latLngToLayerPoint(latlng: LatLng): Point
// Given a geographical coordinate, returns the corresponding pixel coordinate
// relative to the [origin pixel](#map-getpixelorigin).
latLngToLayerPoint: function(t) {
var n = this.project(H(t))._round();
return n._subtract(this.getPixelOrigin());
},
// @method wrapLatLng(latlng: LatLng): LatLng
// Returns a `LatLng` where `lat` and `lng` has been wrapped according to the
// map's CRS's `wrapLat` and `wrapLng` properties, if they are outside the
// CRS's bounds.
// By default this means longitude is wrapped around the dateline so its
// value is between -180 and +180 degrees.
wrapLatLng: function(t) {
return this.options.crs.wrapLatLng(H(t));
},
// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds
// Returns a `LatLngBounds` with the same size as the given one, ensuring that
// its center is within the CRS's bounds.
// By default this means the center longitude is wrapped around the dateline so its
// value is between -180 and +180 degrees, and the majority of the bounds
// overlaps the CRS's bounds.
wrapLatLngBounds: function(t) {
return this.options.crs.wrapLatLngBounds(R(t));
},
// @method distance(latlng1: LatLng, latlng2: LatLng): Number
// Returns the distance between two geographical coordinates according to
// the map's CRS. By default this measures distance in meters.
distance: function(t, n) {
return this.options.crs.distance(H(t), H(n));
},
// @method containerPointToLayerPoint(point: Point): Point
// Given a pixel coordinate relative to the map container, returns the corresponding
// pixel coordinate relative to the [origin pixel](#map-getpixelorigin).
containerPointToLayerPoint: function(t) {
return T(t).subtract(this._getMapPanePos());
},
// @method layerPointToContainerPoint(point: Point): Point
// Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),
// returns the corresponding pixel coordinate relative to the map container.
layerPointToContainerPoint: function(t) {
return T(t).add(this._getMapPanePos());
},
// @method containerPointToLatLng(point: Point): LatLng
// Given a pixel coordinate relative to the map container, returns
// the corresponding geographical coordinate (for the current zoom level).
containerPointToLatLng: function(t) {
var n = this.containerPointToLayerPoint(T(t));
return this.layerPointToLatLng(n);
},
// @method latLngToContainerPoint(latlng: LatLng): Point
// Given a geographical coordinate, returns the corresponding pixel coordinate
// relative to the map container.
latLngToContainerPoint: function(t) {
return this.layerPointToContainerPoint(this.latLngToLayerPoint(H(t)));
},
// @method mouseEventToContainerPoint(ev: MouseEvent): Point
// Given a MouseEvent object, returns the pixel coordinate relative to the
// map container where the event took place.
mouseEventToContainerPoint: function(t) {
return Nr(t, this._container);
},
// @method mouseEventToLayerPoint(ev: MouseEvent): Point
// Given a MouseEvent object, returns the pixel coordinate relative to
// the [origin pixel](#map-getpixelorigin) where the event took place.
mouseEventToLayerPoint: function(t) {
return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t));
},
// @method mouseEventToLatLng(ev: MouseEvent): LatLng
// Given a MouseEvent object, returns geographical coordinate where the
// event took place.
mouseEventToLatLng: function(t) {
return this.layerPointToLatLng(this.mouseEventToLayerPoint(t));
},
// map initialization methods
_initContainer: function(t) {
var n = this._container = Ar(t);
if (n) {
if (n._leaflet_id)
throw new Error("Map container is already initialized.");
} else
throw new Error("Map container not found.");
J(n, "scroll", this._onScroll, this), this._containerId = f(n);
},
_initLayout: function() {
var t = this._container;
this._fadeAnimated = this.options.fadeAnimation && W.any3d, Y(t, "leaflet-container" + (W.touch ? " leaflet-touch" : "") + (W.retina ? " leaflet-retina" : "") + (W.ielt9 ? " leaflet-oldie" : "") + (W.safari ? " leaflet-safari" : "") + (this._fadeAnimated ? " leaflet-fade-anim" : ""));
var n = tn(t, "position");
n !== "absolute" && n !== "relative" && n !== "fixed" && n !== "sticky" && (t.style.position = "relative"), this._initPanes(), this._initControlPos && this._initControlPos();
},
_initPanes: function() {
var t = this._panes = {};
this._paneRenderers = {}, this._mapPane = this.createPane("mapPane", this._container), Ot(this._mapPane, new P(0, 0)), this.createPane("tilePane"), this.createPane("overlayPane"), this.createPane("shadowPane"), this.createPane("markerPane"), this.createPane("tooltipPane"), this.createPane("popupPane"), this.options.markerZoomAnimation || (Y(t.markerPane, "leaflet-zoom-hide"), Y(t.shadowPane, "leaflet-zoom-hide"));
},
// private methods that modify map state
// @section Map state change events
_resetView: function(t, n, a) {
Ot(this._mapPane, new P(0, 0));
var c = !this._loaded;
this._loaded = !0, n = this._limitZoom(n), this.fire("viewprereset");
var d = this._zoom !== n;
this._moveStart(d, a)._move(t, n)._moveEnd(d), this.fire("viewreset"), c && this.fire("load");
},
_moveStart: function(t, n) {
return t && this.fire("zoomstart"), n || this.fire("movestart"), this;
},
_move: function(t, n, a, c) {
n === void 0 && (n = this._zoom);
var d = this._zoom !== n;
return this._zoom = n, this._lastCenter = t, this._pixelOrigin = this._getNewPixelOrigin(t), c ? a && a.pinch && this.fire("zoom", a) : ((d || a && a.pinch) && this.fire("zoom", a), this.fire("move", a)), this;
},
_moveEnd: function(t) {
return t && this.fire("zoomend"), this.fire("moveend");
},
_stop: function() {
return bt(this._flyToFrame), this._panAnim && this._panAnim.stop(), this;
},
_rawPanBy: function(t) {
Ot(this._mapPane, this._getMapPanePos().subtract(t));
},
_getZoomSpan: function() {
return this.getMaxZoom() - this.getMinZoom();
},
_panInsideMaxBounds: function() {
this._enforcingBounds || this.panInsideBounds(this.options.maxBounds);
},
_checkIfLoaded: function() {
if (!this._loaded)
throw new Error("Set map center and zoom first.");
},
// DOM event handling
// @section Interaction events
_initEvents: function(t) {
this._targets = {}, this._targets[f(this._container)] = this;
var n = t ? wt : J;
n(this._container, "click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup", this._handleDOMEvent, this), this.options.trackResize && n(window, "resize", this._onResize, this), W.any3d && this.options.transform3DLimit && (t ? this.off : this.on).call(this, "moveend", this._onMoveEnd);
},
_onResize: function() {
bt(this._resizeRequest), this._resizeRequest = gt(
function() {
this.invalidateSize({ debounceMoveend: !0 });
},
this
);
},
_onScroll: function() {
this._container.scrollTop = 0, this._container.scrollLeft = 0;
},
_onMoveEnd: function() {
var t = this._getMapPanePos();
Math.max(Math.abs(t.x), Math.abs(t.y)) >= this.options.transform3DLimit && this._resetView(this.getCenter(), this.getZoom());
},
_findEventTargets: function(t, n) {
for (var a = [], c, d = n === "mouseout" || n === "mouseover", p = t.target || t.srcElement, y = !1; p; ) {
if (c = this._targets[f(p)], c && (n === "click" || n === "preclick") && this._draggableMoved(c)) {
y = !0;
break;
}
if (c && c.listens(n, !0) && (d && !Rs(p, t) || (a.push(c), d)) || p === this._container)
break;
p = p.parentNode;
}
return !a.length && !y && !d && this.listens(n, !0) && (a = [this]), a;
},
_isClickDisabled: function(t) {
for (; t && t !== this._container; ) {
if (t._leaflet_disable_click)
return !0;
t = t.parentNode;
}
},
_handleDOMEvent: function(t) {
var n = t.target || t.srcElement;
if (!(!this._loaded || n._leaflet_disable_events || t.type === "click" && this._isClickDisabled(n))) {
var a = t.type;
a === "mousedown" && Ts(n), this._fireDOMEvent(t, a);
}
},
_mouseEvents: ["click", "dblclick", "mouseover", "mouseout", "contextmenu"],
_fireDOMEvent: function(t, n, a) {
if (t.type === "click") {
var c = o({}, t);
c.type = "preclick", this._fireDOMEvent(c, c.type, a);
}
var d = this._findEventTargets(t, n);
if (a) {
for (var p = [], y = 0; y < a.length; y++)
a[y].listens(n, !0) && p.push(a[y]);
d = p.concat(d);
}
if (d.length) {
n === "contextmenu" && Ht(t);
var b = d[0], S = {
originalEvent: t
};
if (t.type !== "keypress" && t.type !== "keydown" && t.type !== "keyup") {
var I = b.getLatLng && (!b._radius || b._radius <= 10);
S.containerPoint = I ? this.latLngToContainerPoint(b.getLatLng()) : this.mouseEventToContainerPoint(t), S.layerPoint = this.containerPointToLayerPoint(S.containerPoint), S.latlng = I ? b.getLatLng() : this.layerPointToLatLng(S.layerPoint);
}
for (y = 0; y < d.length; y++)
if (d[y].fire(n, S, !0), S.originalEvent._stopped || d[y].options.bubblingMouseEvents === !1 && lt(this._mouseEvents, n) !== -1)
return;
}
},
_draggableMoved: function(t) {
return t = t.dragging && t.dragging.enabled() ? t : this, t.dragging && t.dragging.moved() || this.boxZoom && this.boxZoom.moved();
},
_clearHandlers: function() {
for (var t = 0, n = this._handlers.length; t < n; t++)
this._handlers[t].disable();
},
// @section Other Methods
// @method whenReady(fn: Function, context?: Object): this
// Runs the given function `fn` when the map gets initialized with
// a view (center and zoom) and at least one layer, or immediately
// if it's already initialized, optionally passing a function context.
whenReady: function(t, n) {
return this._loaded ? t.call(n || this, { target: this }) : this.on("load", t, n), this;
},
// private methods for getting map state
_getMapPanePos: function() {
return ii(this._mapPane) || new P(0, 0);
},
_moved: function() {
var t = this._getMapPanePos();
return t && !t.equals([0, 0]);
},
_getTopLeftPoint: function(t, n) {
var a = t && n !== void 0 ? this._getNewPixelOrigin(t, n) : this.getPixelOrigin();
return a.subtract(this._getMapPanePos());
},
_getNewPixelOrigin: function(t, n) {
var a = this.getSize()._divideBy(2);
return this.project(t, n)._subtract(a)._add(this._getMapPanePos())._round();
},
_latLngToNewLayerPoint: function(t, n, a) {
var c = this._getNewPixelOrigin(a, n);
return this.project(t, n)._subtract(c);
},
_latLngBoundsToNewLayerBounds: function(t, n, a) {
var c = this._getNewPixelOrigin(a, n);
return A([
this.project(t.getSouthWest(), n)._subtract(c),
this.project(t.getNorthWest(), n)._subtract(c),
this.project(t.getSouthEast(), n)._subtract(c),
this.project(t.getNorthEast(), n)._subtract(c)
]);
},
// layer point of the current center
_getCenterLayerPoint: function() {
return this.containerPointToLayerPoint(this.getSize()._divideBy(2));
},
// offset of the specified place to the current center in pixels
_getCenterOffset: function(t) {
return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint());
},
// adjust center for view to get inside bounds
_limitCenter: function(t, n, a) {
if (!a)
return t;
var c = this.project(t, n), d = this.getSize().divideBy(2), p = new G(c.subtract(d), c.add(d)), y = this._getBoundsOffset(p, a, n);
return Math.abs(y.x) <= 1 && Math.abs(y.y) <= 1 ? t : this.unproject(c.add(y), n);
},
// adjust offset for view to get inside bounds
_limitOffset: function(t, n) {
if (!n)
return t;
var a = this.getPixelBounds(), c = new G(a.min.add(t), a.max.add(t));
return t.add(this._getBoundsOffset(c, n));
},
// returns offset needed for pxBounds to get inside maxBounds at a specified zoom
_getBoundsOffset: function(t, n, a) {
var c = A(
this.project(n.getNorthEast(), a),
this.project(n.getSouthWest(), a)
), d = c.min.subtract(t.min), p = c.max.subtract(t.max), y = this._rebound(d.x, -p.x), b = this._rebound(d.y, -p.y);
return new P(y, b);
},
_rebound: function(t, n) {
return t + n > 0 ? Math.round(t - n) / 2 : Math.max(0, Math.ceil(t)) - Math.max(0, Math.floor(n));
},
_limitZoom: function(t) {
var n = this.getMinZoom(), a = this.getMaxZoom(), c = W.any3d ? this.options.zoomSnap : 1;
return c && (t = Math.round(t / c) * c), Math.max(n, Math.min(a, t));
},
_onPanTransitionStep: function() {
this.fire("move");
},
_onPanTransitionEnd: function() {
Ct(this._mapPane, "leaflet-pan-anim"), this.fire("moveend");
},
_tryAnimatedPan: function(t, n) {
var a = this._getCenterOffset(t)._trunc();
return (n && n.animate) !== !0 && !this.getSize().contains(a) ? !1 : (this.panBy(a, n), !0);
},
_createAnimProxy: function() {
var t = this._proxy = ct("div", "leaflet-proxy leaflet-zoom-animated");
this._panes.mapPane.appendChild(t), this.on("zoomanim", function(n) {
var a = bs, c = this._proxy.style[a];
ei(this._proxy, this.project(n.center, n.zoom), this.getZoomScale(n.zoom, 1)), c === this._proxy.style[a] && this._animatingZoom && this._onZoomTransitionEnd();
}, this), this.on("load moveend", this._animMoveEnd, this), this._on("unload", this._destroyAnimProxy, this);
},
_destroyAnimProxy: function() {
Et(this._proxy), this.off("load moveend", this._animMoveEnd, this), delete this._proxy;
},
_animMoveEnd: function() {
var t = this.getCenter(), n = this.getZoom();
ei(this._proxy, this.project(t, n), this.getZoomScale(n, 1));
},
_catchTransitionEnd: function(t) {
this._animatingZoom && t.propertyName.indexOf("transform") >= 0 && this._onZoomTransitionEnd();
},
_nothingToAnimate: function() {
return !this._container.getElementsByClassName("leaflet-zoom-animated").length;
},
_tryAnimatedZoom: function(t, n, a) {
if (this._animatingZoom)
return !0;
if (a = a || {}, !this._zoomAnimated || a.animate === !1 || this._nothingToAnimate() || Math.abs(n - this._zoom) > this.options.zoomAnimationThreshold)
return !1;
var c = this.getZoomScale(n), d = this._getCenterOffset(t)._divideBy(1 - 1 / c);
return a.animate !== !0 && !this.getSize().contains(d) ? !1 : (gt(function() {
this._moveStart(!0, a.noMoveStart || !1)._animateZoom(t, n, !0);
}, this), !0);
},
_animateZoom: function(t, n, a, c) {
this._mapPane && (a && (this._animatingZoom = !0, this._animateToCenter = t, this._animateToZoom = n, Y(this._mapPane, "leaflet-zoom-anim")), this.fire("zoomanim", {
center: t,
zoom: n,
noUpdate: c
}), this._tempFireZoomEvent || (this._tempFireZoomEvent = this._zoom !== this._animateToZoom), this._move(this._animateToCenter, this._animateToZoom, void 0, !0), setTimeout(l(this._onZoomTransitionEnd, this), 250));
},
_onZoomTransitionEnd: function() {
this._animatingZoom && (this._mapPane && Ct(this._mapPane, "leaflet-zoom-anim"), this._animatingZoom = !1, this._move(this._animateToCenter, this._animateToZoom, void 0, !0), this._tempFireZoomEvent && this.fire("zoom"), delete this._tempFireZoomEvent, this.fire("move"), this._moveEnd(!0));
}
});
function Qo(t, n) {
return new ot(t, n);
}
var me = Dt.extend({
// @section
// @aka Control Options
options: {
// @option position: String = 'topright'
// The position of the control (one of the map corners). Possible values are `'topleft'`,
// `'topright'`, `'bottomleft'` or `'bottomright'`
position: "topright"
},
initialize: function(t) {
x(this, t);
},
/* @section
* Classes extending L.Control will inherit the following methods:
*
* @method getPosition: string
* Returns the position of the control.
*/
getPosition: function() {
return this.options.position;
},
// @method setPosition(position: string): this
// Sets the position of the control.
setPosition: function(t) {
var n = this._map;
return n && n.removeControl(this), this.options.position = t, n && n.addControl(this), this;
},
// @method getContainer: HTMLElement
// Returns the HTMLElement that contains the control.
getContainer: function() {
return this._container;
},
// @method addTo(map: Map): this
// Adds the control to the given map.
addTo: function(t) {
this.remove(), this._map = t;
var n = this._container = this.onAdd(t), a = this.getPosition(), c = t._controlCorners[a];
return Y(n, "leaflet-control"), a.indexOf("bottom") !== -1 ? c.insertBefore(n, c.firstChild) : c.appendChild(n), this._map.on("unload", this.remove, this), this;
},
// @method remove: this
// Removes the control from the map it is currently active on.
remove: function() {
return this._map ? (Et(this._container), this.onRemove && this.onRemove(this._map), this._map.off("unload", this.remove, this), this._map = null, this) : this;
},
_refocusOnMap: function(t) {
this._map && t && t.screenX > 0 && t.screenY > 0 && this._map.getContainer().focus();
}
}), an = function(t) {
return new me(t);
};
ot.include({
// @method addControl(control: Control): this
// Adds the given control to the map
addControl: function(t) {
return t.addTo(this), this;
},
// @method removeControl(control: Control): this
// Removes the given control from the map
removeControl: function(t) {
return t.remove(), this;
},
_initControlPos: function() {
var t = this._controlCorners = {}, n = "leaflet-", a = this._controlContainer = ct("div", n + "control-container", this._container);
function c(d, p) {
var y = n + d + " " + n + p;
t[d + p] = ct("div", y, a);
}
c("top", "left"), c("top", "right"), c("bottom", "left"), c("bottom", "right");
},
_clearControlPos: function() {
for (var t in this._controlCorners)
Et(this._controlCorners[t]);
Et(this._controlContainer), delete this._controlCorners, delete this._controlContainer;
}
});
var Or = me.extend({
// @section
// @aka Control.Layers options
options: {
// @option collapsed: Boolean = true
// If `true`, the control will be collapsed into an icon and expanded on mouse hover, touch, or keyboard activation.
collapsed: !0,
position: "topright",
// @option autoZIndex: Boolean = true
// If `true`, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
autoZIndex: !0,
// @option hideSingleBase: Boolean = false
// If `true`, the base layers in the control will be hidden when there is only one.
hideSingleBase: !1,
// @option sortLayers: Boolean = false
// Whether to sort the layers. When `false`, layers will keep the order
// in which they were added to the control.
sortLayers: !1,
// @option sortFunction: Function = *
// A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)
// that will be used for sorting the layers, when `sortLayers` is `true`.
// The function receives both the `L.Layer` instances and their names, as in
// `sortFunction(layerA, layerB, nameA, nameB)`.
// By default, it sorts layers alphabetically by their name.
sortFunction: function(t, n, a, c) {
return a < c ? -1 : c < a ? 1 : 0;
}
},
initialize: function(t, n, a) {
x(this, a), this._layerControlInputs = [], this._layers = [], this._lastZIndex = 0, this._handlingClick = !1, this._preventClick = !1;
for (var c in t)
this._addLayer(t[c], c);
for (c in n)
this._addLayer(n[c], c, !0);
},
onAdd: function(t) {
this._initLayout(), this._update(), this._map = t, t.on("zoomend", this._checkDisabledLayers, this);
for (var n = 0; n < this._layers.length; n++)
this._layers[n].layer.on("add remove", this._onLayerChange, this);
return this._container;
},
addTo: function(t) {
return me.prototype.addTo.call(this, t), this._expandIfNotCollapsed();
},
onRemove: function() {
this._map.off("zoomend", this._checkDisabledLayers, this);
for (var t = 0; t < this._layers.length; t++)
this._layers[t].layer.off("add remove", this._onLayerChange, this);
},
// @method addBaseLayer(layer: Layer, name: String): this
// Adds a base layer (radio button entry) with the given name to the control.
addBaseLayer: function(t, n) {
return this._addLayer(t, n), this._map ? this._update() : this;
},
// @method addOverlay(layer: Layer, name: String): this
// Adds an overlay (checkbox entry) with the given name to the control.
addOverlay: function(t, n) {
return this._addLayer(t, n, !0), this._map ? this._update() : this;
},
// @method removeLayer(layer: Layer): this
// Remove the given layer from the control.
removeLayer: function(t) {
t.off("add remove", this._onLayerChange, this);
var n = this._getLayer(f(t));
return n && this._layers.splice(this._layers.indexOf(n), 1), this._map ? this._update() : this;
},
// @method expand(): this
// Expand the control container if collapsed.
expand: function() {
Y(this._container, "leaflet-control-layers-expanded"), this._section.style.height = null;
var t = this._map.getSize().y - (this._container.offsetTop + 50);
return t < this._section.clientHeight ? (Y(this._section, "leaflet-control-layers-scrollbar"), this._section.style.height = t + "px") : Ct(this._section, "leaflet-control-layers-scrollbar"), this._checkDisabledLayers(), this;
},
// @method collapse(): this
// Collapse the control container if expanded.
collapse: function() {
return Ct(this._container, "leaflet-control-layers-expanded"), this;
},
_initLayout: function() {
var t = "leaflet-control-layers", n = this._container = ct("div", t), a = this.options.collapsed;
n.setAttribute("aria-haspopup", !0), rn(n), ks(n);
var c = this._section = ct("section", t + "-list");
a && (this._map.on("click", this.collapse, this), J(n, {
mouseenter: this._expandSafely,
mouseleave: this.collapse
}, this));
var d = this._layersLink = ct("a", t + "-toggle", n);
d.href = "#", d.title = "Layers", d.setAttribute("role", "button"), J(d, {
keydown: function(p) {
p.keyCode === 13 && this._expandSafely();
},
// Certain screen readers intercept the key event and instead send a click event
click: function(p) {
Ht(p), this._expandSafely();
}
}, this), a || this.expand(), this._baseLayersList = ct("div", t + "-base", c), this._separator = ct("div", t + "-separator", c), this._overlaysList = ct("div", t + "-overlays", c), n.appendChild(c);
},
_getLayer: function(t) {
for (var n = 0; n < this._layers.length; n++)
if (this._layers[n] && f(this._layers[n].layer) === t)
return this._layers[n];
},
_addLayer: function(t, n, a) {
this._map && t.on("add remove", this._onLayerChange, this), this._layers.push({
layer: t,
name: n,
overlay: a
}), this.options.sortLayers && this._layers.sort(l(function(c, d) {
return this.options.sortFunction(c.layer, d.layer, c.name, d.name);
}, this)), this.options.autoZIndex && t.setZIndex && (this._lastZIndex++, t.setZIndex(this._lastZIndex)), this._expandIfNotCollapsed();
},
_update: function() {
if (!this._container)
return this;
qn(this._baseLayersList), qn(this._overlaysList), this._layerControlInputs = [];
var t, n, a, c, d = 0;
for (a = 0; a < this._layers.length; a++)
c = this._layers[a], this._addItem(c), n = n || c.overlay, t = t || !c.overlay, d += c.overlay ? 0 : 1;
return this.options.hideSingleBase && (t = t && d > 1, this._baseLayersList.style.display = t ? "" : "none"), this._separator.style.display = n && t ? "" : "none", this;
},
_onLayerChange: function(t) {
this._handlingClick || this._update();
var n = this._getLayer(f(t.target)), a = n.overlay ? t.type === "add" ? "overlayadd" : "overlayremove" : t.type === "add" ? "baselayerchange" : null;
a && this._map.fire(a, n);
},
// IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see https://stackoverflow.com/a/119079)
_createRadioElement: function(t, n) {
var a = '<input type="radio" class="leaflet-control-layers-selector" name="' + t + '"' + (n ? ' checked="checked"' : "") + "/>", c = document.createElement("div");
return c.innerHTML = a, c.firstChild;
},
_addItem: function(t) {
var n = document.createElement("label"), a = this._map.hasLayer(t.layer), c;
t.overlay ? (c = document.createElement("input"), c.type = "checkbox", c.className = "leaflet-control-layers-selector", c.defaultChecked = a) : c = this._createRadioElement("leaflet-base-layers_" + f(this), a), this._layerControlInputs.push(c), c.layerId = f(t.layer), J(c, "click", this._onInputClick, this);
var d = document.createElement("span");
d.innerHTML = " " + t.name;
var p = document.createElement("span");
n.appendChild(p), p.appendChild(c), p.appendChild(d);
var y = t.overlay ? this._overlaysList : this._baseLayersList;
return y.appendChild(n), this._checkDisabledLayers(), n;
},
_onInputClick: function() {
if (!this._preventClick) {
var t = this._layerControlInputs, n, a, c = [], d = [];
this._handlingClick = !0;
for (var p = t.length - 1; p >= 0; p--)
n = t[p], a = this._getLayer(n.layerId).layer, n.checked ? c.push(a) : n.checked || d.push(a);
for (p = 0; p < d.length; p++)
this._map.hasLayer(d[p]) && this._map.removeLayer(d[p]);
for (p = 0; p < c.length; p++)
this._map.hasLayer(c[p]) || this._map.addLayer(c[p]);
this._handlingClick = !1, this._refocusOnMap();
}
},
_checkDisabledLayers: function() {
for (var t = this._layerControlInputs, n, a, c = this._map.getZoom(), d = t.length - 1; d >= 0; d--)
n = t[d], a = this._getLayer(n.layerId).layer, n.disabled = a.options.minZoom !== void 0 && c < a.options.minZoom || a.options.maxZoom !== void 0 && c > a.options.maxZoom;
},
_expandIfNotCollapsed: function() {
return this._map && !this.options.collapsed && this.expand(), this;
},
_expandSafely: function() {
var t = this._section;
this._preventClick = !0, J(t, "click", Ht), this.expand();
var n = this;
setTimeout(function() {
wt(t, "click", Ht), n._preventClick = !1;
});
}
}), Yo = function(t, n, a) {
return new Or(t, n, a);
}, zs = me.extend({
// @section
// @aka Control.Zoom options
options: {
position: "topleft",
// @option zoomInText: String = '<span aria-hidden="true">+</span>'
// The text set on the 'zoom in' button.
zoomInText: '<span aria-hidden="true">+</span>',
// @option zoomInTitle: String = 'Zoom in'
// The title set on the 'zoom in' button.
zoomInTitle: "Zoom in",
// @option zoomOutText: String = '<span aria-hidden="true">−</span>'
// The text set on the 'zoom out' button.
zoomOutText: '<span aria-hidden="true">−</span>',
// @option zoomOutTitle: String = 'Zoom out'
// The title set on the 'zoom out' button.
zoomOutTitle: "Zoom out"
},
onAdd: function(t) {
var n = "leaflet-control-zoom", a = ct("div", n + " leaflet-bar"), c = this.options;
return this._zoomInButton = this._createButton(
c.zoomInText,
c.zoomInTitle,
n + "-in",
a,
this._zoomIn
), this._zoomOutButton = this._createButton(
c.zoomOutText,
c.zoomOutTitle,
n + "-out",
a,
this._zoomOut
), this._updateDisabled(), t.on("zoomend zoomlevelschange", this._updateDisabled, this), a;
},
onRemove: function(t) {
t.off("zoomend zoomlevelschange", this._updateDisabled, this);
},
disable: function() {
return this._disabled = !0, this._updateDisabled(), this;
},
enable: function() {
return this._disabled = !1, this._updateDisabled(), this;
},
_zoomIn: function(t) {
!this._disabled && this._map._zoom < this._map.getMaxZoom() && this._map.zoomIn(this._map.options.zoomDelta * (t.shiftKey ? 3 : 1));
},
_zoomOut: function(t) {
!this._disabled && this._map._zoom > this._map.getMinZoom() && this._map.zoomOut(this._map.options.zoomDelta * (t.shiftKey ? 3 : 1));
},
_createButton: function(t, n, a, c, d) {
var p = ct("a", a, c);
return p.innerHTML = t, p.href = "#", p.title = n, p.setAttribute("role", "button"), p.setAttribute("aria-label", n), rn(p), J(p, "click", si), J(p, "click", d, this), J(p, "click", this._refocusOnMap, this), p;
},
_updateDisabled: function() {
var t = this._map, n = "leaflet-disabled";
Ct(this._zoomInButton, n), Ct(this._zoomOutButton, n), this._zoomInButton.setAttribute("aria-disabled", "false"), this._zoomOutButton.setAttribute("aria-disabled", "false"), (this._disabled || t._zoom === t.getMinZoom()) && (Y(this._zoomOutButton, n), this._zoomOutButton.setAttribute("aria-disabled", "true")), (this._disabled || t._zoom === t.getMaxZoom()) && (Y(this._zoomInButton, n), this._zoomInButton.setAttribute("aria-disabled", "true"));
}
});
ot.mergeOptions({
zoomControl: !0
}), ot.addInitHook(function() {
this.options.zoomControl && (this.zoomControl = new zs(), this.addControl(this.zoomControl));
});
var th = function(t) {
return new zs(t);
}, kr = me.extend({
// @section
// @aka Control.Scale options
options: {
position: "bottomleft",
// @option maxWidth: Number = 100
// Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
maxWidth: 100,
// @option metric: Boolean = True
// Whether to show the metric scale line (m/km).
metric: !0,
// @option imperial: Boolean = True
// Whether to show the imperial scale line (mi/ft).
imperial: !0
// @option updateWhenIdle: Boolean = false
// If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)).
},
onAdd: function(t) {
var n = "leaflet-control-scale", a = ct("div", n), c = this.options;
return this._addScales(c, n + "-line", a), t.on(c.updateWhenIdle ? "moveend" : "move", this._update, this), t.whenReady(this._update, this), a;
},
onRemove: function(t) {
t.off(this.options.updateWhenIdle ? "moveend" : "move", this._update, this);
},
_addScales: function(t, n, a) {
t.metric && (this._mScale = ct("div", n, a)), t.imperial && (this._iScale = ct("div", n, a));
},
_update: function() {
var t = this._map, n = t.getSize().y / 2, a = t.distance(
t.containerPointToLatLng([0, n]),
t.containerPointToLatLng([this.options.maxWidth, n])
);
this._updateScales(a);
},
_updateScales: function(t) {
this.options.metric && t && this._updateMetric(t), this.options.imperial && t && this._updateImperial(t);
},
_updateMetric: function(t) {
var n = this._getRoundNum(t), a = n < 1e3 ? n + " m" : n / 1e3 + " km";
this._updateScale(this._mScale, a, n / t);
},
_updateImperial: function(t) {
var n = t * 3.2808399, a, c, d;
n > 5280 ? (a = n / 5280, c = this._getRoundNum(a), this._updateScale(this._iScale, c + " mi", c / a)) : (d = this._getRoundNum(n), this._updateScale(this._iScale, d + " ft", d / n));
},
_updateScale: function(t, n, a) {
t.style.width = Math.round(this.options.maxWidth * a) + "px", t.innerHTML = n;
},
_getRoundNum: function(t) {
var n = Math.pow(10, (Math.floor(t) + "").length - 1), a = t / n;
return a = a >= 10 ? 10 : a >= 5 ? 5 : a >= 3 ? 3 : a >= 2 ? 2 : 1, n * a;
}
}), eh = function(t) {
return new kr(t);
}, ih = '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>', Ds = me.extend({
// @section
// @aka Control.Attribution options
options: {
position: "bottomright",
// @option prefix: String|false = 'Leaflet'
// The HTML text shown before the attributions. Pass `false` to disable.
prefix: '<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">' + (W.inlineSvg ? ih + " " : "") + "Leaflet</a>"
},
initialize: function(t) {
x(this, t), this._attributions = {};
},
onAdd: function(t) {
t.attributionControl = this, this._container = ct("div", "leaflet-control-attribution"), rn(this._container);
for (var n in t._layers)
t._layers[n].getAttribution && this.addAttribution(t._layers[n].getAttribution());
return this._update(), t.on("layeradd", this._addAttribution, this), this._container;
},
onRemove: function(t) {
t.off("layeradd", this._addAttribution, this);
},
_addAttribution: function(t) {
t.layer.getAttribution && (this.addAttribution(t.layer.getAttribution()), t.layer.once("remove", function() {
this.removeAttribution(t.layer.getAttribution());
}, this));
},
// @method setPrefix(prefix: String|false): this
// The HTML text shown before the attributions. Pass `false` to disable.
setPrefix: function(t) {
return this.options.prefix = t, this._update(), this;
},
// @method addAttribution(text: String): this
// Adds an attribution text (e.g. `'© OpenStreetMap contributors'`).
addAttribution: function(t) {
return t ? (this._attributions[t] || (this._attributions[t] = 0), this._attributions[t]++, this._update(), this) : this;
},
// @method removeAttribution(text: String): this
// Removes an attribution text.
removeAttribution: function(t) {
return t ? (this._attributions[t] && (this._attributions[t]--, this._update()), this) : this;
},
_update: function() {
if (this._map) {
var t = [];
for (var n in this._attributions)
this._attributions[n] && t.push(n);
var a = [];
this.options.prefix && a.push(this.options.prefix), t.length && a.push(t.join(", ")), this._container.innerHTML = a.join(' <span aria-hidden="true">|</span> ');
}
}
});
ot.mergeOptions({
attributionControl: !0
}), ot.addInitHook(function() {
this.options.attributionControl && new Ds().addTo(this);
});
var nh = function(t) {
return new Ds(t);
};
me.Layers = Or, me.Zoom = zs, me.Scale = kr, me.Attribution = Ds, an.layers = Yo, an.zoom = th, an.scale = eh, an.attribution = nh;
var xe = Dt.extend({
initialize: function(t) {
this._map = t;
},
// @method enable(): this
// Enables the handler
enable: function() {
return this._enabled ? this : (this._enabled = !0, this.addHooks(), this);
},
// @method disable(): this
// Disables the handler
disable: function() {
return this._enabled ? (this._enabled = !1, this.removeHooks(), this) : this;
},
// @method enabled(): Boolean
// Returns `true` if the handler is enabled
enabled: function() {
return !!this._enabled;
}
// @section Extension methods
// Classes inheriting from `Handler` must implement the two following methods:
// @method addHooks()
// Called when the handler is enabled, should add event hooks.
// @method removeHooks()
// Called when the handler is disabled, should remove the event hooks added previously.
});
xe.addTo = function(t, n) {
return t.addHandler(n, this), this;
};
var sh = { Events: Gt }, Rr = W.touch ? "touchstart mousedown" : "mousedown", Ue = ae.extend({
options: {
// @section
// @aka Draggable options
// @option clickTolerance: Number = 3
// The max number of pixels a user can shift the mouse pointer during a click
// for it to be considered a valid click (as opposed to a mouse drag).
clickTolerance: 3
},
// @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options)
// Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default).
initialize: function(t, n, a, c) {
x(this, c), this._element = t, this._dragStartTarget = n || t, this._preventOutline = a;
},
// @method enable()
// Enables the dragging ability
enable: function() {
this._enabled || (J(this._dragStartTarget, Rr, this._onDown, this), this._enabled = !0);
},
// @method disable()
// Disables the dragging ability
disable: function() {
this._enabled && (Ue._dragging === this && this.finishDrag(!0), wt(this._dragStartTarget, Rr, this._onDown, this), this._enabled = !1, this._moved = !1);
},
_onDown: function(t) {
if (this._enabled && (this._moved = !1, !Es(this._element, "leaflet-zoom-anim"))) {
if (t.touches && t.touches.length !== 1) {
Ue._dragging === this && this.finishDrag();
return;
}
if (!(Ue._dragging || t.shiftKey || t.which !== 1 && t.button !== 1 && !t.touches) && (Ue._dragging = this, this._preventOutline && Ts(this._element), As(), en(), !this._moving)) {
this.fire("down");
var n = t.touches ? t.touches[0] : t, a = Lr(this._element);
this._startPoint = new P(n.clientX, n.clientY), this._startPos = ii(this._element), this._parentScale = Ns(a);
var c = t.type === "mousedown";
J(document, c ? "mousemove" : "touchmove", this._onMove, this), J(document, c ? "mouseup" : "touchend touchcancel", this._onUp, this);
}
}
},
_onMove: function(t) {
if (this._enabled) {
if (t.touches && t.touches.length > 1) {
this._moved = !0;
return;
}
var n = t.touches && t.touches.length === 1 ? t.touches[0] : t, a = new P(n.clientX, n.clientY)._subtract(this._startPoint);
!a.x && !a.y || Math.abs(a.x) + Math.abs(a.y) < this.options.clickTolerance || (a.x /= this._parentScale.x, a.y /= this._parentScale.y, Ht(t), this._moved || (this.fire("dragstart"), this._moved = !0, Y(document.body, "leaflet-dragging"), this._lastTarget = t.target || t.srcElement, window.SVGElementInstance && this._lastTarget instanceof window.SVGElementInstance && (this._lastTarget = this._lastTarget.correspondingUseElement), Y(this._lastTarget, "leaflet-drag-target")), this._newPos = this._startPos.add(a), this._moving = !0, this._lastEvent = t, this._updatePosition());
}
},
_updatePosition: function() {
var t = { originalEvent: this._lastEvent };
this.fire("predrag", t), Ot(this._element, this._newPos), this.fire("drag", t);
},
_onUp: function() {
this._enabled && this.finishDrag();
},
finishDrag: function(t) {
Ct(document.body, "leaflet-dragging"), this._lastTarget && (Ct(this._lastTarget, "leaflet-drag-target"), this._lastTarget = null), wt(document, "mousemove touchmove", this._onMove, this), wt(document, "mouseup touchend touchcancel", this._onUp, this), Ls(), nn();
var n = this._moved && this._moving;
this._moving = !1, Ue._dragging = !1, n && this.fire("dragend", {
noInertia: t,
distance: this._newPos.distanceTo(this._startPos)
});
}
});
function zr(t, n, a) {
var c, d = [1, 4, 2, 8], p, y, b, S, I, q, V, st;
for (p = 0, q = t.length; p < q; p++)
t[p]._code = ri(t[p], n);
for (b = 0; b < 4; b++) {
for (V = d[b], c = [], p = 0, q = t.length, y = q - 1; p < q; y = p++)
S = t[p], I = t[y], S._code & V ? I._code & V || (st = jn(I, S, V, n, a), st._code = ri(st, n), c.push(st)) : (I._code & V && (st = jn(I, S, V, n, a), st._code = ri(st, n), c.push(st)), c.push(S));
t = c;
}
return t;
}
function Dr(t, n) {
var a, c, d, p, y, b, S, I, q;
if (!t || t.length === 0)
throw new Error("latlngs not passed");
fe(t) || (console.warn("latlngs are not flat! Only the first ring will be used"), t = t[0]);
var V = H([0, 0]), st = R(t), Vt = st.getNorthWest().distanceTo(st.getSouthWest()) * st.getNorthEast().distanceTo(st.getNorthWest());
Vt < 1700 && (V = Bs(t));
var Ut = t.length, de = [];
for (a = 0; a < Ut; a++) {
var te = H(t[a]);
de.push(n.project(H([te.lat - V.lat, te.lng - V.lng])));
}
for (b = S = I = 0, a = 0, c = Ut - 1; a < Ut; c = a++)
d = de[a], p = de[c], y = d.y * p.x - p.y * d.x, S += (d.x + p.x) * y, I += (d.y + p.y) * y, b += y * 3;
b === 0 ? q = de[0] : q = [S / b, I / b];
var Ci = n.unproject(T(q));
return H([Ci.lat + V.lat, Ci.lng + V.lng]);
}
function Bs(t) {
for (var n = 0, a = 0, c = 0, d = 0; d < t.length; d++) {
var p = H(t[d]);
n += p.lat, a += p.lng, c++;
}
return H([n / c, a / c]);
}
var rh = {
__proto__: null,
clipPolygon: zr,
polygonCenter: Dr,
centroid: Bs
};
function Br(t, n) {
if (!n || !t.length)
return t.slice();
var a = n * n;
return t = hh(t, a), t = oh(t, a), t;
}
function Ur(t, n, a) {
return Math.sqrt(on(t, n, a, !0));
}
function ah(t, n, a) {
return on(t, n, a);
}
function oh(t, n) {
var a = t.length, c = typeof Uint8Array != void 0 + "" ? Uint8Array : Array, d = new c(a);
d[0] = d[a - 1] = 1, Us(t, d, n, 0, a - 1);
var p, y = [];
for (p = 0; p < a; p++)
d[p] && y.push(t[p]);
return y;
}
function Us(t, n, a, c, d) {
var p = 0, y, b, S;
for (b = c + 1; b <= d - 1; b++)
S = on(t[b], t[c], t[d], !0), S > p && (y = b, p = S);
p > a && (n[y] = 1, Us(t, n, a, c, y), Us(t, n, a, y, d));
}
function hh(t, n) {
for (var a = [t[0]], c = 1, d = 0, p = t.length; c < p; c++)
lh(t[c], t[d]) > n && (a.push(t[c]), d = c);
return d < p - 1 && a.push(t[p - 1]), a;
}
var Zr;
function qr(t, n, a, c, d) {
var p = c ? Zr : ri(t, a), y = ri(n, a), b, S, I;
for (Zr = y; ; ) {
if (!(p | y))
return [t, n];
if (p & y)
return !1;
b = p || y, S = jn(t, n, b, a, d), I = ri(S, a), b === p ? (t = S, p = I) : (n = S, y = I);
}
}
function jn(t, n, a, c, d) {
var p = n.x - t.x, y = n.y - t.y, b = c.min, S = c.max, I, q;
return a & 8 ? (I = t.x + p * (S.y - t.y) / y, q = S.y) : a & 4 ? (I = t.x + p * (b.y - t.y) / y, q = b.y) : a & 2 ? (I = S.x, q = t.y + y * (S.x - t.x) / p) : a & 1 && (I = b.x, q = t.y + y * (b.x - t.x) / p), new P(I, q, d);
}
function ri(t, n) {
var a = 0;
return t.x < n.min.x ? a |= 1 : t.x > n.max.x && (a |= 2), t.y < n.min.y ? a |= 4 : t.y > n.max.y && (a |= 8), a;
}
function lh(t, n) {
var a = n.x - t.x, c = n.y - t.y;
return a * a + c * c;
}
function on(t, n, a, c) {
var d = n.x, p = n.y, y = a.x - d, b = a.y - p, S = y * y + b * b, I;
return S > 0 && (I = ((t.x - d) * y + (t.y - p) * b) / S, I > 1 ? (d = a.x, p = a.y) : I > 0 && (d += y * I, p += b * I)), y = t.x - d, b = t.y - p, c ? y * y + b * b : new P(d, p);
}
function fe(t) {
return !$(t[0]) || typeof t[0][0] != "object" && typeof t[0][0] < "u";
}
function $r(t) {
return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."), fe(t);
}
function Fr(t, n) {
var a, c, d, p, y, b, S, I;
if (!t || t.length === 0)
throw new Error("latlngs not passed");
fe(t) || (console.warn("latlngs are not flat! Only the first ring will be used"), t = t[0]);
var q = H([0, 0]), V = R(t), st = V.getNorthWest().distanceTo(V.getSouthWest()) * V.getNorthEast().distanceTo(V.getNorthWest());
st < 1700 && (q = Bs(t));
var Vt = t.length, Ut = [];
for (a = 0; a < Vt; a++) {
var de = H(t[a]);
Ut.push(n.project(H([de.lat - q.lat, de.lng - q.lng])));
}
for (a = 0, c = 0; a < Vt - 1; a++)
c += Ut[a].distanceTo(Ut[a + 1]) / 2;
if (c === 0)
I = Ut[0];
else
for (a = 0, p = 0; a < Vt - 1; a++)
if (y = Ut[a], b = Ut[a + 1], d = y.distanceTo(b), p += d, p > c) {
S = (p - c) / d, I = [
b.x - S * (b.x - y.x),
b.y - S * (b.y - y.y)
];
break;
}
var te = n.unproject(T(I));
return H([te.lat + q.lat, te.lng + q.lng]);
}
var ch = {
__proto__: null,
simplify: Br,
pointToSegmentDistance: Ur,
closestPointOnSegment: ah,
clipSegment: qr,
_getEdgeIntersection: jn,
_getBitCode: ri,
_sqClosestPointOnSegment: on,
isFlat: fe,
_flat: $r,
polylineCenter: Fr
}, Zs = {
project: function(t) {
return new P(t.lng, t.lat);
},
unproject: function(t) {
return new F(t.y, t.x);
},
bounds: new G([-180, -90], [180, 90])
}, qs = {
R: 6378137,
R_MINOR: 6356752314245179e-9,
bounds: new G([-2003750834279e-5, -1549657073972e-5], [2003750834279e-5, 1876465623138e-5]),
project: function(t) {
var n = Math.PI / 180, a = this.R, c = t.lat * n, d = this.R_MINOR / a, p = Math.sqrt(1 - d * d), y = p * Math.sin(c), b = Math.tan(Math.PI / 4 - c / 2) / Math.pow((1 - y) / (1 + y), p / 2);
return c = -a * Math.log(Math.max(b, 1e-10)), new P(t.lng * n * a, c);
},
unproject: function(t) {
for (var n = 180 / Math.PI, a = this.R, c = this.R_MINOR / a, d = Math.sqrt(1 - c * c), p = Math.exp(-t.y / a), y = Math.PI / 2 - 2 * Math.atan(p), b = 0, S = 0.1, I; b < 15 && Math.abs(S) > 1e-7; b++)
I = d * Math.sin(y), I = Math.pow((1 - I) / (1 + I), d / 2), S = Math.PI / 2 - 2 * Math.atan(p * I) - y, y += S;
return new F(y * n, t.x * n / a);
}
}, uh = {
__proto__: null,
LonLat: Zs,
Mercator: qs,
SphericalMercator: tt
}, fh = o({}, it, {
code: "EPSG:3395",
projection: qs,
transformation: function() {
var t = 0.5 / (Math.PI * qs.R);
return z(t, 0.5, -t, 0.5);
}()
}), Hr = o({}, it, {
code: "EPSG:4326",
projection: Zs,
transformation: z(1 / 180, 1, -1 / 180, 0.5)
}), dh = o({}, K, {
projection: Zs,
transformation: z(1, 0, -1, 0),
scale: function(t) {
return Math.pow(2, t);
},
zoom: function(t) {
return Math.log(t) / Math.LN2;
},
distance: function(t, n) {
var a = n.lng - t.lng, c = n.lat - t.lat;
return Math.sqrt(a * a + c * c);
},
infinite: !0
});
K.Earth = it, K.EPSG3395 = fh, K.EPSG3857 = X, K.EPSG900913 = ht, K.EPSG4326 = Hr, K.Simple = dh;
var ge = ae.extend({
// Classes extending `L.Layer` will inherit the following options:
options: {
// @option pane: String = 'overlayPane'
// By default the layer will be added to the map's [overlay pane](#map-overlaypane). Overriding this option will cause the layer to be placed on another pane by default.
pane: "overlayPane",
// @option attribution: String = null
// String to be shown in the attribution control, e.g. "© OpenStreetMap contributors". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.
attribution: null,
bubblingMouseEvents: !0
},
/* @section
* Classes extending `L.Layer` will inherit the following methods:
*
* @method addTo(map: Map|LayerGroup): this
* Adds the layer to the given map or layer group.
*/
addTo: function(t) {
return t.addLayer(this), this;
},
// @method remove: this
// Removes the layer from the map it is currently active on.
remove: function() {
return this.removeFrom(this._map || this._mapToAdd);
},
// @method removeFrom(map: Map): this
// Removes the layer from the given map
//
// @alternative
// @method removeFrom(group: LayerGroup): this
// Removes the layer from the given `LayerGroup`
removeFrom: function(t) {
return t && t.removeLayer(this), this;
},
// @method getPane(name? : String): HTMLElement
// Returns the `HTMLElement` representing the named pane on the map. If `name` is omitted, returns the pane for this layer.
getPane: function(t) {
return this._map.getPane(t ? this.options[t] || t : this.options.pane);
},
addInteractiveTarget: function(t) {
return this._map._targets[f(t)] = this, this;
},
removeInteractiveTarget: function(t) {
return delete this._map._targets[f(t)], this;
},
// @method getAttribution: String
// Used by the `attribution control`, returns the [attribution option](#gridlayer-attribution).
getAttribution: function() {
return this.options.attribution;
},
_layerAdd: function(t) {
var n = t.target;
if (n.hasLayer(this)) {
if (this._map = n, this._zoomAnimated = n._zoomAnimated, this.getEvents) {
var a = this.getEvents();
n.on(a, this), this.once("remove", function() {
n.off(a, this);
}, this);
}
this.onAdd(n), this.fire("add"), n.fire("layeradd", { layer: this });
}
}
});
ot.include({
// @method addLayer(layer: Layer): this
// Adds the given layer to the map
addLayer: function(t) {
if (!t._layerAdd)
throw new Error("The provided object is not a Layer.");
var n = f(t);
return this._layers[n] ? this : (this._layers[n] = t, t._mapToAdd = this, t.beforeAdd && t.beforeAdd(this), this.whenReady(t._layerAdd, t), this);
},
// @method removeLayer(layer: Layer): this
// Removes the given layer from the map.
removeLayer: function(t) {
var n = f(t);
return this._layers[n] ? (this._loaded && t.onRemove(this), delete this._layers[n], this._loaded && (this.fire("layerremove", { layer: t }), t.fire("remove")), t._map = t._mapToAdd = null, this) : this;
},
// @method hasLayer(layer: Layer): Boolean
// Returns `true` if the given layer is currently added to the map
hasLayer: function(t) {
return f(t) in this._layers;
},
/* @method eachLayer(fn: Function, context?: Object): this
* Iterates over the layers of the map, optionally specifying context of the iterator function.
* ```
* map.eachLayer(function(layer){
* layer.bindPopup('Hello');
* });
* ```
*/
eachLayer: function(t, n) {
for (var a in this._layers)
t.call(n, this._layers[a]);
return this;
},
_addLayers: function(t) {
t = t ? $(t) ? t : [t] : [];
for (var n = 0, a = t.length; n < a; n++)
this.addLayer(t[n]);
},
_addZoomLimit: function(t) {
(!isNaN(t.options.maxZoom) || !isNaN(t.options.minZoom)) && (this._zoomBoundLayers[f(t)] = t, this._updateZoomLevels());
},
_removeZoomLimit: function(t) {
var n = f(t);
this._zoomBoundLayers[n] && (delete this._zoomBoundLayers[n], this._updateZoomLevels());
},
_updateZoomLevels: function() {
var t = 1 / 0, n = -1 / 0, a = this._getZoomSpan();
for (var c in this._zoomBoundLayers) {
var d = this._zoomBoundLayers[c].options;
t = d.minZoom === void 0 ? t : Math.min(t, d.minZoom), n = d.maxZoom === void 0 ? n : Math.max(n, d.maxZoom);
}
this._layersMaxZoom = n === -1 / 0 ? void 0 : n, this._layersMinZoom = t === 1 / 0 ? void 0 : t, a !== this._getZoomSpan() && this.fire("zoomlevelschange"), this.options.maxZoom === void 0 && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom && this.setZoom(this._layersMaxZoom), this.options.minZoom === void 0 && this._layersMinZoom && this.getZoom() < this._layersMinZoom && this.setZoom(this._layersMinZoom);
}
});
var Ei = ge.extend({
initialize: function(t, n) {
x(this, n), this._layers = {};
var a, c;
if (t)
for (a = 0, c = t.length; a < c; a++)
this.addLayer(t[a]);
},
// @method addLayer(layer: Layer): this
// Adds the given layer to the group.
addLayer: function(t) {
var n = this.getLayerId(t);
return this._layers[n] = t, this._map && this._map.addLayer(t), this;
},
// @method removeLayer(layer: Layer): this
// Removes the given layer from the group.
// @alternative
// @method removeLayer(id: Number): this
// Removes the layer with the given internal ID from the group.
removeLayer: function(t) {
var n = t in this._layers ? t : this.getLayerId(t);
return this._map && this._layers[n] && this._map.removeLayer(this._layers[n]), delete this._layers[n], this;
},
// @method hasLayer(layer: Layer): Boolean
// Returns `true` if the given layer is currently added to the group.
// @alternative
// @method hasLayer(id: Number): Boolean
// Returns `true` if the given internal ID is currently added to the group.
hasLayer: function(t) {
var n = typeof t == "number" ? t : this.getLayerId(t);
return n in this._layers;
},
// @method clearLayers(): this
// Removes all the layers from the group.
clearLayers: function() {
return this.eachLayer(this.removeLayer, this);
},
// @method invoke(methodName: String, …): this
// Calls `methodName` on every layer contained in this group, passing any
// additional parameters. Has no effect if the layers contained do not
// implement `methodName`.
invoke: function(t) {
var n = Array.prototype.slice.call(arguments, 1), a, c;
for (a in this._layers)
c = this._layers[a], c[t] && c[t].apply(c, n);
return this;
},
onAdd: function(t) {
this.eachLayer(t.addLayer, t);
},
onRemove: function(t) {
this.eachLayer(t.removeLayer, t);
},
// @method eachLayer(fn: Function, context?: Object): this
// Iterates over the layers of the group, optionally specifying context of the iterator function.
// ```js
// group.eachLayer(function (layer) {
// layer.bindPopup('Hello');
// });
// ```
eachLayer: function(t, n) {
for (var a in this._layers)
t.call(n, this._layers[a]);
return this;
},
// @method getLayer(id: Number): Layer
// Returns the layer with the given internal ID.
getLayer: function(t) {
return this._layers[t];
},
// @method getLayers(): Layer[]
// Returns an array of all the layers added to the group.
getLayers: function() {
var t = [];
return this.eachLayer(t.push, t), t;
},
// @method setZIndex(zIndex: Number): this
// Calls `setZIndex` on every layer contained in this group, passing the z-index.
setZIndex: function(t) {
return this.invoke("setZIndex", t);
},
// @method getLayerId(layer: Layer): Number
// Returns the internal ID for a layer
getLayerId: function(t) {
return f(t);
}
}), _h = function(t, n) {
return new Ei(t, n);
}, Ce = Ei.extend({
addLayer: function(t) {
return this.hasLayer(t) ? this : (t.addEventParent(this), Ei.prototype.addLayer.call(this, t), this.fire("layeradd", { layer: t }));
},
removeLayer: function(t) {
return this.hasLayer(t) ? (t in this._layers && (t = this._layers[t]), t.removeEventParent(this), Ei.prototype.removeLayer.call(this, t), this.fire("layerremove", { layer: t })) : this;
},
// @method setStyle(style: Path options): this
// Sets the given path options to each layer of the group that has a `setStyle` method.
setStyle: function(t) {
return this.invoke("setStyle", t);
},
// @method bringToFront(): this
// Brings the layer group to the top of all other layers
bringToFront: function() {
return this.invoke("bringToFront");
},
// @method bringToBack(): this
// Brings the layer group to the back of all other layers
bringToBack: function() {
return this.invoke("bringToBack");
},
// @method getBounds(): LatLngBounds
// Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).
getBounds: function() {
var t = new N();
for (var n in this._layers) {
var a = this._layers[n];
t.extend(a.getBounds ? a.getBounds() : a.getLatLng());
}
return t;
}
}), ph = function(t, n) {
return new Ce(t, n);
}, Pi = Dt.extend({
/* @section
* @aka Icon options
*
* @option iconUrl: String = null
* **(required)** The URL to the icon image (absolute or relative to your script path).
*
* @option iconRetinaUrl: String = null
* The URL to a retina sized version of the icon image (absolute or relative to your
* script path). Used for Retina screen devices.
*
* @option iconSize: Point = null
* Size of the icon image in pixels.
*
* @option iconAnchor: Point = null
* The coordinates of the "tip" of the icon (relative to its top left corner). The icon
* will be aligned so that this point is at the marker's geographical location. Centered
* by default if size is specified, also can be set in CSS with negative margins.
*
* @option popupAnchor: Point = [0, 0]
* The coordinates of the point from which popups will "open", relative to the icon anchor.
*
* @option tooltipAnchor: Point = [0, 0]
* The coordinates of the point from which tooltips will "open", relative to the icon anchor.
*
* @option shadowUrl: String = null
* The URL to the icon shadow image. If not specified, no shadow image will be created.
*
* @option shadowRetinaUrl: String = null
*
* @option shadowSize: Point = null
* Size of the shadow image in pixels.
*
* @option shadowAnchor: Point = null
* The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
* as iconAnchor if not specified).
*
* @option className: String = ''
* A custom class name to assign to both icon and shadow images. Empty by default.
*/
options: {
popupAnchor: [0, 0],
tooltipAnchor: [0, 0],
// @option crossOrigin: Boolean|String = false
// Whether the crossOrigin attribute will be added to the tiles.
// If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.
crossOrigin: !1
},
initialize: function(t) {
x(this, t);
},
// @method createIcon(oldIcon?: HTMLElement): HTMLElement
// Called internally when the icon has to be shown, returns a `<img>` HTML element
// styled according to the options.
createIcon: function(t) {
return this._createIcon("icon", t);
},
// @method createShadow(oldIcon?: HTMLElement): HTMLElement
// As `createIcon`, but for the shadow beneath it.
createShadow: function(t) {
return this._createIcon("shadow", t);
},
_createIcon: function(t, n) {
var a = this._getIconUrl(t);
if (!a) {
if (t === "icon")
throw new Error("iconUrl not set in Icon options (see the docs).");
return null;
}
var c = this._createImg(a, n && n.tagName === "IMG" ? n : null);
return this._setIconStyles(c, t), (this.options.crossOrigin || this.options.crossOrigin === "") && (c.crossOrigin = this.options.crossOrigin === !0 ? "" : this.options.crossOrigin), c;
},
_setIconStyles: function(t, n) {
var a = this.options, c = a[n + "Size"];
typeof c == "number" && (c = [c, c]);
var d = T(c), p = T(n === "shadow" && a.shadowAnchor || a.iconAnchor || d && d.divideBy(2, !0));
t.className = "leaflet-marker-" + n + " " + (a.className || ""), p && (t.style.marginLeft = -p.x + "px", t.style.marginTop = -p.y + "px"), d && (t.style.width = d.x + "px", t.style.height = d.y + "px");
},
_createImg: function(t, n) {
return n = n || document.createElement("img"), n.src = t, n;
},
_getIconUrl: function(t) {
return W.retina && this.options[t + "RetinaUrl"] || this.options[t + "Url"];
}
});
function mh(t) {
return new Pi(t);
}
var hn = Pi.extend({
options: {
iconUrl: "marker-icon.png",
iconRetinaUrl: "marker-icon-2x.png",
shadowUrl: "marker-shadow.png",
iconSize: [25, 41],
iconAnchor: [12, 41],
popupAnchor: [1, -34],
tooltipAnchor: [16, -28],
shadowSize: [41, 41]
},
_getIconUrl: function(t) {
return typeof hn.imagePath != "string" && (hn.imagePath = this._detectIconPath()), (this.options.imagePath || hn.imagePath) + Pi.prototype._getIconUrl.call(this, t);
},
_stripUrl: function(t) {
var n = function(a, c, d) {
var p = c.exec(a);
return p && p[d];
};
return t = n(t, /^url\((['"])?(.+)\1\)$/, 2), t && n(t, /^(.*)marker-icon\.png$/, 1);
},
_detectIconPath: function() {
var t = ct("div", "leaflet-default-icon-path", document.body), n = tn(t, "background-image") || tn(t, "backgroundImage");
if (document.body.removeChild(t), n = this._stripUrl(n), n)
return n;
var a = document.querySelector('link[href$="leaflet.css"]');
return a ? a.href.substring(0, a.href.length - 11 - 1) : "";
}
}), Wr = xe.extend({
initialize: function(t) {
this._marker = t;
},
addHooks: function() {
var t = this._marker._icon;
this._draggable || (this._draggable = new Ue(t, t, !0)), this._draggable.on({
dragstart: this._onDragStart,
predrag: this._onPreDrag,
drag: this._onDrag,
dragend: this._onDragEnd
}, this).enable(), Y(t, "leaflet-marker-draggable");
},
removeHooks: function() {
this._draggable.off({
dragstart: this._onDragStart,
predrag: this._onPreDrag,
drag: this._onDrag,
dragend: this._onDragEnd
}, this).disable(), this._marker._icon && Ct(this._marker._icon, "leaflet-marker-draggable");
},
moved: function() {
return this._draggable && this._draggable._moved;
},
_adjustPan: function(t) {
var n = this._marker, a = n._map, c = this._marker.options.autoPanSpeed, d = this._marker.options.autoPanPadding, p = ii(n._icon), y = a.getPixelBounds(), b = a.getPixelOrigin(), S = A(
y.min._subtract(b).add(d),
y.max._subtract(b).subtract(d)
);
if (!S.contains(p)) {
var I = T(
(Math.max(S.max.x, p.x) - S.max.x) / (y.max.x - S.max.x) - (Math.min(S.min.x, p.x) - S.min.x) / (y.min.x - S.min.x),
(Math.max(S.max.y, p.y) - S.max.y) / (y.max.y - S.max.y) - (Math.min(S.min.y, p.y) - S.min.y) / (y.min.y - S.min.y)
).multiplyBy(c);
a.panBy(I, { animate: !1 }), this._draggable._newPos._add(I), this._draggable._startPos._add(I), Ot(n._icon, this._draggable._newPos), this._onDrag(t), this._panRequest = gt(this._adjustPan.bind(this, t));
}
},
_onDragStart: function() {
this._oldLatLng = this._marker.getLatLng(), this._marker.closePopup && this._marker.closePopup(), this._marker.fire("movestart").fire("dragstart");
},
_onPreDrag: function(t) {
this._marker.options.autoPan && (bt(this._panRequest), this._panRequest = gt(this._adjustPan.bind(this, t)));
},
_onDrag: function(t) {
var n = this._marker, a = n._shadow, c = ii(n._icon), d = n._map.layerPointToLatLng(c);
a && Ot(a, c), n._latlng = d, t.latlng = d, t.oldLatLng = this._oldLatLng, n.fire("move", t).fire("drag", t);
},
_onDragEnd: function(t) {
bt(this._panRequest), delete this._oldLatLng, this._marker.fire("moveend").fire("dragend", t);
}
}), Kn = ge.extend({
// @section
// @aka Marker options
options: {
// @option icon: Icon = *
// Icon instance to use for rendering the marker.
// See [Icon documentation](#L.Icon) for details on how to customize the marker icon.
// If not specified, a common instance of `L.Icon.Default` is used.
icon: new hn(),
// Option inherited from "Interactive layer" abstract class
interactive: !0,
// @option keyboard: Boolean = true
// Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.
keyboard: !0,
// @option title: String = ''
// Text for the browser tooltip that appear on marker hover (no tooltip by default).
// [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled).
title: "",
// @option alt: String = 'Marker'
// Text for the `alt` attribute of the icon image.
// [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled).
alt: "Marker",
// @option zIndexOffset: Number = 0
// By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like `1000` (or high negative value, respectively).
zIndexOffset: 0,
// @option opacity: Number = 1.0
// The opacity of the marker.
opacity: 1,
// @option riseOnHover: Boolean = false
// If `true`, the marker will get on top of others when you hover the mouse over it.
riseOnHover: !1,
// @option riseOffset: Number = 250
// The z-index offset used for the `riseOnHover` feature.
riseOffset: 250,
// @option pane: String = 'markerPane'
// `Map pane` where the markers icon will be added.
pane: "markerPane",
// @option shadowPane: String = 'shadowPane'
// `Map pane` where the markers shadow will be added.
shadowPane: "shadowPane",
// @option bubblingMouseEvents: Boolean = false
// When `true`, a mouse event on this marker will trigger the same event on the map
// (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).
bubblingMouseEvents: !1,
// @option autoPanOnFocus: Boolean = true
// When `true`, the map will pan whenever the marker is focused (via
// e.g. pressing `tab` on the keyboard) to ensure the marker is
// visible within the map's bounds
autoPanOnFocus: !0,
// @section Draggable marker options
// @option draggable: Boolean = false
// Whether the marker is draggable with mouse/touch or not.
draggable: !1,
// @option autoPan: Boolean = false
// Whether to pan the map when dragging this marker near its edge or not.
autoPan: !1,
// @option autoPanPadding: Point = Point(50, 50)
// Distance (in pixels to the left/right and to the top/bottom) of the
// map edge to start panning the map.
autoPanPadding: [50, 50],
// @option autoPanSpeed: Number = 10
// Number of pixels the map should pan by.
autoPanSpeed: 10
},
/* @section
*
* In addition to [shared layer methods](#Layer) like `addTo()` and `remove()` and [popup methods](#Popup) like bindPopup() you can also use the following methods:
*/
initialize: function(t, n) {
x(this, n), this._latlng = H(t);
},
onAdd: function(t) {
this._zoomAnimated = this._zoomAnimated && t.options.markerZoomAnimation, this._zoomAnimated && t.on("zoomanim", this._animateZoom, this), this._initIcon(), this.update();
},
onRemove: function(t) {
this.dragging && this.dragging.enabled() && (this.options.draggable = !0, this.dragging.removeHooks()), delete this.dragging, this._zoomAnimated && t.off("zoomanim", this._animateZoom, this), this._removeIcon(), this._removeShadow();
},
getEvents: function() {
return {
zoom: this.update,
viewreset: this.update
};
},
// @method getLatLng: LatLng
// Returns the current geographical position of the marker.
getLatLng: function() {
return this._latlng;
},
// @method setLatLng(latlng: LatLng): this
// Changes the marker position to the given point.
setLatLng: function(t) {
var n = this._latlng;
return this._latlng = H(t), this.update(), this.fire("move", { oldLatLng: n, latlng: this._latlng });
},
// @method setZIndexOffset(offset: Number): this
// Changes the [zIndex offset](#marker-zindexoffset) of the marker.
setZIndexOffset: function(t) {
return this.options.zIndexOffset = t, this.update();
},
// @method getIcon: Icon
// Returns the current icon used by the marker
getIcon: function() {
return this.options.icon;
},
// @method setIcon(icon: Icon): this
// Changes the marker icon.
setIcon: function(t) {
return this.options.icon = t, this._map && (this._initIcon(), this.update()), this._popup && this.bindPopup(this._popup, this._popup.options), this;
},
getElement: function() {
return this._icon;
},
update: function() {
if (this._icon && this._map) {
var t = this._map.latLngToLayerPoint(this._latlng).round();
this._setPos(t);
}
return this;
},
_initIcon: function() {
var t = this.options, n = "leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide"), a = t.icon.createIcon(this._icon), c = !1;
a !== this._icon && (this._icon && this._removeIcon(), c = !0, t.title && (a.title = t.title), a.tagName === "IMG" && (a.alt = t.alt || "")), Y(a, n), t.keyboard && (a.tabIndex = "0", a.setAttribute("role", "button")), this._icon = a, t.riseOnHover && this.on({
mouseover: this._bringToFront,
mouseout: this._resetZIndex
}), this.options.autoPanOnFocus && J(a, "focus", this._panOnFocus, this);
var d = t.icon.createShadow(this._shadow), p = !1;
d !== this._shadow && (this._removeShadow(), p = !0), d && (Y(d, n), d.alt = ""), this._shadow = d, t.opacity < 1 && this._updateOpacity(), c && this.getPane().appendChild(this._icon), this._initInteraction(), d && p && this.getPane(t.shadowPane).appendChild(this._shadow);
},
_removeIcon: function() {
this.options.riseOnHover && this.off({
mouseover: this._bringToFront,
mouseout: this._resetZIndex
}), this.options.autoPanOnFocus && wt(this._icon, "focus", this._panOnFocus, this), Et(this._icon), this.removeInteractiveTarget(this._icon), this._icon = null;
},
_removeShadow: function() {
this._shadow && Et(this._shadow), this._shadow = null;
},
_setPos: function(t) {
this._icon && Ot(this._icon, t), this._shadow && Ot(this._shadow, t), this._zIndex = t.y + this.options.zIndexOffset, this._resetZIndex();
},
_updateZIndex: function(t) {
this._icon && (this._icon.style.zIndex = this._zIndex + t);
},
_animateZoom: function(t) {
var n = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center).round();
this._setPos(n);
},
_initInteraction: function() {
if (this.options.interactive && (Y(this._icon, "leaflet-interactive"), this.addInteractiveTarget(this._icon), Wr)) {
var t = this.options.draggable;
this.dragging && (t = this.dragging.enabled(), this.dragging.disable()), this.dragging = new Wr(this), t && this.dragging.enable();
}
},
// @method setOpacity(opacity: Number): this
// Changes the opacity of the marker.
setOpacity: function(t) {
return this.options.opacity = t, this._map && this._updateOpacity(), this;
},
_updateOpacity: function() {
var t = this.options.opacity;
this._icon && ue(this._icon, t), this._shadow && ue(this._shadow, t);
},
_bringToFront: function() {
this._updateZIndex(this.options.riseOffset);
},
_resetZIndex: function() {
this._updateZIndex(0);
},
_panOnFocus: function() {
var t = this._map;
if (t) {
var n = this.options.icon.options, a = n.iconSize ? T(n.iconSize) : T(0, 0), c = n.iconAnchor ? T(n.iconAnchor) : T(0, 0);
t.panInside(this._latlng, {
paddingTopLeft: c,
paddingBottomRight: a.subtract(c)
});
}
},
_getPopupAnchor: function() {
return this.options.icon.options.popupAnchor;
},
_getTooltipAnchor: function() {
return this.options.icon.options.tooltipAnchor;
}
});
function gh(t, n) {
return new Kn(t, n);
}
var Ze = ge.extend({
// @section
// @aka Path options
options: {
// @option stroke: Boolean = true
// Whether to draw stroke along the path. Set it to `false` to disable borders on polygons or circles.
stroke: !0,
// @option color: String = '#3388ff'
// Stroke color
color: "#3388ff",
// @option weight: Number = 3
// Stroke width in pixels
weight: 3,
// @option opacity: Number = 1.0
// Stroke opacity
opacity: 1,
// @option lineCap: String= 'round'
// A string that defines [shape to be used at the end](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap) of the stroke.
lineCap: "round",
// @option lineJoin: String = 'round'
// A string that defines [shape to be used at the corners](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin) of the stroke.
lineJoin: "round",
// @option dashArray: String = null
// A string that defines the stroke [dash pattern](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).
dashArray: null,
// @option dashOffset: String = null
// A string that defines the [distance into the dash pattern to start the dash](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).
dashOffset: null,
// @option fill: Boolean = depends
// Whether to fill the path with color. Set it to `false` to disable filling on polygons or circles.
fill: !1,
// @option fillColor: String = *
// Fill color. Defaults to the value of the [`color`](#path-color) option
fillColor: null,
// @option fillOpacity: Number = 0.2
// Fill opacity.
fillOpacity: 0.2,
// @option fillRule: String = 'evenodd'
// A string that defines [how the inside of a shape](https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule) is determined.
fillRule: "evenodd",
// className: '',
// Option inherited from "Interactive layer" abstract class
interactive: !0,
// @option bubblingMouseEvents: Boolean = true
// When `true`, a mouse event on this path will trigger the same event on the map
// (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).
bubblingMouseEvents: !0
},
beforeAdd: function(t) {
this._renderer = t.getRenderer(this);
},
onAdd: function() {
this._renderer._initPath(this), this._reset(), this._renderer._addPath(this);
},
onRemove: function() {
this._renderer._removePath(this);
},
// @method redraw(): this
// Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
redraw: function() {
return this._map && this._renderer._updatePath(this), this;
},
// @method setStyle(style: Path options): this
// Changes the appearance of a Path based on the options in the `Path options` object.
setStyle: function(t) {
return x(this, t), this._renderer && (this._renderer._updateStyle(this), this.options.stroke && t && Object.prototype.hasOwnProperty.call(t, "weight") && this._updateBounds()), this;
},
// @method bringToFront(): this
// Brings the layer to the top of all path layers.
bringToFront: function() {
return this._renderer && this._renderer._bringToFront(this), this;
},
// @method bringToBack(): this
// Brings the layer to the bottom of all path layers.
bringToBack: function() {
return this._renderer && this._renderer._bringToBack(this), this;
},
getElement: function() {
return this._path;
},
_reset: function() {
this._project(), this._update();
},
_clickTolerance: function() {
return (this.options.stroke ? this.options.weight / 2 : 0) + (this._renderer.options.tolerance || 0);
}
}), Vn = Ze.extend({
// @section
// @aka CircleMarker options
options: {
fill: !0,
// @option radius: Number = 10
// Radius of the circle marker, in pixels
radius: 10
},
initialize: function(t, n) {
x(this, n), this._latlng = H(t), this._radius = this.options.radius;
},
// @method setLatLng(latLng: LatLng): this
// Sets the position of a circle marker to a new location.
setLatLng: function(t) {
var n = this._latlng;
return this._latlng = H(t), this.redraw(), this.fire("move", { oldLatLng: n, latlng: this._latlng });
},
// @method getLatLng(): LatLng
// Returns the current geographical position of the circle marker
getLatLng: function() {
return this._latlng;
},
// @method setRadius(radius: Number): this
// Sets the radius of a circle marker. Units are in pixels.
setRadius: function(t) {
return this.options.radius = this._radius = t, this.redraw();
},
// @method getRadius(): Number
// Returns the current radius of the circle
getRadius: function() {
return this._radius;
},
setStyle: function(t) {
var n = t && t.radius || this._radius;
return Ze.prototype.setStyle.call(this, t), this.setRadius(n), this;
},
_project: function() {
this._point = this._map.latLngToLayerPoint(this._latlng), this._updateBounds();
},
_updateBounds: function() {
var t = this._radius, n = this._radiusY || t, a = this._clickTolerance(), c = [t + a, n + a];
this._pxBounds = new G(this._point.subtract(c), this._point.add(c));
},
_update: function() {
this._map && this._updatePath();
},
_updatePath: function() {
this._renderer._updateCircle(this);
},
_empty: function() {
return this._radius && !this._renderer._bounds.intersects(this._pxBounds);
},
// Needed by the `Canvas` renderer for interactivity
_containsPoint: function(t) {
return t.distanceTo(this._point) <= this._radius + this._clickTolerance();
}
});
function vh(t, n) {
return new Vn(t, n);
}
var $s = Vn.extend({
initialize: function(t, n, a) {
if (typeof n == "number" && (n = o({}, a, { radius: n })), x(this, n), this._latlng = H(t), isNaN(this.options.radius))
throw new Error("Circle radius cannot be NaN");
this._mRadius = this.options.radius;
},
// @method setRadius(radius: Number): this
// Sets the radius of a circle. Units are in meters.
setRadius: function(t) {
return this._mRadius = t, this.redraw();
},
// @method getRadius(): Number
// Returns the current radius of a circle. Units are in meters.
getRadius: function() {
return this._mRadius;
},
// @method getBounds(): LatLngBounds
// Returns the `LatLngBounds` of the path.
getBounds: function() {
var t = [this._radius, this._radiusY || this._radius];
return new N(
this._map.layerPointToLatLng(this._point.subtract(t)),
this._map.layerPointToLatLng(this._point.add(t))
);
},
setStyle: Ze.prototype.setStyle,
_project: function() {
var t = this._latlng.lng, n = this._latlng.lat, a = this._map, c = a.options.crs;
if (c.distance === it.distance) {
var d = Math.PI / 180, p = this._mRadius / it.R / d, y = a.project([n + p, t]), b = a.project([n - p, t]), S = y.add(b).divideBy(2), I = a.unproject(S).lat, q = Math.acos((Math.cos(p * d) - Math.sin(n * d) * Math.sin(I * d)) / (Math.cos(n * d) * Math.cos(I * d))) / d;
(isNaN(q) || q === 0) && (q = p / Math.cos(Math.PI / 180 * n)), this._point = S.subtract(a.getPixelOrigin()), this._radius = isNaN(q) ? 0 : S.x - a.project([I, t - q]).x, this._radiusY = S.y - y.y;
} else {
var V = c.unproject(c.project(this._latlng).subtract([this._mRadius, 0]));
this._point = a.latLngToLayerPoint(this._latlng), this._radius = this._point.x - a.latLngToLayerPoint(V).x;
}
this._updateBounds();
}
});
function yh(t, n, a) {
return new $s(t, n, a);
}
var Te = Ze.extend({
// @section
// @aka Polyline options
options: {
// @option smoothFactor: Number = 1.0
// How much to simplify the polyline on each zoom level. More means
// better performance and smoother look, and less means more accurate representation.
smoothFactor: 1,
// @option noClip: Boolean = false
// Disable polyline clipping.
noClip: !1
},
initialize: function(t, n) {
x(this, n), this._setLatLngs(t);
},
// @method getLatLngs(): LatLng[]
// Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
getLatLngs: function() {
return this._latlngs;
},
// @method setLatLngs(latlngs: LatLng[]): this
// Replaces all the points in the polyline with the given array of geographical points.
setLatLngs: function(t) {
return this._setLatLngs(t), this.redraw();
},
// @method isEmpty(): Boolean
// Returns `true` if the Polyline has no LatLngs.
isEmpty: function() {
return !this._latlngs.length;
},
// @method closestLayerPoint(p: Point): Point
// Returns the point closest to `p` on the Polyline.
closestLayerPoint: function(t) {
for (var n = 1 / 0, a = null, c = on, d, p, y = 0, b = this._parts.length; y < b; y++)
for (var S = this._parts[y], I = 1, q = S.length; I < q; I++) {
d = S[I - 1], p = S[I];
var V = c(t, d, p, !0);
V < n && (n = V, a = c(t, d, p));
}
return a && (a.distance = Math.sqrt(n)), a;
},
// @method getCenter(): LatLng
// Returns the center ([centroid](https://en.wikipedia.org/wiki/Centroid)) of the polyline.
getCenter: function() {
if (!this._map)
throw new Error("Must add layer to map before using getCenter()");
return Fr(this._defaultShape(), this._map.options.crs);
},
// @method getBounds(): LatLngBounds
// Returns the `LatLngBounds` of the path.
getBounds: function() {
return this._bounds;
},
// @method addLatLng(latlng: LatLng, latlngs?: LatLng[]): this
// Adds a given point to the polyline. By default, adds to the first ring of
// the polyline in case of a multi-polyline, but can be overridden by passing
// a specific ring as a LatLng array (that you can earlier access with [`getLatLngs`](#polyline-getlatlngs)).
addLatLng: function(t, n) {
return n = n || this._defaultShape(), t = H(t), n.push(t), this._bounds.extend(t), this.redraw();
},
_setLatLngs: function(t) {
this._bounds = new N(), this._latlngs = this._convertLatLngs(t);
},
_defaultShape: function() {
return fe(this._latlngs) ? this._latlngs : this._latlngs[0];
},
// recursively convert latlngs input into actual LatLng instances; calculate bounds along the way
_convertLatLngs: function(t) {
for (var n = [], a = fe(t), c = 0, d = t.length; c < d; c++)
a ? (n[c] = H(t[c]), this._bounds.extend(n[c])) : n[c] = this._convertLatLngs(t[c]);
return n;
},
_project: function() {
var t = new G();
this._rings = [], this._projectLatlngs(this._latlngs, this._rings, t), this._bounds.isValid() && t.isValid() && (this._rawPxBounds = t, this._updateBounds());
},
_updateBounds: function() {
var t = this._clickTolerance(), n = new P(t, t);
this._rawPxBounds && (this._pxBounds = new G([
this._rawPxBounds.min.subtract(n),
this._rawPxBounds.max.add(n)
]));
},
// recursively turns latlngs into a set of rings with projected coordinates
_projectLatlngs: function(t, n, a) {
var c = t[0] instanceof F, d = t.length, p, y;
if (c) {
for (y = [], p = 0; p < d; p++)
y[p] = this._map.latLngToLayerPoint(t[p]), a.extend(y[p]);
n.push(y);
} else
for (p = 0; p < d; p++)
this._projectLatlngs(t[p], n, a);
},
// clip polyline by renderer bounds so that we have less to render for performance
_clipPoints: function() {
var t = this._renderer._bounds;
if (this._parts = [], !(!this._pxBounds || !this._pxBounds.intersects(t))) {
if (this.options.noClip) {
this._parts = this._rings;
return;
}
var n = this._parts, a, c, d, p, y, b, S;
for (a = 0, d = 0, p = this._rings.length; a < p; a++)
for (S = this._rings[a], c = 0, y = S.length; c < y - 1; c++)
b = qr(S[c], S[c + 1], t, c, !0), b && (n[d] = n[d] || [], n[d].push(b[0]), (b[1] !== S[c + 1] || c === y - 2) && (n[d].push(b[1]), d++));
}
},
// simplify each clipped part of the polyline for performance
_simplifyPoints: function() {
for (var t = this._parts, n = this.options.smoothFactor, a = 0, c = t.length; a < c; a++)
t[a] = Br(t[a], n);
},
_update: function() {
this._map && (this._clipPoints(), this._simplifyPoints(), this._updatePath());
},
_updatePath: function() {
this._renderer._updatePoly(this);
},
// Needed by the `Canvas` renderer for interactivity
_containsPoint: function(t, n) {
var a, c, d, p, y, b, S = this._clickTolerance();
if (!this._pxBounds || !this._pxBounds.contains(t))
return !1;
for (a = 0, p = this._parts.length; a < p; a++)
for (b = this._parts[a], c = 0, y = b.length, d = y - 1; c < y; d = c++)
if (!(!n && c === 0) && Ur(t, b[d], b[c]) <= S)
return !0;
return !1;
}
});
function Mh(t, n) {
return new Te(t, n);
}
Te._flat = $r;
var Si = Te.extend({
options: {
fill: !0
},
isEmpty: function() {
return !this._latlngs.length || !this._latlngs[0].length;
},
// @method getCenter(): LatLng
// Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the Polygon.
getCenter: function() {
if (!this._map)
throw new Error("Must add layer to map before using getCenter()");
return Dr(this._defaultShape(), this._map.options.crs);
},
_convertLatLngs: function(t) {
var n = Te.prototype._convertLatLngs.call(this, t), a = n.length;
return a >= 2 && n[0] instanceof F && n[0].equals(n[a - 1]) && n.pop(), n;
},
_setLatLngs: function(t) {
Te.prototype._setLatLngs.call(this, t), fe(this._latlngs) && (this._latlngs = [this._latlngs]);
},
_defaultShape: function() {
return fe(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0];
},
_clipPoints: function() {
var t = this._renderer._bounds, n = this.options.weight, a = new P(n, n);
if (t = new G(t.min.subtract(a), t.max.add(a)), this._parts = [], !(!this._pxBounds || !this._pxBounds.intersects(t))) {
if (this.options.noClip) {
this._parts = this._rings;
return;
}
for (var c = 0, d = this._rings.length, p; c < d; c++)
p = zr(this._rings[c], t, !0), p.length && this._parts.push(p);
}
},
_updatePath: function() {
this._renderer._updatePoly(this, !0);
},
// Needed by the `Canvas` renderer for interactivity
_containsPoint: function(t) {
var n = !1, a, c, d, p, y, b, S, I;
if (!this._pxBounds || !this._pxBounds.contains(t))
return !1;
for (p = 0, S = this._parts.length; p < S; p++)
for (a = this._parts[p], y = 0, I = a.length, b = I - 1; y < I; b = y++)
c = a[y], d = a[b], c.y > t.y != d.y > t.y && t.x < (d.x - c.x) * (t.y - c.y) / (d.y - c.y) + c.x && (n = !n);
return n || Te.prototype._containsPoint.call(this, t, !0);
}
});
function wh(t, n) {
return new Si(t, n);
}
var Ne = Ce.extend({
/* @section
* @aka GeoJSON options
*
* @option pointToLayer: Function = *
* A `Function` defining how GeoJSON points spawn Leaflet layers. It is internally
* called when data is added, passing the GeoJSON point feature and its `LatLng`.
* The default is to spawn a default `Marker`:
* ```js
* function(geoJsonPoint, latlng) {
* return L.marker(latlng);
* }
* ```
*
* @option style: Function = *
* A `Function` defining the `Path options` for styling GeoJSON lines and polygons,
* called internally when data is added.
* The default value is to not override any defaults:
* ```js
* function (geoJsonFeature) {
* return {}
* }
* ```
*
* @option onEachFeature: Function = *
* A `Function` that will be called once for each created `Feature`, after it has
* been created and styled. Useful for attaching events and popups to features.
* The default is to do nothing with the newly created layers:
* ```js
* function (feature, layer) {}
* ```
*
* @option filter: Function = *
* A `Function` that will be used to decide whether to include a feature or not.
* The default is to include all features:
* ```js
* function (geoJsonFeature) {
* return true;
* }
* ```
* Note: dynamically changing the `filter` option will have effect only on newly
* added data. It will _not_ re-evaluate already included features.
*
* @option coordsToLatLng: Function = *
* A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s.
* The default is the `coordsToLatLng` static method.
*
* @option markersInheritOptions: Boolean = false
* Whether default Markers for "Point" type Features inherit from group options.
*/
initialize: function(t, n) {
x(this, n), this._layers = {}, t && this.addData(t);
},
// @method addData( <GeoJSON> data ): this
// Adds a GeoJSON object to the layer.
addData: function(t) {
var n = $(t) ? t : t.features, a, c, d;
if (n) {
for (a = 0, c = n.length; a < c; a++)
d = n[a], (d.geometries || d.geometry || d.features || d.coordinates) && this.addData(d);
return this;
}
var p = this.options;
if (p.filter && !p.filter(t))
return this;
var y = Jn(t, p);
return y ? (y.feature = Yn(t), y.defaultOptions = y.options, this.resetStyle(y), p.onEachFeature && p.onEachFeature(t, y), this.addLayer(y)) : this;
},
// @method resetStyle( <Path> layer? ): this
// Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.
// If `layer` is omitted, the style of all features in the current layer is reset.
resetStyle: function(t) {
return t === void 0 ? this.eachLayer(this.resetStyle, this) : (t.options = o({}, t.defaultOptions), this._setLayerStyle(t, this.options.style), this);
},
// @method setStyle( <Function> style ): this
// Changes styles of GeoJSON vector layers with the given style function.
setStyle: function(t) {
return this.eachLayer(function(n) {
this._setLayerStyle(n, t);
}, this);
},
_setLayerStyle: function(t, n) {
t.setStyle && (typeof n == "function" && (n = n(t.feature)), t.setStyle(n));
}
});
function Jn(t, n) {
var a = t.type === "Feature" ? t.geometry : t, c = a ? a.coordinates : null, d = [], p = n && n.pointToLayer, y = n && n.coordsToLatLng || Fs, b, S, I, q;
if (!c && !a)
return null;
switch (a.type) {
case "Point":
return b = y(c), jr(p, t, b, n);
case "MultiPoint":
for (I = 0, q = c.length; I < q; I++)
b = y(c[I]), d.push(jr(p, t, b, n));
return new Ce(d);
case "LineString":
case "MultiLineString":
return S = Xn(c, a.type === "LineString" ? 0 : 1, y), new Te(S, n);
case "Polygon":
case "MultiPolygon":
return S = Xn(c, a.type === "Polygon" ? 1 : 2, y), new Si(S, n);
case "GeometryCollection":
for (I = 0, q = a.geometries.length; I < q; I++) {
var V = Jn({
geometry: a.geometries[I],
type: "Feature",
properties: t.properties
}, n);
V && d.push(V);
}
return new Ce(d);
case "FeatureCollection":
for (I = 0, q = a.features.length; I < q; I++) {
var st = Jn(a.features[I], n);
st && d.push(st);
}
return new Ce(d);
default:
throw new Error("Invalid GeoJSON object.");
}
}
function jr(t, n, a, c) {
return t ? t(n, a) : new Kn(a, c && c.markersInheritOptions && c);
}
function Fs(t) {
return new F(t[1], t[0], t[2]);
}
function Xn(t, n, a) {
for (var c = [], d = 0, p = t.length, y; d < p; d++)
y = n ? Xn(t[d], n - 1, a) : (a || Fs)(t[d]), c.push(y);
return c;
}
function Hs(t, n) {
return t = H(t), t.alt !== void 0 ? [g(t.lng, n), g(t.lat, n), g(t.alt, n)] : [g(t.lng, n), g(t.lat, n)];
}
function Qn(t, n, a, c) {
for (var d = [], p = 0, y = t.length; p < y; p++)
d.push(n ? Qn(t[p], fe(t[p]) ? 0 : n - 1, a, c) : Hs(t[p], c));
return !n && a && d.length > 0 && d.push(d[0].slice()), d;
}
function Ai(t, n) {
return t.feature ? o({}, t.feature, { geometry: n }) : Yn(n);
}
function Yn(t) {
return t.type === "Feature" || t.type === "FeatureCollection" ? t : {
type: "Feature",
properties: {},
geometry: t
};
}
var Ws = {
toGeoJSON: function(t) {
return Ai(this, {
type: "Point",
coordinates: Hs(this.getLatLng(), t)
});
}
};
Kn.include(Ws), $s.include(Ws), Vn.include(Ws), Te.include({
toGeoJSON: function(t) {
var n = !fe(this._latlngs), a = Qn(this._latlngs, n ? 1 : 0, !1, t);
return Ai(this, {
type: (n ? "Multi" : "") + "LineString",
coordinates: a
});
}
}), Si.include({
toGeoJSON: function(t) {
var n = !fe(this._latlngs), a = n && !fe(this._latlngs[0]), c = Qn(this._latlngs, a ? 2 : n ? 1 : 0, !0, t);
return n || (c = [c]), Ai(this, {
type: (a ? "Multi" : "") + "Polygon",
coordinates: c
});
}
}), Ei.include({
toMultiPoint: function(t) {
var n = [];
return this.eachLayer(function(a) {
n.push(a.toGeoJSON(t).geometry.coordinates);
}), Ai(this, {
type: "MultiPoint",
coordinates: n
});
},
// @method toGeoJSON(precision?: Number|false): Object
// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.
// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the layer group (as a GeoJSON `FeatureCollection`, `GeometryCollection`, or `MultiPoint`).
toGeoJSON: function(t) {
var n = this.feature && this.feature.geometry && this.feature.geometry.type;
if (n === "MultiPoint")
return this.toMultiPoint(t);
var a = n === "GeometryCollection", c = [];
return this.eachLayer(function(d) {
if (d.toGeoJSON) {
var p = d.toGeoJSON(t);
if (a)
c.push(p.geometry);
else {
var y = Yn(p);
y.type === "FeatureCollection" ? c.push.apply(c, y.features) : c.push(y);
}
}
}), a ? Ai(this, {
geometries: c,
type: "GeometryCollection"
}) : {
type: "FeatureCollection",
features: c
};
}
});
function Kr(t, n) {
return new Ne(t, n);
}
var xh = Kr, ts = ge.extend({
// @section
// @aka ImageOverlay options
options: {
// @option opacity: Number = 1.0
// The opacity of the image overlay.
opacity: 1,
// @option alt: String = ''
// Text for the `alt` attribute of the image (useful for accessibility).
alt: "",
// @option interactive: Boolean = false
// If `true`, the image overlay will emit [mouse events](#interactive-layer) when clicked or hovered.
interactive: !1,
// @option crossOrigin: Boolean|String = false
// Whether the crossOrigin attribute will be added to the image.
// If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.
// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.
crossOrigin: !1,
// @option errorOverlayUrl: String = ''
// URL to the overlay image to show in place of the overlay that failed to load.
errorOverlayUrl: "",
// @option zIndex: Number = 1
// The explicit [zIndex](https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index) of the overlay layer.
zIndex: 1,
// @option className: String = ''
// A custom class name to assign to the image. Empty by default.
className: ""
},
initialize: function(t, n, a) {
this._url = t, this._bounds = R(n), x(this, a);
},
onAdd: function() {
this._image || (this._initImage(), this.options.opacity < 1 && this._updateOpacity()), this.options.interactive && (Y(this._image, "leaflet-interactive"), this.addInteractiveTarget(this._image)), this.getPane().appendChild(this._image), this._reset();
},
onRemove: function() {
Et(this._image), this.options.interactive && this.removeInteractiveTarget(this._image);
},
// @method setOpacity(opacity: Number): this
// Sets the opacity of the overlay.
setOpacity: function(t) {
return this.options.opacity = t, this._image && this._updateOpacity(), this;
},
setStyle: function(t) {
return t.opacity && this.setOpacity(t.opacity), this;
},
// @method bringToFront(): this
// Brings the layer to the top of all overlays.
bringToFront: function() {
return this._map && xi(this._image), this;
},
// @method bringToBack(): this
// Brings the layer to the bottom of all overlays.
bringToBack: function() {
return this._map && bi(this._image), this;
},
// @method setUrl(url: String): this
// Changes the URL of the image.
setUrl: function(t) {
return this._url = t, this._image && (this._image.src = t), this;
},
// @method setBounds(bounds: LatLngBounds): this
// Update the bounds that this ImageOverlay covers
setBounds: function(t) {
return this._bounds = R(t), this._map && this._reset(), this;
},
getEvents: function() {
var t = {
zoom: this._reset,
viewreset: this._reset
};
return this._zoomAnimated && (t.zoomanim = this._animateZoom), t;
},
// @method setZIndex(value: Number): this
// Changes the [zIndex](#imageoverlay-zindex) of the image overlay.
setZIndex: function(t) {
return this.options.zIndex = t, this._updateZIndex(), this;
},
// @method getBounds(): LatLngBounds
// Get the bounds that this ImageOverlay covers
getBounds: function() {
return this._bounds;
},
// @method getElement(): HTMLElement
// Returns the instance of [`HTMLImageElement`](https://developer.mozilla.org/docs/Web/API/HTMLImageElement)
// used by this overlay.
getElement: function() {
return this._image;
},
_initImage: function() {
var t = this._url.tagName === "IMG", n = this._image = t ? this._url : ct("img");
if (Y(n, "leaflet-image-layer"), this._zoomAnimated && Y(n, "leaflet-zoom-animated"), this.options.className && Y(n, this.options.className), n.onselectstart = m, n.onmousemove = m, n.onload = l(this.fire, this, "load"), n.onerror = l(this._overlayOnError, this, "error"), (this.options.crossOrigin || this.options.crossOrigin === "") && (n.crossOrigin = this.options.crossOrigin === !0 ? "" : this.options.crossOrigin), this.options.zIndex && this._updateZIndex(), t) {
this._url = n.src;
return;
}
n.src = this._url, n.alt = this.options.alt;
},
_animateZoom: function(t) {
var n = this._map.getZoomScale(t.zoom), a = this._map._latLngBoundsToNewLayerBounds(this._bounds, t.zoom, t.center).min;
ei(this._image, a, n);
},
_reset: function() {
var t = this._image, n = new G(
this._map.latLngToLayerPoint(this._bounds.getNorthWest()),
this._map.latLngToLayerPoint(this._bounds.getSouthEast())
), a = n.getSize();
Ot(t, n.min), t.style.width = a.x + "px", t.style.height = a.y + "px";
},
_updateOpacity: function() {
ue(this._image, this.options.opacity);
},
_updateZIndex: function() {
this._image && this.options.zIndex !== void 0 && this.options.zIndex !== null && (this._image.style.zIndex = this.options.zIndex);
},
_overlayOnError: function() {
this.fire("error");
var t = this.options.errorOverlayUrl;
t && this._url !== t && (this._url = t, this._image.src = t);
},
// @method getCenter(): LatLng
// Returns the center of the ImageOverlay.
getCenter: function() {
return this._bounds.getCenter();
}
}), bh = function(t, n, a) {
return new ts(t, n, a);
}, Vr = ts.extend({
// @section
// @aka VideoOverlay options
options: {
// @option autoplay: Boolean = true
// Whether the video starts playing automatically when loaded.
// On some browsers autoplay will only work with `muted: true`
autoplay: !0,
// @option loop: Boolean = true
// Whether the video will loop back to the beginning when played.
loop: !0,
// @option keepAspectRatio: Boolean = true
// Whether the video will save aspect ratio after the projection.
// Relevant for supported browsers. See [browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit)
keepAspectRatio: !0,
// @option muted: Boolean = false
// Whether the video starts on mute when loaded.
muted: !1,
// @option playsInline: Boolean = true
// Mobile browsers will play the video right where it is instead of open it up in fullscreen mode.
playsInline: !0
},
_initImage: function() {
var t = this._url.tagName === "VIDEO", n = this._image = t ? this._url : ct("video");
if (Y(n, "leaflet-image-layer"), this._zoomAnimated && Y(n, "leaflet-zoom-animated"), this.options.className && Y(n, this.options.className), n.onselectstart = m, n.onmousemove = m, n.onloadeddata = l(this.fire, this, "load"), t) {
for (var a = n.getElementsByTagName("source"), c = [], d = 0; d < a.length; d++)
c.push(a[d].src);
this._url = a.length > 0 ? c : [n.src];
return;
}
$(this._url) || (this._url = [this._url]), !this.options.keepAspectRatio && Object.prototype.hasOwnProperty.call(n.style, "objectFit") && (n.style.objectFit = "fill"), n.autoplay = !!this.options.autoplay, n.loop = !!this.options.loop, n.muted = !!this.options.muted, n.playsInline = !!this.options.playsInline;
for (var p = 0; p < this._url.length; p++) {
var y = ct("source");
y.src = this._url[p], n.appendChild(y);
}
}
// @method getElement(): HTMLVideoElement
// Returns the instance of [`HTMLVideoElement`](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement)
// used by this overlay.
});
function Eh(t, n, a) {
return new Vr(t, n, a);
}
var Jr = ts.extend({
_initImage: function() {
var t = this._image = this._url;
Y(t, "leaflet-image-layer"), this._zoomAnimated && Y(t, "leaflet-zoom-animated"), this.options.className && Y(t, this.options.className), t.onselectstart = m, t.onmousemove = m;
}
// @method getElement(): SVGElement
// Returns the instance of [`SVGElement`](https://developer.mozilla.org/docs/Web/API/SVGElement)
// used by this overlay.
});
function Ph(t, n, a) {
return new Jr(t, n, a);
}
var be = ge.extend({
// @section
// @aka DivOverlay options
options: {
// @option interactive: Boolean = false
// If true, the popup/tooltip will listen to the mouse events.
interactive: !1,
// @option offset: Point = Point(0, 0)
// The offset of the overlay position.
offset: [0, 0],
// @option className: String = ''
// A custom CSS class name to assign to the overlay.
className: "",
// @option pane: String = undefined
// `Map pane` where the overlay will be added.
pane: void 0,
// @option content: String|HTMLElement|Function = ''
// Sets the HTML content of the overlay while initializing. If a function is passed the source layer will be
// passed to the function. The function should return a `String` or `HTMLElement` to be used in the overlay.
content: ""
},
initialize: function(t, n) {
t && (t instanceof F || $(t)) ? (this._latlng = H(t), x(this, n)) : (x(this, t), this._source = n), this.options.content && (this._content = this.options.content);
},
// @method openOn(map: Map): this
// Adds the overlay to the map.
// Alternative to `map.openPopup(popup)`/`.openTooltip(tooltip)`.
openOn: function(t) {
return t = arguments.length ? t : this._source._map, t.hasLayer(this) || t.addLayer(this), this;
},
// @method close(): this
// Closes the overlay.
// Alternative to `map.closePopup(popup)`/`.closeTooltip(tooltip)`
// and `layer.closePopup()`/`.closeTooltip()`.
close: function() {
return this._map && this._map.removeLayer(this), this;
},
// @method toggle(layer?: Layer): this
// Opens or closes the overlay bound to layer depending on its current state.
// Argument may be omitted only for overlay bound to layer.
// Alternative to `layer.togglePopup()`/`.toggleTooltip()`.
toggle: function(t) {
return this._map ? this.close() : (arguments.length ? this._source = t : t = this._source, this._prepareOpen(), this.openOn(t._map)), this;
},
onAdd: function(t) {
this._zoomAnimated = t._zoomAnimated, this._container || this._initLayout(), t._fadeAnimated && ue(this._container, 0), clearTimeout(this._removeTimeout), this.getPane().appendChild(this._container), this.update(), t._fadeAnimated && ue(this._container, 1), this.bringToFront(), this.options.interactive && (Y(this._container, "leaflet-interactive"), this.addInteractiveTarget(this._container));
},
onRemove: function(t) {
t._fadeAnimated ? (ue(this._container, 0), this._removeTimeout = setTimeout(l(Et, void 0, this._container), 200)) : Et(this._container), this.options.interactive && (Ct(this._container, "leaflet-interactive"), this.removeInteractiveTarget(this._container));
},
// @namespace DivOverlay
// @method getLatLng: LatLng
// Returns the geographical point of the overlay.
getLatLng: function() {
return this._latlng;
},
// @method setLatLng(latlng: LatLng): this
// Sets the geographical point where the overlay will open.
setLatLng: function(t) {
return this._latlng = H(t), this._map && (this._updatePosition(), this._adjustPan()), this;
},
// @method getContent: String|HTMLElement
// Returns the content of the overlay.
getContent: function() {
return this._content;
},
// @method setContent(htmlContent: String|HTMLElement|Function): this
// Sets the HTML content of the overlay. If a function is passed the source layer will be passed to the function.
// The function should return a `String` or `HTMLElement` to be used in the overlay.
setContent: function(t) {
return this._content = t, this.update(), this;
},
// @method getElement: String|HTMLElement
// Returns the HTML container of the overlay.
getElement: function() {
return this._container;
},
// @method update: null
// Updates the overlay content, layout and position. Useful for updating the overlay after something inside changed, e.g. image loaded.
update: function() {
this._map && (this._container.style.visibility = "hidden", this._updateContent(), this._updateLayout(), this._updatePosition(), this._container.style.visibility = "", this._adjustPan());
},
getEvents: function() {
var t = {
zoom: this._updatePosition,
viewreset: this._updatePosition
};
return this._zoomAnimated && (t.zoomanim = this._animateZoom), t;
},
// @method isOpen: Boolean
// Returns `true` when the overlay is visible on the map.
isOpen: function() {
return !!this._map && this._map.hasLayer(this);
},
// @method bringToFront: this
// Brings this overlay in front of other overlays (in the same map pane).
bringToFront: function() {
return this._map && xi(this._container), this;
},
// @method bringToBack: this
// Brings this overlay to the back of other overlays (in the same map pane).
bringToBack: function() {
return this._map && bi(this._container), this;
},
// prepare bound overlay to open: update latlng pos / content source (for FeatureGroup)
_prepareOpen: function(t) {
var n = this._source;
if (!n._map)
return !1;
if (n instanceof Ce) {
n = null;
var a = this._source._layers;
for (var c in a)
if (a[c]._map) {
n = a[c];
break;
}
if (!n)
return !1;
this._source = n;
}
if (!t)
if (n.getCenter)
t = n.getCenter();
else if (n.getLatLng)
t = n.getLatLng();
else if (n.getBounds)
t = n.getBounds().getCenter();
else
throw new Error("Unable to get source layer LatLng.");
return this.setLatLng(t), this._map && this.update(), !0;
},
_updateContent: function() {
if (this._content) {
var t = this._contentNode, n = typeof this._content == "function" ? this._content(this._source || this) : this._content;
if (typeof n == "string")
t.innerHTML = n;
else {
for (; t.hasChildNodes(); )
t.removeChild(t.firstChild);
t.appendChild(n);
}
this.fire("contentupdate");
}
},
_updatePosition: function() {
if (this._map) {
var t = this._map.latLngToLayerPoint(this._latlng), n = T(this.options.offset), a = this._getAnchor();
this._zoomAnimated ? Ot(this._container, t.add(a)) : n = n.add(t).add(a);
var c = this._containerBottom = -n.y, d = this._containerLeft = -Math.round(this._containerWidth / 2) + n.x;
this._container.style.bottom = c + "px", this._container.style.left = d + "px";
}
},
_getAnchor: function() {
return [0, 0];
}
});
ot.include({
_initOverlay: function(t, n, a, c) {
var d = n;
return d instanceof t || (d = new t(c).setContent(n)), a && d.setLatLng(a), d;
}
}), ge.include({
_initOverlay: function(t, n, a, c) {
var d = a;
return d instanceof t ? (x(d, c), d._source = this) : (d = n && !c ? n : new t(c, this), d.setContent(a)), d;
}
});
var es = be.extend({
// @section
// @aka Popup options
options: {
// @option pane: String = 'popupPane'
// `Map pane` where the popup will be added.
pane: "popupPane",
// @option offset: Point = Point(0, 7)
// The offset of the popup position.
offset: [0, 7],
// @option maxWidth: Number = 300
// Max width of the popup, in pixels.
maxWidth: 300,
// @option minWidth: Number = 50
// Min width of the popup, in pixels.
minWidth: 50,
// @option maxHeight: Number = null
// If set, creates a scrollable container of the given height
// inside a popup if its content exceeds it.
// The scrollable container can be styled using the
// `leaflet-popup-scrolled` CSS class selector.
maxHeight: null,
// @option autoPan: Boolean = true
// Set it to `false` if you don't want the map to do panning animation
// to fit the opened popup.
autoPan: !0,
// @option autoPanPaddingTopLeft: Point = null
// The margin between the popup and the top left corner of the map
// view after autopanning was performed.
autoPanPaddingTopLeft: null,
// @option autoPanPaddingBottomRight: Point = null
// The margin between the popup and the bottom right corner of the map
// view after autopanning was performed.
autoPanPaddingBottomRight: null,
// @option autoPanPadding: Point = Point(5, 5)
// Equivalent of setting both top left and bottom right autopan padding to the same value.
autoPanPadding: [5, 5],
// @option keepInView: Boolean = false
// Set it to `true` if you want to prevent users from panning the popup
// off of the screen while it is open.
keepInView: !1,
// @option closeButton: Boolean = true
// Controls the presence of a close button in the popup.
closeButton: !0,
// @option autoClose: Boolean = true
// Set it to `false` if you want to override the default behavior of
// the popup closing when another popup is opened.
autoClose: !0,
// @option closeOnEscapeKey: Boolean = true
// Set it to `false` if you want to override the default behavior of
// the ESC key for closing of the popup.
closeOnEscapeKey: !0,
// @option closeOnClick: Boolean = *
// Set it if you want to override the default behavior of the popup closing when user clicks
// on the map. Defaults to the map's [`closePopupOnClick`](#map-closepopuponclick) option.
// @option className: String = ''
// A custom CSS class name to assign to the popup.
className: ""
},
// @namespace Popup
// @method openOn(map: Map): this
// Alternative to `map.openPopup(popup)`.
// Adds the popup to the map and closes the previous one.
openOn: function(t) {
return t = arguments.length ? t : this._source._map, !t.hasLayer(this) && t._popup && t._popup.options.autoClose && t.removeLayer(t._popup), t._popup = this, be.prototype.openOn.call(this, t);
},
onAdd: function(t) {
be.prototype.onAdd.call(this, t), t.fire("popupopen", { popup: this }), this._source && (this._source.fire("popupopen", { popup: this }, !0), this._source instanceof Ze || this._source.on("preclick", ni));
},
onRemove: function(t) {
be.prototype.onRemove.call(this, t), t.fire("popupclose", { popup: this }), this._source && (this._source.fire("popupclose", { popup: this }, !0), this._source instanceof Ze || this._source.off("preclick", ni));
},
getEvents: function() {
var t = be.prototype.getEvents.call(this);
return (this.options.closeOnClick !== void 0 ? this.options.closeOnClick : this._map.options.closePopupOnClick) && (t.preclick = this.close), this.options.keepInView && (t.moveend = this._adjustPan), t;
},
_initLayout: function() {
var t = "leaflet-popup", n = this._container = ct(
"div",
t + " " + (this.options.className || "") + " leaflet-zoom-animated"
), a = this._wrapper = ct("div", t + "-content-wrapper", n);
if (this._contentNode = ct("div", t + "-content", a), rn(n), ks(this._contentNode), J(n, "contextmenu", ni), this._tipContainer = ct("div", t + "-tip-container", n), this._tip = ct("div", t + "-tip", this._tipContainer), this.options.closeButton) {
var c = this._closeButton = ct("a", t + "-close-button", n);
c.setAttribute("role", "button"), c.setAttribute("aria-label", "Close popup"), c.href = "#close", c.innerHTML = '<span aria-hidden="true">×</span>', J(c, "click", function(d) {
Ht(d), this.close();
}, this);
}
},
_updateLayout: function() {
var t = this._contentNode, n = t.style;
n.width = "", n.whiteSpace = "nowrap";
var a = t.offsetWidth;
a = Math.min(a, this.options.maxWidth), a = Math.max(a, this.options.minWidth), n.width = a + 1 + "px", n.whiteSpace = "", n.height = "";
var c = t.offsetHeight, d = this.options.maxHeight, p = "leaflet-popup-scrolled";
d && c > d ? (n.height = d + "px", Y(t, p)) : Ct(t, p), this._containerWidth = this._container.offsetWidth;
},
_animateZoom: function(t) {
var n = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center), a = this._getAnchor();
Ot(this._container, n.add(a));
},
_adjustPan: function() {
if (this.options.autoPan) {
if (this._map._panAnim && this._map._panAnim.stop(), this._autopanning) {
this._autopanning = !1;
return;
}
var t = this._map, n = parseInt(tn(this._container, "marginBottom"), 10) || 0, a = this._container.offsetHeight + n, c = this._containerWidth, d = new P(this._containerLeft, -a - this._containerBottom);
d._add(ii(this._container));
var p = t.layerPointToContainerPoint(d), y = T(this.options.autoPanPadding), b = T(this.options.autoPanPaddingTopLeft || y), S = T(this.options.autoPanPaddingBottomRight || y), I = t.getSize(), q = 0, V = 0;
p.x + c + S.x > I.x && (q = p.x + c - I.x + S.x), p.x - q - b.x < 0 && (q = p.x - b.x), p.y + a + S.y > I.y && (V = p.y + a - I.y + S.y), p.y - V - b.y < 0 && (V = p.y - b.y), (q || V) && (this.options.keepInView && (this._autopanning = !0), t.fire("autopanstart").panBy([q, V]));
}
},
_getAnchor: function() {
return T(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [0, 0]);
}
}), Sh = function(t, n) {
return new es(t, n);
};
ot.mergeOptions({
closePopupOnClick: !0
}), ot.include({
// @method openPopup(popup: Popup): this
// Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).
// @alternative
// @method openPopup(content: String|HTMLElement, latlng: LatLng, options?: Popup options): this
// Creates a popup with the specified content and options and opens it in the given point on a map.
openPopup: function(t, n, a) {
return this._initOverlay(es, t, n, a).openOn(this), this;
},
// @method closePopup(popup?: Popup): this
// Closes the popup previously opened with [openPopup](#map-openpopup) (or the given one).
closePopup: function(t) {
return t = arguments.length ? t : this._popup, t && t.close(), this;
}
}), ge.include({
// @method bindPopup(content: String|HTMLElement|Function|Popup, options?: Popup options): this
// Binds a popup to the layer with the passed `content` and sets up the
// necessary event listeners. If a `Function` is passed it will receive
// the layer as the first argument and should return a `String` or `HTMLElement`.
bindPopup: function(t, n) {
return this._popup = this._initOverlay(es, this._popup, t, n), this._popupHandlersAdded || (this.on({
click: this._openPopup,
keypress: this._onKeyPress,
remove: this.closePopup,
move: this._movePopup
}), this._popupHandlersAdded = !0), this;
},
// @method unbindPopup(): this
// Removes the popup previously bound with `bindPopup`.
unbindPopup: function() {
return this._popup && (this.off({
click: this._openPopup,
keypress: this._onKeyPress,
remove: this.closePopup,
move: this._movePopup
}), this._popupHandlersAdded = !1, this._popup = null), this;
},
// @method openPopup(latlng?: LatLng): this
// Opens the bound popup at the specified `latlng` or at the default popup anchor if no `latlng` is passed.
openPopup: function(t) {
return this._popup && (this instanceof Ce || (this._popup._source = this), this._popup._prepareOpen(t || this._latlng) && this._popup.openOn(this._map)), this;
},
// @method closePopup(): this
// Closes the popup bound to this layer if it is open.
closePopup: function() {
return this._popup && this._popup.close(), this;
},
// @method togglePopup(): this
// Opens or closes the popup bound to this layer depending on its current state.
togglePopup: function() {
return this._popup && this._popup.toggle(this), this;
},
// @method isPopupOpen(): boolean
// Returns `true` if the popup bound to this layer is currently open.
isPopupOpen: function() {
return this._popup ? this._popup.isOpen() : !1;
},
// @method setPopupContent(content: String|HTMLElement|Popup): this
// Sets the content of the popup bound to this layer.
setPopupContent: function(t) {
return this._popup && this._popup.setContent(t), this;
},
// @method getPopup(): Popup
// Returns the popup bound to this layer.
getPopup: function() {
return this._popup;
},
_openPopup: function(t) {
if (!(!this._popup || !this._map)) {
si(t);
var n = t.layer || t.target;
if (this._popup._source === n && !(n instanceof Ze)) {
this._map.hasLayer(this._popup) ? this.closePopup() : this.openPopup(t.latlng);
return;
}
this._popup._source = n, this.openPopup(t.latlng);
}
},
_movePopup: function(t) {
this._popup.setLatLng(t.latlng);
},
_onKeyPress: function(t) {
t.originalEvent.keyCode === 13 && this._openPopup(t);
}
});
var is = be.extend({
// @section
// @aka Tooltip options
options: {
// @option pane: String = 'tooltipPane'
// `Map pane` where the tooltip will be added.
pane: "tooltipPane",
// @option offset: Point = Point(0, 0)
// Optional offset of the tooltip position.
offset: [0, 0],
// @option direction: String = 'auto'
// Direction where to open the tooltip. Possible values are: `right`, `left`,
// `top`, `bottom`, `center`, `auto`.
// `auto` will dynamically switch between `right` and `left` according to the tooltip
// position on the map.
direction: "auto",
// @option permanent: Boolean = false
// Whether to open the tooltip permanently or only on mouseover.
permanent: !1,
// @option sticky: Boolean = false
// If true, the tooltip will follow the mouse instead of being fixed at the feature center.
sticky: !1,
// @option opacity: Number = 0.9
// Tooltip container opacity.
opacity: 0.9
},
onAdd: function(t) {
be.prototype.onAdd.call(this, t), this.setOpacity(this.options.opacity), t.fire("tooltipopen", { tooltip: this }), this._source && (this.addEventParent(this._source), this._source.fire("tooltipopen", { tooltip: this }, !0));
},
onRemove: function(t) {
be.prototype.onRemove.call(this, t), t.fire("tooltipclose", { tooltip: this }), this._source && (this.removeEventParent(this._source), this._source.fire("tooltipclose", { tooltip: this }, !0));
},
getEvents: function() {
var t = be.prototype.getEvents.call(this);
return this.options.permanent || (t.preclick = this.close), t;
},
_initLayout: function() {
var t = "leaflet-tooltip", n = t + " " + (this.options.className || "") + " leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide");
this._contentNode = this._container = ct("div", n), this._container.setAttribute("role", "tooltip"), this._container.setAttribute("id", "leaflet-tooltip-" + f(this));
},
_updateLayout: function() {
},
_adjustPan: function() {
},
_setPosition: function(t) {
var n, a, c = this._map, d = this._container, p = c.latLngToContainerPoint(c.getCenter()), y = c.layerPointToContainerPoint(t), b = this.options.direction, S = d.offsetWidth, I = d.offsetHeight, q = T(this.options.offset), V = this._getAnchor();
b === "top" ? (n = S / 2, a = I) : b === "bottom" ? (n = S / 2, a = 0) : b === "center" ? (n = S / 2, a = I / 2) : b === "right" ? (n = 0, a = I / 2) : b === "left" ? (n = S, a = I / 2) : y.x < p.x ? (b = "right", n = 0, a = I / 2) : (b = "left", n = S + (q.x + V.x) * 2, a = I / 2), t = t.subtract(T(n, a, !0)).add(q).add(V), Ct(d, "leaflet-tooltip-right"), Ct(d, "leaflet-tooltip-left"), Ct(d, "leaflet-tooltip-top"), Ct(d, "leaflet-tooltip-bottom"), Y(d, "leaflet-tooltip-" + b), Ot(d, t);
},
_updatePosition: function() {
var t = this._map.latLngToLayerPoint(this._latlng);
this._setPosition(t);
},
setOpacity: function(t) {
this.options.opacity = t, this._container && ue(this._container, t);
},
_animateZoom: function(t) {
var n = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center);
this._setPosition(n);
},
_getAnchor: function() {
return T(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [0, 0]);
}
}), Ah = function(t, n) {
return new is(t, n);
};
ot.include({
// @method openTooltip(tooltip: Tooltip): this
// Opens the specified tooltip.
// @alternative
// @method openTooltip(content: String|HTMLElement, latlng: LatLng, options?: Tooltip options): this
// Creates a tooltip with the specified content and options and open it.
openTooltip: function(t, n, a) {
return this._initOverlay(is, t, n, a).openOn(this), this;
},
// @method closeTooltip(tooltip: Tooltip): this
// Closes the tooltip given as parameter.
closeTooltip: function(t) {
return t.close(), this;
}
}), ge.include({
// @method bindTooltip(content: String|HTMLElement|Function|Tooltip, options?: Tooltip options): this
// Binds a tooltip to the layer with the passed `content` and sets up the
// necessary event listeners. If a `Function` is passed it will receive
// the layer as the first argument and should return a `String` or `HTMLElement`.
bindTooltip: function(t, n) {
return this._tooltip && this.isTooltipOpen() && this.unbindTooltip(), this._tooltip = this._initOverlay(is, this._tooltip, t, n), this._initTooltipInteractions(), this._tooltip.options.permanent && this._map && this._map.hasLayer(this) && this.openTooltip(), this;
},
// @method unbindTooltip(): this
// Removes the tooltip previously bound with `bindTooltip`.
unbindTooltip: function() {
return this._tooltip && (this._initTooltipInteractions(!0), this.closeTooltip(), this._tooltip = null), this;
},
_initTooltipInteractions: function(t) {
if (!(!t && this._tooltipHandlersAdded)) {
var n = t ? "off" : "on", a = {
remove: this.closeTooltip,
move: this._moveTooltip
};
this._tooltip.options.permanent ? a.add = this._openTooltip : (a.mouseover = this._openTooltip, a.mouseout = this.closeTooltip, a.click = this._openTooltip, this._map ? this._addFocusListeners() : a.add = this._addFocusListeners), this._tooltip.options.sticky && (a.mousemove = this._moveTooltip), this[n](a), this._tooltipHandlersAdded = !t;
}
},
// @method openTooltip(latlng?: LatLng): this
// Opens the bound tooltip at the specified `latlng` or at the default tooltip anchor if no `latlng` is passed.
openTooltip: function(t) {
return this._tooltip && (this instanceof Ce || (this._tooltip._source = this), this._tooltip._prepareOpen(t) && (this._tooltip.openOn(this._map), this.getElement ? this._setAriaDescribedByOnLayer(this) : this.eachLayer && this.eachLayer(this._setAriaDescribedByOnLayer, this))), this;
},
// @method closeTooltip(): this
// Closes the tooltip bound to this layer if it is open.
closeTooltip: function() {
if (this._tooltip)
return this._tooltip.close();
},
// @method toggleTooltip(): this
// Opens or closes the tooltip bound to this layer depending on its current state.
toggleTooltip: function() {
return this._tooltip && this._tooltip.toggle(this), this;
},
// @method isTooltipOpen(): boolean
// Returns `true` if the tooltip bound to this layer is currently open.
isTooltipOpen: function() {
return this._tooltip.isOpen();
},
// @method setTooltipContent(content: String|HTMLElement|Tooltip): this
// Sets the content of the tooltip bound to this layer.
setTooltipContent: function(t) {
return this._tooltip && this._tooltip.setContent(t), this;
},
// @method getTooltip(): Tooltip
// Returns the tooltip bound to this layer.
getTooltip: function() {
return this._tooltip;
},
_addFocusListeners: function() {
this.getElement ? this._addFocusListenersOnLayer(this) : this.eachLayer && this.eachLayer(this._addFocusListenersOnLayer, this);
},
_addFocusListenersOnLayer: function(t) {
var n = typeof t.getElement == "function" && t.getElement();
n && (J(n, "focus", function() {
this._tooltip._source = t, this.openTooltip();
}, this), J(n, "blur", this.closeTooltip, this));
},
_setAriaDescribedByOnLayer: function(t) {
var n = typeof t.getElement == "function" && t.getElement();
n && n.setAttribute("aria-describedby", this._tooltip._container.id);
},
_openTooltip: function(t) {
if (!(!this._tooltip || !this._map)) {
if (this._map.dragging && this._map.dragging.moving() && !this._openOnceFlag) {
this._openOnceFlag = !0;
var n = this;
this._map.once("moveend", function() {
n._openOnceFlag = !1, n._openTooltip(t);
});
return;
}
this._tooltip._source = t.layer || t.target, this.openTooltip(this._tooltip.options.sticky ? t.latlng : void 0);
}
},
_moveTooltip: function(t) {
var n = t.latlng, a, c;
this._tooltip.options.sticky && t.originalEvent && (a = this._map.mouseEventToContainerPoint(t.originalEvent), c = this._map.containerPointToLayerPoint(a), n = this._map.layerPointToLatLng(c)), this._tooltip.setLatLng(n);
}
});
var Xr = Pi.extend({
options: {
// @section
// @aka DivIcon options
iconSize: [12, 12],
// also can be set through CSS
// iconAnchor: (Point),
// popupAnchor: (Point),
// @option html: String|HTMLElement = ''
// Custom HTML code to put inside the div element, empty by default. Alternatively,
// an instance of `HTMLElement`.
html: !1,
// @option bgPos: Point = [0, 0]
// Optional relative position of the background, in pixels
bgPos: null,
className: "leaflet-div-icon"
},
createIcon: function(t) {
var n = t && t.tagName === "DIV" ? t : document.createElement("div"), a = this.options;
if (a.html instanceof Element ? (qn(n), n.appendChild(a.html)) : n.innerHTML = a.html !== !1 ? a.html : "", a.bgPos) {
var c = T(a.bgPos);
n.style.backgroundPosition = -c.x + "px " + -c.y + "px";
}
return this._setIconStyles(n, "icon"), n;
},
createShadow: function() {
return null;
}
});
function Lh(t) {
return new Xr(t);
}
Pi.Default = hn;
var ln = ge.extend({
// @section
// @aka GridLayer options
options: {
// @option tileSize: Number|Point = 256
// Width and height of tiles in the grid. Use a number if width and height are equal, or `L.point(width, height)` otherwise.
tileSize: 256,
// @option opacity: Number = 1.0
// Opacity of the tiles. Can be used in the `createTile()` function.
opacity: 1,
// @option updateWhenIdle: Boolean = (depends)
// Load new tiles only when panning ends.
// `true` by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.
// `false` otherwise in order to display new tiles _during_ panning, since it is easy to pan outside the
// [`keepBuffer`](#gridlayer-keepbuffer) option in desktop browsers.
updateWhenIdle: W.mobile,
// @option updateWhenZooming: Boolean = true
// By default, a smooth zoom animation (during a [touch zoom](#map-touchzoom) or a [`flyTo()`](#map-flyto)) will update grid layers every integer zoom level. Setting this option to `false` will update the grid layer only when the smooth animation ends.
updateWhenZooming: !0,
// @option updateInterval: Number = 200
// Tiles will not update more than once every `updateInterval` milliseconds when panning.
updateInterval: 200,
// @option zIndex: Number = 1
// The explicit zIndex of the tile layer.
zIndex: 1,
// @option bounds: LatLngBounds = undefined
// If set, tiles will only be loaded inside the set `LatLngBounds`.
bounds: null,
// @option minZoom: Number = 0
// The minimum zoom level down to which this layer will be displayed (inclusive).
minZoom: 0,
// @option maxZoom: Number = undefined
// The maximum zoom level up to which this layer will be displayed (inclusive).
maxZoom: void 0,
// @option maxNativeZoom: Number = undefined
// Maximum zoom number the tile source has available. If it is specified,
// the tiles on all zoom levels higher than `maxNativeZoom` will be loaded
// from `maxNativeZoom` level and auto-scaled.
maxNativeZoom: void 0,
// @option minNativeZoom: Number = undefined
// Minimum zoom number the tile source has available. If it is specified,
// the tiles on all zoom levels lower than `minNativeZoom` will be loaded
// from `minNativeZoom` level and auto-scaled.
minNativeZoom: void 0,
// @option noWrap: Boolean = false
// Whether the layer is wrapped around the antimeridian. If `true`, the
// GridLayer will only be displayed once at low zoom levels. Has no
// effect when the [map CRS](#map-crs) doesn't wrap around. Can be used
// in combination with [`bounds`](#gridlayer-bounds) to prevent requesting
// tiles outside the CRS limits.
noWrap: !1,
// @option pane: String = 'tilePane'
// `Map pane` where the grid layer will be added.
pane: "tilePane",
// @option className: String = ''
// A custom class name to assign to the tile layer. Empty by default.
className: "",
// @option keepBuffer: Number = 2
// When panning the map, keep this many rows and columns of tiles before unloading them.
keepBuffer: 2
},
initialize: function(t) {
x(this, t);
},
onAdd: function() {
this._initContainer(), this._levels = {}, this._tiles = {}, this._resetView();
},
beforeAdd: function(t) {
t._addZoomLimit(this);
},
onRemove: function(t) {
this._removeAllTiles(), Et(this._container), t._removeZoomLimit(this), this._container = null, this._tileZoom = void 0;
},
// @method bringToFront: this
// Brings the tile layer to the top of all tile layers.
bringToFront: function() {
return this._map && (xi(this._container), this._setAutoZIndex(Math.max)), this;
},
// @method bringToBack: this
// Brings the tile layer to the bottom of all tile layers.
bringToBack: function() {
return this._map && (bi(this._container), this._setAutoZIndex(Math.min)), this;
},
// @method getContainer: HTMLElement
// Returns the HTML element that contains the tiles for this layer.
getContainer: function() {
return this._container;
},
// @method setOpacity(opacity: Number): this
// Changes the [opacity](#gridlayer-opacity) of the grid layer.
setOpacity: function(t) {
return this.options.opacity = t, this._updateOpacity(), this;
},
// @method setZIndex(zIndex: Number): this
// Changes the [zIndex](#gridlayer-zindex) of the grid layer.
setZIndex: function(t) {
return this.options.zIndex = t, this._updateZIndex(), this;
},
// @method isLoading: Boolean
// Returns `true` if any tile in the grid layer has not finished loading.
isLoading: function() {
return this._loading;
},
// @method redraw: this
// Causes the layer to clear all the tiles and request them again.
redraw: function() {
if (this._map) {
this._removeAllTiles();
var t = this._clampZoom(this._map.getZoom());
t !== this._tileZoom && (this._tileZoom = t, this._updateLevels()), this._update();
}
return this;
},
getEvents: function() {
var t = {
viewprereset: this._invalidateAll,
viewreset: this._resetView,
zoom: this._resetView,
moveend: this._onMoveEnd
};
return this.options.updateWhenIdle || (this._onMove || (this._onMove = _(this._onMoveEnd, this.options.updateInterval, this)), t.move = this._onMove), this._zoomAnimated && (t.zoomanim = this._animateZoom), t;
},
// @section Extension methods
// Layers extending `GridLayer` shall reimplement the following method.
// @method createTile(coords: Object, done?: Function): HTMLElement
// Called only internally, must be overridden by classes extending `GridLayer`.
// Returns the `HTMLElement` corresponding to the given `coords`. If the `done` callback
// is specified, it must be called when the tile has finished loading and drawing.
createTile: function() {
return document.createElement("div");
},
// @section
// @method getTileSize: Point
// Normalizes the [tileSize option](#gridlayer-tilesize) into a point. Used by the `createTile()` method.
getTileSize: function() {
var t = this.options.tileSize;
return t instanceof P ? t : new P(t, t);
},
_updateZIndex: function() {
this._container && this.options.zIndex !== void 0 && this.options.zIndex !== null && (this._container.style.zIndex = this.options.zIndex);
},
_setAutoZIndex: function(t) {
for (var n = this.getPane().children, a = -t(-1 / 0, 1 / 0), c = 0, d = n.length, p; c < d; c++)
p = n[c].style.zIndex, n[c] !== this._container && p && (a = t(a, +p));
isFinite(a) && (this.options.zIndex = a + t(-1, 1), this._updateZIndex());
},
_updateOpacity: function() {
if (this._map && !W.ielt9) {
ue(this._container, this.options.opacity);
var t = +/* @__PURE__ */ new Date(), n = !1, a = !1;
for (var c in this._tiles) {
var d = this._tiles[c];
if (!(!d.current || !d.loaded)) {
var p = Math.min(1, (t - d.loaded) / 200);
ue(d.el, p), p < 1 ? n = !0 : (d.active ? a = !0 : this._onOpaqueTile(d), d.active = !0);
}
}
a && !this._noPrune && this._pruneTiles(), n && (bt(this._fadeFrame), this._fadeFrame = gt(this._updateOpacity, this));
}
},
_onOpaqueTile: m,
_initContainer: function() {
this._container || (this._container = ct("div", "leaflet-layer " + (this.options.className || "")), this._updateZIndex(), this.options.opacity < 1 && this._updateOpacity(), this.getPane().appendChild(this._container));
},
_updateLevels: function() {
var t = this._tileZoom, n = this.options.maxZoom;
if (t !== void 0) {
for (var a in this._levels)
a = Number(a), this._levels[a].el.children.length || a === t ? (this._levels[a].el.style.zIndex = n - Math.abs(t - a), this._onUpdateLevel(a)) : (Et(this._levels[a].el), this._removeTilesAtZoom(a), this._onRemoveLevel(a), delete this._levels[a]);
var c = this._levels[t], d = this._map;
return c || (c = this._levels[t] = {}, c.el = ct("div", "leaflet-tile-container leaflet-zoom-animated", this._container), c.el.style.zIndex = n, c.origin = d.project(d.unproject(d.getPixelOrigin()), t).round(), c.zoom = t, this._setZoomTransform(c, d.getCenter(), d.getZoom()), m(c.el.offsetWidth), this._onCreateLevel(c)), this._level = c, c;
}
},
_onUpdateLevel: m,
_onRemoveLevel: m,
_onCreateLevel: m,
_pruneTiles: function() {
if (this._map) {
var t, n, a = this._map.getZoom();
if (a > this.options.maxZoom || a < this.options.minZoom) {
this._removeAllTiles();
return;
}
for (t in this._tiles)
n = this._tiles[t], n.retain = n.current;
for (t in this._tiles)
if (n = this._tiles[t], n.current && !n.active) {
var c = n.coords;
this._retainParent(c.x, c.y, c.z, c.z - 5) || this._retainChildren(c.x, c.y, c.z, c.z + 2);
}
for (t in this._tiles)
this._tiles[t].retain || this._removeTile(t);
}
},
_removeTilesAtZoom: function(t) {
for (var n in this._tiles)
this._tiles[n].coords.z === t && this._removeTile(n);
},
_removeAllTiles: function() {
for (var t in this._tiles)
this._removeTile(t);
},
_invalidateAll: function() {
for (var t in this._levels)
Et(this._levels[t].el), this._onRemoveLevel(Number(t)), delete this._levels[t];
this._removeAllTiles(), this._tileZoom = void 0;
},
_retainParent: function(t, n, a, c) {
var d = Math.floor(t / 2), p = Math.floor(n / 2), y = a - 1, b = new P(+d, +p);
b.z = +y;
var S = this._tileCoordsToKey(b), I = this._tiles[S];
return I && I.active ? (I.retain = !0, !0) : (I && I.loaded && (I.retain = !0), y > c ? this._retainParent(d, p, y, c) : !1);
},
_retainChildren: function(t, n, a, c) {
for (var d = 2 * t; d < 2 * t + 2; d++)
for (var p = 2 * n; p < 2 * n + 2; p++) {
var y = new P(d, p);
y.z = a + 1;
var b = this._tileCoordsToKey(y), S = this._tiles[b];
if (S && S.active) {
S.retain = !0;
continue;
} else
S && S.loaded && (S.retain = !0);
a + 1 < c && this._retainChildren(d, p, a + 1, c);
}
},
_resetView: function(t) {
var n = t && (t.pinch || t.flyTo);
this._setView(this._map.getCenter(), this._map.getZoom(), n, n);
},
_animateZoom: function(t) {
this._setView(t.center, t.zoom, !0, t.noUpdate);
},
_clampZoom: function(t) {
var n = this.options;
return n.minNativeZoom !== void 0 && t < n.minNativeZoom ? n.minNativeZoom : n.maxNativeZoom !== void 0 && n.maxNativeZoom < t ? n.maxNativeZoom : t;
},
_setView: function(t, n, a, c) {
var d = Math.round(n);
this.options.maxZoom !== void 0 && d > this.options.maxZoom || this.options.minZoom !== void 0 && d < this.options.minZoom ? d = void 0 : d = this._clampZoom(d);
var p = this.options.updateWhenZooming && d !== this._tileZoom;
(!c || p) && (this._tileZoom = d, this._abortLoading && this._abortLoading(), this._updateLevels(), this._resetGrid(), d !== void 0 && this._update(t), a || this._pruneTiles(), this._noPrune = !!a), this._setZoomTransforms(t, n);
},
_setZoomTransforms: function(t, n) {
for (var a in this._levels)
this._setZoomTransform(this._levels[a], t, n);
},
_setZoomTransform: function(t, n, a) {
var c = this._map.getZoomScale(a, t.zoom), d = t.origin.multiplyBy(c).subtract(this._map._getNewPixelOrigin(n, a)).round();
W.any3d ? ei(t.el, d, c) : Ot(t.el, d);
},
_resetGrid: function() {
var t = this._map, n = t.options.crs, a = this._tileSize = this.getTileSize(), c = this._tileZoom, d = this._map.getPixelWorldBounds(this._tileZoom);
d && (this._globalTileRange = this._pxBoundsToTileRange(d)), this._wrapX = n.wrapLng && !this.options.noWrap && [
Math.floor(t.project([0, n.wrapLng[0]], c).x / a.x),
Math.ceil(t.project([0, n.wrapLng[1]], c).x / a.y)
], this._wrapY = n.wrapLat && !this.options.noWrap && [
Math.floor(t.project([n.wrapLat[0], 0], c).y / a.x),
Math.ceil(t.project([n.wrapLat[1], 0], c).y / a.y)
];
},
_onMoveEnd: function() {
!this._map || this._map._animatingZoom || this._update();
},
_getTiledPixelBounds: function(t) {
var n = this._map, a = n._animatingZoom ? Math.max(n._animateToZoom, n.getZoom()) : n.getZoom(), c = n.getZoomScale(a, this._tileZoom), d = n.project(t, this._tileZoom).floor(), p = n.getSize().divideBy(c * 2);
return new G(d.subtract(p), d.add(p));
},
// Private method to load tiles in the grid's active zoom level according to map bounds
_update: function(t) {
var n = this._map;
if (n) {
var a = this._clampZoom(n.getZoom());
if (t === void 0 && (t = n.getCenter()), this._tileZoom !== void 0) {
var c = this._getTiledPixelBounds(t), d = this._pxBoundsToTileRange(c), p = d.getCenter(), y = [], b = this.options.keepBuffer, S = new G(
d.getBottomLeft().subtract([b, -b]),
d.getTopRight().add([b, -b])
);
if (!(isFinite(d.min.x) && isFinite(d.min.y) && isFinite(d.max.x) && isFinite(d.max.y)))
throw new Error("Attempted to load an infinite number of tiles");
for (var I in this._tiles) {
var q = this._tiles[I].coords;
(q.z !== this._tileZoom || !S.contains(new P(q.x, q.y))) && (this._tiles[I].current = !1);
}
if (Math.abs(a - this._tileZoom) > 1) {
this._setView(t, a);
return;
}
for (var V = d.min.y; V <= d.max.y; V++)
for (var st = d.min.x; st <= d.max.x; st++) {
var Vt = new P(st, V);
if (Vt.z = this._tileZoom, !!this._isValidTile(Vt)) {
var Ut = this._tiles[this._tileCoordsToKey(Vt)];
Ut ? Ut.current = !0 : y.push(Vt);
}
}
if (y.sort(function(te, Ci) {
return te.distanceTo(p) - Ci.distanceTo(p);
}), y.length !== 0) {
this._loading || (this._loading = !0, this.fire("loading"));
var de = document.createDocumentFragment();
for (st = 0; st < y.length; st++)
this._addTile(y[st], de);
this._level.el.appendChild(de);
}
}
}
},
_isValidTile: function(t) {
var n = this._map.options.crs;
if (!n.infinite) {
var a = this._globalTileRange;
if (!n.wrapLng && (t.x < a.min.x || t.x > a.max.x) || !n.wrapLat && (t.y < a.min.y || t.y > a.max.y))
return !1;
}
if (!this.options.bounds)
return !0;
var c = this._tileCoordsToBounds(t);
return R(this.options.bounds).overlaps(c);
},
_keyToBounds: function(t) {
return this._tileCoordsToBounds(this._keyToTileCoords(t));
},
_tileCoordsToNwSe: function(t) {
var n = this._map, a = this.getTileSize(), c = t.scaleBy(a), d = c.add(a), p = n.unproject(c, t.z), y = n.unproject(d, t.z);
return [p, y];
},
// converts tile coordinates to its geographical bounds
_tileCoordsToBounds: function(t) {
var n = this._tileCoordsToNwSe(t), a = new N(n[0], n[1]);
return this.options.noWrap || (a = this._map.wrapLatLngBounds(a)), a;
},
// converts tile coordinates to key for the tile cache
_tileCoordsToKey: function(t) {
return t.x + ":" + t.y + ":" + t.z;
},
// converts tile cache key to coordinates
_keyToTileCoords: function(t) {
var n = t.split(":"), a = new P(+n[0], +n[1]);
return a.z = +n[2], a;
},
_removeTile: function(t) {
var n = this._tiles[t];
n && (Et(n.el), delete this._tiles[t], this.fire("tileunload", {
tile: n.el,
coords: this._keyToTileCoords(t)
}));
},
_initTile: function(t) {
Y(t, "leaflet-tile");
var n = this.getTileSize();
t.style.width = n.x + "px", t.style.height = n.y + "px", t.onselectstart = m, t.onmousemove = m, W.ielt9 && this.options.opacity < 1 && ue(t, this.options.opacity);
},
_addTile: function(t, n) {
var a = this._getTilePos(t), c = this._tileCoordsToKey(t), d = this.createTile(this._wrapCoords(t), l(this._tileReady, this, t));
this._initTile(d), this.createTile.length < 2 && gt(l(this._tileReady, this, t, null, d)), Ot(d, a), this._tiles[c] = {
el: d,
coords: t,
current: !0
}, n.appendChild(d), this.fire("tileloadstart", {
tile: d,
coords: t
});
},
_tileReady: function(t, n, a) {
n && this.fire("tileerror", {
error: n,
tile: a,
coords: t
});
var c = this._tileCoordsToKey(t);
a = this._tiles[c], a && (a.loaded = +/* @__PURE__ */ new Date(), this._map._fadeAnimated ? (ue(a.el, 0), bt(this._fadeFrame), this._fadeFrame = gt(this._updateOpacity, this)) : (a.active = !0, this._pruneTiles()), n || (Y(a.el, "leaflet-tile-loaded"), this.fire("tileload", {
tile: a.el,
coords: t
})), this._noTilesToLoad() && (this._loading = !1, this.fire("load"), W.ielt9 || !this._map._fadeAnimated ? gt(this._pruneTiles, this) : setTimeout(l(this._pruneTiles, this), 250)));
},
_getTilePos: function(t) {
return t.scaleBy(this.getTileSize()).subtract(this._level.origin);
},
_wrapCoords: function(t) {
var n = new P(
this._wrapX ? v(t.x, this._wrapX) : t.x,
this._wrapY ? v(t.y, this._wrapY) : t.y
);
return n.z = t.z, n;
},
_pxBoundsToTileRange: function(t) {
var n = this.getTileSize();
return new G(
t.min.unscaleBy(n).floor(),
t.max.unscaleBy(n).ceil().subtract([1, 1])
);
},
_noTilesToLoad: function() {
for (var t in this._tiles)
if (!this._tiles[t].loaded)
return !1;
return !0;
}
});
function Ch(t) {
return new ln(t);
}
var Li = ln.extend({
// @section
// @aka TileLayer options
options: {
// @option minZoom: Number = 0
// The minimum zoom level down to which this layer will be displayed (inclusive).
minZoom: 0,
// @option maxZoom: Number = 18
// The maximum zoom level up to which this layer will be displayed (inclusive).
maxZoom: 18,
// @option subdomains: String|String[] = 'abc'
// Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
subdomains: "abc",
// @option errorTileUrl: String = ''
// URL to the tile image to show in place of the tile that failed to load.
errorTileUrl: "",
// @option zoomOffset: Number = 0
// The zoom number used in tile URLs will be offset with this value.
zoomOffset: 0,
// @option tms: Boolean = false
// If `true`, inverses Y axis numbering for tiles (turn this on for [TMS](https://en.wikipedia.org/wiki/Tile_Map_Service) services).
tms: !1,
// @option zoomReverse: Boolean = false
// If set to true, the zoom number used in tile URLs will be reversed (`maxZoom - zoom` instead of `zoom`)
zoomReverse: !1,
// @option detectRetina: Boolean = false
// If `true` and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
detectRetina: !1,
// @option crossOrigin: Boolean|String = false
// Whether the crossOrigin attribute will be added to the tiles.
// If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.
// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.
crossOrigin: !1,
// @option referrerPolicy: Boolean|String = false
// Whether the referrerPolicy attribute will be added to the tiles.
// If a String is provided, all tiles will have their referrerPolicy attribute set to the String provided.
// This may be needed if your map's rendering context has a strict default but your tile provider expects a valid referrer
// (e.g. to validate an API token).
// Refer to [HTMLImageElement.referrerPolicy](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy) for valid String values.
referrerPolicy: !1
},
initialize: function(t, n) {
this._url = t, n = x(this, n), n.detectRetina && W.retina && n.maxZoom > 0 ? (n.tileSize = Math.floor(n.tileSize / 2), n.zoomReverse ? (n.zoomOffset--, n.minZoom = Math.min(n.maxZoom, n.minZoom + 1)) : (n.zoomOffset++, n.maxZoom = Math.max(n.minZoom, n.maxZoom - 1)), n.minZoom = Math.max(0, n.minZoom)) : n.zoomReverse ? n.minZoom = Math.min(n.maxZoom, n.minZoom) : n.maxZoom = Math.max(n.minZoom, n.maxZoom), typeof n.subdomains == "string" && (n.subdomains = n.subdomains.split("")), this.on("tileunload", this._onTileRemove);
},
// @method setUrl(url: String, noRedraw?: Boolean): this
// Updates the layer's URL template and redraws it (unless `noRedraw` is set to `true`).
// If the URL does not change, the layer will not be redrawn unless
// the noRedraw parameter is set to false.
setUrl: function(t, n) {
return this._url === t && n === void 0 && (n = !0), this._url = t, n || this.redraw(), this;
},
// @method createTile(coords: Object, done?: Function): HTMLElement
// Called only internally, overrides GridLayer's [`createTile()`](#gridlayer-createtile)
// to return an `<img>` HTML element with the appropriate image URL given `coords`. The `done`
// callback is called when the tile has been loaded.
createTile: function(t, n) {
var a = document.createElement("img");
return J(a, "load", l(this._tileOnLoad, this, n, a)), J(a, "error", l(this._tileOnError, this, n, a)), (this.options.crossOrigin || this.options.crossOrigin === "") && (a.crossOrigin = this.options.crossOrigin === !0 ? "" : this.options.crossOrigin), typeof this.options.referrerPolicy == "string" && (a.referrerPolicy = this.options.referrerPolicy), a.alt = "", a.src = this.getTileUrl(t), a;
},
// @section Extension methods
// @uninheritable
// Layers extending `TileLayer` might reimplement the following method.
// @method getTileUrl(coords: Object): String
// Called only internally, returns the URL for a tile given its coordinates.
// Classes extending `TileLayer` can override this function to provide custom tile URL naming schemes.
getTileUrl: function(t) {
var n = {
r: W.retina ? "@2x" : "",
s: this._getSubdomain(t),
x: t.x,
y: t.y,
z: this._getZoomForUrl()
};
if (this._map && !this._map.options.crs.infinite) {
var a = this._globalTileRange.max.y - t.y;
this.options.tms && (n.y = a), n["-y"] = a;
}
return U(this._url, o(n, this.options));
},
_tileOnLoad: function(t, n) {
W.ielt9 ? setTimeout(l(t, this, null, n), 0) : t(null, n);
},
_tileOnError: function(t, n, a) {
var c = this.options.errorTileUrl;
c && n.getAttribute("src") !== c && (n.src = c), t(a, n);
},
_onTileRemove: function(t) {
t.tile.onload = null;
},
_getZoomForUrl: function() {
var t = this._tileZoom, n = this.options.maxZoom, a = this.options.zoomReverse, c = this.options.zoomOffset;
return a && (t = n - t), t + c;
},
_getSubdomain: function(t) {
var n = Math.abs(t.x + t.y) % this.options.subdomains.length;
return this.options.subdomains[n];
},
// stops loading all tiles in the background layer
_abortLoading: function() {
var t, n;
for (t in this._tiles)
if (this._tiles[t].coords.z !== this._tileZoom && (n = this._tiles[t].el, n.onload = m, n.onerror = m, !n.complete)) {
n.src = mt;
var a = this._tiles[t].coords;
Et(n), delete this._tiles[t], this.fire("tileabort", {
tile: n,
coords: a
});
}
},
_removeTile: function(t) {
var n = this._tiles[t];
if (n)
return n.el.setAttribute("src", mt), ln.prototype._removeTile.call(this, t);
},
_tileReady: function(t, n, a) {
if (!(!this._map || a && a.getAttribute("src") === mt))
return ln.prototype._tileReady.call(this, t, n, a);
}
});
function Qr(t, n) {
return new Li(t, n);
}
var Yr = Li.extend({
// @section
// @aka TileLayer.WMS options
// If any custom options not documented here are used, they will be sent to the
// WMS server as extra parameters in each request URL. This can be useful for
// [non-standard vendor WMS parameters](https://docs.geoserver.org/stable/en/user/services/wms/vendor.html).
defaultWmsParams: {
service: "WMS",
request: "GetMap",
// @option layers: String = ''
// **(required)** Comma-separated list of WMS layers to show.
layers: "",
// @option styles: String = ''
// Comma-separated list of WMS styles.
styles: "",
// @option format: String = 'image/jpeg'
// WMS image format (use `'image/png'` for layers with transparency).
format: "image/jpeg",
// @option transparent: Boolean = false
// If `true`, the WMS service will return images with transparency.
transparent: !1,
// @option version: String = '1.1.1'
// Version of the WMS service to use
version: "1.1.1"
},
options: {
// @option crs: CRS = null
// Coordinate Reference System to use for the WMS requests, defaults to
// map CRS. Don't change this if you're not sure what it means.
crs: null,
// @option uppercase: Boolean = false
// If `true`, WMS request parameter keys will be uppercase.
uppercase: !1
},
initialize: function(t, n) {
this._url = t;
var a = o({}, this.defaultWmsParams);
for (var c in n)
c in this.options || (a[c] = n[c]);
n = x(this, n);
var d = n.detectRetina && W.retina ? 2 : 1, p = this.getTileSize();
a.width = p.x * d, a.height = p.y * d, this.wmsParams = a;
},
onAdd: function(t) {
this._crs = this.options.crs || t.options.crs, this._wmsVersion = parseFloat(this.wmsParams.version);
var n = this._wmsVersion >= 1.3 ? "crs" : "srs";
this.wmsParams[n] = this._crs.code, Li.prototype.onAdd.call(this, t);
},
getTileUrl: function(t) {
var n = this._tileCoordsToNwSe(t), a = this._crs, c = A(a.project(n[0]), a.project(n[1])), d = c.min, p = c.max, y = (this._wmsVersion >= 1.3 && this._crs === Hr ? [d.y, d.x, p.y, p.x] : [d.x, d.y, p.x, p.y]).join(","), b = Li.prototype.getTileUrl.call(this, t);
return b + C(this.wmsParams, b, this.options.uppercase) + (this.options.uppercase ? "&BBOX=" : "&bbox=") + y;
},
// @method setParams(params: Object, noRedraw?: Boolean): this
// Merges an object with the new parameters and re-requests tiles on the current screen (unless `noRedraw` was set to true).
setParams: function(t, n) {
return o(this.wmsParams, t), n || this.redraw(), this;
}
});
function Th(t, n) {
return new Yr(t, n);
}
Li.WMS = Yr, Qr.wms = Th;
var Ge = ge.extend({
// @section
// @aka Renderer options
options: {
// @option padding: Number = 0.1
// How much to extend the clip area around the map view (relative to its size)
// e.g. 0.1 would be 10% of map view in each direction
padding: 0.1
},
initialize: function(t) {
x(this, t), f(this), this._layers = this._layers || {};
},
onAdd: function() {
this._container || (this._initContainer(), Y(this._container, "leaflet-zoom-animated")), this.getPane().appendChild(this._container), this._update(), this.on("update", this._updatePaths, this);
},
onRemove: function() {
this.off("update", this._updatePaths, this), this._destroyContainer();
},
getEvents: function() {
var t = {
viewreset: this._reset,
zoom: this._onZoom,
moveend: this._update,
zoomend: this._onZoomEnd
};
return this._zoomAnimated && (t.zoomanim = this._onAnimZoom), t;
},
_onAnimZoom: function(t) {
this._updateTransform(t.center, t.zoom);
},
_onZoom: function() {
this._updateTransform(this._map.getCenter(), this._map.getZoom());
},
_updateTransform: function(t, n) {
var a = this._map.getZoomScale(n, this._zoom), c = this._map.getSize().multiplyBy(0.5 + this.options.padding), d = this._map.project(this._center, n), p = c.multiplyBy(-a).add(d).subtract(this._map._getNewPixelOrigin(t, n));
W.any3d ? ei(this._container, p, a) : Ot(this._container, p);
},
_reset: function() {
this._update(), this._updateTransform(this._center, this._zoom);
for (var t in this._layers)
this._layers[t]._reset();
},
_onZoomEnd: function() {
for (var t in this._layers)
this._layers[t]._project();
},
_updatePaths: function() {
for (var t in this._layers)
this._layers[t]._update();
},
_update: function() {
var t = this.options.padding, n = this._map.getSize(), a = this._map.containerPointToLayerPoint(n.multiplyBy(-t)).round();
this._bounds = new G(a, a.add(n.multiplyBy(1 + t * 2)).round()), this._center = this._map.getCenter(), this._zoom = this._map.getZoom();
}
}), ta = Ge.extend({
// @section
// @aka Canvas options
options: {
// @option tolerance: Number = 0
// How much to extend the click tolerance around a path/object on the map.
tolerance: 0
},
getEvents: function() {
var t = Ge.prototype.getEvents.call(this);
return t.viewprereset = this._onViewPreReset, t;
},
_onViewPreReset: function() {
this._postponeUpdatePaths = !0;
},
onAdd: function() {
Ge.prototype.onAdd.call(this), this._draw();
},
_initContainer: function() {
var t = this._container = document.createElement("canvas");
J(t, "mousemove", this._onMouseMove, this), J(t, "click dblclick mousedown mouseup contextmenu", this._onClick, this), J(t, "mouseout", this._handleMouseOut, this), t._leaflet_disable_events = !0, this._ctx = t.getContext("2d");
},
_destroyContainer: function() {
bt(this._redrawRequest), delete this._ctx, Et(this._container), wt(this._container), delete this._container;
},
_updatePaths: function() {
if (!this._postponeUpdatePaths) {
var t;
this._redrawBounds = null;
for (var n in this._layers)
t = this._layers[n], t._update();
this._redraw();
}
},
_update: function() {
if (!(this._map._animatingZoom && this._bounds)) {
Ge.prototype._update.call(this);
var t = this._bounds, n = this._container, a = t.getSize(), c = W.retina ? 2 : 1;
Ot(n, t.min), n.width = c * a.x, n.height = c * a.y, n.style.width = a.x + "px", n.style.height = a.y + "px", W.retina && this._ctx.scale(2, 2), this._ctx.translate(-t.min.x, -t.min.y), this.fire("update");
}
},
_reset: function() {
Ge.prototype._reset.call(this), this._postponeUpdatePaths && (this._postponeUpdatePaths = !1, this._updatePaths());
},
_initPath: function(t) {
this._updateDashArray(t), this._layers[f(t)] = t;
var n = t._order = {
layer: t,
prev: this._drawLast,
next: null
};
this._drawLast && (this._drawLast.next = n), this._drawLast = n, this._drawFirst = this._drawFirst || this._drawLast;
},
_addPath: function(t) {
this._requestRedraw(t);
},
_removePath: function(t) {
var n = t._order, a = n.next, c = n.prev;
a ? a.prev = c : this._drawLast = c, c ? c.next = a : this._drawFirst = a, delete t._order, delete this._layers[f(t)], this._requestRedraw(t);
},
_updatePath: function(t) {
this._extendRedrawBounds(t), t._project(), t._update(), this._requestRedraw(t);
},
_updateStyle: function(t) {
this._updateDashArray(t), this._requestRedraw(t);
},
_updateDashArray: function(t) {
if (typeof t.options.dashArray == "string") {
var n = t.options.dashArray.split(/[, ]+/), a = [], c, d;
for (d = 0; d < n.length; d++) {
if (c = Number(n[d]), isNaN(c))
return;
a.push(c);
}
t.options._dashArray = a;
} else
t.options._dashArray = t.options.dashArray;
},
_requestRedraw: function(t) {
this._map && (this._extendRedrawBounds(t), this._redrawRequest = this._redrawRequest || gt(this._redraw, this));
},
_extendRedrawBounds: function(t) {
if (t._pxBounds) {
var n = (t.options.weight || 0) + 1;
this._redrawBounds = this._redrawBounds || new G(), this._redrawBounds.extend(t._pxBounds.min.subtract([n, n])), this._redrawBounds.extend(t._pxBounds.max.add([n, n]));
}
},
_redraw: function() {
this._redrawRequest = null, this._redrawBounds && (this._redrawBounds.min._floor(), this._redrawBounds.max._ceil()), this._clear(), this._draw(), this._redrawBounds = null;
},
_clear: function() {
var t = this._redrawBounds;
if (t) {
var n = t.getSize();
this._ctx.clearRect(t.min.x, t.min.y, n.x, n.y);
} else
this._ctx.save(), this._ctx.setTransform(1, 0, 0, 1, 0, 0), this._ctx.clearRect(0, 0, this._container.width, this._container.height), this._ctx.restore();
},
_draw: function() {
var t, n = this._redrawBounds;
if (this._ctx.save(), n) {
var a = n.getSize();
this._ctx.beginPath(), this._ctx.rect(n.min.x, n.min.y, a.x, a.y), this._ctx.clip();
}
this._drawing = !0;
for (var c = this._drawFirst; c; c = c.next)
t = c.layer, (!n || t._pxBounds && t._pxBounds.intersects(n)) && t._updatePath();
this._drawing = !1, this._ctx.restore();
},
_updatePoly: function(t, n) {
if (this._drawing) {
var a, c, d, p, y = t._parts, b = y.length, S = this._ctx;
if (b) {
for (S.beginPath(), a = 0; a < b; a++) {
for (c = 0, d = y[a].length; c < d; c++)
p = y[a][c], S[c ? "lineTo" : "moveTo"](p.x, p.y);
n && S.closePath();
}
this._fillStroke(S, t);
}
}
},
_updateCircle: function(t) {
if (!(!this._drawing || t._empty())) {
var n = t._point, a = this._ctx, c = Math.max(Math.round(t._radius), 1), d = (Math.max(Math.round(t._radiusY), 1) || c) / c;
d !== 1 && (a.save(), a.scale(1, d)), a.beginPath(), a.arc(n.x, n.y / d, c, 0, Math.PI * 2, !1), d !== 1 && a.restore(), this._fillStroke(a, t);
}
},
_fillStroke: function(t, n) {
var a = n.options;
a.fill && (t.globalAlpha = a.fillOpacity, t.fillStyle = a.fillColor || a.color, t.fill(a.fillRule || "evenodd")), a.stroke && a.weight !== 0 && (t.setLineDash && t.setLineDash(n.options && n.options._dashArray || []), t.globalAlpha = a.opacity, t.lineWidth = a.weight, t.strokeStyle = a.color, t.lineCap = a.lineCap, t.lineJoin = a.lineJoin, t.stroke());
},
// Canvas obviously doesn't have mouse events for individual drawn objects,
// so we emulate that by calculating what's under the mouse on mousemove/click manually
_onClick: function(t) {
for (var n = this._map.mouseEventToLayerPoint(t), a, c, d = this._drawFirst; d; d = d.next)
a = d.layer, a.options.interactive && a._containsPoint(n) && (!(t.type === "click" || t.type === "preclick") || !this._map._draggableMoved(a)) && (c = a);
this._fireEvent(c ? [c] : !1, t);
},
_onMouseMove: function(t) {
if (!(!this._map || this._map.dragging.moving() || this._map._animatingZoom)) {
var n = this._map.mouseEventToLayerPoint(t);
this._handleMouseHover(t, n);
}
},
_handleMouseOut: function(t) {
var n = this._hoveredLayer;
n && (Ct(this._container, "leaflet-interactive"), this._fireEvent([n], t, "mouseout"), this._hoveredLayer = null, this._mouseHoverThrottled = !1);
},
_handleMouseHover: function(t, n) {
if (!this._mouseHoverThrottled) {
for (var a, c, d = this._drawFirst; d; d = d.next)
a = d.layer, a.options.interactive && a._containsPoint(n) && (c = a);
c !== this._hoveredLayer && (this._handleMouseOut(t), c && (Y(this._container, "leaflet-interactive"), this._fireEvent([c], t, "mouseover"), this._hoveredLayer = c)), this._fireEvent(this._hoveredLayer ? [this._hoveredLayer] : !1, t), this._mouseHoverThrottled = !0, setTimeout(l(function() {
this._mouseHoverThrottled = !1;
}, this), 32);
}
},
_fireEvent: function(t, n, a) {
this._map._fireDOMEvent(n, a || n.type, t);
},
_bringToFront: function(t) {
var n = t._order;
if (n) {
var a = n.next, c = n.prev;
if (a)
a.prev = c;
else
return;
c ? c.next = a : a && (this._drawFirst = a), n.prev = this._drawLast, this._drawLast.next = n, n.next = null, this._drawLast = n, this._requestRedraw(t);
}
},
_bringToBack: function(t) {
var n = t._order;
if (n) {
var a = n.next, c = n.prev;
if (c)
c.next = a;
else
return;
a ? a.prev = c : c && (this._drawLast = c), n.prev = null, n.next = this._drawFirst, this._drawFirst.prev = n, this._drawFirst = n, this._requestRedraw(t);
}
}
});
function ea(t) {
return W.canvas ? new ta(t) : null;
}
var cn = function() {
try {
return document.namespaces.add("lvml", "urn:schemas-microsoft-com:vml"), function(t) {
return document.createElement("<lvml:" + t + ' class="lvml">');
};
} catch {
}
return function(t) {
return document.createElement("<" + t + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">');
};
}(), Nh = {
_initContainer: function() {
this._container = ct("div", "leaflet-vml-container");
},
_update: function() {
this._map._animatingZoom || (Ge.prototype._update.call(this), this.fire("update"));
},
_initPath: function(t) {
var n = t._container = cn("shape");
Y(n, "leaflet-vml-shape " + (this.options.className || "")), n.coordsize = "1 1", t._path = cn("path"), n.appendChild(t._path), this._updateStyle(t), this._layers[f(t)] = t;
},
_addPath: function(t) {
var n = t._container;
this._container.appendChild(n), t.options.interactive && t.addInteractiveTarget(n);
},
_removePath: function(t) {
var n = t._container;
Et(n), t.removeInteractiveTarget(n), delete this._layers[f(t)];
},
_updateStyle: function(t) {
var n = t._stroke, a = t._fill, c = t.options, d = t._container;
d.stroked = !!c.stroke, d.filled = !!c.fill, c.stroke ? (n || (n = t._stroke = cn("stroke")), d.appendChild(n), n.weight = c.weight + "px", n.color = c.color, n.opacity = c.opacity, c.dashArray ? n.dashStyle = $(c.dashArray) ? c.dashArray.join(" ") : c.dashArray.replace(/( *, *)/g, " ") : n.dashStyle = "", n.endcap = c.lineCap.replace("butt", "flat"), n.joinstyle = c.lineJoin) : n && (d.removeChild(n), t._stroke = null), c.fill ? (a || (a = t._fill = cn("fill")), d.appendChild(a), a.color = c.fillColor || c.color, a.opacity = c.fillOpacity) : a && (d.removeChild(a), t._fill = null);
},
_updateCircle: function(t) {
var n = t._point.round(), a = Math.round(t._radius), c = Math.round(t._radiusY || a);
this._setPath(t, t._empty() ? "M0 0" : "AL " + n.x + "," + n.y + " " + a + "," + c + " 0," + 65535 * 360);
},
_setPath: function(t, n) {
t._path.v = n;
},
_bringToFront: function(t) {
xi(t._container);
},
_bringToBack: function(t) {
bi(t._container);
}
}, ns = W.vml ? cn : dt, un = Ge.extend({
_initContainer: function() {
this._container = ns("svg"), this._container.setAttribute("pointer-events", "none"), this._rootGroup = ns("g"), this._container.appendChild(this._rootGroup);
},
_destroyContainer: function() {
Et(this._container), wt(this._container), delete this._container, delete this._rootGroup, delete this._svgSize;
},
_update: function() {
if (!(this._map._animatingZoom && this._bounds)) {
Ge.prototype._update.call(this);
var t = this._bounds, n = t.getSize(), a = this._container;
(!this._svgSize || !this._svgSize.equals(n)) && (this._svgSize = n, a.setAttribute("width", n.x), a.setAttribute("height", n.y)), Ot(a, t.min), a.setAttribute("viewBox", [t.min.x, t.min.y, n.x, n.y].join(" ")), this.fire("update");
}
},
// methods below are called by vector layers implementations
_initPath: function(t) {
var n = t._path = ns("path");
t.options.className && Y(n, t.options.className), t.options.interactive && Y(n, "leaflet-interactive"), this._updateStyle(t), this._layers[f(t)] = t;
},
_addPath: function(t) {
this._rootGroup || this._initContainer(), this._rootGroup.appendChild(t._path), t.addInteractiveTarget(t._path);
},
_removePath: function(t) {
Et(t._path), t.removeInteractiveTarget(t._path), delete this._layers[f(t)];
},
_updatePath: function(t) {
t._project(), t._update();
},
_updateStyle: function(t) {
var n = t._path, a = t.options;
n && (a.stroke ? (n.setAttribute("stroke", a.color), n.setAttribute("stroke-opacity", a.opacity), n.setAttribute("stroke-width", a.weight), n.setAttribute("stroke-linecap", a.lineCap), n.setAttribute("stroke-linejoin", a.lineJoin), a.dashArray ? n.setAttribute("stroke-dasharray", a.dashArray) : n.removeAttribute("stroke-dasharray"), a.dashOffset ? n.setAttribute("stroke-dashoffset", a.dashOffset) : n.removeAttribute("stroke-dashoffset")) : n.setAttribute("stroke", "none"), a.fill ? (n.setAttribute("fill", a.fillColor || a.color), n.setAttribute("fill-opacity", a.fillOpacity), n.setAttribute("fill-rule", a.fillRule || "evenodd")) : n.setAttribute("fill", "none"));
},
_updatePoly: function(t, n) {
this._setPath(t, vt(t._parts, n));
},
_updateCircle: function(t) {
var n = t._point, a = Math.max(Math.round(t._radius), 1), c = Math.max(Math.round(t._radiusY), 1) || a, d = "a" + a + "," + c + " 0 1,0 ", p = t._empty() ? "M0 0" : "M" + (n.x - a) + "," + n.y + d + a * 2 + ",0 " + d + -a * 2 + ",0 ";
this._setPath(t, p);
},
_setPath: function(t, n) {
t._path.setAttribute("d", n);
},
// SVG does not have the concept of zIndex so we resort to changing the DOM order of elements
_bringToFront: function(t) {
xi(t._path);
},
_bringToBack: function(t) {
bi(t._path);
}
});
W.vml && un.include(Nh);
function ia(t) {
return W.svg || W.vml ? new un(t) : null;
}
ot.include({
// @namespace Map; @method getRenderer(layer: Path): Renderer
// Returns the instance of `Renderer` that should be used to render the given
// `Path`. It will ensure that the `renderer` options of the map and paths
// are respected, and that the renderers do exist on the map.
getRenderer: function(t) {
var n = t.options.renderer || this._getPaneRenderer(t.options.pane) || this.options.renderer || this._renderer;
return n || (n = this._renderer = this._createRenderer()), this.hasLayer(n) || this.addLayer(n), n;
},
_getPaneRenderer: function(t) {
if (t === "overlayPane" || t === void 0)
return !1;
var n = this._paneRenderers[t];
return n === void 0 && (n = this._createRenderer({ pane: t }), this._paneRenderers[t] = n), n;
},
_createRenderer: function(t) {
return this.options.preferCanvas && ea(t) || ia(t);
}
});
var na = Si.extend({
initialize: function(t, n) {
Si.prototype.initialize.call(this, this._boundsToLatLngs(t), n);
},
// @method setBounds(latLngBounds: LatLngBounds): this
// Redraws the rectangle with the passed bounds.
setBounds: function(t) {
return this.setLatLngs(this._boundsToLatLngs(t));
},
_boundsToLatLngs: function(t) {
return t = R(t), [
t.getSouthWest(),
t.getNorthWest(),
t.getNorthEast(),
t.getSouthEast()
];
}
});
function Gh(t, n) {
return new na(t, n);
}
un.create = ns, un.pointsToPath = vt, Ne.geometryToLayer = Jn, Ne.coordsToLatLng = Fs, Ne.coordsToLatLngs = Xn, Ne.latLngToCoords = Hs, Ne.latLngsToCoords = Qn, Ne.getFeature = Ai, Ne.asFeature = Yn, ot.mergeOptions({
// @option boxZoom: Boolean = true
// Whether the map can be zoomed to a rectangular area specified by
// dragging the mouse while pressing the shift key.
boxZoom: !0
});
var sa = xe.extend({
initialize: function(t) {
this._map = t, this._container = t._container, this._pane = t._panes.overlayPane, this._resetStateTimeout = 0, t.on("unload", this._destroy, this);
},
addHooks: function() {
J(this._container, "mousedown", this._onMouseDown, this);
},
removeHooks: function() {
wt(this._container, "mousedown", this._onMouseDown, this);
},
moved: function() {
return this._moved;
},
_destroy: function() {
Et(this._pane), delete this._pane;
},
_resetState: function() {
this._resetStateTimeout = 0, this._moved = !1;
},
_clearDeferredResetState: function() {
this._resetStateTimeout !== 0 && (clearTimeout(this._resetStateTimeout), this._resetStateTimeout = 0);
},
_onMouseDown: function(t) {
if (!t.shiftKey || t.which !== 1 && t.button !== 1)
return !1;
this._clearDeferredResetState(), this._resetState(), en(), As(), this._startPoint = this._map.mouseEventToContainerPoint(t), J(document, {
contextmenu: si,
mousemove: this._onMouseMove,
mouseup: this._onMouseUp,
keydown: this._onKeyDown
}, this);
},
_onMouseMove: function(t) {
this._moved || (this._moved = !0, this._box = ct("div", "leaflet-zoom-box", this._container), Y(this._container, "leaflet-crosshair"), this._map.fire("boxzoomstart")), this._point = this._map.mouseEventToContainerPoint(t);
var n = new G(this._point, this._startPoint), a = n.getSize();
Ot(this._box, n.min), this._box.style.width = a.x + "px", this._box.style.height = a.y + "px";
},
_finish: function() {
this._moved && (Et(this._box), Ct(this._container, "leaflet-crosshair")), nn(), Ls(), wt(document, {
contextmenu: si,
mousemove: this._onMouseMove,
mouseup: this._onMouseUp,
keydown: this._onKeyDown
}, this);
},
_onMouseUp: function(t) {
if (!(t.which !== 1 && t.button !== 1) && (this._finish(), !!this._moved)) {
this._clearDeferredResetState(), this._resetStateTimeout = setTimeout(l(this._resetState, this), 0);
var n = new N(
this._map.containerPointToLatLng(this._startPoint),
this._map.containerPointToLatLng(this._point)
);
this._map.fitBounds(n).fire("boxzoomend", { boxZoomBounds: n });
}
},
_onKeyDown: function(t) {
t.keyCode === 27 && (this._finish(), this._clearDeferredResetState(), this._resetState());
}
});
ot.addInitHook("addHandler", "boxZoom", sa), ot.mergeOptions({
// @option doubleClickZoom: Boolean|String = true
// Whether the map can be zoomed in by double clicking on it and
// zoomed out by double clicking while holding shift. If passed
// `'center'`, double-click zoom will zoom to the center of the
// view regardless of where the mouse was.
doubleClickZoom: !0
});
var ra = xe.extend({
addHooks: function() {
this._map.on("dblclick", this._onDoubleClick, this);
},
removeHooks: function() {
this._map.off("dblclick", this._onDoubleClick, this);
},
_onDoubleClick: function(t) {
var n = this._map, a = n.getZoom(), c = n.options.zoomDelta, d = t.originalEvent.shiftKey ? a - c : a + c;
n.options.doubleClickZoom === "center" ? n.setZoom(d) : n.setZoomAround(t.containerPoint, d);
}
});
ot.addInitHook("addHandler", "doubleClickZoom", ra), ot.mergeOptions({
// @option dragging: Boolean = true
// Whether the map is draggable with mouse/touch or not.
dragging: !0,
// @section Panning Inertia Options
// @option inertia: Boolean = *
// If enabled, panning of the map will have an inertia effect where
// the map builds momentum while dragging and continues moving in
// the same direction for some time. Feels especially nice on touch
// devices. Enabled by default.
inertia: !0,
// @option inertiaDeceleration: Number = 3000
// The rate with which the inertial movement slows down, in pixels/second².
inertiaDeceleration: 3400,
// px/s^2
// @option inertiaMaxSpeed: Number = Infinity
// Max speed of the inertial movement, in pixels/second.
inertiaMaxSpeed: 1 / 0,
// px/s
// @option easeLinearity: Number = 0.2
easeLinearity: 0.2,
// TODO refactor, move to CRS
// @option worldCopyJump: Boolean = false
// With this option enabled, the map tracks when you pan to another "copy"
// of the world and seamlessly jumps to the original one so that all overlays
// like markers and vector layers are still visible.
worldCopyJump: !1,
// @option maxBoundsViscosity: Number = 0.0
// If `maxBounds` is set, this option will control how solid the bounds
// are when dragging the map around. The default value of `0.0` allows the
// user to drag outside the bounds at normal speed, higher values will
// slow down map dragging outside bounds, and `1.0` makes the bounds fully
// solid, preventing the user from dragging outside the bounds.
maxBoundsViscosity: 0
});
var aa = xe.extend({
addHooks: function() {
if (!this._draggable) {
var t = this._map;
this._draggable = new Ue(t._mapPane, t._container), this._draggable.on({
dragstart: this._onDragStart,
drag: this._onDrag,
dragend: this._onDragEnd
}, this), this._draggable.on("predrag", this._onPreDragLimit, this), t.options.worldCopyJump && (this._draggable.on("predrag", this._onPreDragWrap, this), t.on("zoomend", this._onZoomEnd, this), t.whenReady(this._onZoomEnd, this));
}
Y(this._map._container, "leaflet-grab leaflet-touch-drag"), this._draggable.enable(), this._positions = [], this._times = [];
},
removeHooks: function() {
Ct(this._map._container, "leaflet-grab"), Ct(this._map._container, "leaflet-touch-drag"), this._draggable.disable();
},
moved: function() {
return this._draggable && this._draggable._moved;
},
moving: function() {
return this._draggable && this._draggable._moving;
},
_onDragStart: function() {
var t = this._map;
if (t._stop(), this._map.options.maxBounds && this._map.options.maxBoundsViscosity) {
var n = R(this._map.options.maxBounds);
this._offsetLimit = A(
this._map.latLngToContainerPoint(n.getNorthWest()).multiplyBy(-1),
this._map.latLngToContainerPoint(n.getSouthEast()).multiplyBy(-1).add(this._map.getSize())
), this._viscosity = Math.min(1, Math.max(0, this._map.options.maxBoundsViscosity));
} else
this._offsetLimit = null;
t.fire("movestart").fire("dragstart"), t.options.inertia && (this._positions = [], this._times = []);
},
_onDrag: function(t) {
if (this._map.options.inertia) {
var n = this._lastTime = +/* @__PURE__ */ new Date(), a = this._lastPos = this._draggable._absPos || this._draggable._newPos;
this._positions.push(a), this._times.push(n), this._prunePositions(n);
}
this._map.fire("move", t).fire("drag", t);
},
_prunePositions: function(t) {
for (; this._positions.length > 1 && t - this._times[0] > 50; )
this._positions.shift(), this._times.shift();
},
_onZoomEnd: function() {
var t = this._map.getSize().divideBy(2), n = this._map.latLngToLayerPoint([0, 0]);
this._initialWorldOffset = n.subtract(t).x, this._worldWidth = this._map.getPixelWorldBounds().getSize().x;
},
_viscousLimit: function(t, n) {
return t - (t - n) * this._viscosity;
},
_onPreDragLimit: function() {
if (!(!this._viscosity || !this._offsetLimit)) {
var t = this._draggable._newPos.subtract(this._draggable._startPos), n = this._offsetLimit;
t.x < n.min.x && (t.x = this._viscousLimit(t.x, n.min.x)), t.y < n.min.y && (t.y = this._viscousLimit(t.y, n.min.y)), t.x > n.max.x && (t.x = this._viscousLimit(t.x, n.max.x)), t.y > n.max.y && (t.y = this._viscousLimit(t.y, n.max.y)), this._draggable._newPos = this._draggable._startPos.add(t);
}
},
_onPreDragWrap: function() {
var t = this._worldWidth, n = Math.round(t / 2), a = this._initialWorldOffset, c = this._draggable._newPos.x, d = (c - n + a) % t + n - a, p = (c + n + a) % t - n - a, y = Math.abs(d + a) < Math.abs(p + a) ? d : p;
this._draggable._absPos = this._draggable._newPos.clone(), this._draggable._newPos.x = y;
},
_onDragEnd: function(t) {
var n = this._map, a = n.options, c = !a.inertia || t.noInertia || this._times.length < 2;
if (n.fire("dragend", t), c)
n.fire("moveend");
else {
this._prunePositions(+/* @__PURE__ */ new Date());
var d = this._lastPos.subtract(this._positions[0]), p = (this._lastTime - this._times[0]) / 1e3, y = a.easeLinearity, b = d.multiplyBy(y / p), S = b.distanceTo([0, 0]), I = Math.min(a.inertiaMaxSpeed, S), q = b.multiplyBy(I / S), V = I / (a.inertiaDeceleration * y), st = q.multiplyBy(-V / 2).round();
!st.x && !st.y ? n.fire("moveend") : (st = n._limitOffset(st, n.options.maxBounds), gt(function() {
n.panBy(st, {
duration: V,
easeLinearity: y,
noMoveStart: !0,
animate: !0
});
}));
}
}
});
ot.addInitHook("addHandler", "dragging", aa), ot.mergeOptions({
// @option keyboard: Boolean = true
// Makes the map focusable and allows users to navigate the map with keyboard
// arrows and `+`/`-` keys.
keyboard: !0,
// @option keyboardPanDelta: Number = 80
// Amount of pixels to pan when pressing an arrow key.
keyboardPanDelta: 80
});
var oa = xe.extend({
keyCodes: {
left: [37],
right: [39],
down: [40],
up: [38],
zoomIn: [187, 107, 61, 171],
zoomOut: [189, 109, 54, 173]
},
initialize: function(t) {
this._map = t, this._setPanDelta(t.options.keyboardPanDelta), this._setZoomDelta(t.options.zoomDelta);
},
addHooks: function() {
var t = this._map._container;
t.tabIndex <= 0 && (t.tabIndex = "0"), J(t, {
focus: this._onFocus,
blur: this._onBlur,
mousedown: this._onMouseDown
}, this), this._map.on({
focus: this._addHooks,
blur: this._removeHooks
}, this);
},
removeHooks: function() {
this._removeHooks(), wt(this._map._container, {
focus: this._onFocus,
blur: this._onBlur,
mousedown: this._onMouseDown
}, this), this._map.off({
focus: this._addHooks,
blur: this._removeHooks
}, this);
},
_onMouseDown: function() {
if (!this._focused) {
var t = document.body, n = document.documentElement, a = t.scrollTop || n.scrollTop, c = t.scrollLeft || n.scrollLeft;
this._map._container.focus(), window.scrollTo(c, a);
}
},
_onFocus: function() {
this._focused = !0, this._map.fire("focus");
},
_onBlur: function() {
this._focused = !1, this._map.fire("blur");
},
_setPanDelta: function(t) {
var n = this._panKeys = {}, a = this.keyCodes, c, d;
for (c = 0, d = a.left.length; c < d; c++)
n[a.left[c]] = [-1 * t, 0];
for (c = 0, d = a.right.length; c < d; c++)
n[a.right[c]] = [t, 0];
for (c = 0, d = a.down.length; c < d; c++)
n[a.down[c]] = [0, t];
for (c = 0, d = a.up.length; c < d; c++)
n[a.up[c]] = [0, -1 * t];
},
_setZoomDelta: function(t) {
var n = this._zoomKeys = {}, a = this.keyCodes, c, d;
for (c = 0, d = a.zoomIn.length; c < d; c++)
n[a.zoomIn[c]] = t;
for (c = 0, d = a.zoomOut.length; c < d; c++)
n[a.zoomOut[c]] = -t;
},
_addHooks: function() {
J(document, "keydown", this._onKeyDown, this);
},
_removeHooks: function() {
wt(document, "keydown", this._onKeyDown, this);
},
_onKeyDown: function(t) {
if (!(t.altKey || t.ctrlKey || t.metaKey)) {
var n = t.keyCode, a = this._map, c;
if (n in this._panKeys) {
if (!a._panAnim || !a._panAnim._inProgress)
if (c = this._panKeys[n], t.shiftKey && (c = T(c).multiplyBy(3)), a.options.maxBounds && (c = a._limitOffset(T(c), a.options.maxBounds)), a.options.worldCopyJump) {
var d = a.wrapLatLng(a.unproject(a.project(a.getCenter()).add(c)));
a.panTo(d);
} else
a.panBy(c);
} else if (n in this._zoomKeys)
a.setZoom(a.getZoom() + (t.shiftKey ? 3 : 1) * this._zoomKeys[n]);
else if (n === 27 && a._popup && a._popup.options.closeOnEscapeKey)
a.closePopup();
else
return;
si(t);
}
}
});
ot.addInitHook("addHandler", "keyboard", oa), ot.mergeOptions({
// @section Mouse wheel options
// @option scrollWheelZoom: Boolean|String = true
// Whether the map can be zoomed by using the mouse wheel. If passed `'center'`,
// it will zoom to the center of the view regardless of where the mouse was.
scrollWheelZoom: !0,
// @option wheelDebounceTime: Number = 40
// Limits the rate at which a wheel can fire (in milliseconds). By default
// user can't zoom via wheel more often than once per 40 ms.
wheelDebounceTime: 40,
// @option wheelPxPerZoomLevel: Number = 60
// How many scroll pixels (as reported by [L.DomEvent.getWheelDelta](#domevent-getwheeldelta))
// mean a change of one full zoom level. Smaller values will make wheel-zooming
// faster (and vice versa).
wheelPxPerZoomLevel: 60
});
var ha = xe.extend({
addHooks: function() {
J(this._map._container, "wheel", this._onWheelScroll, this), this._delta = 0;
},
removeHooks: function() {
wt(this._map._container, "wheel", this._onWheelScroll, this);
},
_onWheelScroll: function(t) {
var n = Gr(t), a = this._map.options.wheelDebounceTime;
this._delta += n, this._lastMousePos = this._map.mouseEventToContainerPoint(t), this._startTime || (this._startTime = +/* @__PURE__ */ new Date());
var c = Math.max(a - (+/* @__PURE__ */ new Date() - this._startTime), 0);
clearTimeout(this._timer), this._timer = setTimeout(l(this._performZoom, this), c), si(t);
},
_performZoom: function() {
var t = this._map, n = t.getZoom(), a = this._map.options.zoomSnap || 0;
t._stop();
var c = this._delta / (this._map.options.wheelPxPerZoomLevel * 4), d = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(c)))) / Math.LN2, p = a ? Math.ceil(d / a) * a : d, y = t._limitZoom(n + (this._delta > 0 ? p : -p)) - n;
this._delta = 0, this._startTime = null, y && (t.options.scrollWheelZoom === "center" ? t.setZoom(n + y) : t.setZoomAround(this._lastMousePos, n + y));
}
});
ot.addInitHook("addHandler", "scrollWheelZoom", ha);
var Ih = 600;
ot.mergeOptions({
// @section Touch interaction options
// @option tapHold: Boolean
// Enables simulation of `contextmenu` event, default is `true` for mobile Safari.
tapHold: W.touchNative && W.safari && W.mobile,
// @option tapTolerance: Number = 15
// The max number of pixels a user can shift his finger during touch
// for it to be considered a valid tap.
tapTolerance: 15
});
var la = xe.extend({
addHooks: function() {
J(this._map._container, "touchstart", this._onDown, this);
},
removeHooks: function() {
wt(this._map._container, "touchstart", this._onDown, this);
},
_onDown: function(t) {
if (clearTimeout(this._holdTimeout), t.touches.length === 1) {
var n = t.touches[0];
this._startPos = this._newPos = new P(n.clientX, n.clientY), this._holdTimeout = setTimeout(l(function() {
this._cancel(), this._isTapValid() && (J(document, "touchend", Ht), J(document, "touchend touchcancel", this._cancelClickPrevent), this._simulateEvent("contextmenu", n));
}, this), Ih), J(document, "touchend touchcancel contextmenu", this._cancel, this), J(document, "touchmove", this._onMove, this);
}
},
_cancelClickPrevent: function t() {
wt(document, "touchend", Ht), wt(document, "touchend touchcancel", t);
},
_cancel: function() {
clearTimeout(this._holdTimeout), wt(document, "touchend touchcancel contextmenu", this._cancel, this), wt(document, "touchmove", this._onMove, this);
},
_onMove: function(t) {
var n = t.touches[0];
this._newPos = new P(n.clientX, n.clientY);
},
_isTapValid: function() {
return this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance;
},
_simulateEvent: function(t, n) {
var a = new MouseEvent(t, {
bubbles: !0,
cancelable: !0,
view: window,
// detail: 1,
screenX: n.screenX,
screenY: n.screenY,
clientX: n.clientX,
clientY: n.clientY
// button: 2,
// buttons: 2
});
a._simulated = !0, n.target.dispatchEvent(a);
}
});
ot.addInitHook("addHandler", "tapHold", la), ot.mergeOptions({
// @section Touch interaction options
// @option touchZoom: Boolean|String = *
// Whether the map can be zoomed by touch-dragging with two fingers. If
// passed `'center'`, it will zoom to the center of the view regardless of
// where the touch events (fingers) were. Enabled for touch-capable web
// browsers.
touchZoom: W.touch,
// @option bounceAtZoomLimits: Boolean = true
// Set it to false if you don't want the map to zoom beyond min/max zoom
// and then bounce back when pinch-zooming.
bounceAtZoomLimits: !0
});
var ca = xe.extend({
addHooks: function() {
Y(this._map._container, "leaflet-touch-zoom"), J(this._map._container, "touchstart", this._onTouchStart, this);
},
removeHooks: function() {
Ct(this._map._container, "leaflet-touch-zoom"), wt(this._map._container, "touchstart", this._onTouchStart, this);
},
_onTouchStart: function(t) {
var n = this._map;
if (!(!t.touches || t.touches.length !== 2 || n._animatingZoom || this._zooming)) {
var a = n.mouseEventToContainerPoint(t.touches[0]), c = n.mouseEventToContainerPoint(t.touches[1]);
this._centerPoint = n.getSize()._divideBy(2), this._startLatLng = n.containerPointToLatLng(this._centerPoint), n.options.touchZoom !== "center" && (this._pinchStartLatLng = n.containerPointToLatLng(a.add(c)._divideBy(2))), this._startDist = a.distanceTo(c), this._startZoom = n.getZoom(), this._moved = !1, this._zooming = !0, n._stop(), J(document, "touchmove", this._onTouchMove, this), J(document, "touchend touchcancel", this._onTouchEnd, this), Ht(t);
}
},
_onTouchMove: function(t) {
if (!(!t.touches || t.touches.length !== 2 || !this._zooming)) {
var n = this._map, a = n.mouseEventToContainerPoint(t.touches[0]), c = n.mouseEventToContainerPoint(t.touches[1]), d = a.distanceTo(c) / this._startDist;
if (this._zoom = n.getScaleZoom(d, this._startZoom), !n.options.bounceAtZoomLimits && (this._zoom < n.getMinZoom() && d < 1 || this._zoom > n.getMaxZoom() && d > 1) && (this._zoom = n._limitZoom(this._zoom)), n.options.touchZoom === "center") {
if (this._center = this._startLatLng, d === 1)
return;
} else {
var p = a._add(c)._divideBy(2)._subtract(this._centerPoint);
if (d === 1 && p.x === 0 && p.y === 0)
return;
this._center = n.unproject(n.project(this._pinchStartLatLng, this._zoom).subtract(p), this._zoom);
}
this._moved || (n._moveStart(!0, !1), this._moved = !0), bt(this._animRequest);
var y = l(n._move, n, this._center, this._zoom, { pinch: !0, round: !1 }, void 0);
this._animRequest = gt(y, this, !0), Ht(t);
}
},
_onTouchEnd: function() {
if (!this._moved || !this._zooming) {
this._zooming = !1;
return;
}
this._zooming = !1, bt(this._animRequest), wt(document, "touchmove", this._onTouchMove, this), wt(document, "touchend touchcancel", this._onTouchEnd, this), this._map.options.zoomAnimation ? this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), !0, this._map.options.zoomSnap) : this._map._resetView(this._center, this._map._limitZoom(this._zoom));
}
});
ot.addInitHook("addHandler", "touchZoom", ca), ot.BoxZoom = sa, ot.DoubleClickZoom = ra, ot.Drag = aa, ot.Keyboard = oa, ot.ScrollWheelZoom = ha, ot.TapHold = la, ot.TouchZoom = ca, s.Bounds = G, s.Browser = W, s.CRS = K, s.Canvas = ta, s.Circle = $s, s.CircleMarker = Vn, s.Class = Dt, s.Control = me, s.DivIcon = Xr, s.DivOverlay = be, s.DomEvent = Xo, s.DomUtil = Vo, s.Draggable = Ue, s.Evented = ae, s.FeatureGroup = Ce, s.GeoJSON = Ne, s.GridLayer = ln, s.Handler = xe, s.Icon = Pi, s.ImageOverlay = ts, s.LatLng = F, s.LatLngBounds = N, s.Layer = ge, s.LayerGroup = Ei, s.LineUtil = ch, s.Map = ot, s.Marker = Kn, s.Mixin = sh, s.Path = Ze, s.Point = P, s.PolyUtil = rh, s.Polygon = Si, s.Polyline = Te, s.Popup = es, s.PosAnimation = Ir, s.Projection = uh, s.Rectangle = na, s.Renderer = Ge, s.SVG = un, s.SVGOverlay = Jr, s.TileLayer = Li, s.Tooltip = is, s.Transformation = rt, s.Util = re, s.VideoOverlay = Vr, s.bind = l, s.bounds = A, s.canvas = ea, s.circle = yh, s.circleMarker = vh, s.control = an, s.divIcon = Lh, s.extend = o, s.featureGroup = ph, s.geoJSON = Kr, s.geoJson = xh, s.gridLayer = Ch, s.icon = mh, s.imageOverlay = bh, s.latLng = H, s.latLngBounds = R, s.layerGroup = _h, s.map = Qo, s.marker = gh, s.point = T, s.polygon = wh, s.polyline = Mh, s.popup = Sh, s.rectangle = Gh, s.setOptions = x, s.stamp = f, s.svg = ia, s.svgOverlay = Ph, s.tileLayer = Qr, s.tooltip = Ah, s.transformation = z, s.version = r, s.videoOverlay = Eh;
var Oh = window.L;
s.noConflict = function() {
return window.L = Oh, this;
}, window.L = s;
});
})(ir, ir.exports);
var w = ir.exports;
const ds = /* @__PURE__ */ _l(w);
function Qt(e, i) {
return w.Util.extend(i, e.geocodingQueryParams);
}
function ne(e, i) {
return w.Util.extend(i, e.reverseQueryParams);
}
let pl = 0;
const ml = /[&<>"'`]/g, gl = /[&<>"'`]/, vl = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'",
"`": "`"
};
function yl(e) {
return vl[e];
}
function Ml(e) {
return e == null ? "" : e ? (e = "" + e, gl.test(e) ? e.replace(ml, yl) : e) : e + "";
}
function Ea(e, i, s, r, o) {
const h = "_l_geocoder_" + pl++;
i[o || "callback"] = h, window[h] = w.Util.bind(s, r);
const l = document.createElement("script");
l.type = "text/javascript", l.src = e + Ya(i), l.id = h, document.getElementsByTagName("head")[0].appendChild(l);
}
function St(e, i, s) {
const r = new XMLHttpRequest();
r.onreadystatechange = function() {
if (r.readyState !== 4)
return;
let o;
if (r.status !== 200 && r.status !== 304)
o = "";
else if (typeof r.response == "string")
try {
o = JSON.parse(r.response);
} catch {
o = r.response;
}
else
o = r.response;
s(o);
}, r.open("GET", e + Ya(i), !0), r.responseType = "json", r.setRequestHeader("Accept", "application/json"), r.send(null);
}
function wl(e, i) {
return e.replace(/\{ *([\w_]+) *\}/g, (s, r) => {
let o = i[r];
return o === void 0 ? o = "" : typeof o == "function" && (o = o(i)), Ml(o);
});
}
function Ya(e, i, s) {
const r = [];
for (const o in e) {
const h = encodeURIComponent(s ? o.toUpperCase() : o), l = e[o];
if (!Array.isArray(l))
r.push(h + "=" + encodeURIComponent(String(l)));
else
for (let u = 0; u < l.length; u++)
r.push(h + "=" + encodeURIComponent(l[u]));
}
return (!i || i.indexOf("?") === -1 ? "?" : "&") + r.join("&");
}
class to {
constructor(i) {
this.options = {
serviceUrl: "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",
apiKey: ""
}, w.Util.setOptions(this, i);
}
geocode(i, s, r) {
const o = Qt(this.options, {
token: this.options.apiKey,
SingleLine: i,
outFields: "Addr_Type",
forStorage: !1,
maxLocations: 10,
f: "json"
});
St(this.options.serviceUrl + "/findAddressCandidates", o, (h) => {
const l = [];
if (h.candidates && h.candidates.length)
for (let u = 0; u <= h.candidates.length - 1; u++) {
const f = h.candidates[u], _ = w.latLng(f.location.y, f.location.x), v = w.latLngBounds(w.latLng(f.extent.ymax, f.extent.xmax), w.latLng(f.extent.ymin, f.extent.xmin));
l[u] = {
name: f.address,
bbox: v,
center: _
};
}
s.call(r, l);
});
}
suggest(i, s, r) {
return this.geocode(i, s, r);
}
reverse(i, s, r, o) {
const h = ne(this.options, {
location: i.lng + "," + i.lat,
distance: 100,
f: "json"
});
St(this.options.serviceUrl + "/reverseGeocode", h, (l) => {
const u = [];
if (l && !l.error) {
const f = w.latLng(l.location.y, l.location.x), _ = w.latLngBounds(f, f);
u.push({
name: l.address.Match_addr,
center: f,
bbox: _
});
}
r.call(o, u);
});
}
}
function xl(e) {
return new to(e);
}
class eo {
constructor(i) {
this.options = {
serviceUrl: "https://dev.virtualearth.net/REST/v1/Locations"
}, w.Util.setOptions(this, i);
}
geocode(i, s, r) {
const o = Qt(this.options, {
query: i,
key: this.options.apiKey
});
Ea(this.options.apiKey, o, (h) => {
const l = [];
if (h.resourceSets.length > 0)
for (let u = h.resourceSets[0].resources.length - 1; u >= 0; u--) {
const f = h.resourceSets[0].resources[u], _ = f.bbox;
l[u] = {
name: f.name,
bbox: w.latLngBounds([_[0], _[1]], [_[2], _[3]]),
center: w.latLng(f.point.coordinates)
};
}
s.call(r, l);
}, this, "jsonp");
}
reverse(i, s, r, o) {
const h = ne(this.options, {
key: this.options.apiKey
});
Ea(this.options.serviceUrl + i.lat + "," + i.lng, h, (l) => {
const u = [];
for (let f = l.resourceSets[0].resources.length - 1; f >= 0; f--) {
const _ = l.resourceSets[0].resources[f], v = _.bbox;
u[f] = {
name: _.name,
bbox: w.latLngBounds([v[0], v[1]], [v[2], v[3]]),
center: w.latLng(_.point.coordinates)
};
}
r.call(o, u);
}, this, "jsonp");
}
}
function bl(e) {
return new eo(e);
}
class io {
constructor(i) {
this.options = {
serviceUrl: "https://maps.googleapis.com/maps/api/geocode/json"
}, w.Util.setOptions(this, i);
}
geocode(i, s, r) {
const o = Qt(this.options, {
key: this.options.apiKey,
address: i
});
St(this.options.serviceUrl, o, (h) => {
const l = [];
if (h.results && h.results.length)
for (let u = 0; u <= h.results.length - 1; u++) {
const f = h.results[u], _ = w.latLng(f.geometry.location), v = w.latLngBounds(w.latLng(f.geometry.viewport.northeast), w.latLng(f.geometry.viewport.southwest));
l[u] = {
name: f.formatted_address,
bbox: v,
center: _,
properties: f.address_components
};
}
s.call(r, l);
});
}
reverse(i, s, r, o) {
const h = ne(this.options, {
key: this.options.apiKey,
latlng: i.lat + "," + i.lng
});
St(this.options.serviceUrl, h, (l) => {
const u = [];
if (l.results && l.results.length)
for (let f = 0; f <= l.results.length - 1; f++) {
const _ = l.results[f], v = w.latLng(_.geometry.location), m = w.latLngBounds(w.latLng(_.geometry.viewport.northeast), w.latLng(_.geometry.viewport.southwest));
u[f] = {
name: _.formatted_address,
bbox: m,
center: v,
properties: _.address_components
};
}
r.call(o, u);
});
}
}
function El(e) {
return new io(e);
}
class no {
constructor(i) {
if (this.options = {
serviceUrl: "https://geocoder.api.here.com/6.2/",
app_id: "",
app_code: "",
apiKey: "",
maxResults: 5
}, w.Util.setOptions(this, i), i.apiKey)
throw Error("apiKey is not supported, use app_id/app_code instead!");
}
geocode(i, s, r) {
const o = Qt(this.options, {
searchtext: i,
gen: 9,
app_id: this.options.app_id,
app_code: this.options.app_code,
jsonattributes: 1,
maxresults: this.options.maxResults
});
this.getJSON(this.options.serviceUrl + "geocode.json", o, s, r);
}
reverse(i, s, r, o) {
let h = i.lat + "," + i.lng;
this.options.reverseGeocodeProxRadius && (h += "," + this.options.reverseGeocodeProxRadius);
const l = ne(this.options, {
prox: h,
mode: "retrieveAddresses",
app_id: this.options.app_id,
app_code: this.options.app_code,
gen: 9,
jsonattributes: 1,
maxresults: this.options.maxResults
});
this.getJSON(this.options.serviceUrl + "reversegeocode.json", l, r, o);
}
getJSON(i, s, r, o) {
St(i, s, (h) => {
const l = [];
if (h.response.view && h.response.view.length)
for (let u = 0; u <= h.response.view[0].result.length - 1; u++) {
const f = h.response.view[0].result[u].location, _ = w.latLng(f.displayPosition.latitude, f.displayPosition.longitude), v = w.latLngBounds(w.latLng(f.mapView.topLeft.latitude, f.mapView.topLeft.longitude), w.latLng(f.mapView.bottomRight.latitude, f.mapView.bottomRight.longitude));
l[u] = {
name: f.address.label,
properties: f.address,
bbox: v,
center: _
};
}
r.call(o, l);
});
}
}
class so {
constructor(i) {
this.options = {
serviceUrl: "https://geocode.search.hereapi.com/v1",
apiKey: "",
app_id: "",
app_code: "",
maxResults: 10
}, w.Util.setOptions(this, i);
}
geocode(i, s, r) {
const o = Qt(this.options, {
q: i,
apiKey: this.options.apiKey,
limit: this.options.maxResults
});
if (!o.at && !o.in)
throw Error("at / in parameters not found. Please define coordinates (at=latitude,longitude) or other (in) in your geocodingQueryParams.");
this.getJSON(this.options.serviceUrl + "/discover", o, s, r);
}
reverse(i, s, r, o) {
const h = ne(this.options, {
at: i.lat + "," + i.lng,
limit: this.options.reverseGeocodeProxRadius,
apiKey: this.options.apiKey
});
this.getJSON(this.options.serviceUrl + "/revgeocode", h, r, o);
}
getJSON(i, s, r, o) {
St(i, s, (h) => {
const l = [];
if (h.items && h.items.length)
for (let u = 0; u <= h.items.length - 1; u++) {
const f = h.items[u], _ = w.latLng(f.position.lat, f.position.lng);
let v;
f.mapView ? v = w.latLngBounds(w.latLng(f.mapView.south, f.mapView.west), w.latLng(f.mapView.north, f.mapView.east)) : v = w.latLngBounds(w.latLng(f.position.lat, f.position.lng), w.latLng(f.position.lat, f.position.lng)), l[u] = {
name: f.address.label,
properties: f.address,
bbox: v,
center: _
};
}
r.call(o, l);
});
}
}
function Pl(e) {
return e.apiKey ? new so(e) : new no(e);
}
function ro(e) {
let i;
if (i = e.match(/^([NS])\s*(\d{1,3}(?:\.\d*)?)\W*([EW])\s*(\d{1,3}(?:\.\d*)?)$/))
return w.latLng((/N/i.test(i[1]) ? 1 : -1) * +i[2], (/E/i.test(i[3]) ? 1 : -1) * +i[4]);
if (i = e.match(/^(\d{1,3}(?:\.\d*)?)\s*([NS])\W*(\d{1,3}(?:\.\d*)?)\s*([EW])$/))
return w.latLng((/N/i.test(i[2]) ? 1 : -1) * +i[1], (/E/i.test(i[4]) ? 1 : -1) * +i[3]);
if (i = e.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?$/))
return w.latLng((/N/i.test(i[1]) ? 1 : -1) * (+i[2] + +i[3] / 60), (/E/i.test(i[4]) ? 1 : -1) * (+i[5] + +i[6] / 60));
if (i = e.match(/^(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([EW])$/))
return w.latLng((/N/i.test(i[3]) ? 1 : -1) * (+i[1] + +i[2] / 60), (/E/i.test(i[6]) ? 1 : -1) * (+i[4] + +i[5] / 60));
if (i = e.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?$/))
return w.latLng((/N/i.test(i[1]) ? 1 : -1) * (+i[2] + +i[3] / 60 + +i[4] / 3600), (/E/i.test(i[5]) ? 1 : -1) * (+i[6] + +i[7] / 60 + +i[8] / 3600));
if (i = e.match(/^(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]\s*([NS])\W*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\s*([EW])$/))
return w.latLng((/N/i.test(i[4]) ? 1 : -1) * (+i[1] + +i[2] / 60 + +i[3] / 3600), (/E/i.test(i[8]) ? 1 : -1) * (+i[5] + +i[6] / 60 + +i[7] / 3600));
if (i = e.match(/^\s*([+-]?\d+(?:\.\d*)?)\s*[\s,]\s*([+-]?\d+(?:\.\d*)?)\s*$/))
return w.latLng(+i[1], +i[2]);
}
class ao {
constructor(i) {
this.options = {
next: void 0,
sizeInMeters: 1e4
}, w.Util.setOptions(this, i);
}
geocode(i, s, r) {
const o = ro(i);
if (o) {
const h = [{
name: i,
center: o,
bbox: o.toBounds(this.options.sizeInMeters)
}];
s.call(r, h);
} else
this.options.next && this.options.next.geocode(i, s, r);
}
}
function Sl(e) {
return new ao(e);
}
class oo {
constructor(i) {
this.options = {
serviceUrl: "https://api.mapbox.com/geocoding/v5/mapbox.places/"
}, w.Util.setOptions(this, i);
}
_getProperties(i) {
const s = {
text: i.text,
address: i.address
};
for (let r = 0; r < (i.context || []).length; r++) {
const o = i.context[r].id.split(".")[0];
s[o] = i.context[r].text, i.context[r].short_code && (s.countryShortCode = i.context[r].short_code);
}
return s;
}
geocode(i, s, r) {
const o = Qt(this.options, {
access_token: this.options.apiKey
});
o.proximity !== void 0 && o.proximity.lat !== void 0 && o.proximity.lng !== void 0 && (o.proximity = o.proximity.lng + "," + o.proximity.lat), St(this.options.serviceUrl + encodeURIComponent(i) + ".json", o, (h) => {
const l = [];
if (h.features && h.features.length)
for (let u = 0; u <= h.features.length - 1; u++) {
const f = h.features[u], _ = w.latLng(f.center.reverse());
let v;
f.bbox ? v = w.latLngBounds(w.latLng(f.bbox.slice(0, 2).reverse()), w.latLng(f.bbox.slice(2, 4).reverse())) : v = w.latLngBounds(_, _), l[u] = {
name: f.place_name,
bbox: v,
center: _,
properties: this._getProperties(f)
};
}
s.call(r, l);
});
}
suggest(i, s, r) {
return this.geocode(i, s, r);
}
reverse(i, s, r, o) {
const h = this.options.serviceUrl + i.lng + "," + i.lat + ".json", l = ne(this.options, {
access_token: this.options.apiKey
});
St(h, l, (u) => {
const f = [];
if (u.features && u.features.length)
for (let _ = 0; _ <= u.features.length - 1; _++) {
const v = u.features[_], m = w.latLng(v.center.reverse());
let g;
v.bbox ? g = w.latLngBounds(w.latLng(v.bbox.slice(0, 2).reverse()), w.latLng(v.bbox.slice(2, 4).reverse())) : g = w.latLngBounds(m, m), f[_] = {
name: v.place_name,
bbox: g,
center: m,
properties: this._getProperties(v)
};
}
r.call(o, f);
});
}
}
function Al(e) {
return new oo(e);
}
class ho {
constructor(i) {
this.options = {
serviceUrl: "https://www.mapquestapi.com/geocoding/v1"
}, w.Util.setOptions(this, i), this.options.apiKey = decodeURIComponent(this.options.apiKey);
}
_formatName(...i) {
return i.filter((s) => !!s).join(", ");
}
geocode(i, s, r) {
const o = Qt(this.options, {
key: this.options.apiKey,
location: i,
limit: 5,
outFormat: "json"
});
St(this.options.serviceUrl + "/address", o, w.Util.bind(function(h) {
const l = [];
if (h.results && h.results[0].locations)
for (let u = h.results[0].locations.length - 1; u >= 0; u--) {
const f = h.results[0].locations[u], _ = w.latLng(f.latLng);
l[u] = {
name: this._formatName(f.street, f.adminArea4, f.adminArea3, f.adminArea1),
bbox: w.latLngBounds(_, _),
center: _
};
}
s.call(r, l);
}, this));
}
reverse(i, s, r, o) {
const h = ne(this.options, {
key: this.options.apiKey,
location: i.lat + "," + i.lng,
outputFormat: "json"
});
St(this.options.serviceUrl + "/reverse", h, w.Util.bind(function(l) {
const u = [];
if (l.results && l.results[0].locations)
for (let f = l.results[0].locations.length - 1; f >= 0; f--) {
const _ = l.results[0].locations[f], v = w.latLng(_.latLng);
u[f] = {
name: this._formatName(_.street, _.adminArea4, _.adminArea3, _.adminArea1),
bbox: w.latLngBounds(v, v),
center: v
};
}
r.call(o, u);
}, this));
}
}
function Ll(e) {
return new ho(e);
}
class lo {
constructor(i) {
this.options = {
userId: void 0,
apiKey: void 0,
serviceUrl: "https://neutrinoapi.com/"
}, w.Util.setOptions(this, i);
}
// https://www.neutrinoapi.com/api/geocode-address/
geocode(i, s, r) {
const o = Qt(this.options, {
apiKey: this.options.apiKey,
userId: this.options.userId,
//get three words and make a dot based string
address: i.split(/\s+/).join(".")
});
St(this.options.serviceUrl + "geocode-address", o, (h) => {
const l = [];
if (h.locations) {
h.geometry = h.locations[0];
const u = w.latLng(h.geometry.latitude, h.geometry.longitude), f = w.latLngBounds(u, u);
l[0] = {
name: h.geometry.address,
bbox: f,
center: u
};
}
s.call(r, l);
});
}
suggest(i, s, r) {
return this.geocode(i, s, r);
}
// https://www.neutrinoapi.com/api/geocode-reverse/
reverse(i, s, r, o) {
const h = ne(this.options, {
apiKey: this.options.apiKey,
userId: this.options.userId,
latitude: i.lat,
longitude: i.lng
});
St(this.options.serviceUrl + "geocode-reverse", h, (l) => {
const u = [];
if (l.status.status == 200 && l.found) {
const f = w.latLng(i.lat, i.lng), _ = w.latLngBounds(f, f);
u[0] = {
name: l.address,
bbox: _,
center: f
};
}
r.call(o, u);
});
}
}
function Cl(e) {
return new lo(e);
}
class ur {
constructor(i) {
this.options = {
serviceUrl: "https://nominatim.openstreetmap.org/",
htmlTemplate: function(s) {
const r = s.address;
let o;
const h = [];
return (r.road || r.building) && h.push("{building} {road} {house_number}"), (r.city || r.town || r.village || r.hamlet) && (o = h.length > 0 ? "leaflet-control-geocoder-address-detail" : "", h.push('<span class="' + o + '">{postcode} {city} {town} {village} {hamlet}</span>')), (r.state || r.country) && (o = h.length > 0 ? "leaflet-control-geocoder-address-context" : "", h.push('<span class="' + o + '">{state} {country}</span>')), wl(h.join("<br/>"), r);
}
}, w.Util.setOptions(this, i || {});
}
geocode(i, s, r) {
const o = Qt(this.options, {
q: i,
limit: 5,
format: "json",
addressdetails: 1
});
St(this.options.serviceUrl + "search", o, (h) => {
const l = [];
for (let u = h.length - 1; u >= 0; u--) {
const f = h[u].boundingbox;
for (let _ = 0; _ < 4; _++)
f[_] = +f[_];
l[u] = {
icon: h[u].icon,
name: h[u].display_name,
html: this.options.htmlTemplate ? this.options.htmlTemplate(h[u]) : void 0,
bbox: w.latLngBounds([f[0], f[2]], [f[1], f[3]]),
center: w.latLng(h[u].lat, h[u].lon),
properties: h[u]
};
}
s.call(r, l);
});
}
reverse(i, s, r, o) {
const h = ne(this.options, {
lat: i.lat,
lon: i.lng,
zoom: Math.round(Math.log(s / 256) / Math.log(2)),
addressdetails: 1,
format: "json"
});
St(this.options.serviceUrl + "reverse", h, (l) => {
const u = [];
if (l && l.lat && l.lon) {
const f = w.latLng(l.lat, l.lon), _ = w.latLngBounds(f, f);
u.push({
name: l.display_name,
html: this.options.htmlTemplate ? this.options.htmlTemplate(l) : void 0,
center: f,
bbox: _,
properties: l
});
}
r.call(o, u);
});
}
}
function Tl(e) {
return new ur(e);
}
class co {
constructor(i) {
w.Util.setOptions(this, i);
}
geocode(i, s, r) {
try {
const o = this.options.OpenLocationCode.decode(i), h = {
name: i,
center: w.latLng(o.latitudeCenter, o.longitudeCenter),
bbox: w.latLngBounds(w.latLng(o.latitudeLo, o.longitudeLo), w.latLng(o.latitudeHi, o.longitudeHi))
};
s.call(r, [h]);
} catch (o) {
console.warn(o), s.call(r, []);
}
}
reverse(i, s, r, o) {
try {
const l = {
name: this.options.OpenLocationCode.encode(i.lat, i.lng, this.options.codeLength),
center: w.latLng(i.lat, i.lng),
bbox: w.latLngBounds(w.latLng(i.lat, i.lng), w.latLng(i.lat, i.lng))
};
r.call(o, [l]);
} catch (h) {
console.warn(h), r.call(o, []);
}
}
}
function Nl(e) {
return new co(e);
}
class uo {
constructor(i) {
this.options = {
serviceUrl: "https://api.opencagedata.com/geocode/v1/json"
}, w.Util.setOptions(this, i);
}
geocode(i, s, r) {
const o = Qt(this.options, {
key: this.options.apiKey,
q: i
});
St(this.options.serviceUrl, o, (h) => {
const l = [];
if (h.results && h.results.length)
for (let u = 0; u < h.results.length; u++) {
const f = h.results[u], _ = w.latLng(f.geometry);
let v;
f.annotations && f.annotations.bounds ? v = w.latLngBounds(w.latLng(f.annotations.bounds.northeast), w.latLng(f.annotations.bounds.southwest)) : v = w.latLngBounds(_, _), l.push({
name: f.formatted,
bbox: v,
center: _
});
}
s.call(r, l);
});
}
suggest(i, s, r) {
return this.geocode(i, s, r);
}
reverse(i, s, r, o) {
const h = ne(this.options, {
key: this.options.apiKey,
q: [i.lat, i.lng].join(",")
});
St(this.options.serviceUrl, h, (l) => {
const u = [];
if (l.results && l.results.length)
for (let f = 0; f < l.results.length; f++) {
const _ = l.results[f], v = w.latLng(_.geometry);
let m;
_.annotations && _.annotations.bounds ? m = w.latLngBounds(w.latLng(_.annotations.bounds.northeast), w.latLng(_.annotations.bounds.southwest)) : m = w.latLngBounds(v, v), u.push({
name: _.formatted,
bbox: m,
center: v
});
}
r.call(o, u);
});
}
}
function Gl(e) {
return new uo(e);
}
class In {
constructor(i) {
this.options = {
serviceUrl: "https://api.geocode.earth/v1"
}, this._lastSuggest = 0, w.Util.setOptions(this, i);
}
geocode(i, s, r) {
const o = Qt(this.options, {
api_key: this.options.apiKey,
text: i
});
St(this.options.serviceUrl + "/search", o, (h) => {
s.call(r, this._parseResults(h, "bbox"));
});
}
suggest(i, s, r) {
const o = Qt(this.options, {
api_key: this.options.apiKey,
text: i
});
St(this.options.serviceUrl + "/autocomplete", o, (h) => {
h.geocoding.timestamp > this._lastSuggest && (this._lastSuggest = h.geocoding.timestamp, s.call(r, this._parseResults(h, "bbox")));
});
}
reverse(i, s, r, o) {
const h = ne(this.options, {
api_key: this.options.apiKey,
"point.lat": i.lat,
"point.lon": i.lng
});
St(this.options.serviceUrl + "/reverse", h, (l) => {
r.call(o, this._parseResults(l, "bounds"));
});
}
_parseResults(i, s) {
const r = [];
return w.geoJSON(i, {
pointToLayer: function(o, h) {
return w.circleMarker(h);
},
onEachFeature: function(o, h) {
const l = {};
let u, f;
h.getBounds ? (u = h.getBounds(), f = u.getCenter()) : h.feature.bbox ? (f = h.getLatLng(), u = w.latLngBounds(w.GeoJSON.coordsToLatLng(h.feature.bbox.slice(0, 2)), w.GeoJSON.coordsToLatLng(h.feature.bbox.slice(2, 4)))) : (f = h.getLatLng(), u = w.latLngBounds(f, f)), l.name = h.feature.properties.label, l.center = f, l[s] = u, l.properties = h.feature.properties, r.push(l);
}
}), r;
}
}
function fr(e) {
return new In(e);
}
const Il = In, Ol = fr, kl = In, Rl = fr;
class fo extends In {
constructor(i) {
super(w.Util.extend({
serviceUrl: "https://api.openrouteservice.org/geocode"
}, i));
}
}
function zl(e) {
return new fo(e);
}
class _o {
constructor(i) {
this.options = {
serviceUrl: "https://photon.komoot.io/api/",
reverseUrl: "https://photon.komoot.io/reverse/",
nameProperties: ["name", "street", "suburb", "hamlet", "town", "city", "state", "country"]
}, w.Util.setOptions(this, i);
}
geocode(i, s, r) {
const o = Qt(this.options, {
q: i
});
St(this.options.serviceUrl, o, w.Util.bind(function(h) {
s.call(r, this._decodeFeatures(h));
}, this));
}
suggest(i, s, r) {
return this.geocode(i, s, r);
}
reverse(i, s, r, o) {
const h = ne(this.options, {
lat: i.lat,
lon: i.lng
});
St(this.options.reverseUrl, h, w.Util.bind(function(l) {
r.call(o, this._decodeFeatures(l));
}, this));
}
_decodeFeatures(i) {
const s = [];
if (i && i.features)
for (let r = 0; r < i.features.length; r++) {
const o = i.features[r], h = o.geometry.coordinates, l = w.latLng(h[1], h[0]), u = o.properties.extent, f = u ? w.latLngBounds([u[1], u[0]], [u[3], u[2]]) : w.latLngBounds(l, l);
s.push({
name: this._decodeFeatureName(o),
html: this.options.htmlTemplate ? this.options.htmlTemplate(o) : void 0,
center: l,
bbox: f,
properties: o.properties
});
}
return s;
}
_decodeFeatureName(i) {
return (this.options.nameProperties || []).map((s) => i.properties[s]).filter((s) => !!s).join(", ");
}
}
function Dl(e) {
return new _o(e);
}
class po {
constructor(i) {
this.options = {
serviceUrl: "https://api.what3words.com/v2/"
}, w.Util.setOptions(this, i);
}
geocode(i, s, r) {
St(this.options.serviceUrl + "forward", Qt(this.options, {
key: this.options.apiKey,
addr: i.split(/\s+/).join(".")
}), (o) => {
const h = [];
if (o.geometry) {
const l = w.latLng(o.geometry.lat, o.geometry.lng), u = w.latLngBounds(l, l);
h[0] = {
name: o.words,
bbox: u,
center: l
};
}
s.call(r, h);
});
}
suggest(i, s, r) {
return this.geocode(i, s, r);
}
reverse(i, s, r, o) {
St(this.options.serviceUrl + "reverse", ne(this.options, {
key: this.options.apiKey,
coords: [i.lat, i.lng].join(",")
}), (h) => {
const l = [];
if (h.status.status == 200) {
const u = w.latLng(h.geometry.lat, h.geometry.lng), f = w.latLngBounds(u, u);
l[0] = {
name: h.words,
bbox: f,
center: u
};
}
r.call(o, l);
});
}
}
function Bl(e) {
return new po(e);
}
var Ul = {
__proto__: null,
geocodingParams: Qt,
reverseParams: ne,
ArcGis: to,
arcgis: xl,
Bing: eo,
bing: bl,
Google: io,
google: El,
HERE: no,
HEREv2: so,
here: Pl,
parseLatLng: ro,
LatLng: ao,
latLng: Sl,
Mapbox: oo,
mapbox: Al,
MapQuest: ho,
mapQuest: Ll,
Neutrino: lo,
neutrino: Cl,
Nominatim: ur,
nominatim: Tl,
OpenLocationCode: co,
openLocationCode: Nl,
OpenCage: uo,
opencage: Gl,
Pelias: In,
pelias: fr,
GeocodeEarth: Il,
geocodeEarth: Ol,
Mapzen: kl,
mapzen: Rl,
Openrouteservice: fo,
openrouteservice: zl,
Photon: _o,
photon: Dl,
What3Words: po,
what3words: Bl
};
class dr {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
constructor(...i) {
}
}
w.Util.extend(dr.prototype, w.Control.prototype);
w.Util.extend(dr.prototype, w.Evented.prototype);
class ws extends dr {
/**
* Instantiates a geocoder control (to be invoked using `new`)
* @param options the options
*/
constructor(i) {
super(i), this.options = {
showUniqueResult: !0,
showResultIcons: !1,
collapsed: !0,
expand: "touch",
position: "topright",
placeholder: "Search...",
errorMessage: "Nothing found.",
iconLabel: "Initiate a new search",
query: "",
queryMinLength: 1,
suggestMinLength: 3,
suggestTimeout: 250,
defaultMarkGeocode: !0
}, this._requestCount = 0, w.Util.setOptions(this, i), this.options.geocoder || (this.options.geocoder = new ur());
}
addThrobberClass() {
w.DomUtil.addClass(this._container, "leaflet-control-geocoder-throbber");
}
removeThrobberClass() {
w.DomUtil.removeClass(this._container, "leaflet-control-geocoder-throbber");
}
/**
* Returns the container DOM element for the control and add listeners on relevant map events.
* @param map the map instance
* @see https://leafletjs.com/reference.html#control-onadd
*/
onAdd(i) {
const s = "leaflet-control-geocoder", r = w.DomUtil.create("div", s + " leaflet-bar"), o = w.DomUtil.create("button", s + "-icon", r), h = this._form = w.DomUtil.create("div", s + "-form", r);
this._map = i, this._container = r, o.innerHTML = " ", o.type = "button", o.setAttribute("aria-label", this.options.iconLabel);
const l = this._input = w.DomUtil.create("input", "", h);
return l.type = "text", l.value = this.options.query, l.placeholder = this.options.placeholder, w.DomEvent.disableClickPropagation(l), this._errorElement = w.DomUtil.create("div", s + "-form-no-error", r), this._errorElement.innerHTML = this.options.errorMessage, this._alts = w.DomUtil.create("ul", s + "-alternatives leaflet-control-geocoder-alternatives-minimized", r), w.DomEvent.disableClickPropagation(this._alts), w.DomEvent.addListener(l, "keydown", this._keydown, this), this.options.geocoder.suggest && w.DomEvent.addListener(l, "input", this._change, this), w.DomEvent.addListener(l, "blur", () => {
this.options.collapsed && !this._preventBlurCollapse && this._collapse(), this._preventBlurCollapse = !1;
}), this.options.collapsed ? this.options.expand === "click" ? w.DomEvent.addListener(r, "click", (u) => {
u.button === 0 && u.detail !== 2 && this._toggle();
}) : this.options.expand === "touch" ? w.DomEvent.addListener(r, w.Browser.touch ? "touchstart mousedown" : "mousedown", (u) => {
this._toggle(), u.preventDefault(), u.stopPropagation();
}, this) : (w.DomEvent.addListener(r, "mouseover", this._expand, this), w.DomEvent.addListener(r, "mouseout", this._collapse, this), this._map.on("movestart", this._collapse, this)) : (this._expand(), w.Browser.touch ? w.DomEvent.addListener(r, "touchstart", () => this._geocode()) : w.DomEvent.addListener(r, "click", () => this._geocode())), this.options.defaultMarkGeocode && this.on("markgeocode", this.markGeocode, this), this.on("startgeocode", this.addThrobberClass, this), this.on("finishgeocode", this.removeThrobberClass, this), this.on("startsuggest", this.addThrobberClass, this), this.on("finishsuggest", this.removeThrobberClass, this), w.DomEvent.disableClickPropagation(r), r;
}
/**
* Sets the query string on the text input
* @param string the query string
*/
setQuery(i) {
return this._input.value = i, this;
}
_geocodeResult(i, s) {
if (!s && this.options.showUniqueResult && i.length === 1)
this._geocodeResultSelected(i[0]);
else if (i.length > 0) {
this._alts.innerHTML = "", this._results = i, w.DomUtil.removeClass(this._alts, "leaflet-control-geocoder-alternatives-minimized"), w.DomUtil.addClass(this._container, "leaflet-control-geocoder-options-open");
for (let r = 0; r < i.length; r++)
this._alts.appendChild(this._createAlt(i[r], r));
} else
w.DomUtil.addClass(this._container, "leaflet-control-geocoder-options-error"), w.DomUtil.addClass(this._errorElement, "leaflet-control-geocoder-error");
}
/**
* Marks a geocoding result on the map
* @param result the geocoding result
*/
markGeocode(i) {
const s = i.geocode;
return this._map.fitBounds(s.bbox), this._geocodeMarker && this._map.removeLayer(this._geocodeMarker), this._geocodeMarker = new w.Marker(s.center).bindPopup(s.html || s.name).addTo(this._map).openPopup(), this;
}
_geocode(i) {
const s = this._input.value;
if (!i && s.length < this.options.queryMinLength)
return;
const r = ++this._requestCount, o = (l) => {
if (r === this._requestCount) {
const u = {
input: s,
results: l
};
this.fire(i ? "finishsuggest" : "finishgeocode", u), this._geocodeResult(l, i);
}
};
this._lastGeocode = s, i || this._clearResults();
const h = {
input: s
};
this.fire(i ? "startsuggest" : "startgeocode", h), i ? this.options.geocoder.suggest(s, o) : this.options.geocoder.geocode(s, o);
}
_geocodeResultSelected(i) {
const s = {
geocode: i
};
this.fire("markgeocode", s);
}
_toggle() {
w.DomUtil.hasClass(this._container, "leaflet-control-geocoder-expanded") ? this._collapse() : this._expand();
}
_expand() {
w.DomUtil.addClass(this._container, "leaflet-control-geocoder-expanded"), this._input.select(), this.fire("expand");
}
_collapse() {
w.DomUtil.removeClass(this._container, "leaflet-control-geocoder-expanded"), w.DomUtil.addClass(this._alts, "leaflet-control-geocoder-alternatives-minimized"), w.DomUtil.removeClass(this._errorElement, "leaflet-control-geocoder-error"), w.DomUtil.removeClass(this._container, "leaflet-control-geocoder-options-open"), w.DomUtil.removeClass(this._container, "leaflet-control-geocoder-options-error"), this._input.blur(), this.fire("collapse");
}
_clearResults() {
w.DomUtil.addClass(this._alts, "leaflet-control-geocoder-alternatives-minimized"), this._selection = null, w.DomUtil.removeClass(this._errorElement, "leaflet-control-geocoder-error"), w.DomUtil.removeClass(this._container, "leaflet-control-geocoder-options-open"), w.DomUtil.removeClass(this._container, "leaflet-control-geocoder-options-error");
}
_createAlt(i, s) {
const r = w.DomUtil.create("li", ""), o = w.DomUtil.create("a", "", r), h = this.options.showResultIcons && i.icon ? w.DomUtil.create("img", "", o) : null, l = i.html ? void 0 : document.createTextNode(i.name), u = (f) => {
this._preventBlurCollapse = !0, w.DomEvent.stop(f), this._geocodeResultSelected(i), w.DomEvent.on(r, "click touchend", () => {
this.options.collapsed ? this._collapse() : this._clearResults();
});
};
return h && (h.src = i.icon), r.setAttribute("data-result-index", String(s)), i.html ? o.innerHTML = o.innerHTML + i.html : l && o.appendChild(l), w.DomEvent.addListener(r, "mousedown touchstart", u, this), r;
}
_keydown(i) {
const s = (r) => {
this._selection && (w.DomUtil.removeClass(this._selection, "leaflet-control-geocoder-selected"), this._selection = this._selection[r > 0 ? "nextSibling" : "previousSibling"]), this._selection || (this._selection = this._alts[r > 0 ? "firstChild" : "lastChild"]), this._selection && w.DomUtil.addClass(this._selection, "leaflet-control-geocoder-selected");
};
switch (i.keyCode) {
case 27:
this.options.collapsed ? this._collapse() : this._clearResults();
break;
case 38:
s(-1);
break;
case 40:
s(1);
break;
case 13:
if (this._selection) {
const r = parseInt(this._selection.getAttribute("data-result-index"), 10);
this._geocodeResultSelected(this._results[r]), this._clearResults();
} else
this._geocode();
break;
default:
return;
}
w.DomEvent.preventDefault(i);
}
_change() {
const i = this._input.value;
i !== this._lastGeocode && (clearTimeout(this._suggestTimeout), i.length >= this.options.suggestMinLength ? this._suggestTimeout = setTimeout(() => this._geocode(!0), this.options.suggestTimeout) : this._clearResults());
}
}
function Zl(e) {
return new ws(e);
}
/* @preserve
* Leaflet Control Geocoder
* https://github.com/perliedman/leaflet-control-geocoder
*
* Copyright (c) 2012 sa3m (https://github.com/sa3m)
* Copyright (c) 2018 Per Liedman
* All rights reserved.
*/
w.Util.extend(ws, Ul);
w.Util.extend(w.Control, {
Geocoder: ws,
geocoder: Zl
});
const ql = `.leaflet-control-geocoder {
border-radius: 4px;
background: white;
min-width: 26px;
min-height: 26px;
}
.leaflet-touch .leaflet-control-geocoder {
min-width: 30px;
min-height: 30px;
}
.leaflet-control-geocoder a,
.leaflet-control-geocoder .leaflet-control-geocoder-icon {
border-bottom: none;
display: inline-block;
}
.leaflet-control-geocoder .leaflet-control-geocoder-alternatives a {
width: inherit;
height: inherit;
line-height: inherit;
}
.leaflet-control-geocoder a:hover,
.leaflet-control-geocoder .leaflet-control-geocoder-icon:hover {
border-bottom: none;
display: inline-block;
}
.leaflet-control-geocoder-form {
display: none;
vertical-align: middle;
}
.leaflet-control-geocoder-expanded .leaflet-control-geocoder-form {
display: inline-block;
}
.leaflet-control-geocoder-form input {
font-size: 120%;
border: 0;
background-color: transparent;
width: 246px;
}
.leaflet-control-geocoder-icon {
border-radius: 4px;
width: 26px;
height: 26px;
border: none;
background-color: white;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.2 13l3.4 6.6c.6 1.1 2.5-.4 2-1.2l-4-6.2z'/%3E%3Ccircle cx='10.8' cy='8.9' r='3.9' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: center;
cursor: pointer;
}
.leaflet-touch .leaflet-control-geocoder-icon {
width: 30px;
height: 30px;
}
.leaflet-control-geocoder-throbber .leaflet-control-geocoder-icon {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke='%23000' stroke-linecap='round' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Cdefs/%3E%3Cg%3E%3Cpath stroke-opacity='.1' d='M14 8.4l3-5'/%3E%3Cpath stroke-opacity='.2' d='M15.6 10l5-3'/%3E%3Cpath stroke-opacity='.3' d='M16.2 12H22'/%3E%3Cpath stroke-opacity='.4' d='M15.6 14l5 3m-6.5-1.4l2.9 5'/%3E%3Cpath stroke-opacity='.5' d='M12 16.2V22m-2-6.4l-3 5'/%3E%3Cpath stroke-opacity='.6' d='M8.4 14l-5 3'/%3E%3Cpath stroke-opacity='.7' d='M7.8 12H2'/%3E%3Cpath stroke-opacity='.8' d='M8.4 10l-5-3'/%3E%3Cpath stroke-opacity='.9' d='M10 8.4l-3-5'/%3E%3Cpath d='M12 7.8V2'/%3E%3CanimateTransform attributeName='transform' calcMode='discrete' dur='1s' repeatCount='indefinite' type='rotate' values='0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12'/%3E%3C/g%3E%3C/svg%3E");
}
.leaflet-control-geocoder-form-no-error {
display: none;
}
.leaflet-control-geocoder-form input:focus {
outline: none;
}
.leaflet-control-geocoder-form button {
display: none;
}
.leaflet-control-geocoder-error {
margin-top: 8px;
margin-left: 8px;
display: block;
color: #444;
}
.leaflet-control-geocoder-alternatives {
display: block;
width: 272px;
list-style: none;
padding: 0;
margin: 0;
}
.leaflet-control-geocoder-alternatives-minimized {
display: none;
height: 0;
}
.leaflet-control-geocoder-alternatives li {
white-space: nowrap;
display: block;
overflow: hidden;
padding: 5px 8px;
text-overflow: ellipsis;
border-bottom: 1px solid #ccc;
cursor: pointer;
}
.leaflet-control-geocoder-alternatives li a,
.leaflet-control-geocoder-alternatives li a:hover {
width: inherit;
height: inherit;
line-height: inherit;
background: inherit;
border-radius: inherit;
text-align: left;
}
.leaflet-control-geocoder-alternatives li:last-child {
border-bottom: none;
}
.leaflet-control-geocoder-alternatives li:hover,
.leaflet-control-geocoder-selected {
background-color: #f5f5f5;
}
.leaflet-control-geocoder-address-detail {
}
.leaflet-control-geocoder-address-context {
color: #666;
}
`, $l = `/* required styles */\r
\r
.leaflet-pane,\r
.leaflet-tile,\r
.leaflet-marker-icon,\r
.leaflet-marker-shadow,\r
.leaflet-tile-container,\r
.leaflet-pane > svg,\r
.leaflet-pane > canvas,\r
.leaflet-zoom-box,\r
.leaflet-image-layer,\r
.leaflet-layer {\r
position: absolute;\r
left: 0;\r
top: 0;\r
}\r
.leaflet-container {\r
overflow: hidden;\r
}\r
.leaflet-tile,\r
.leaflet-marker-icon,\r
.leaflet-marker-shadow {\r
-webkit-user-select: none;\r
-moz-user-select: none;\r
user-select: none;\r
-webkit-user-drag: none;\r
}\r
/* Prevents IE11 from highlighting tiles in blue */\r
.leaflet-tile::selection {\r
background: transparent;\r
}\r
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */\r
.leaflet-safari .leaflet-tile {\r
image-rendering: -webkit-optimize-contrast;\r
}\r
/* hack that prevents hw layers "stretching" when loading new tiles */\r
.leaflet-safari .leaflet-tile-container {\r
width: 1600px;\r
height: 1600px;\r
-webkit-transform-origin: 0 0;\r
}\r
.leaflet-marker-icon,\r
.leaflet-marker-shadow {\r
display: block;\r
}\r
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */\r
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */\r
.leaflet-container .leaflet-overlay-pane svg {\r
max-width: none !important;\r
max-height: none !important;\r
}\r
.leaflet-container .leaflet-marker-pane img,\r
.leaflet-container .leaflet-shadow-pane img,\r
.leaflet-container .leaflet-tile-pane img,\r
.leaflet-container img.leaflet-image-layer,\r
.leaflet-container .leaflet-tile {\r
max-width: none !important;\r
max-height: none !important;\r
width: auto;\r
padding: 0;\r
}\r
\r
.leaflet-container img.leaflet-tile {\r
/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */\r
mix-blend-mode: plus-lighter;\r
}\r
\r
.leaflet-container.leaflet-touch-zoom {\r
-ms-touch-action: pan-x pan-y;\r
touch-action: pan-x pan-y;\r
}\r
.leaflet-container.leaflet-touch-drag {\r
-ms-touch-action: pinch-zoom;\r
/* Fallback for FF which doesn't support pinch-zoom */\r
touch-action: none;\r
touch-action: pinch-zoom;\r
}\r
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\r
-ms-touch-action: none;\r
touch-action: none;\r
}\r
.leaflet-container {\r
-webkit-tap-highlight-color: transparent;\r
}\r
.leaflet-container a {\r
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\r
}\r
.leaflet-tile {\r
filter: inherit;\r
visibility: hidden;\r
}\r
.leaflet-tile-loaded {\r
visibility: inherit;\r
}\r
.leaflet-zoom-box {\r
width: 0;\r
height: 0;\r
-moz-box-sizing: border-box;\r
box-sizing: border-box;\r
z-index: 800;\r
}\r
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */\r
.leaflet-overlay-pane svg {\r
-moz-user-select: none;\r
}\r
\r
.leaflet-pane { z-index: 400; }\r
\r
.leaflet-tile-pane { z-index: 200; }\r
.leaflet-overlay-pane { z-index: 400; }\r
.leaflet-shadow-pane { z-index: 500; }\r
.leaflet-marker-pane { z-index: 600; }\r
.leaflet-tooltip-pane { z-index: 650; }\r
.leaflet-popup-pane { z-index: 700; }\r
\r
.leaflet-map-pane canvas { z-index: 100; }\r
.leaflet-map-pane svg { z-index: 200; }\r
\r
.leaflet-vml-shape {\r
width: 1px;\r
height: 1px;\r
}\r
.lvml {\r
behavior: url(#default#VML);\r
display: inline-block;\r
position: absolute;\r
}\r
\r
\r
/* control positioning */\r
\r
.leaflet-control {\r
position: relative;\r
z-index: 800;\r
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */\r
pointer-events: auto;\r
}\r
.leaflet-top,\r
.leaflet-bottom {\r
position: absolute;\r
z-index: 1000;\r
pointer-events: none;\r
}\r
.leaflet-top {\r
top: 0;\r
}\r
.leaflet-right {\r
right: 0;\r
}\r
.leaflet-bottom {\r
bottom: 0;\r
}\r
.leaflet-left {\r
left: 0;\r
}\r
.leaflet-control {\r
float: left;\r
clear: both;\r
}\r
.leaflet-right .leaflet-control {\r
float: right;\r
}\r
.leaflet-top .leaflet-control {\r
margin-top: 10px;\r
}\r
.leaflet-bottom .leaflet-control {\r
margin-bottom: 10px;\r
}\r
.leaflet-left .leaflet-control {\r
margin-left: 10px;\r
}\r
.leaflet-right .leaflet-control {\r
margin-right: 10px;\r
}\r
\r
\r
/* zoom and fade animations */\r
\r
.leaflet-fade-anim .leaflet-popup {\r
opacity: 0;\r
-webkit-transition: opacity 0.2s linear;\r
-moz-transition: opacity 0.2s linear;\r
transition: opacity 0.2s linear;\r
}\r
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\r
opacity: 1;\r
}\r
.leaflet-zoom-animated {\r
-webkit-transform-origin: 0 0;\r
-ms-transform-origin: 0 0;\r
transform-origin: 0 0;\r
}\r
svg.leaflet-zoom-animated {\r
will-change: transform;\r
}\r
\r
.leaflet-zoom-anim .leaflet-zoom-animated {\r
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);\r
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);\r
transition: transform 0.25s cubic-bezier(0,0,0.25,1);\r
}\r
.leaflet-zoom-anim .leaflet-tile,\r
.leaflet-pan-anim .leaflet-tile {\r
-webkit-transition: none;\r
-moz-transition: none;\r
transition: none;\r
}\r
\r
.leaflet-zoom-anim .leaflet-zoom-hide {\r
visibility: hidden;\r
}\r
\r
\r
/* cursors */\r
\r
.leaflet-interactive {\r
cursor: pointer;\r
}\r
.leaflet-grab {\r
cursor: -webkit-grab;\r
cursor: -moz-grab;\r
cursor: grab;\r
}\r
.leaflet-crosshair,\r
.leaflet-crosshair .leaflet-interactive {\r
cursor: crosshair;\r
}\r
.leaflet-popup-pane,\r
.leaflet-control {\r
cursor: auto;\r
}\r
.leaflet-dragging .leaflet-grab,\r
.leaflet-dragging .leaflet-grab .leaflet-interactive,\r
.leaflet-dragging .leaflet-marker-draggable {\r
cursor: move;\r
cursor: -webkit-grabbing;\r
cursor: -moz-grabbing;\r
cursor: grabbing;\r
}\r
\r
/* marker & overlays interactivity */\r
.leaflet-marker-icon,\r
.leaflet-marker-shadow,\r
.leaflet-image-layer,\r
.leaflet-pane > svg path,\r
.leaflet-tile-container {\r
pointer-events: none;\r
}\r
\r
.leaflet-marker-icon.leaflet-interactive,\r
.leaflet-image-layer.leaflet-interactive,\r
.leaflet-pane > svg path.leaflet-interactive,\r
svg.leaflet-image-layer.leaflet-interactive path {\r
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */\r
pointer-events: auto;\r
}\r
\r
/* visual tweaks */\r
\r
.leaflet-container {\r
background: #ddd;\r
outline-offset: 1px;\r
}\r
.leaflet-container a {\r
color: #0078A8;\r
}\r
.leaflet-zoom-box {\r
border: 2px dotted #38f;\r
background: rgba(255,255,255,0.5);\r
}\r
\r
\r
/* general typography */\r
.leaflet-container {\r
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;\r
font-size: 12px;\r
font-size: 0.75rem;\r
line-height: 1.5;\r
}\r
\r
\r
/* general toolbar styles */\r
\r
.leaflet-bar {\r
box-shadow: 0 1px 5px rgba(0,0,0,0.65);\r
border-radius: 4px;\r
}\r
.leaflet-bar a {\r
background-color: #fff;\r
border-bottom: 1px solid #ccc;\r
width: 26px;\r
height: 26px;\r
line-height: 26px;\r
display: block;\r
text-align: center;\r
text-decoration: none;\r
color: black;\r
}\r
.leaflet-bar a,\r
.leaflet-control-layers-toggle {\r
background-position: 50% 50%;\r
background-repeat: no-repeat;\r
display: block;\r
}\r
.leaflet-bar a:hover,\r
.leaflet-bar a:focus {\r
background-color: #f4f4f4;\r
}\r
.leaflet-bar a:first-child {\r
border-top-left-radius: 4px;\r
border-top-right-radius: 4px;\r
}\r
.leaflet-bar a:last-child {\r
border-bottom-left-radius: 4px;\r
border-bottom-right-radius: 4px;\r
border-bottom: none;\r
}\r
.leaflet-bar a.leaflet-disabled {\r
cursor: default;\r
background-color: #f4f4f4;\r
color: #bbb;\r
}\r
\r
.leaflet-touch .leaflet-bar a {\r
width: 30px;\r
height: 30px;\r
line-height: 30px;\r
}\r
.leaflet-touch .leaflet-bar a:first-child {\r
border-top-left-radius: 2px;\r
border-top-right-radius: 2px;\r
}\r
.leaflet-touch .leaflet-bar a:last-child {\r
border-bottom-left-radius: 2px;\r
border-bottom-right-radius: 2px;\r
}\r
\r
/* zoom control */\r
\r
.leaflet-control-zoom-in,\r
.leaflet-control-zoom-out {\r
font: bold 18px 'Lucida Console', Monaco, monospace;\r
text-indent: 1px;\r
}\r
\r
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {\r
font-size: 22px;\r
}\r
\r
\r
/* layers control */\r
\r
.leaflet-control-layers {\r
box-shadow: 0 1px 5px rgba(0,0,0,0.4);\r
background: #fff;\r
border-radius: 5px;\r
}\r
.leaflet-control-layers-toggle {\r
background-image: url(images/layers.png);\r
width: 36px;\r
height: 36px;\r
}\r
.leaflet-retina .leaflet-control-layers-toggle {\r
background-image: url(images/layers-2x.png);\r
background-size: 26px 26px;\r
}\r
.leaflet-touch .leaflet-control-layers-toggle {\r
width: 44px;\r
height: 44px;\r
}\r
.leaflet-control-layers .leaflet-control-layers-list,\r
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\r
display: none;\r
}\r
.leaflet-control-layers-expanded .leaflet-control-layers-list {\r
display: block;\r
position: relative;\r
}\r
.leaflet-control-layers-expanded {\r
padding: 6px 10px 6px 6px;\r
color: #333;\r
background: #fff;\r
}\r
.leaflet-control-layers-scrollbar {\r
overflow-y: scroll;\r
overflow-x: hidden;\r
padding-right: 5px;\r
}\r
.leaflet-control-layers-selector {\r
margin-top: 2px;\r
position: relative;\r
top: 1px;\r
}\r
.leaflet-control-layers label {\r
display: block;\r
font-size: 13px;\r
font-size: 1.08333em;\r
}\r
.leaflet-control-layers-separator {\r
height: 0;\r
border-top: 1px solid #ddd;\r
margin: 5px -10px 5px -6px;\r
}\r
\r
/* Default icon URLs */\r
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */\r
background-image: url(images/marker-icon.png);\r
}\r
\r
\r
/* attribution and scale controls */\r
\r
.leaflet-container .leaflet-control-attribution {\r
background: #fff;\r
background: rgba(255, 255, 255, 0.8);\r
margin: 0;\r
}\r
.leaflet-control-attribution,\r
.leaflet-control-scale-line {\r
padding: 0 5px;\r
color: #333;\r
line-height: 1.4;\r
}\r
.leaflet-control-attribution a {\r
text-decoration: none;\r
}\r
.leaflet-control-attribution a:hover,\r
.leaflet-control-attribution a:focus {\r
text-decoration: underline;\r
}\r
.leaflet-attribution-flag {\r
display: inline !important;\r
vertical-align: baseline !important;\r
width: 1em;\r
height: 0.6669em;\r
}\r
.leaflet-left .leaflet-control-scale {\r
margin-left: 5px;\r
}\r
.leaflet-bottom .leaflet-control-scale {\r
margin-bottom: 5px;\r
}\r
.leaflet-control-scale-line {\r
border: 2px solid #777;\r
border-top: none;\r
line-height: 1.1;\r
padding: 2px 5px 1px;\r
white-space: nowrap;\r
-moz-box-sizing: border-box;\r
box-sizing: border-box;\r
background: rgba(255, 255, 255, 0.8);\r
text-shadow: 1px 1px #fff;\r
}\r
.leaflet-control-scale-line:not(:first-child) {\r
border-top: 2px solid #777;\r
border-bottom: none;\r
margin-top: -2px;\r
}\r
.leaflet-control-scale-line:not(:first-child):not(:last-child) {\r
border-bottom: 2px solid #777;\r
}\r
\r
.leaflet-touch .leaflet-control-attribution,\r
.leaflet-touch .leaflet-control-layers,\r
.leaflet-touch .leaflet-bar {\r
box-shadow: none;\r
}\r
.leaflet-touch .leaflet-control-layers,\r
.leaflet-touch .leaflet-bar {\r
border: 2px solid rgba(0,0,0,0.2);\r
background-clip: padding-box;\r
}\r
\r
\r
/* popup */\r
\r
.leaflet-popup {\r
position: absolute;\r
text-align: center;\r
margin-bottom: 20px;\r
}\r
.leaflet-popup-content-wrapper {\r
padding: 1px;\r
text-align: left;\r
border-radius: 12px;\r
}\r
.leaflet-popup-content {\r
margin: 13px 24px 13px 20px;\r
line-height: 1.3;\r
font-size: 13px;\r
font-size: 1.08333em;\r
min-height: 1px;\r
}\r
.leaflet-popup-content p {\r
margin: 17px 0;\r
margin: 1.3em 0;\r
}\r
.leaflet-popup-tip-container {\r
width: 40px;\r
height: 20px;\r
position: absolute;\r
left: 50%;\r
margin-top: -1px;\r
margin-left: -20px;\r
overflow: hidden;\r
pointer-events: none;\r
}\r
.leaflet-popup-tip {\r
width: 17px;\r
height: 17px;\r
padding: 1px;\r
\r
margin: -10px auto 0;\r
pointer-events: auto;\r
\r
-webkit-transform: rotate(45deg);\r
-moz-transform: rotate(45deg);\r
-ms-transform: rotate(45deg);\r
transform: rotate(45deg);\r
}\r
.leaflet-popup-content-wrapper,\r
.leaflet-popup-tip {\r
background: white;\r
color: #333;\r
box-shadow: 0 3px 14px rgba(0,0,0,0.4);\r
}\r
.leaflet-container a.leaflet-popup-close-button {\r
position: absolute;\r
top: 0;\r
right: 0;\r
border: none;\r
text-align: center;\r
width: 24px;\r
height: 24px;\r
font: 16px/24px Tahoma, Verdana, sans-serif;\r
color: #757575;\r
text-decoration: none;\r
background: transparent;\r
}\r
.leaflet-container a.leaflet-popup-close-button:hover,\r
.leaflet-container a.leaflet-popup-close-button:focus {\r
color: #585858;\r
}\r
.leaflet-popup-scrolled {\r
overflow: auto;\r
}\r
\r
.leaflet-oldie .leaflet-popup-content-wrapper {\r
-ms-zoom: 1;\r
}\r
.leaflet-oldie .leaflet-popup-tip {\r
width: 24px;\r
margin: 0 auto;\r
\r
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";\r
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);\r
}\r
\r
.leaflet-oldie .leaflet-control-zoom,\r
.leaflet-oldie .leaflet-control-layers,\r
.leaflet-oldie .leaflet-popup-content-wrapper,\r
.leaflet-oldie .leaflet-popup-tip {\r
border: 1px solid #999;\r
}\r
\r
\r
/* div icon */\r
\r
.leaflet-div-icon {\r
background: #fff;\r
border: 1px solid #666;\r
}\r
\r
\r
/* Tooltip */\r
/* Base styles for the element that has a tooltip */\r
.leaflet-tooltip {\r
position: absolute;\r
padding: 6px;\r
background-color: #fff;\r
border: 1px solid #fff;\r
border-radius: 3px;\r
color: #222;\r
white-space: nowrap;\r
-webkit-user-select: none;\r
-moz-user-select: none;\r
-ms-user-select: none;\r
user-select: none;\r
pointer-events: none;\r
box-shadow: 0 1px 3px rgba(0,0,0,0.4);\r
}\r
.leaflet-tooltip.leaflet-interactive {\r
cursor: pointer;\r
pointer-events: auto;\r
}\r
.leaflet-tooltip-top:before,\r
.leaflet-tooltip-bottom:before,\r
.leaflet-tooltip-left:before,\r
.leaflet-tooltip-right:before {\r
position: absolute;\r
pointer-events: none;\r
border: 6px solid transparent;\r
background: transparent;\r
content: "";\r
}\r
\r
/* Directions */\r
\r
.leaflet-tooltip-bottom {\r
margin-top: 6px;\r
}\r
.leaflet-tooltip-top {\r
margin-top: -6px;\r
}\r
.leaflet-tooltip-bottom:before,\r
.leaflet-tooltip-top:before {\r
left: 50%;\r
margin-left: -6px;\r
}\r
.leaflet-tooltip-top:before {\r
bottom: 0;\r
margin-bottom: -12px;\r
border-top-color: #fff;\r
}\r
.leaflet-tooltip-bottom:before {\r
top: 0;\r
margin-top: -12px;\r
margin-left: -6px;\r
border-bottom-color: #fff;\r
}\r
.leaflet-tooltip-left {\r
margin-left: -6px;\r
}\r
.leaflet-tooltip-right {\r
margin-left: 6px;\r
}\r
.leaflet-tooltip-left:before,\r
.leaflet-tooltip-right:before {\r
top: 50%;\r
margin-top: -6px;\r
}\r
.leaflet-tooltip-left:before {\r
right: 0;\r
margin-right: -12px;\r
border-left-color: #fff;\r
}\r
.leaflet-tooltip-right:before {\r
left: 0;\r
margin-left: -12px;\r
border-right-color: #fff;\r
}\r
\r
/* Printing */\r
\r
@media print {\r
/* Prevent printers from removing background-images of controls. */\r
.leaflet-control {\r
-webkit-print-color-adjust: exact;\r
print-color-adjust: exact;\r
}\r
}\r
`;
function Fl(e) {
e("EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"), e("EPSG:4269", "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"), e("EPSG:3857", "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
for (var i = 1; i <= 60; ++i)
e("EPSG:" + (32600 + i), "+proj=utm +zone=" + i + " +datum=WGS84 +units=m"), e("EPSG:" + (32700 + i), "+proj=utm +zone=" + i + " +south +datum=WGS84 +units=m");
e.WGS84 = e["EPSG:4326"], e["EPSG:3785"] = e["EPSG:3857"], e.GOOGLE = e["EPSG:3857"], e["EPSG:900913"] = e["EPSG:3857"], e["EPSG:102113"] = e["EPSG:3857"];
}
var ui = 1, fi = 2, Ri = 3, Hl = 4, nr = 5, Pa = 6378137, Wl = 6356752314e-3, Sa = 0.0066943799901413165, Mn = 484813681109536e-20, O = Math.PI / 2, jl = 0.16666666666666666, Kl = 0.04722222222222222, Vl = 0.022156084656084655, B = 1e-10, yt = 0.017453292519943295, Ee = 57.29577951308232, ut = Math.PI / 4, Ln = Math.PI * 2, Tt = 3.14159265359, se = {};
se.greenwich = 0;
se.lisbon = -9.131906111111;
se.paris = 2.337229166667;
se.bogota = -74.080916666667;
se.madrid = -3.687938888889;
se.rome = 12.452333333333;
se.bern = 7.439583333333;
se.jakarta = 106.807719444444;
se.ferro = -17.666666666667;
se.brussels = 4.367975;
se.stockholm = 18.058277777778;
se.athens = 23.7163375;
se.oslo = 10.722916666667;
const Jl = {
mm: { to_meter: 1e-3 },
cm: { to_meter: 0.01 },
ft: { to_meter: 0.3048 },
"us-ft": { to_meter: 1200 / 3937 },
fath: { to_meter: 1.8288 },
kmi: { to_meter: 1852 },
"us-ch": { to_meter: 20.1168402336805 },
"us-mi": { to_meter: 1609.34721869444 },
km: { to_meter: 1e3 },
"ind-ft": { to_meter: 0.30479841 },
"ind-yd": { to_meter: 0.91439523 },
mi: { to_meter: 1609.344 },
yd: { to_meter: 0.9144 },
ch: { to_meter: 20.1168 },
link: { to_meter: 0.201168 },
dm: { to_meter: 0.1 },
in: { to_meter: 0.0254 },
"ind-ch": { to_meter: 20.11669506 },
"us-in": { to_meter: 0.025400050800101 },
"us-yd": { to_meter: 0.914401828803658 }
};
var Aa = /[\s_\-\/\(\)]/g;
function We(e, i) {
if (e[i])
return e[i];
for (var s = Object.keys(e), r = i.toLowerCase().replace(Aa, ""), o = -1, h, l; ++o < s.length; )
if (h = s[o], l = h.toLowerCase().replace(Aa, ""), l === r)
return e[h];
}
function sr(e) {
var i = {}, s = e.split("+").map(function(u) {
return u.trim();
}).filter(function(u) {
return u;
}).reduce(function(u, f) {
var _ = f.split("=");
return _.push(!0), u[_[0].toLowerCase()] = _[1], u;
}, {}), r, o, h, l = {
proj: "projName",
datum: "datumCode",
rf: function(u) {
i.rf = parseFloat(u);
},
lat_0: function(u) {
i.lat0 = u * yt;
},
lat_1: function(u) {
i.lat1 = u * yt;
},
lat_2: function(u) {
i.lat2 = u * yt;
},
lat_ts: function(u) {
i.lat_ts = u * yt;
},
lon_0: function(u) {
i.long0 = u * yt;
},
lon_1: function(u) {
i.long1 = u * yt;
},
lon_2: function(u) {
i.long2 = u * yt;
},
alpha: function(u) {
i.alpha = parseFloat(u) * yt;
},
gamma: function(u) {
i.rectified_grid_angle = parseFloat(u) * yt;
},
lonc: function(u) {
i.longc = u * yt;
},
x_0: function(u) {
i.x0 = parseFloat(u);
},
y_0: function(u) {
i.y0 = parseFloat(u);
},
k_0: function(u) {
i.k0 = parseFloat(u);
},
k: function(u) {
i.k0 = parseFloat(u);
},
a: function(u) {
i.a = parseFloat(u);
},
b: function(u) {
i.b = parseFloat(u);
},
r: function(u) {
i.a = i.b = parseFloat(u);
},
r_a: function() {
i.R_A = !0;
},
zone: function(u) {
i.zone = parseInt(u, 10);
},
south: function() {
i.utmSouth = !0;
},
towgs84: function(u) {
i.datum_params = u.split(",").map(function(f) {
return parseFloat(f);
});
},
to_meter: function(u) {
i.to_meter = parseFloat(u);
},
units: function(u) {
i.units = u;
var f = We(Jl, u);
f && (i.to_meter = f.to_meter);
},
from_greenwich: function(u) {
i.from_greenwich = u * yt;
},
pm: function(u) {
var f = We(se, u);
i.from_greenwich = (f || parseFloat(u)) * yt;
},
nadgrids: function(u) {
u === "@null" ? i.datumCode = "none" : i.nadgrids = u;
},
axis: function(u) {
var f = "ewnsud";
u.length === 3 && f.indexOf(u.substr(0, 1)) !== -1 && f.indexOf(u.substr(1, 1)) !== -1 && f.indexOf(u.substr(2, 1)) !== -1 && (i.axis = u);
},
approx: function() {
i.approx = !0;
}
};
for (r in s)
o = s[r], r in l ? (h = l[r], typeof h == "function" ? h(o) : i[h] = o) : i[r] = o;
return typeof i.datumCode == "string" && i.datumCode !== "WGS84" && (i.datumCode = i.datumCode.toLowerCase()), i;
}
class mo {
static getId(i) {
const s = i.find((r) => Array.isArray(r) && r[0] === "ID");
return s && s.length >= 3 ? {
authority: s[1],
code: parseInt(s[2], 10)
} : null;
}
static convertUnit(i, s = "unit") {
if (!i || i.length < 3)
return { type: s, name: "unknown", conversion_factor: null };
const r = i[1], o = parseFloat(i[2]) || null, h = i.find((u) => Array.isArray(u) && u[0] === "ID"), l = h ? {
authority: h[1],
code: parseInt(h[2], 10)
} : null;
return {
type: s,
name: r,
conversion_factor: o,
id: l
};
}
static convertAxis(i) {
const s = i[1] || "Unknown";
let r;
const o = s.match(/^\((.)\)$/);
if (o) {
const _ = o[1].toUpperCase();
if (_ === "E")
r = "east";
else if (_ === "N")
r = "north";
else if (_ === "U")
r = "up";
else
throw new Error(`Unknown axis abbreviation: ${_}`);
} else
r = i[2] ? i[2].toLowerCase() : "unknown";
const h = i.find((_) => Array.isArray(_) && _[0] === "ORDER"), l = h ? parseInt(h[1], 10) : null, u = i.find(
(_) => Array.isArray(_) && (_[0] === "LENGTHUNIT" || _[0] === "ANGLEUNIT" || _[0] === "SCALEUNIT")
), f = this.convertUnit(u);
return {
name: s,
direction: r,
// Use the valid PROJJSON direction value
unit: f,
order: l
};
}
static extractAxes(i) {
return i.filter((s) => Array.isArray(s) && s[0] === "AXIS").map((s) => this.convertAxis(s)).sort((s, r) => (s.order || 0) - (r.order || 0));
}
static convert(i, s = {}) {
switch (i[0]) {
case "PROJCRS":
s.type = "ProjectedCRS", s.name = i[1], s.base_crs = i.find((g) => Array.isArray(g) && g[0] === "BASEGEOGCRS") ? this.convert(i.find((g) => Array.isArray(g) && g[0] === "BASEGEOGCRS")) : null, s.conversion = i.find((g) => Array.isArray(g) && g[0] === "CONVERSION") ? this.convert(i.find((g) => Array.isArray(g) && g[0] === "CONVERSION")) : null;
const r = i.find((g) => Array.isArray(g) && g[0] === "CS");
r && (s.coordinate_system = {
type: r[1],
axis: this.extractAxes(i)
});
const o = i.find((g) => Array.isArray(g) && g[0] === "LENGTHUNIT");
if (o) {
const g = this.convertUnit(o);
s.coordinate_system.unit = g;
}
s.id = this.getId(i);
break;
case "BASEGEOGCRS":
case "GEOGCRS":
s.type = "GeographicCRS", s.name = i[1];
const h = i.find(
(g) => Array.isArray(g) && (g[0] === "DATUM" || g[0] === "ENSEMBLE")
);
if (h) {
const g = this.convert(h);
h[0] === "ENSEMBLE" ? s.datum_ensemble = g : s.datum = g;
const M = i.find((E) => Array.isArray(E) && E[0] === "PRIMEM");
M && M[1] !== "Greenwich" && (g.prime_meridian = {
name: M[1],
longitude: parseFloat(M[2])
});
}
s.coordinate_system = {
type: "ellipsoidal",
axis: this.extractAxes(i)
}, s.id = this.getId(i);
break;
case "DATUM":
s.type = "GeodeticReferenceFrame", s.name = i[1], s.ellipsoid = i.find((g) => Array.isArray(g) && g[0] === "ELLIPSOID") ? this.convert(i.find((g) => Array.isArray(g) && g[0] === "ELLIPSOID")) : null;
break;
case "ENSEMBLE":
s.type = "DatumEnsemble", s.name = i[1], s.members = i.filter((g) => Array.isArray(g) && g[0] === "MEMBER").map((g) => ({
type: "DatumEnsembleMember",
name: g[1],
id: this.getId(g)
// Extract ID as { authority, code }
}));
const l = i.find((g) => Array.isArray(g) && g[0] === "ENSEMBLEACCURACY");
l && (s.accuracy = parseFloat(l[1]));
const u = i.find((g) => Array.isArray(g) && g[0] === "ELLIPSOID");
u && (s.ellipsoid = this.convert(u)), s.id = this.getId(i);
break;
case "ELLIPSOID":
s.type = "Ellipsoid", s.name = i[1], s.semi_major_axis = parseFloat(i[2]), s.inverse_flattening = parseFloat(i[3]), i.find((g) => Array.isArray(g) && g[0] === "LENGTHUNIT") && this.convert(i.find((g) => Array.isArray(g) && g[0] === "LENGTHUNIT"), s);
break;
case "CONVERSION":
s.type = "Conversion", s.name = i[1], s.method = i.find((g) => Array.isArray(g) && g[0] === "METHOD") ? this.convert(i.find((g) => Array.isArray(g) && g[0] === "METHOD")) : null, s.parameters = i.filter((g) => Array.isArray(g) && g[0] === "PARAMETER").map((g) => this.convert(g));
break;
case "METHOD":
s.type = "Method", s.name = i[1], s.id = this.getId(i);
break;
case "PARAMETER":
s.type = "Parameter", s.name = i[1], s.value = parseFloat(i[2]), s.unit = this.convertUnit(
i.find(
(g) => Array.isArray(g) && (g[0] === "LENGTHUNIT" || g[0] === "ANGLEUNIT" || g[0] === "SCALEUNIT")
)
), s.id = this.getId(i);
break;
case "BOUNDCRS":
s.type = "BoundCRS";
const f = i.find((g) => Array.isArray(g) && g[0] === "SOURCECRS");
if (f) {
const g = f.find((M) => Array.isArray(M));
s.source_crs = g ? this.convert(g) : null;
}
const _ = i.find((g) => Array.isArray(g) && g[0] === "TARGETCRS");
if (_) {
const g = _.find((M) => Array.isArray(M));
s.target_crs = g ? this.convert(g) : null;
}
const v = i.find((g) => Array.isArray(g) && g[0] === "ABRIDGEDTRANSFORMATION");
v ? s.transformation = this.convert(v) : s.transformation = null;
break;
case "ABRIDGEDTRANSFORMATION":
if (s.type = "Transformation", s.name = i[1], s.method = i.find((g) => Array.isArray(g) && g[0] === "METHOD") ? this.convert(i.find((g) => Array.isArray(g) && g[0] === "METHOD")) : null, s.parameters = i.filter((g) => Array.isArray(g) && (g[0] === "PARAMETER" || g[0] === "PARAMETERFILE")).map((g) => {
if (g[0] === "PARAMETER")
return this.convert(g);
if (g[0] === "PARAMETERFILE")
return {
name: g[1],
value: g[2],
id: {
authority: "EPSG",
code: 8656
}
};
}), s.parameters.length === 7) {
const g = s.parameters[6];
g.name === "Scale difference" && (g.value = Math.round((g.value - 1) * 1e12) / 1e6);
}
s.id = this.getId(i);
break;
case "AXIS":
s.coordinate_system || (s.coordinate_system = { type: "unspecified", axis: [] }), s.coordinate_system.axis.push(this.convertAxis(i));
break;
case "LENGTHUNIT":
const m = this.convertUnit(i, "LinearUnit");
s.coordinate_system && s.coordinate_system.axis && s.coordinate_system.axis.forEach((g) => {
g.unit || (g.unit = m);
}), m.conversion_factor && m.conversion_factor !== 1 && s.semi_major_axis && (s.semi_major_axis = {
value: s.semi_major_axis,
unit: m
});
break;
default:
s.keyword = i[0];
break;
}
return s;
}
}
class Xl extends mo {
static convert(i, s = {}) {
return super.convert(i, s), s.coordinate_system && s.coordinate_system.subtype === "Cartesian" && delete s.coordinate_system, s.usage && delete s.usage, s;
}
}
class Ql extends mo {
static convert(i, s = {}) {
super.convert(i, s);
const r = i.find((h) => Array.isArray(h) && h[0] === "CS");
r && (s.coordinate_system = {
subtype: r[1],
axis: this.extractAxes(i)
});
const o = i.find((h) => Array.isArray(h) && h[0] === "USAGE");
if (o) {
const h = o.find((f) => Array.isArray(f) && f[0] === "SCOPE"), l = o.find((f) => Array.isArray(f) && f[0] === "AREA"), u = o.find((f) => Array.isArray(f) && f[0] === "BBOX");
s.usage = {}, h && (s.usage.scope = h[1]), l && (s.usage.area = l[1]), u && (s.usage.bbox = u.slice(1));
}
return s;
}
}
function Yl(e) {
return e.find((i) => Array.isArray(i) && i[0] === "USAGE") ? "2019" : (e.find((i) => Array.isArray(i) && i[0] === "CS") || e[0] === "BOUNDCRS" || e[0] === "PROJCRS" || e[0] === "GEOGCRS", "2015");
}
function tc(e) {
return (Yl(e) === "2019" ? Ql : Xl).convert(e);
}
function ec(e) {
const i = e.toUpperCase();
return i.includes("PROJCRS") || i.includes("GEOGCRS") || i.includes("BOUNDCRS") || i.includes("VERTCRS") || i.includes("LENGTHUNIT") || i.includes("ANGLEUNIT") || i.includes("SCALEUNIT") ? "WKT2" : (i.includes("PROJCS") || i.includes("GEOGCS") || i.includes("LOCAL_CS") || i.includes("VERT_CS") || i.includes("UNIT"), "WKT1");
}
var Cn = 1, go = 2, vo = 3, _s = 4, yo = 5, _r = -1, ic = /\s/, nc = /[A-Za-z]/, sc = /[A-Za-z84_]/, xs = /[,\]]/, Mo = /[\d\.E\-\+]/;
function Oe(e) {
if (typeof e != "string")
throw new Error("not a string");
this.text = e.trim(), this.level = 0, this.place = 0, this.root = null, this.stack = [], this.currentObject = null, this.state = Cn;
}
Oe.prototype.readCharicter = function() {
var e = this.text[this.place++];
if (this.state !== _s)
for (; ic.test(e); ) {
if (this.place >= this.text.length)
return;
e = this.text[this.place++];
}
switch (this.state) {
case Cn:
return this.neutral(e);
case go:
return this.keyword(e);
case _s:
return this.quoted(e);
case yo:
return this.afterquote(e);
case vo:
return this.number(e);
case _r:
return;
}
};
Oe.prototype.afterquote = function(e) {
if (e === '"') {
this.word += '"', this.state = _s;
return;
}
if (xs.test(e)) {
this.word = this.word.trim(), this.afterItem(e);
return;
}
throw new Error(`havn't handled "` + e + '" in afterquote yet, index ' + this.place);
};
Oe.prototype.afterItem = function(e) {
if (e === ",") {
this.word !== null && this.currentObject.push(this.word), this.word = null, this.state = Cn;
return;
}
if (e === "]") {
this.level--, this.word !== null && (this.currentObject.push(this.word), this.word = null), this.state = Cn, this.currentObject = this.stack.pop(), this.currentObject || (this.state = _r);
return;
}
};
Oe.prototype.number = function(e) {
if (Mo.test(e)) {
this.word += e;
return;
}
if (xs.test(e)) {
this.word = parseFloat(this.word), this.afterItem(e);
return;
}
throw new Error(`havn't handled "` + e + '" in number yet, index ' + this.place);
};
Oe.prototype.quoted = function(e) {
if (e === '"') {
this.state = yo;
return;
}
this.word += e;
};
Oe.prototype.keyword = function(e) {
if (sc.test(e)) {
this.word += e;
return;
}
if (e === "[") {
var i = [];
i.push(this.word), this.level++, this.root === null ? this.root = i : this.currentObject.push(i), this.stack.push(this.currentObject), this.currentObject = i, this.state = Cn;
return;
}
if (xs.test(e)) {
this.afterItem(e);
return;
}
throw new Error(`havn't handled "` + e + '" in keyword yet, index ' + this.place);
};
Oe.prototype.neutral = function(e) {
if (nc.test(e)) {
this.word = e, this.state = go;
return;
}
if (e === '"') {
this.word = "", this.state = _s;
return;
}
if (Mo.test(e)) {
this.word = e, this.state = vo;
return;
}
if (xs.test(e)) {
this.afterItem(e);
return;
}
throw new Error(`havn't handled "` + e + '" in neutral yet, index ' + this.place);
};
Oe.prototype.output = function() {
for (; this.place < this.text.length; )
this.readCharicter();
if (this.state === _r)
return this.root;
throw new Error('unable to parse string "' + this.text + '". State is ' + this.state);
};
function rc(e) {
var i = new Oe(e);
return i.output();
}
function Qs(e, i, s) {
Array.isArray(i) && (s.unshift(i), i = null);
var r = i ? {} : e, o = s.reduce(function(h, l) {
return Gi(l, h), h;
}, r);
i && (e[i] = o);
}
function Gi(e, i) {
if (!Array.isArray(e)) {
i[e] = !0;
return;
}
var s = e.shift();
if (s === "PARAMETER" && (s = e.shift()), e.length === 1) {
if (Array.isArray(e[0])) {
i[s] = {}, Gi(e[0], i[s]);
return;
}
i[s] = e[0];
return;
}
if (!e.length) {
i[s] = !0;
return;
}
if (s === "TOWGS84") {
i[s] = e;
return;
}
if (s === "AXIS") {
s in i || (i[s] = []), i[s].push(e);
return;
}
Array.isArray(s) || (i[s] = {});
var r;
switch (s) {
case "UNIT":
case "PRIMEM":
case "VERT_DATUM":
i[s] = {
name: e[0].toLowerCase(),
convert: e[1]
}, e.length === 3 && Gi(e[2], i[s]);
return;
case "SPHEROID":
case "ELLIPSOID":
i[s] = {
name: e[0],
a: e[1],
rf: e[2]
}, e.length === 4 && Gi(e[3], i[s]);
return;
case "EDATUM":
case "ENGINEERINGDATUM":
case "LOCAL_DATUM":
case "DATUM":
case "VERT_CS":
case "VERTCRS":
case "VERTICALCRS":
e[0] = ["name", e[0]], Qs(i, s, e);
return;
case "COMPD_CS":
case "COMPOUNDCRS":
case "FITTED_CS":
case "PROJECTEDCRS":
case "PROJCRS":
case "GEOGCS":
case "GEOCCS":
case "PROJCS":
case "LOCAL_CS":
case "GEODCRS":
case "GEODETICCRS":
case "GEODETICDATUM":
case "ENGCRS":
case "ENGINEERINGCRS":
e[0] = ["name", e[0]], Qs(i, s, e), i[s].type = s;
return;
default:
for (r = -1; ++r < e.length; )
if (!Array.isArray(e[r]))
return Gi(e, i[s]);
return Qs(i, s, e);
}
}
var ac = 0.017453292519943295;
function ve(e) {
return e * ac;
}
function wo(e) {
const i = (e.projName || "").toLowerCase().replace(/_/g, " ");
!e.long0 && e.longc && (i === "albers conic equal area" || i === "lambert azimuthal equal area") && (e.long0 = e.longc), !e.lat_ts && e.lat1 && (i === "stereographic south pole" || i === "polar stereographic (variant b)") ? (e.lat0 = ve(e.lat1 > 0 ? 90 : -90), e.lat_ts = e.lat1, delete e.lat1) : !e.lat_ts && e.lat0 && (i === "polar stereographic" || i === "polar stereographic (variant a)") && (e.lat_ts = e.lat0, e.lat0 = ve(e.lat0 > 0 ? 90 : -90), delete e.lat1);
}
function La(e) {
let i = { units: null, to_meter: void 0 };
return typeof e == "string" ? (i.units = e.toLowerCase(), i.units === "metre" && (i.units = "meter"), i.units === "meter" && (i.to_meter = 1)) : e && e.name && (i.units = e.name.toLowerCase(), i.units === "metre" && (i.units = "meter"), i.to_meter = e.conversion_factor), i;
}
function Ca(e) {
return typeof e == "object" ? e.value * e.unit.conversion_factor : e;
}
function Ta(e, i) {
e.ellipsoid.radius ? (i.a = e.ellipsoid.radius, i.rf = 0) : (i.a = Ca(e.ellipsoid.semi_major_axis), e.ellipsoid.inverse_flattening !== void 0 ? i.rf = e.ellipsoid.inverse_flattening : e.ellipsoid.semi_major_axis !== void 0 && e.ellipsoid.semi_minor_axis !== void 0 && (i.rf = i.a / (i.a - Ca(e.ellipsoid.semi_minor_axis))));
}
function ps(e, i = {}) {
return !e || typeof e != "object" ? e : e.type === "BoundCRS" ? (ps(e.source_crs, i), e.transformation && (e.transformation.method && e.transformation.method.name === "NTv2" ? i.nadgrids = e.transformation.parameters[0].value : i.datum_params = e.transformation.parameters.map((s) => s.value)), i) : (Object.keys(e).forEach((s) => {
const r = e[s];
if (r !== null)
switch (s) {
case "name":
if (i.srsCode)
break;
i.name = r, i.srsCode = r;
break;
case "type":
r === "GeographicCRS" ? i.projName = "longlat" : r === "ProjectedCRS" && e.conversion && e.conversion.method && (i.projName = e.conversion.method.name);
break;
case "datum":
case "datum_ensemble":
r.ellipsoid && (i.ellps = r.ellipsoid.name, Ta(r, i)), r.prime_meridian && (i.from_greenwich = r.prime_meridian.longitude * Math.PI / 180);
break;
case "ellipsoid":
i.ellps = r.name, Ta(r, i);
break;
case "prime_meridian":
i.long0 = (r.longitude || 0) * Math.PI / 180;
break;
case "coordinate_system":
if (r.axis) {
if (i.axis = r.axis.map((o) => {
const h = o.direction;
if (h === "east")
return "e";
if (h === "north")
return "n";
if (h === "west")
return "w";
if (h === "south")
return "s";
throw new Error(`Unknown axis direction: ${h}`);
}).join("") + "u", r.unit) {
const { units: o, to_meter: h } = La(r.unit);
i.units = o, i.to_meter = h;
} else if (r.axis[0] && r.axis[0].unit) {
const { units: o, to_meter: h } = La(r.axis[0].unit);
i.units = o, i.to_meter = h;
}
}
break;
case "id":
r.authority && r.code && (i.title = r.authority + ":" + r.code);
break;
case "conversion":
r.method && r.method.name && (i.projName = r.method.name), r.parameters && r.parameters.forEach((o) => {
const h = o.name.toLowerCase().replace(/\s+/g, "_"), l = o.value;
o.unit && o.unit.conversion_factor ? i[h] = l * o.unit.conversion_factor : o.unit === "degree" ? i[h] = l * Math.PI / 180 : i[h] = l;
});
break;
case "unit":
r.name && (i.units = r.name.toLowerCase(), i.units === "metre" && (i.units = "meter")), r.conversion_factor && (i.to_meter = r.conversion_factor);
break;
case "base_crs":
ps(r, i), i.datumCode = r.id ? r.id.authority + "_" + r.id.code : r.name;
break;
}
}), i.latitude_of_false_origin !== void 0 && (i.lat0 = i.latitude_of_false_origin), i.longitude_of_false_origin !== void 0 && (i.long0 = i.longitude_of_false_origin), i.latitude_of_standard_parallel !== void 0 && (i.lat0 = i.latitude_of_standard_parallel, i.lat1 = i.latitude_of_standard_parallel), i.latitude_of_1st_standard_parallel !== void 0 && (i.lat1 = i.latitude_of_1st_standard_parallel), i.latitude_of_2nd_standard_parallel !== void 0 && (i.lat2 = i.latitude_of_2nd_standard_parallel), i.latitude_of_projection_centre !== void 0 && (i.lat0 = i.latitude_of_projection_centre), i.longitude_of_projection_centre !== void 0 && (i.longc = i.longitude_of_projection_centre), i.easting_at_false_origin !== void 0 && (i.x0 = i.easting_at_false_origin), i.northing_at_false_origin !== void 0 && (i.y0 = i.northing_at_false_origin), i.latitude_of_natural_origin !== void 0 && (i.lat0 = i.latitude_of_natural_origin), i.longitude_of_natural_origin !== void 0 && (i.long0 = i.longitude_of_natural_origin), i.longitude_of_origin !== void 0 && (i.long0 = i.longitude_of_origin), i.false_easting !== void 0 && (i.x0 = i.false_easting), i.easting_at_projection_centre && (i.x0 = i.easting_at_projection_centre), i.false_northing !== void 0 && (i.y0 = i.false_northing), i.northing_at_projection_centre && (i.y0 = i.northing_at_projection_centre), i.standard_parallel_1 !== void 0 && (i.lat1 = i.standard_parallel_1), i.standard_parallel_2 !== void 0 && (i.lat2 = i.standard_parallel_2), i.scale_factor_at_natural_origin !== void 0 && (i.k0 = i.scale_factor_at_natural_origin), i.scale_factor_at_projection_centre !== void 0 && (i.k0 = i.scale_factor_at_projection_centre), i.scale_factor_on_pseudo_standard_parallel !== void 0 && (i.k0 = i.scale_factor_on_pseudo_standard_parallel), i.azimuth !== void 0 && (i.alpha = i.azimuth), i.azimuth_at_projection_centre !== void 0 && (i.alpha = i.azimuth_at_projection_centre), i.angle_from_rectified_to_skew_grid && (i.rectified_grid_angle = i.angle_from_rectified_to_skew_grid), wo(i), i);
}
var oc = [
"PROJECTEDCRS",
"PROJCRS",
"GEOGCS",
"GEOCCS",
"PROJCS",
"LOCAL_CS",
"GEODCRS",
"GEODETICCRS",
"GEODETICDATUM",
"ENGCRS",
"ENGINEERINGCRS"
];
function hc(e, i) {
var s = i[0], r = i[1];
!(s in e) && r in e && (e[s] = e[r], i.length === 3 && (e[s] = i[2](e[s])));
}
function xo(e) {
for (var i = Object.keys(e), s = 0, r = i.length; s < r; ++s) {
var o = i[s];
oc.indexOf(o) !== -1 && lc(e[o]), typeof e[o] == "object" && xo(e[o]);
}
}
function lc(e) {
if (e.AUTHORITY) {
var i = Object.keys(e.AUTHORITY)[0];
i && i in e.AUTHORITY && (e.title = i + ":" + e.AUTHORITY[i]);
}
if (e.type === "GEOGCS" ? e.projName = "longlat" : e.type === "LOCAL_CS" ? (e.projName = "identity", e.local = !0) : typeof e.PROJECTION == "object" ? e.projName = Object.keys(e.PROJECTION)[0] : e.projName = e.PROJECTION, e.AXIS) {
for (var s = "", r = 0, o = e.AXIS.length; r < o; ++r) {
var h = [e.AXIS[r][0].toLowerCase(), e.AXIS[r][1].toLowerCase()];
h[0].indexOf("north") !== -1 || (h[0] === "y" || h[0] === "lat") && h[1] === "north" ? s += "n" : h[0].indexOf("south") !== -1 || (h[0] === "y" || h[0] === "lat") && h[1] === "south" ? s += "s" : h[0].indexOf("east") !== -1 || (h[0] === "x" || h[0] === "lon") && h[1] === "east" ? s += "e" : (h[0].indexOf("west") !== -1 || (h[0] === "x" || h[0] === "lon") && h[1] === "west") && (s += "w");
}
s.length === 2 && (s += "u"), s.length === 3 && (e.axis = s);
}
e.UNIT && (e.units = e.UNIT.name.toLowerCase(), e.units === "metre" && (e.units = "meter"), e.UNIT.convert && (e.type === "GEOGCS" ? e.DATUM && e.DATUM.SPHEROID && (e.to_meter = e.UNIT.convert * e.DATUM.SPHEROID.a) : e.to_meter = e.UNIT.convert));
var l = e.GEOGCS;
e.type === "GEOGCS" && (l = e), l && (l.DATUM ? e.datumCode = l.DATUM.name.toLowerCase() : e.datumCode = l.name.toLowerCase(), e.datumCode.slice(0, 2) === "d_" && (e.datumCode = e.datumCode.slice(2)), e.datumCode === "new_zealand_1949" && (e.datumCode = "nzgd49"), (e.datumCode === "wgs_1984" || e.datumCode === "world_geodetic_system_1984") && (e.PROJECTION === "Mercator_Auxiliary_Sphere" && (e.sphere = !0), e.datumCode = "wgs84"), e.datumCode === "belge_1972" && (e.datumCode = "rnb72"), l.DATUM && l.DATUM.SPHEROID && (e.ellps = l.DATUM.SPHEROID.name.replace("_19", "").replace(/[Cc]larke\_18/, "clrk"), e.ellps.toLowerCase().slice(0, 13) === "international" && (e.ellps = "intl"), e.a = l.DATUM.SPHEROID.a, e.rf = parseFloat(l.DATUM.SPHEROID.rf, 10)), l.DATUM && l.DATUM.TOWGS84 && (e.datum_params = l.DATUM.TOWGS84), ~e.datumCode.indexOf("osgb_1936") && (e.datumCode = "osgb36"), ~e.datumCode.indexOf("osni_1952") && (e.datumCode = "osni52"), (~e.datumCode.indexOf("tm65") || ~e.datumCode.indexOf("geodetic_datum_of_1965")) && (e.datumCode = "ire65"), e.datumCode === "ch1903+" && (e.datumCode = "ch1903"), ~e.datumCode.indexOf("israel") && (e.datumCode = "isr93")), e.b && !isFinite(e.b) && (e.b = e.a), e.rectified_grid_angle && (e.rectified_grid_angle = ve(e.rectified_grid_angle));
function u(v) {
var m = e.to_meter || 1;
return v * m;
}
var f = function(v) {
return hc(e, v);
}, _ = [
["standard_parallel_1", "Standard_Parallel_1"],
["standard_parallel_1", "Latitude of 1st standard parallel"],
["standard_parallel_2", "Standard_Parallel_2"],
["standard_parallel_2", "Latitude of 2nd standard parallel"],
["false_easting", "False_Easting"],
["false_easting", "False easting"],
["false-easting", "Easting at false origin"],
["false_northing", "False_Northing"],
["false_northing", "False northing"],
["false_northing", "Northing at false origin"],
["central_meridian", "Central_Meridian"],
["central_meridian", "Longitude of natural origin"],
["central_meridian", "Longitude of false origin"],
["latitude_of_origin", "Latitude_Of_Origin"],
["latitude_of_origin", "Central_Parallel"],
["latitude_of_origin", "Latitude of natural origin"],
["latitude_of_origin", "Latitude of false origin"],
["scale_factor", "Scale_Factor"],
["k0", "scale_factor"],
["latitude_of_center", "Latitude_Of_Center"],
["latitude_of_center", "Latitude_of_center"],
["lat0", "latitude_of_center", ve],
["longitude_of_center", "Longitude_Of_Center"],
["longitude_of_center", "Longitude_of_center"],
["longc", "longitude_of_center", ve],
["x0", "false_easting", u],
["y0", "false_northing", u],
["long0", "central_meridian", ve],
["lat0", "latitude_of_origin", ve],
["lat0", "standard_parallel_1", ve],
["lat1", "standard_parallel_1", ve],
["lat2", "standard_parallel_2", ve],
["azimuth", "Azimuth"],
["alpha", "azimuth", ve],
["srsCode", "name"]
];
_.forEach(f), wo(e);
}
function rr(e) {
if (typeof e == "object")
return ps(e);
const i = ec(e);
var s = rc(e);
if (i === "WKT2") {
const h = tc(s);
return ps(h);
}
var r = s[0], o = {};
return Gi(s, o), xo(o), o[r];
}
function Jt(e) {
var i = this;
if (arguments.length === 2) {
var s = arguments[1];
typeof s == "string" ? s.charAt(0) === "+" ? Jt[e] = sr(arguments[1]) : Jt[e] = rr(arguments[1]) : Jt[e] = s;
} else if (arguments.length === 1) {
if (Array.isArray(e))
return e.map(function(r) {
Array.isArray(r) ? Jt.apply(i, r) : Jt(r);
});
if (typeof e == "string") {
if (e in Jt)
return Jt[e];
} else
"EPSG" in e ? Jt["EPSG:" + e.EPSG] = e : "ESRI" in e ? Jt["ESRI:" + e.ESRI] = e : "IAU2000" in e ? Jt["IAU2000:" + e.IAU2000] = e : console.log(e);
return;
}
}
Fl(Jt);
function cc(e) {
return typeof e == "string";
}
function uc(e) {
return e in Jt;
}
function fc(e) {
return e.indexOf("+") !== 0 && e.indexOf("[") !== -1 || typeof e == "object" && !("srsCode" in e);
}
var dc = ["3857", "900913", "3785", "102113"];
function _c(e) {
var i = We(e, "authority");
if (i) {
var s = We(i, "epsg");
return s && dc.indexOf(s) > -1;
}
}
function pc(e) {
var i = We(e, "extension");
if (i)
return We(i, "proj4");
}
function mc(e) {
return e[0] === "+";
}
function gc(e) {
if (cc(e)) {
if (uc(e))
return Jt[e];
if (fc(e)) {
var i = rr(e);
if (_c(i))
return Jt["EPSG:3857"];
var s = pc(i);
return s ? sr(s) : i;
}
if (mc(e))
return sr(e);
} else
return e.projName ? e : rr(e);
}
function Na(e, i) {
e = e || {};
var s, r;
if (!i)
return e;
for (r in i)
s = i[r], s !== void 0 && (e[r] = s);
return e;
}
function Se(e, i, s) {
var r = e * i;
return s / Math.sqrt(1 - r * r);
}
function On(e) {
return e < 0 ? -1 : 1;
}
function Z(e) {
return Math.abs(e) <= Tt ? e : e - On(e) * Ln;
}
function ye(e, i, s) {
var r = e * s, o = 0.5 * e;
return r = Math.pow((1 - r) / (1 + r), o), Math.tan(0.5 * (O - i)) / r;
}
function Tn(e, i) {
for (var s = 0.5 * e, r, o, h = O - 2 * Math.atan(i), l = 0; l <= 15; l++)
if (r = e * Math.sin(h), o = O - 2 * Math.atan(i * Math.pow((1 - r) / (1 + r), s)) - h, h += o, Math.abs(o) <= 1e-10)
return h;
return -9999;
}
function vc() {
var e = this.b / this.a;
this.es = 1 - e * e, "x0" in this || (this.x0 = 0), "y0" in this || (this.y0 = 0), this.e = Math.sqrt(this.es), this.lat_ts ? this.sphere ? this.k0 = Math.cos(this.lat_ts) : this.k0 = Se(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) : this.k0 || (this.k ? this.k0 = this.k : this.k0 = 1);
}
function yc(e) {
var i = e.x, s = e.y;
if (s * Ee > 90 && s * Ee < -90 && i * Ee > 180 && i * Ee < -180)
return null;
var r, o;
if (Math.abs(Math.abs(s) - O) <= B)
return null;
if (this.sphere)
r = this.x0 + this.a * this.k0 * Z(i - this.long0), o = this.y0 + this.a * this.k0 * Math.log(Math.tan(ut + 0.5 * s));
else {
var h = Math.sin(s), l = ye(this.e, s, h);
r = this.x0 + this.a * this.k0 * Z(i - this.long0), o = this.y0 - this.a * this.k0 * Math.log(l);
}
return e.x = r, e.y = o, e;
}
function Mc(e) {
var i = e.x - this.x0, s = e.y - this.y0, r, o;
if (this.sphere)
o = O - 2 * Math.atan(Math.exp(-s / (this.a * this.k0)));
else {
var h = Math.exp(-s / (this.a * this.k0));
if (o = Tn(this.e, h), o === -9999)
return null;
}
return r = Z(this.long0 + i / (this.a * this.k0)), e.x = r, e.y = o, e;
}
var wc = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "Mercator_Variant_A", "merc"];
const xc = {
init: vc,
forward: yc,
inverse: Mc,
names: wc
};
function bc() {
}
function Ga(e) {
return e;
}
var Ec = ["longlat", "identity"];
const Pc = {
init: bc,
forward: Ga,
inverse: Ga,
names: Ec
};
var Sc = [xc, Pc], oi = {}, Ii = [];
function bo(e, i) {
var s = Ii.length;
return e.names ? (Ii[s] = e, e.names.forEach(function(r) {
oi[r.toLowerCase()] = s;
}), this) : (console.log(i), !0);
}
function Eo(e) {
return e.replace(/[-\(\)\s]+/g, " ").trim().replace(/ /g, "_");
}
function Ac(e) {
if (!e)
return !1;
var i = e.toLowerCase();
if (typeof oi[i] < "u" && Ii[oi[i]] || (i = Eo(i), i in oi && Ii[oi[i]]))
return Ii[oi[i]];
}
function Lc() {
Sc.forEach(bo);
}
const Cc = {
start: Lc,
add: bo,
get: Ac
};
var Po = {
MERIT: {
a: 6378137,
rf: 298.257,
ellipseName: "MERIT 1983"
},
SGS85: {
a: 6378136,
rf: 298.257,
ellipseName: "Soviet Geodetic System 85"
},
GRS80: {
a: 6378137,
rf: 298.257222101,
ellipseName: "GRS 1980(IUGG, 1980)"
},
IAU76: {
a: 6378140,
rf: 298.257,
ellipseName: "IAU 1976"
},
airy: {
a: 6377563396e-3,
b: 635625691e-2,
ellipseName: "Airy 1830"
},
APL4: {
a: 6378137,
rf: 298.25,
ellipseName: "Appl. Physics. 1965"
},
NWL9D: {
a: 6378145,
rf: 298.25,
ellipseName: "Naval Weapons Lab., 1965"
},
mod_airy: {
a: 6377340189e-3,
b: 6356034446e-3,
ellipseName: "Modified Airy"
},
andrae: {
a: 637710443e-2,
rf: 300,
ellipseName: "Andrae 1876 (Den., Iclnd.)"
},
aust_SA: {
a: 6378160,
rf: 298.25,
ellipseName: "Australian Natl & S. Amer. 1969"
},
GRS67: {
a: 6378160,
rf: 298.247167427,
ellipseName: "GRS 67(IUGG 1967)"
},
bessel: {
a: 6377397155e-3,
rf: 299.1528128,
ellipseName: "Bessel 1841"
},
bess_nam: {
a: 6377483865e-3,
rf: 299.1528128,
ellipseName: "Bessel 1841 (Namibia)"
},
clrk66: {
a: 63782064e-1,
b: 63565838e-1,
ellipseName: "Clarke 1866"
},
clrk80: {
a: 6378249145e-3,
rf: 293.4663,
ellipseName: "Clarke 1880 mod."
},
clrk80ign: {
a: 63782492e-1,
b: 6356515,
rf: 293.4660213,
ellipseName: "Clarke 1880 (IGN)"
},
clrk58: {
a: 6378293645208759e-9,
rf: 294.2606763692654,
ellipseName: "Clarke 1858"
},
CPM: {
a: 63757387e-1,
rf: 334.29,
ellipseName: "Comm. des Poids et Mesures 1799"
},
delmbr: {
a: 6376428,
rf: 311.5,
ellipseName: "Delambre 1810 (Belgium)"
},
engelis: {
a: 637813605e-2,
rf: 298.2566,
ellipseName: "Engelis 1985"
},
evrst30: {
a: 6377276345e-3,
rf: 300.8017,
ellipseName: "Everest 1830"
},
evrst48: {
a: 6377304063e-3,
rf: 300.8017,
ellipseName: "Everest 1948"
},
evrst56: {
a: 6377301243e-3,
rf: 300.8017,
ellipseName: "Everest 1956"
},
evrst69: {
a: 6377295664e-3,
rf: 300.8017,
ellipseName: "Everest 1969"
},
evrstSS: {
a: 6377298556e-3,
rf: 300.8017,
ellipseName: "Everest (Sabah & Sarawak)"
},
fschr60: {
a: 6378166,
rf: 298.3,
ellipseName: "Fischer (Mercury Datum) 1960"
},
fschr60m: {
a: 6378155,
rf: 298.3,
ellipseName: "Fischer 1960"
},
fschr68: {
a: 6378150,
rf: 298.3,
ellipseName: "Fischer 1968"
},
helmert: {
a: 6378200,
rf: 298.3,
ellipseName: "Helmert 1906"
},
hough: {
a: 6378270,
rf: 297,
ellipseName: "Hough"
},
intl: {
a: 6378388,
rf: 297,
ellipseName: "International 1909 (Hayford)"
},
kaula: {
a: 6378163,
rf: 298.24,
ellipseName: "Kaula 1961"
},
lerch: {
a: 6378139,
rf: 298.257,
ellipseName: "Lerch 1979"
},
mprts: {
a: 6397300,
rf: 191,
ellipseName: "Maupertius 1738"
},
new_intl: {
a: 63781575e-1,
b: 63567722e-1,
ellipseName: "New International 1967"
},
plessis: {
a: 6376523,
rf: 6355863,
ellipseName: "Plessis 1817 (France)"
},
krass: {
a: 6378245,
rf: 298.3,
ellipseName: "Krassovsky, 1942"
},
SEasia: {
a: 6378155,
b: 63567733205e-4,
ellipseName: "Southeast Asia"
},
walbeck: {
a: 6376896,
b: 63558348467e-4,
ellipseName: "Walbeck"
},
WGS60: {
a: 6378165,
rf: 298.3,
ellipseName: "WGS 60"
},
WGS66: {
a: 6378145,
rf: 298.25,
ellipseName: "WGS 66"
},
WGS7: {
a: 6378135,
rf: 298.26,
ellipseName: "WGS 72"
},
WGS84: {
a: 6378137,
rf: 298.257223563,
ellipseName: "WGS 84"
},
sphere: {
a: 6370997,
b: 6370997,
ellipseName: "Normal Sphere (r=6370997)"
}
};
const Tc = Po.WGS84;
function Nc(e, i, s, r) {
var o = e * e, h = i * i, l = (o - h) / o, u = 0;
r ? (e *= 1 - l * (jl + l * (Kl + l * Vl)), o = e * e, l = 0) : u = Math.sqrt(l);
var f = (o - h) / h;
return {
es: l,
e: u,
ep2: f
};
}
function Gc(e, i, s, r, o) {
if (!e) {
var h = We(Po, r);
h || (h = Tc), e = h.a, i = h.b, s = h.rf;
}
return s && !i && (i = (1 - 1 / s) * e), (s === 0 || Math.abs(e - i) < B) && (o = !0, i = e), {
a: e,
b: i,
rf: s,
sphere: o
};
}
var hs = {
wgs84: {
towgs84: "0,0,0",
ellipse: "WGS84",
datumName: "WGS84"
},
ch1903: {
towgs84: "674.374,15.056,405.346",
ellipse: "bessel",
datumName: "swiss"
},
ggrs87: {
towgs84: "-199.87,74.79,246.62",
ellipse: "GRS80",
datumName: "Greek_Geodetic_Reference_System_1987"
},
nad83: {
towgs84: "0,0,0",
ellipse: "GRS80",
datumName: "North_American_Datum_1983"
},
nad27: {
nadgrids: "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",
ellipse: "clrk66",
datumName: "North_American_Datum_1927"
},
potsdam: {
towgs84: "598.1,73.7,418.2,0.202,0.045,-2.455,6.7",
ellipse: "bessel",
datumName: "Potsdam Rauenberg 1950 DHDN"
},
carthage: {
towgs84: "-263.0,6.0,431.0",
ellipse: "clark80",
datumName: "Carthage 1934 Tunisia"
},
hermannskogel: {
towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
ellipse: "bessel",
datumName: "Hermannskogel"
},
mgi: {
towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
ellipse: "bessel",
datumName: "Militar-Geographische Institut"
},
osni52: {
towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
ellipse: "airy",
datumName: "Irish National"
},
ire65: {
towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
ellipse: "mod_airy",
datumName: "Ireland 1965"
},
rassadiran: {
towgs84: "-133.63,-157.5,-158.62",
ellipse: "intl",
datumName: "Rassadiran"
},
nzgd49: {
towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",
ellipse: "intl",
datumName: "New Zealand Geodetic Datum 1949"
},
osgb36: {
towgs84: "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",
ellipse: "airy",
datumName: "Ordnance Survey of Great Britain 1936"
},
s_jtsk: {
towgs84: "589,76,480",
ellipse: "bessel",
datumName: "S-JTSK (Ferro)"
},
beduaram: {
towgs84: "-106,-87,188",
ellipse: "clrk80",
datumName: "Beduaram"
},
gunung_segara: {
towgs84: "-403,684,41",
ellipse: "bessel",
datumName: "Gunung Segara Jakarta"
},
rnb72: {
towgs84: "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",
ellipse: "intl",
datumName: "Reseau National Belge 1972"
},
EPSG_5451: {
towgs84: "6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"
},
IGNF_LURESG: {
towgs84: "-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"
},
EPSG_4614: {
towgs84: "-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"
},
EPSG_4615: {
towgs84: "-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"
},
ESRI_37241: {
towgs84: "-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"
},
ESRI_37249: {
towgs84: "-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"
},
ESRI_37245: {
towgs84: "-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"
},
EPSG_4178: {
towgs84: "24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"
},
EPSG_4622: {
towgs84: "-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"
},
EPSG_4625: {
towgs84: "126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"
},
EPSG_5252: {
towgs84: "0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"
},
EPSG_4314: {
towgs84: "597.1,71.4,412.1,0.894,0.068,-1.563,7.58"
},
EPSG_4282: {
towgs84: "-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"
},
EPSG_4231: {
towgs84: "-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"
},
EPSG_4274: {
towgs84: "-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"
},
EPSG_4134: {
towgs84: "-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"
},
EPSG_4254: {
towgs84: "18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"
},
EPSG_4159: {
towgs84: "-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"
},
EPSG_4687: {
towgs84: "0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"
},
EPSG_4227: {
towgs84: "-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"
},
EPSG_4746: {
towgs84: "599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"
},
EPSG_4745: {
towgs84: "612.4,77,440.2,-0.054,0.057,-2.797,2.55"
},
EPSG_6311: {
towgs84: "8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"
},
EPSG_4289: {
towgs84: "565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"
},
EPSG_4230: {
towgs84: "-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"
},
EPSG_4154: {
towgs84: "-123.02,-158.95,-168.47"
},
EPSG_4156: {
towgs84: "570.8,85.7,462.8,4.998,1.587,5.261,3.56"
},
EPSG_4299: {
towgs84: "482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"
},
EPSG_4179: {
towgs84: "33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"
},
EPSG_4313: {
towgs84: "-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"
},
EPSG_4194: {
towgs84: "163.511,127.533,-159.789"
},
EPSG_4195: {
towgs84: "105,326,-102.5"
},
EPSG_4196: {
towgs84: "-45,417,-3.5"
},
EPSG_4611: {
towgs84: "-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"
},
EPSG_4633: {
towgs84: "137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"
},
EPSG_4641: {
towgs84: "-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"
},
EPSG_4643: {
towgs84: "-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"
},
EPSG_4300: {
towgs84: "482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"
},
EPSG_4188: {
towgs84: "482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"
},
EPSG_4660: {
towgs84: "982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"
},
EPSG_4662: {
towgs84: "97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"
},
EPSG_3906: {
towgs84: "577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"
},
EPSG_4307: {
towgs84: "-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"
},
EPSG_6892: {
towgs84: "-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"
},
EPSG_4690: {
towgs84: "221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"
},
EPSG_4691: {
towgs84: "218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"
},
EPSG_4629: {
towgs84: "72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"
},
EPSG_4630: {
towgs84: "165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"
},
EPSG_4692: {
towgs84: "217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"
},
EPSG_9333: {
towgs84: "0,0,0,-8.393,0.749,-10.276,0"
},
EPSG_9059: {
towgs84: "0,0,0"
},
EPSG_4312: {
towgs84: "601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"
},
EPSG_4123: {
towgs84: "-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"
},
EPSG_4309: {
towgs84: "-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"
},
ESRI_104106: {
towgs84: "-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"
},
EPSG_4281: {
towgs84: "-219.247,-73.802,269.529"
},
EPSG_4322: {
towgs84: "0,0,4.5"
},
EPSG_4324: {
towgs84: "0,0,1.9"
},
EPSG_4284: {
towgs84: "43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"
},
EPSG_4277: {
towgs84: "446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"
},
EPSG_4207: {
towgs84: "-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"
},
EPSG_4688: {
towgs84: "347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"
},
EPSG_4689: {
towgs84: "410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"
},
EPSG_4720: {
towgs84: "0,0,4.5"
},
EPSG_4273: {
towgs84: "278.3,93,474.5,7.889,0.05,-6.61,6.21"
},
EPSG_4240: {
towgs84: "204.64,834.74,293.8"
},
EPSG_4817: {
towgs84: "278.3,93,474.5,7.889,0.05,-6.61,6.21"
},
ESRI_104131: {
towgs84: "426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"
},
EPSG_4265: {
towgs84: "-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"
},
EPSG_4263: {
towgs84: "-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"
},
EPSG_4298: {
towgs84: "-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"
},
EPSG_4270: {
towgs84: "-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"
},
EPSG_4229: {
towgs84: "-121.8,98.1,-10.7"
},
EPSG_4220: {
towgs84: "-55.5,-348,-229.2"
},
EPSG_4214: {
towgs84: "12.646,-155.176,-80.863"
},
EPSG_4232: {
towgs84: "-345,3,223"
},
EPSG_4238: {
towgs84: "-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"
},
EPSG_4168: {
towgs84: "-170,33,326"
},
EPSG_4131: {
towgs84: "199,931,318.9"
},
EPSG_4152: {
towgs84: "-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"
},
EPSG_5228: {
towgs84: "572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"
},
EPSG_8351: {
towgs84: "485.021,169.465,483.839,7.786342,4.397554,4.102655,0"
},
EPSG_4683: {
towgs84: "-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"
},
EPSG_4133: {
towgs84: "0,0,0"
},
EPSG_7373: {
towgs84: "0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"
},
EPSG_9075: {
towgs84: "-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"
},
EPSG_9072: {
towgs84: "-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"
},
EPSG_9294: {
towgs84: "1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"
},
EPSG_4212: {
towgs84: "-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"
},
EPSG_4191: {
towgs84: "-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"
},
EPSG_4237: {
towgs84: "52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"
},
EPSG_4740: {
towgs84: "-1.08,-0.27,-0.9"
},
EPSG_4124: {
towgs84: "419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"
},
EPSG_5681: {
towgs84: "584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"
},
EPSG_4141: {
towgs84: "23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"
},
EPSG_4204: {
towgs84: "-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"
},
EPSG_4319: {
towgs84: "226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"
},
EPSG_4200: {
towgs84: "24.82,-131.21,-82.66"
},
EPSG_4130: {
towgs84: "0,0,0"
},
EPSG_4127: {
towgs84: "-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"
},
EPSG_4149: {
towgs84: "674.374,15.056,405.346"
},
EPSG_4617: {
towgs84: "-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"
},
EPSG_4663: {
towgs84: "-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"
},
EPSG_4664: {
towgs84: "-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"
},
EPSG_4665: {
towgs84: "-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"
},
EPSG_4666: {
towgs84: "631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"
},
EPSG_4756: {
towgs84: "-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"
},
EPSG_4723: {
towgs84: "-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"
},
EPSG_4726: {
towgs84: "8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"
},
EPSG_4267: {
towgs84: "-8.0,160.0,176.0"
},
EPSG_5365: {
towgs84: "-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"
},
EPSG_4218: {
towgs84: "304.5,306.5,-318.1"
},
EPSG_4242: {
towgs84: "-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"
},
EPSG_4216: {
towgs84: "-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"
},
ESRI_104105: {
towgs84: "631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"
},
ESRI_104129: {
towgs84: "0,0,0"
},
EPSG_4673: {
towgs84: "174.05,-25.49,112.57"
},
EPSG_4202: {
towgs84: "-124,-60,154"
},
EPSG_4203: {
towgs84: "-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"
},
EPSG_3819: {
towgs84: "595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"
},
EPSG_8694: {
towgs84: "-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"
},
EPSG_4145: {
towgs84: "275.57,676.78,229.6"
},
EPSG_4283: {
towgs84: "61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"
},
EPSG_4317: {
towgs84: "2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"
},
EPSG_4272: {
towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"
},
EPSG_4248: {
towgs84: "-307.7,265.3,-363.5"
},
EPSG_5561: {
towgs84: "24,-121,-76"
},
EPSG_5233: {
towgs84: "-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"
},
ESRI_104130: {
towgs84: "-86,-98,-119"
},
ESRI_104102: {
towgs84: "682,-203,480"
},
ESRI_37207: {
towgs84: "7,-10,-26"
},
EPSG_4675: {
towgs84: "59.935,118.4,-10.871"
},
ESRI_104109: {
towgs84: "-89.121,-348.182,260.871"
},
ESRI_104112: {
towgs84: "-185.583,-230.096,281.361"
},
ESRI_104113: {
towgs84: "25.1,-275.6,222.6"
},
IGNF_WGS72G: {
towgs84: "0,12,6"
},
IGNF_NTFG: {
towgs84: "-168,-60,320"
},
IGNF_EFATE57G: {
towgs84: "-127,-769,472"
},
IGNF_PGP50G: {
towgs84: "324.8,153.6,172.1"
},
IGNF_REUN47G: {
towgs84: "94,-948,-1262"
},
IGNF_CSG67G: {
towgs84: "-186,230,110"
},
IGNF_GUAD48G: {
towgs84: "-467,-16,-300"
},
IGNF_TAHI51G: {
towgs84: "162,117,154"
},
IGNF_TAHAAG: {
towgs84: "65,342,77"
},
IGNF_NUKU72G: {
towgs84: "84,274,65"
},
IGNF_PETRELS72G: {
towgs84: "365,194,166"
},
IGNF_WALL78G: {
towgs84: "253,-133,-127"
},
IGNF_MAYO50G: {
towgs84: "-382,-59,-262"
},
IGNF_TANNAG: {
towgs84: "-139,-967,436"
},
IGNF_IGN72G: {
towgs84: "-13,-348,292"
},
IGNF_ATIGG: {
towgs84: "1118,23,66"
},
IGNF_FANGA84G: {
towgs84: "150.57,158.33,118.32"
},
IGNF_RUSAT84G: {
towgs84: "202.13,174.6,-15.74"
},
IGNF_KAUE70G: {
towgs84: "126.74,300.1,-75.49"
},
IGNF_MOP90G: {
towgs84: "-10.8,-1.8,12.77"
},
IGNF_MHPF67G: {
towgs84: "338.08,212.58,-296.17"
},
IGNF_TAHI79G: {
towgs84: "160.61,116.05,153.69"
},
IGNF_ANAA92G: {
towgs84: "1.5,3.84,4.81"
},
IGNF_MARQUI72G: {
towgs84: "330.91,-13.92,58.56"
},
IGNF_APAT86G: {
towgs84: "143.6,197.82,74.05"
},
IGNF_TUBU69G: {
towgs84: "237.17,171.61,-77.84"
},
IGNF_STPM50G: {
towgs84: "11.363,424.148,373.13"
},
EPSG_4150: {
towgs84: "674.374,15.056,405.346"
},
EPSG_4754: {
towgs84: "-208.4058,-109.8777,-2.5764"
},
ESRI_104101: {
towgs84: "374,150,588"
},
EPSG_4693: {
towgs84: "0,-0.15,0.68"
},
EPSG_6207: {
towgs84: "293.17,726.18,245.36"
},
EPSG_4153: {
towgs84: "-133.63,-157.5,-158.62"
},
EPSG_4132: {
towgs84: "-241.54,-163.64,396.06"
},
EPSG_4221: {
towgs84: "-154.5,150.7,100.4"
},
EPSG_4266: {
towgs84: "-80.7,-132.5,41.1"
},
EPSG_4193: {
towgs84: "-70.9,-151.8,-41.4"
},
EPSG_5340: {
towgs84: "-0.41,0.46,-0.35"
},
EPSG_4246: {
towgs84: "-294.7,-200.1,525.5"
},
EPSG_4318: {
towgs84: "-3.2,-5.7,2.8"
},
EPSG_4121: {
towgs84: "-199.87,74.79,246.62"
},
EPSG_4223: {
towgs84: "-260.1,5.5,432.2"
},
EPSG_4158: {
towgs84: "-0.465,372.095,171.736"
},
EPSG_4285: {
towgs84: "-128.16,-282.42,21.93"
},
EPSG_4613: {
towgs84: "-404.78,685.68,45.47"
},
EPSG_4607: {
towgs84: "195.671,332.517,274.607"
},
EPSG_4475: {
towgs84: "-381.788,-57.501,-256.673"
},
EPSG_4208: {
towgs84: "-157.84,308.54,-146.6"
},
EPSG_4743: {
towgs84: "70.995,-335.916,262.898"
},
EPSG_4710: {
towgs84: "-323.65,551.39,-491.22"
},
EPSG_7881: {
towgs84: "-0.077,0.079,0.086"
},
EPSG_4682: {
towgs84: "283.729,735.942,261.143"
},
EPSG_4739: {
towgs84: "-156,-271,-189"
},
EPSG_4679: {
towgs84: "-80.01,253.26,291.19"
},
EPSG_4750: {
towgs84: "-56.263,16.136,-22.856"
},
EPSG_4644: {
towgs84: "-10.18,-350.43,291.37"
},
EPSG_4695: {
towgs84: "-103.746,-9.614,-255.95"
},
EPSG_4292: {
towgs84: "-355,21,72"
},
EPSG_4302: {
towgs84: "-61.702,284.488,472.052"
},
EPSG_4143: {
towgs84: "-124.76,53,466.79"
},
EPSG_4606: {
towgs84: "-153,153,307"
},
EPSG_4699: {
towgs84: "-770.1,158.4,-498.2"
},
EPSG_4247: {
towgs84: "-273.5,110.6,-357.9"
},
EPSG_4160: {
towgs84: "8.88,184.86,106.69"
},
EPSG_4161: {
towgs84: "-233.43,6.65,173.64"
},
EPSG_9251: {
towgs84: "-9.5,122.9,138.2"
},
EPSG_9253: {
towgs84: "-78.1,101.6,133.3"
},
EPSG_4297: {
towgs84: "-198.383,-240.517,-107.909"
},
EPSG_4269: {
towgs84: "0,0,0"
},
EPSG_4301: {
towgs84: "-147,506,687"
},
EPSG_4618: {
towgs84: "-59,-11,-52"
},
EPSG_4612: {
towgs84: "0,0,0"
},
EPSG_4678: {
towgs84: "44.585,-131.212,-39.544"
},
EPSG_4250: {
towgs84: "-130,29,364"
},
EPSG_4144: {
towgs84: "214,804,268"
},
EPSG_4147: {
towgs84: "-17.51,-108.32,-62.39"
},
EPSG_4259: {
towgs84: "-254.1,-5.36,-100.29"
},
EPSG_4164: {
towgs84: "-76,-138,67"
},
EPSG_4211: {
towgs84: "-378.873,676.002,-46.255"
},
EPSG_4182: {
towgs84: "-422.651,-172.995,84.02"
},
EPSG_4224: {
towgs84: "-143.87,243.37,-33.52"
},
EPSG_4225: {
towgs84: "-205.57,168.77,-4.12"
},
EPSG_5527: {
towgs84: "-67.35,3.88,-38.22"
},
EPSG_4752: {
towgs84: "98,390,-22"
},
EPSG_4310: {
towgs84: "-30,190,89"
},
EPSG_9248: {
towgs84: "-192.26,65.72,132.08"
},
EPSG_4680: {
towgs84: "124.5,-63.5,-281"
},
EPSG_4701: {
towgs84: "-79.9,-158,-168.9"
},
EPSG_4706: {
towgs84: "-146.21,112.63,4.05"
},
EPSG_4805: {
towgs84: "682,-203,480"
},
EPSG_4201: {
towgs84: "-165,-11,206"
},
EPSG_4210: {
towgs84: "-157,-2,-299"
},
EPSG_4183: {
towgs84: "-104,167,-38"
},
EPSG_4139: {
towgs84: "11,72,-101"
},
EPSG_4668: {
towgs84: "-86,-98,-119"
},
EPSG_4717: {
towgs84: "-2,151,181"
},
EPSG_4732: {
towgs84: "102,52,-38"
},
EPSG_4280: {
towgs84: "-377,681,-50"
},
EPSG_4209: {
towgs84: "-138,-105,-289"
},
EPSG_4261: {
towgs84: "31,146,47"
},
EPSG_4658: {
towgs84: "-73,46,-86"
},
EPSG_4721: {
towgs84: "265.025,384.929,-194.046"
},
EPSG_4222: {
towgs84: "-136,-108,-292"
},
EPSG_4601: {
towgs84: "-255,-15,71"
},
EPSG_4602: {
towgs84: "725,685,536"
},
EPSG_4603: {
towgs84: "72,213.7,93"
},
EPSG_4605: {
towgs84: "9,183,236"
},
EPSG_4621: {
towgs84: "137,248,-430"
},
EPSG_4657: {
towgs84: "-28,199,5"
},
EPSG_4316: {
towgs84: "103.25,-100.4,-307.19"
},
EPSG_4642: {
towgs84: "-13,-348,292"
},
EPSG_4698: {
towgs84: "145,-187,103"
},
EPSG_4192: {
towgs84: "-206.1,-174.7,-87.7"
},
EPSG_4311: {
towgs84: "-265,120,-358"
},
EPSG_4135: {
towgs84: "58,-283,-182"
},
ESRI_104138: {
towgs84: "198,-226,-347"
},
EPSG_4245: {
towgs84: "-11,851,5"
},
EPSG_4142: {
towgs84: "-125,53,467"
},
EPSG_4213: {
towgs84: "-106,-87,188"
},
EPSG_4253: {
towgs84: "-133,-77,-51"
},
EPSG_4129: {
towgs84: "-132,-110,-335"
},
EPSG_4713: {
towgs84: "-77,-128,142"
},
EPSG_4239: {
towgs84: "217,823,299"
},
EPSG_4146: {
towgs84: "295,736,257"
},
EPSG_4155: {
towgs84: "-83,37,124"
},
EPSG_4165: {
towgs84: "-173,253,27"
},
EPSG_4672: {
towgs84: "175,-38,113"
},
EPSG_4236: {
towgs84: "-637,-549,-203"
},
EPSG_4251: {
towgs84: "-90,40,88"
},
EPSG_4271: {
towgs84: "-2,374,172"
},
EPSG_4175: {
towgs84: "-88,4,101"
},
EPSG_4716: {
towgs84: "298,-304,-375"
},
EPSG_4315: {
towgs84: "-23,259,-9"
},
EPSG_4744: {
towgs84: "-242.2,-144.9,370.3"
},
EPSG_4244: {
towgs84: "-97,787,86"
},
EPSG_4293: {
towgs84: "616,97,-251"
},
EPSG_4714: {
towgs84: "-127,-769,472"
},
EPSG_4736: {
towgs84: "260,12,-147"
},
EPSG_6883: {
towgs84: "-235,-110,393"
},
EPSG_6894: {
towgs84: "-63,176,185"
},
EPSG_4205: {
towgs84: "-43,-163,45"
},
EPSG_4256: {
towgs84: "41,-220,-134"
},
EPSG_4262: {
towgs84: "639,405,60"
},
EPSG_4604: {
towgs84: "174,359,365"
},
EPSG_4169: {
towgs84: "-115,118,426"
},
EPSG_4620: {
towgs84: "-106,-129,165"
},
EPSG_4184: {
towgs84: "-203,141,53"
},
EPSG_4616: {
towgs84: "-289,-124,60"
},
EPSG_9403: {
towgs84: "-307,-92,127"
},
EPSG_4684: {
towgs84: "-133,-321,50"
},
EPSG_4708: {
towgs84: "-491,-22,435"
},
EPSG_4707: {
towgs84: "114,-116,-333"
},
EPSG_4709: {
towgs84: "145,75,-272"
},
EPSG_4712: {
towgs84: "-205,107,53"
},
EPSG_4711: {
towgs84: "124,-234,-25"
},
EPSG_4718: {
towgs84: "230,-199,-752"
},
EPSG_4719: {
towgs84: "211,147,111"
},
EPSG_4724: {
towgs84: "208,-435,-229"
},
EPSG_4725: {
towgs84: "189,-79,-202"
},
EPSG_4735: {
towgs84: "647,1777,-1124"
},
EPSG_4722: {
towgs84: "-794,119,-298"
},
EPSG_4728: {
towgs84: "-307,-92,127"
},
EPSG_4734: {
towgs84: "-632,438,-609"
},
EPSG_4727: {
towgs84: "912,-58,1227"
},
EPSG_4729: {
towgs84: "185,165,42"
},
EPSG_4730: {
towgs84: "170,42,84"
},
EPSG_4733: {
towgs84: "276,-57,149"
},
ESRI_37218: {
towgs84: "230,-199,-752"
},
ESRI_37240: {
towgs84: "-7,215,225"
},
ESRI_37221: {
towgs84: "252,-209,-751"
},
ESRI_4305: {
towgs84: "-123,-206,219"
},
ESRI_104139: {
towgs84: "-73,-247,227"
},
EPSG_4748: {
towgs84: "51,391,-36"
},
EPSG_4219: {
towgs84: "-384,664,-48"
},
EPSG_4255: {
towgs84: "-333,-222,114"
},
EPSG_4257: {
towgs84: "-587.8,519.75,145.76"
},
EPSG_4646: {
towgs84: "-963,510,-359"
},
EPSG_6881: {
towgs84: "-24,-203,268"
},
EPSG_6882: {
towgs84: "-183,-15,273"
},
EPSG_4715: {
towgs84: "-104,-129,239"
},
IGNF_RGF93GDD: {
towgs84: "0,0,0"
},
IGNF_RGM04GDD: {
towgs84: "0,0,0"
},
IGNF_RGSPM06GDD: {
towgs84: "0,0,0"
},
IGNF_RGTAAF07GDD: {
towgs84: "0,0,0"
},
IGNF_RGFG95GDD: {
towgs84: "0,0,0"
},
IGNF_RGNCG: {
towgs84: "0,0,0"
},
IGNF_RGPFGDD: {
towgs84: "0,0,0"
},
IGNF_ETRS89G: {
towgs84: "0,0,0"
},
IGNF_RGR92GDD: {
towgs84: "0,0,0"
},
EPSG_4173: {
towgs84: "0,0,0"
},
EPSG_4180: {
towgs84: "0,0,0"
},
EPSG_4619: {
towgs84: "0,0,0"
},
EPSG_4667: {
towgs84: "0,0,0"
},
EPSG_4075: {
towgs84: "0,0,0"
},
EPSG_6706: {
towgs84: "0,0,0"
},
EPSG_7798: {
towgs84: "0,0,0"
},
EPSG_4661: {
towgs84: "0,0,0"
},
EPSG_4669: {
towgs84: "0,0,0"
},
EPSG_8685: {
towgs84: "0,0,0"
},
EPSG_4151: {
towgs84: "0,0,0"
},
EPSG_9702: {
towgs84: "0,0,0"
},
EPSG_4758: {
towgs84: "0,0,0"
},
EPSG_4761: {
towgs84: "0,0,0"
},
EPSG_4765: {
towgs84: "0,0,0"
},
EPSG_8997: {
towgs84: "0,0,0"
},
EPSG_4023: {
towgs84: "0,0,0"
},
EPSG_4670: {
towgs84: "0,0,0"
},
EPSG_4694: {
towgs84: "0,0,0"
},
EPSG_4148: {
towgs84: "0,0,0"
},
EPSG_4163: {
towgs84: "0,0,0"
},
EPSG_4167: {
towgs84: "0,0,0"
},
EPSG_4189: {
towgs84: "0,0,0"
},
EPSG_4190: {
towgs84: "0,0,0"
},
EPSG_4176: {
towgs84: "0,0,0"
},
EPSG_4659: {
towgs84: "0,0,0"
},
EPSG_3824: {
towgs84: "0,0,0"
},
EPSG_3889: {
towgs84: "0,0,0"
},
EPSG_4046: {
towgs84: "0,0,0"
},
EPSG_4081: {
towgs84: "0,0,0"
},
EPSG_4558: {
towgs84: "0,0,0"
},
EPSG_4483: {
towgs84: "0,0,0"
},
EPSG_5013: {
towgs84: "0,0,0"
},
EPSG_5264: {
towgs84: "0,0,0"
},
EPSG_5324: {
towgs84: "0,0,0"
},
EPSG_5354: {
towgs84: "0,0,0"
},
EPSG_5371: {
towgs84: "0,0,0"
},
EPSG_5373: {
towgs84: "0,0,0"
},
EPSG_5381: {
towgs84: "0,0,0"
},
EPSG_5393: {
towgs84: "0,0,0"
},
EPSG_5489: {
towgs84: "0,0,0"
},
EPSG_5593: {
towgs84: "0,0,0"
},
EPSG_6135: {
towgs84: "0,0,0"
},
EPSG_6365: {
towgs84: "0,0,0"
},
EPSG_5246: {
towgs84: "0,0,0"
},
EPSG_7886: {
towgs84: "0,0,0"
},
EPSG_8431: {
towgs84: "0,0,0"
},
EPSG_8427: {
towgs84: "0,0,0"
},
EPSG_8699: {
towgs84: "0,0,0"
},
EPSG_8818: {
towgs84: "0,0,0"
},
EPSG_4757: {
towgs84: "0,0,0"
},
EPSG_9140: {
towgs84: "0,0,0"
},
EPSG_8086: {
towgs84: "0,0,0"
},
EPSG_4686: {
towgs84: "0,0,0"
},
EPSG_4737: {
towgs84: "0,0,0"
},
EPSG_4702: {
towgs84: "0,0,0"
},
EPSG_4747: {
towgs84: "0,0,0"
},
EPSG_4749: {
towgs84: "0,0,0"
},
EPSG_4674: {
towgs84: "0,0,0"
},
EPSG_4755: {
towgs84: "0,0,0"
},
EPSG_4759: {
towgs84: "0,0,0"
},
EPSG_4762: {
towgs84: "0,0,0"
},
EPSG_4763: {
towgs84: "0,0,0"
},
EPSG_4764: {
towgs84: "0,0,0"
},
EPSG_4166: {
towgs84: "0,0,0"
},
EPSG_4170: {
towgs84: "0,0,0"
},
EPSG_5546: {
towgs84: "0,0,0"
},
EPSG_7844: {
towgs84: "0,0,0"
},
EPSG_4818: {
towgs84: "589,76,480"
}
};
for (var Ic in hs) {
var Ys = hs[Ic];
Ys.datumName && (hs[Ys.datumName] = Ys);
}
function Oc(e, i, s, r, o, h, l) {
var u = {};
return e === void 0 || e === "none" ? u.datum_type = nr : u.datum_type = Hl, i && (u.datum_params = i.map(parseFloat), (u.datum_params[0] !== 0 || u.datum_params[1] !== 0 || u.datum_params[2] !== 0) && (u.datum_type = ui), u.datum_params.length > 3 && (u.datum_params[3] !== 0 || u.datum_params[4] !== 0 || u.datum_params[5] !== 0 || u.datum_params[6] !== 0) && (u.datum_type = fi, u.datum_params[3] *= Mn, u.datum_params[4] *= Mn, u.datum_params[5] *= Mn, u.datum_params[6] = u.datum_params[6] / 1e6 + 1)), l && (u.datum_type = Ri, u.grids = l), u.a = s, u.b = r, u.es = o, u.ep2 = h, u;
}
var pr = {};
function kc(e, i, s) {
return i instanceof ArrayBuffer ? Rc(e, i, s) : { ready: zc(e, i) };
}
function Rc(e, i, s) {
var r = !0;
s !== void 0 && s.includeErrorFields === !1 && (r = !1);
var o = new DataView(i), h = Uc(o), l = Zc(o, h), u = qc(o, l, h, r), f = { header: l, subgrids: u };
return pr[e] = f, f;
}
async function zc(e, i) {
for (var s = [], r = await i.getImageCount(), o = r - 1; o >= 0; o--) {
var h = await i.getImage(o), l = await h.readRasters(), u = l, f = [h.getWidth(), h.getHeight()], _ = h.getBoundingBox().map(Ia), v = [h.fileDirectory.ModelPixelScale[0], h.fileDirectory.ModelPixelScale[1]].map(Ia), m = _[0] + (f[0] - 1) * v[0], g = _[3] - (f[1] - 1) * v[1], M = u[0], E = u[1], x = [];
for (let U = f[1] - 1; U >= 0; U--)
for (let $ = f[0] - 1; $ >= 0; $--) {
var C = U * f[0] + $;
x.push([-$e(E[C]), $e(M[C])]);
}
s.push({
del: v,
lim: f,
ll: [-m, g],
cvs: x
});
}
var D = {
header: {
nSubgrids: r
},
subgrids: s
};
return pr[e] = D, D;
}
function Dc(e) {
if (e === void 0)
return null;
var i = e.split(",");
return i.map(Bc);
}
function Bc(e) {
if (e.length === 0)
return null;
var i = e[0] === "@";
return i && (e = e.slice(1)), e === "null" ? { name: "null", mandatory: !i, grid: null, isNull: !0 } : {
name: e,
mandatory: !i,
grid: pr[e] || null,
isNull: !1
};
}
function Ia(e) {
return e * Math.PI / 180;
}
function $e(e) {
return e / 3600 * Math.PI / 180;
}
function Uc(e) {
var i = e.getInt32(8, !1);
return i === 11 ? !1 : (i = e.getInt32(8, !0), i !== 11 && console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"), !0);
}
function Zc(e, i) {
return {
nFields: e.getInt32(8, i),
nSubgridFields: e.getInt32(24, i),
nSubgrids: e.getInt32(40, i),
shiftType: ar(e, 56, 56 + 8).trim(),
fromSemiMajorAxis: e.getFloat64(120, i),
fromSemiMinorAxis: e.getFloat64(136, i),
toSemiMajorAxis: e.getFloat64(152, i),
toSemiMinorAxis: e.getFloat64(168, i)
};
}
function ar(e, i, s) {
return String.fromCharCode.apply(null, new Uint8Array(e.buffer.slice(i, s)));
}
function qc(e, i, s, r) {
for (var o = 176, h = [], l = 0; l < i.nSubgrids; l++) {
var u = Fc(e, o, s), f = Hc(e, o, u, s, r), _ = Math.round(
1 + (u.upperLongitude - u.lowerLongitude) / u.longitudeInterval
), v = Math.round(
1 + (u.upperLatitude - u.lowerLatitude) / u.latitudeInterval
);
h.push({
ll: [$e(u.lowerLongitude), $e(u.lowerLatitude)],
del: [$e(u.longitudeInterval), $e(u.latitudeInterval)],
lim: [_, v],
count: u.gridNodeCount,
cvs: $c(f)
});
var m = 16;
r === !1 && (m = 8), o += 176 + u.gridNodeCount * m;
}
return h;
}
function $c(e) {
return e.map(function(i) {
return [$e(i.longitudeShift), $e(i.latitudeShift)];
});
}
function Fc(e, i, s) {
return {
name: ar(e, i + 8, i + 16).trim(),
parent: ar(e, i + 24, i + 24 + 8).trim(),
lowerLatitude: e.getFloat64(i + 72, s),
upperLatitude: e.getFloat64(i + 88, s),
lowerLongitude: e.getFloat64(i + 104, s),
upperLongitude: e.getFloat64(i + 120, s),
latitudeInterval: e.getFloat64(i + 136, s),
longitudeInterval: e.getFloat64(i + 152, s),
gridNodeCount: e.getInt32(i + 168, s)
};
}
function Hc(e, i, s, r, o) {
var h = i + 176, l = 16;
o === !1 && (l = 8);
for (var u = [], f = 0; f < s.gridNodeCount; f++) {
var _ = {
latitudeShift: e.getFloat32(h + f * l, r),
longitudeShift: e.getFloat32(h + f * l + 4, r)
};
o !== !1 && (_.latitudeAccuracy = e.getFloat32(h + f * l + 8, r), _.longitudeAccuracy = e.getFloat32(h + f * l + 12, r)), u.push(_);
}
return u;
}
function Pe(e, i) {
if (!(this instanceof Pe))
return new Pe(e);
i = i || function(_) {
if (_)
throw _;
};
var s = gc(e);
if (typeof s != "object") {
i("Could not parse to valid json: " + e);
return;
}
var r = Pe.projections.get(s.projName);
if (!r) {
i("Could not get projection name from: " + e);
return;
}
if (s.datumCode && s.datumCode !== "none") {
var o = We(hs, s.datumCode);
o && (s.datum_params = s.datum_params || (o.towgs84 ? o.towgs84.split(",") : null), s.ellps = o.ellipse, s.datumName = o.datumName ? o.datumName : s.datumCode);
}
s.k0 = s.k0 || 1, s.axis = s.axis || "enu", s.ellps = s.ellps || "wgs84", s.lat1 = s.lat1 || s.lat0;
var h = Gc(s.a, s.b, s.rf, s.ellps, s.sphere), l = Nc(h.a, h.b, h.rf, s.R_A), u = Dc(s.nadgrids), f = s.datum || Oc(
s.datumCode,
s.datum_params,
h.a,
h.b,
l.es,
l.ep2,
u
);
Na(this, s), Na(this, r), this.a = h.a, this.b = h.b, this.rf = h.rf, this.sphere = h.sphere, this.es = l.es, this.e = l.e, this.ep2 = l.ep2, this.datum = f, this.init(), i(null, this);
}
Pe.projections = Cc;
Pe.projections.start();
function Wc(e, i) {
return e.datum_type !== i.datum_type || e.a !== i.a || Math.abs(e.es - i.es) > 5e-11 ? !1 : e.datum_type === ui ? e.datum_params[0] === i.datum_params[0] && e.datum_params[1] === i.datum_params[1] && e.datum_params[2] === i.datum_params[2] : e.datum_type === fi ? e.datum_params[0] === i.datum_params[0] && e.datum_params[1] === i.datum_params[1] && e.datum_params[2] === i.datum_params[2] && e.datum_params[3] === i.datum_params[3] && e.datum_params[4] === i.datum_params[4] && e.datum_params[5] === i.datum_params[5] && e.datum_params[6] === i.datum_params[6] : !0;
}
function So(e, i, s) {
var r = e.x, o = e.y, h = e.z ? e.z : 0, l, u, f, _;
if (o < -O && o > -1.001 * O)
o = -O;
else if (o > O && o < 1.001 * O)
o = O;
else {
if (o < -O)
return { x: -1 / 0, y: -1 / 0, z: e.z };
if (o > O)
return { x: 1 / 0, y: 1 / 0, z: e.z };
}
return r > Math.PI && (r -= 2 * Math.PI), u = Math.sin(o), _ = Math.cos(o), f = u * u, l = s / Math.sqrt(1 - i * f), {
x: (l + h) * _ * Math.cos(r),
y: (l + h) * _ * Math.sin(r),
z: (l * (1 - i) + h) * u
};
}
function Ao(e, i, s, r) {
var o = 1e-12, h = o * o, l = 30, u, f, _, v, m, g, M, E, x, C, D, U, $, lt = e.x, mt = e.y, Mt = e.z ? e.z : 0, Rt, zt, Wt;
if (u = Math.sqrt(lt * lt + mt * mt), f = Math.sqrt(lt * lt + mt * mt + Mt * Mt), u / s < o) {
if (Rt = 0, f / s < o)
return zt = O, Wt = -r, {
x: e.x,
y: e.y,
z: e.z
};
} else
Rt = Math.atan2(mt, lt);
_ = Mt / f, v = u / f, m = 1 / Math.sqrt(1 - i * (2 - i) * v * v), E = v * (1 - i) * m, x = _ * m, $ = 0;
do
$++, M = s / Math.sqrt(1 - i * x * x), Wt = u * E + Mt * x - M * (1 - i * x * x), g = i * M / (M + Wt), m = 1 / Math.sqrt(1 - g * (2 - g) * v * v), C = v * (1 - g) * m, D = _ * m, U = D * E - C * x, E = C, x = D;
while (U * U > h && $ < l);
return zt = Math.atan(D / Math.abs(C)), {
x: Rt,
y: zt,
z: Wt
};
}
function jc(e, i, s) {
if (i === ui)
return {
x: e.x + s[0],
y: e.y + s[1],
z: e.z + s[2]
};
if (i === fi) {
var r = s[0], o = s[1], h = s[2], l = s[3], u = s[4], f = s[5], _ = s[6];
return {
x: _ * (e.x - f * e.y + u * e.z) + r,
y: _ * (f * e.x + e.y - l * e.z) + o,
z: _ * (-u * e.x + l * e.y + e.z) + h
};
}
}
function Kc(e, i, s) {
if (i === ui)
return {
x: e.x - s[0],
y: e.y - s[1],
z: e.z - s[2]
};
if (i === fi) {
var r = s[0], o = s[1], h = s[2], l = s[3], u = s[4], f = s[5], _ = s[6], v = (e.x - r) / _, m = (e.y - o) / _, g = (e.z - h) / _;
return {
x: v + f * m - u * g,
y: -f * v + m + l * g,
z: u * v - l * m + g
};
}
}
function rs(e) {
return e === ui || e === fi;
}
function Vc(e, i, s) {
if (Wc(e, i) || e.datum_type === nr || i.datum_type === nr)
return s;
var r = e.a, o = e.es;
if (e.datum_type === Ri) {
var h = Oa(e, !1, s);
if (h !== 0)
return;
r = Pa, o = Sa;
}
var l = i.a, u = i.b, f = i.es;
if (i.datum_type === Ri && (l = Pa, u = Wl, f = Sa), o === f && r === l && !rs(e.datum_type) && !rs(i.datum_type))
return s;
if (s = So(s, o, r), rs(e.datum_type) && (s = jc(s, e.datum_type, e.datum_params)), rs(i.datum_type) && (s = Kc(s, i.datum_type, i.datum_params)), s = Ao(s, f, l, u), i.datum_type === Ri) {
var _ = Oa(i, !0, s);
if (_ !== 0)
return;
}
return s;
}
function Oa(e, i, s) {
if (e.grids === null || e.grids.length === 0)
return console.log("Grid shift grids not found"), -1;
var r = { x: -s.x, y: s.y }, o = { x: Number.NaN, y: Number.NaN }, h = [];
t:
for (var l = 0; l < e.grids.length; l++) {
var u = e.grids[l];
if (h.push(u.name), u.isNull) {
o = r;
break;
}
if (u.grid === null) {
if (u.mandatory)
return console.log("Unable to find mandatory grid '" + u.name + "'"), -1;
continue;
}
for (var f = u.grid.subgrids, _ = 0, v = f.length; _ < v; _++) {
var m = f[_], g = (Math.abs(m.del[1]) + Math.abs(m.del[0])) / 1e4, M = m.ll[0] - g, E = m.ll[1] - g, x = m.ll[0] + (m.lim[0] - 1) * m.del[0] + g, C = m.ll[1] + (m.lim[1] - 1) * m.del[1] + g;
if (!(E > r.y || M > r.x || C < r.y || x < r.x) && (o = Jc(r, i, m), !isNaN(o.x)))
break t;
}
}
return isNaN(o.x) ? (console.log("Failed to find a grid shift table for location '" + -r.x * Ee + " " + r.y * Ee + " tried: '" + h + "'"), -1) : (s.x = -o.x, s.y = o.y, 0);
}
function Jc(e, i, s) {
var r = { x: Number.NaN, y: Number.NaN };
if (isNaN(e.x))
return r;
var o = { x: e.x, y: e.y };
o.x -= s.ll[0], o.y -= s.ll[1], o.x = Z(o.x - Math.PI) + Math.PI;
var h = ka(o, s);
if (i) {
if (isNaN(h.x))
return r;
h.x = o.x - h.x, h.y = o.y - h.y;
var l = 9, u = 1e-12, f, _;
do {
if (_ = ka(h, s), isNaN(_.x)) {
console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");
break;
}
f = { x: o.x - (_.x + h.x), y: o.y - (_.y + h.y) }, h.x += f.x, h.y += f.y;
} while (l-- && Math.abs(f.x) > u && Math.abs(f.y) > u);
if (l < 0)
return console.log("Inverse grid shift iterator failed to converge."), r;
r.x = Z(h.x + s.ll[0]), r.y = h.y + s.ll[1];
} else
isNaN(h.x) || (r.x = e.x + h.x, r.y = e.y + h.y);
return r;
}
function ka(e, i) {
var s = { x: e.x / i.del[0], y: e.y / i.del[1] }, r = { x: Math.floor(s.x), y: Math.floor(s.y) }, o = { x: s.x - 1 * r.x, y: s.y - 1 * r.y }, h = { x: Number.NaN, y: Number.NaN }, l;
if (r.x < 0 || r.x >= i.lim[0] || r.y < 0 || r.y >= i.lim[1])
return h;
l = r.y * i.lim[0] + r.x;
var u = { x: i.cvs[l][0], y: i.cvs[l][1] };
l++;
var f = { x: i.cvs[l][0], y: i.cvs[l][1] };
l += i.lim[0];
var _ = { x: i.cvs[l][0], y: i.cvs[l][1] };
l--;
var v = { x: i.cvs[l][0], y: i.cvs[l][1] }, m = o.x * o.y, g = o.x * (1 - o.y), M = (1 - o.x) * (1 - o.y), E = (1 - o.x) * o.y;
return h.x = M * u.x + g * f.x + E * v.x + m * _.x, h.y = M * u.y + g * f.y + E * v.y + m * _.y, h;
}
function Ra(e, i, s) {
var r = s.x, o = s.y, h = s.z || 0, l, u, f, _ = {};
for (f = 0; f < 3; f++)
if (!(i && f === 2 && s.z === void 0))
switch (f === 0 ? (l = r, "ew".indexOf(e.axis[f]) !== -1 ? u = "x" : u = "y") : f === 1 ? (l = o, "ns".indexOf(e.axis[f]) !== -1 ? u = "y" : u = "x") : (l = h, u = "z"), e.axis[f]) {
case "e":
_[u] = l;
break;
case "w":
_[u] = -l;
break;
case "n":
_[u] = l;
break;
case "s":
_[u] = -l;
break;
case "u":
s[u] !== void 0 && (_.z = l);
break;
case "d":
s[u] !== void 0 && (_.z = -l);
break;
default:
return null;
}
return _;
}
function Lo(e) {
var i = {
x: e[0],
y: e[1]
};
return e.length > 2 && (i.z = e[2]), e.length > 3 && (i.m = e[3]), i;
}
function Xc(e) {
za(e.x), za(e.y);
}
function za(e) {
if (typeof Number.isFinite == "function") {
if (Number.isFinite(e))
return;
throw new TypeError("coordinates must be finite numbers");
}
if (typeof e != "number" || e !== e || !isFinite(e))
throw new TypeError("coordinates must be finite numbers");
}
function Qc(e, i) {
return (e.datum.datum_type === ui || e.datum.datum_type === fi || e.datum.datum_type === Ri) && i.datumCode !== "WGS84" || (i.datum.datum_type === ui || i.datum.datum_type === fi || i.datum.datum_type === Ri) && e.datumCode !== "WGS84";
}
function ms(e, i, s, r) {
var o;
Array.isArray(s) ? s = Lo(s) : s = {
x: s.x,
y: s.y,
z: s.z,
m: s.m
};
var h = s.z !== void 0;
if (Xc(s), e.datum && i.datum && Qc(e, i) && (o = new Pe("WGS84"), s = ms(e, o, s, r), e = o), r && e.axis !== "enu" && (s = Ra(e, !1, s)), e.projName === "longlat")
s = {
x: s.x * yt,
y: s.y * yt,
z: s.z || 0
};
else if (e.to_meter && (s = {
x: s.x * e.to_meter,
y: s.y * e.to_meter,
z: s.z || 0
}), s = e.inverse(s), !s)
return;
if (e.from_greenwich && (s.x += e.from_greenwich), s = Vc(e.datum, i.datum, s), !!s)
return i.from_greenwich && (s = {
x: s.x - i.from_greenwich,
y: s.y,
z: s.z || 0
}), i.projName === "longlat" ? s = {
x: s.x * Ee,
y: s.y * Ee,
z: s.z || 0
} : (s = i.forward(s), i.to_meter && (s = {
x: s.x / i.to_meter,
y: s.y / i.to_meter,
z: s.z || 0
})), r && i.axis !== "enu" ? Ra(i, !0, s) : (s && !h && delete s.z, s);
}
var Da = Pe("WGS84");
function tr(e, i, s, r) {
var o, h, l;
return Array.isArray(s) ? (o = ms(e, i, s, r) || { x: NaN, y: NaN }, s.length > 2 ? typeof e.name < "u" && e.name === "geocent" || typeof i.name < "u" && i.name === "geocent" ? typeof o.z == "number" ? [o.x, o.y, o.z].concat(s.slice(3)) : [o.x, o.y, s[2]].concat(s.slice(3)) : [o.x, o.y].concat(s.slice(2)) : [o.x, o.y]) : (h = ms(e, i, s, r), l = Object.keys(s), l.length === 2 || l.forEach(function(u) {
if (typeof e.name < "u" && e.name === "geocent" || typeof i.name < "u" && i.name === "geocent") {
if (u === "x" || u === "y" || u === "z")
return;
} else if (u === "x" || u === "y")
return;
h[u] = s[u];
}), h);
}
function Ba(e) {
return e instanceof Pe ? e : e.oProj ? e.oProj : Pe(e);
}
function Nt(e, i, s) {
e = Ba(e);
var r = !1, o;
return typeof i > "u" ? (i = e, e = Da, r = !0) : (typeof i.x < "u" || Array.isArray(i)) && (s = i, i = e, e = Da, r = !0), i = Ba(i), s ? tr(e, i, s) : (o = {
forward: function(h, l) {
return tr(e, i, h, l);
},
inverse: function(h, l) {
return tr(i, e, h, l);
}
}, r && (o.oProj = i), o);
}
var Ua = 6, Co = "AJSAJS", To = "AFAFAF", Oi = 65, ee = 73, _e = 79, _n = 86, pn = 90;
const Yc = {
forward: No,
inverse: tu,
toPoint: Go
};
function No(e, i) {
return i = i || 5, nu(eu({
lat: e[1],
lon: e[0]
}), i);
}
function tu(e) {
var i = mr(Oo(e.toUpperCase()));
return i.lat && i.lon ? [i.lon, i.lat, i.lon, i.lat] : [i.left, i.bottom, i.right, i.top];
}
function Go(e) {
var i = mr(Oo(e.toUpperCase()));
return i.lat && i.lon ? [i.lon, i.lat] : [(i.left + i.right) / 2, (i.top + i.bottom) / 2];
}
function er(e) {
return e * (Math.PI / 180);
}
function Za(e) {
return 180 * (e / Math.PI);
}
function eu(e) {
var i = e.lat, s = e.lon, r = 6378137, o = 669438e-8, h = 0.9996, l, u, f, _, v, m, g, M = er(i), E = er(s), x, C;
C = Math.floor((s + 180) / 6) + 1, s === 180 && (C = 60), i >= 56 && i < 64 && s >= 3 && s < 12 && (C = 32), i >= 72 && i < 84 && (s >= 0 && s < 9 ? C = 31 : s >= 9 && s < 21 ? C = 33 : s >= 21 && s < 33 ? C = 35 : s >= 33 && s < 42 && (C = 37)), l = (C - 1) * 6 - 180 + 3, x = er(l), u = o / (1 - o), f = r / Math.sqrt(1 - o * Math.sin(M) * Math.sin(M)), _ = Math.tan(M) * Math.tan(M), v = u * Math.cos(M) * Math.cos(M), m = Math.cos(M) * (E - x), g = r * ((1 - o / 4 - 3 * o * o / 64 - 5 * o * o * o / 256) * M - (3 * o / 8 + 3 * o * o / 32 + 45 * o * o * o / 1024) * Math.sin(2 * M) + (15 * o * o / 256 + 45 * o * o * o / 1024) * Math.sin(4 * M) - 35 * o * o * o / 3072 * Math.sin(6 * M));
var D = h * f * (m + (1 - _ + v) * m * m * m / 6 + (5 - 18 * _ + _ * _ + 72 * v - 58 * u) * m * m * m * m * m / 120) + 5e5, U = h * (g + f * Math.tan(M) * (m * m / 2 + (5 - _ + 9 * v + 4 * v * v) * m * m * m * m / 24 + (61 - 58 * _ + _ * _ + 600 * v - 330 * u) * m * m * m * m * m * m / 720));
return i < 0 && (U += 1e7), {
northing: Math.round(U),
easting: Math.round(D),
zoneNumber: C,
zoneLetter: iu(i)
};
}
function mr(e) {
var i = e.northing, s = e.easting, r = e.zoneLetter, o = e.zoneNumber;
if (o < 0 || o > 60)
return null;
var h = 0.9996, l = 6378137, u = 669438e-8, f, _ = (1 - Math.sqrt(1 - u)) / (1 + Math.sqrt(1 - u)), v, m, g, M, E, x, C, D, U, $ = s - 5e5, lt = i;
r < "N" && (lt -= 1e7), C = (o - 1) * 6 - 180 + 3, f = u / (1 - u), x = lt / h, D = x / (l * (1 - u / 4 - 3 * u * u / 64 - 5 * u * u * u / 256)), U = D + (3 * _ / 2 - 27 * _ * _ * _ / 32) * Math.sin(2 * D) + (21 * _ * _ / 16 - 55 * _ * _ * _ * _ / 32) * Math.sin(4 * D) + 151 * _ * _ * _ / 96 * Math.sin(6 * D), v = l / Math.sqrt(1 - u * Math.sin(U) * Math.sin(U)), m = Math.tan(U) * Math.tan(U), g = f * Math.cos(U) * Math.cos(U), M = l * (1 - u) / Math.pow(1 - u * Math.sin(U) * Math.sin(U), 1.5), E = $ / (v * h);
var mt = U - v * Math.tan(U) / M * (E * E / 2 - (5 + 3 * m + 10 * g - 4 * g * g - 9 * f) * E * E * E * E / 24 + (61 + 90 * m + 298 * g + 45 * m * m - 252 * f - 3 * g * g) * E * E * E * E * E * E / 720);
mt = Za(mt);
var Mt = (E - (1 + 2 * m + g) * E * E * E / 6 + (5 - 2 * g + 28 * m - 3 * g * g + 8 * f + 24 * m * m) * E * E * E * E * E / 120) / Math.cos(U);
Mt = C + Za(Mt);
var Rt;
if (e.accuracy) {
var zt = mr({
northing: e.northing + e.accuracy,
easting: e.easting + e.accuracy,
zoneLetter: e.zoneLetter,
zoneNumber: e.zoneNumber
});
Rt = {
top: zt.lat,
right: zt.lon,
bottom: mt,
left: Mt
};
} else
Rt = {
lat: mt,
lon: Mt
};
return Rt;
}
function iu(e) {
var i = "Z";
return 84 >= e && e >= 72 ? i = "X" : 72 > e && e >= 64 ? i = "W" : 64 > e && e >= 56 ? i = "V" : 56 > e && e >= 48 ? i = "U" : 48 > e && e >= 40 ? i = "T" : 40 > e && e >= 32 ? i = "S" : 32 > e && e >= 24 ? i = "R" : 24 > e && e >= 16 ? i = "Q" : 16 > e && e >= 8 ? i = "P" : 8 > e && e >= 0 ? i = "N" : 0 > e && e >= -8 ? i = "M" : -8 > e && e >= -16 ? i = "L" : -16 > e && e >= -24 ? i = "K" : -24 > e && e >= -32 ? i = "J" : -32 > e && e >= -40 ? i = "H" : -40 > e && e >= -48 ? i = "G" : -48 > e && e >= -56 ? i = "F" : -56 > e && e >= -64 ? i = "E" : -64 > e && e >= -72 ? i = "D" : -72 > e && e >= -80 && (i = "C"), i;
}
function nu(e, i) {
var s = "00000" + e.easting, r = "00000" + e.northing;
return e.zoneNumber + e.zoneLetter + su(e.easting, e.northing, e.zoneNumber) + s.substr(s.length - 5, i) + r.substr(r.length - 5, i);
}
function su(e, i, s) {
var r = Io(s), o = Math.floor(e / 1e5), h = Math.floor(i / 1e5) % 20;
return ru(o, h, r);
}
function Io(e) {
var i = e % Ua;
return i === 0 && (i = Ua), i;
}
function ru(e, i, s) {
var r = s - 1, o = Co.charCodeAt(r), h = To.charCodeAt(r), l = o + e - 1, u = h + i, f = !1;
l > pn && (l = l - pn + Oi - 1, f = !0), (l === ee || o < ee && l > ee || (l > ee || o < ee) && f) && l++, (l === _e || o < _e && l > _e || (l > _e || o < _e) && f) && (l++, l === ee && l++), l > pn && (l = l - pn + Oi - 1), u > _n ? (u = u - _n + Oi - 1, f = !0) : f = !1, (u === ee || h < ee && u > ee || (u > ee || h < ee) && f) && u++, (u === _e || h < _e && u > _e || (u > _e || h < _e) && f) && (u++, u === ee && u++), u > _n && (u = u - _n + Oi - 1);
var _ = String.fromCharCode(l) + String.fromCharCode(u);
return _;
}
function Oo(e) {
if (e && e.length === 0)
throw "MGRSPoint coverting from nothing";
for (var i = e.length, s = null, r = "", o, h = 0; !/[A-Z]/.test(o = e.charAt(h)); ) {
if (h >= 2)
throw "MGRSPoint bad conversion from: " + e;
r += o, h++;
}
var l = parseInt(r, 10);
if (h === 0 || h + 3 > i)
throw "MGRSPoint bad conversion from: " + e;
var u = e.charAt(h++);
if (u <= "A" || u === "B" || u === "Y" || u >= "Z" || u === "I" || u === "O")
throw "MGRSPoint zone letter " + u + " not handled: " + e;
s = e.substring(h, h += 2);
for (var f = Io(l), _ = au(s.charAt(0), f), v = ou(s.charAt(1), f); v < hu(u); )
v += 2e6;
var m = i - h;
if (m % 2 !== 0)
throw `MGRSPoint has to have an even number
of digits after the zone letter and two 100km letters - front
half for easting meters, second half for
northing meters` + e;
var g = m / 2, M = 0, E = 0, x, C, D, U, $;
return g > 0 && (x = 1e5 / Math.pow(10, g), C = e.substring(h, h + g), M = parseFloat(C) * x, D = e.substring(h + g), E = parseFloat(D) * x), U = M + _, $ = E + v, {
easting: U,
northing: $,
zoneLetter: u,
zoneNumber: l,
accuracy: x
};
}
function au(e, i) {
for (var s = Co.charCodeAt(i - 1), r = 1e5, o = !1; s !== e.charCodeAt(0); ) {
if (s++, s === ee && s++, s === _e && s++, s > pn) {
if (o)
throw "Bad character: " + e;
s = Oi, o = !0;
}
r += 1e5;
}
return r;
}
function ou(e, i) {
if (e > "V")
throw "MGRSPoint given invalid Northing " + e;
for (var s = To.charCodeAt(i - 1), r = 0, o = !1; s !== e.charCodeAt(0); ) {
if (s++, s === ee && s++, s === _e && s++, s > _n) {
if (o)
throw "Bad character: " + e;
s = Oi, o = !0;
}
r += 1e5;
}
return r;
}
function hu(e) {
var i;
switch (e) {
case "C":
i = 11e5;
break;
case "D":
i = 2e6;
break;
case "E":
i = 28e5;
break;
case "F":
i = 37e5;
break;
case "G":
i = 46e5;
break;
case "H":
i = 55e5;
break;
case "J":
i = 64e5;
break;
case "K":
i = 73e5;
break;
case "L":
i = 82e5;
break;
case "M":
i = 91e5;
break;
case "N":
i = 0;
break;
case "P":
i = 8e5;
break;
case "Q":
i = 17e5;
break;
case "R":
i = 26e5;
break;
case "S":
i = 35e5;
break;
case "T":
i = 44e5;
break;
case "U":
i = 53e5;
break;
case "V":
i = 62e5;
break;
case "W":
i = 7e6;
break;
case "X":
i = 79e5;
break;
default:
i = -1;
}
if (i >= 0)
return i;
throw "Invalid zone letter: " + e;
}
function Ui(e, i, s) {
if (!(this instanceof Ui))
return new Ui(e, i, s);
if (Array.isArray(e))
this.x = e[0], this.y = e[1], this.z = e[2] || 0;
else if (typeof e == "object")
this.x = e.x, this.y = e.y, this.z = e.z || 0;
else if (typeof e == "string" && typeof i > "u") {
var r = e.split(",");
this.x = parseFloat(r[0], 10), this.y = parseFloat(r[1], 10), this.z = parseFloat(r[2], 10) || 0;
} else
this.x = e, this.y = i, this.z = s || 0;
console.warn("proj4.Point will be removed in version 3, use proj4.toPoint");
}
Ui.fromMGRS = function(e) {
return new Ui(Go(e));
};
Ui.prototype.toMGRS = function(e) {
return No([this.x, this.y], e);
};
var lu = 1, cu = 0.25, qa = 0.046875, $a = 0.01953125, Fa = 0.01068115234375, uu = 0.75, fu = 0.46875, du = 0.013020833333333334, _u = 0.007120768229166667, pu = 0.3645833333333333, mu = 0.005696614583333333, gu = 0.3076171875;
function gr(e) {
var i = [];
i[0] = lu - e * (cu + e * (qa + e * ($a + e * Fa))), i[1] = e * (uu - e * (qa + e * ($a + e * Fa)));
var s = e * e;
return i[2] = s * (fu - e * (du + e * _u)), s *= e, i[3] = s * (pu - e * mu), i[4] = s * e * gu, i;
}
function qi(e, i, s, r) {
return s *= i, i *= i, r[0] * e - s * (r[1] + i * (r[2] + i * (r[3] + i * r[4])));
}
var vu = 20;
function vr(e, i, s) {
for (var r = 1 / (1 - i), o = e, h = vu; h; --h) {
var l = Math.sin(o), u = 1 - i * l * l;
if (u = (qi(o, l, Math.cos(o), s) - e) * (u * Math.sqrt(u)) * r, o -= u, Math.abs(u) < B)
return o;
}
return o;
}
function yu() {
this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0, this.es && (this.en = gr(this.es), this.ml0 = qi(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en));
}
function Mu(e) {
var i = e.x, s = e.y, r = Z(i - this.long0), o, h, l, u = Math.sin(s), f = Math.cos(s);
if (this.es) {
var v = f * r, m = Math.pow(v, 2), g = this.ep2 * Math.pow(f, 2), M = Math.pow(g, 2), E = Math.abs(f) > B ? Math.tan(s) : 0, x = Math.pow(E, 2), C = Math.pow(x, 2);
o = 1 - this.es * Math.pow(u, 2), v = v / Math.sqrt(o);
var D = qi(s, u, f, this.en);
h = this.a * (this.k0 * v * (1 + m / 6 * (1 - x + g + m / 20 * (5 - 18 * x + C + 14 * g - 58 * x * g + m / 42 * (61 + 179 * C - C * x - 479 * x))))) + this.x0, l = this.a * (this.k0 * (D - this.ml0 + u * r * v / 2 * (1 + m / 12 * (5 - x + 9 * g + 4 * M + m / 30 * (61 + C - 58 * x + 270 * g - 330 * x * g + m / 56 * (1385 + 543 * C - C * x - 3111 * x)))))) + this.y0;
} else {
var _ = f * Math.sin(r);
if (Math.abs(Math.abs(_) - 1) < B)
return 93;
if (h = 0.5 * this.a * this.k0 * Math.log((1 + _) / (1 - _)) + this.x0, l = f * Math.cos(r) / Math.sqrt(1 - Math.pow(_, 2)), _ = Math.abs(l), _ >= 1) {
if (_ - 1 > B)
return 93;
l = 0;
} else
l = Math.acos(l);
s < 0 && (l = -l), l = this.a * this.k0 * (l - this.lat0) + this.y0;
}
return e.x = h, e.y = l, e;
}
function wu(e) {
var i, s, r, o, h = (e.x - this.x0) * (1 / this.a), l = (e.y - this.y0) * (1 / this.a);
if (this.es)
if (i = this.ml0 + l / this.k0, s = vr(i, this.es, this.en), Math.abs(s) < O) {
var m = Math.sin(s), g = Math.cos(s), M = Math.abs(g) > B ? Math.tan(s) : 0, E = this.ep2 * Math.pow(g, 2), x = Math.pow(E, 2), C = Math.pow(M, 2), D = Math.pow(C, 2);
i = 1 - this.es * Math.pow(m, 2);
var U = h * Math.sqrt(i) / this.k0, $ = Math.pow(U, 2);
i = i * M, r = s - i * $ / (1 - this.es) * 0.5 * (1 - $ / 12 * (5 + 3 * C - 9 * E * C + E - 4 * x - $ / 30 * (61 + 90 * C - 252 * E * C + 45 * D + 46 * E - $ / 56 * (1385 + 3633 * C + 4095 * D + 1574 * D * C)))), o = Z(this.long0 + U * (1 - $ / 6 * (1 + 2 * C + E - $ / 20 * (5 + 28 * C + 24 * D + 8 * E * C + 6 * E - $ / 42 * (61 + 662 * C + 1320 * D + 720 * D * C)))) / g);
} else
r = O * On(l), o = 0;
else {
var u = Math.exp(h / this.k0), f = 0.5 * (u - 1 / u), _ = this.lat0 + l / this.k0, v = Math.cos(_);
i = Math.sqrt((1 - Math.pow(v, 2)) / (1 + Math.pow(f, 2))), r = Math.asin(i), l < 0 && (r = -r), f === 0 && v === 0 ? o = 0 : o = Z(Math.atan2(f, v) + this.long0);
}
return e.x = o, e.y = r, e;
}
var xu = ["Fast_Transverse_Mercator", "Fast Transverse Mercator"];
const ls = {
init: yu,
forward: Mu,
inverse: wu,
names: xu
};
function ko(e) {
var i = Math.exp(e);
return i = (i - 1 / i) / 2, i;
}
function ie(e, i) {
e = Math.abs(e), i = Math.abs(i);
var s = Math.max(e, i), r = Math.min(e, i) / (s || 1);
return s * Math.sqrt(1 + Math.pow(r, 2));
}
function bu(e) {
var i = 1 + e, s = i - 1;
return s === 0 ? e : e * Math.log(i) / s;
}
function Eu(e) {
var i = Math.abs(e);
return i = bu(i * (1 + i / (ie(1, i) + 1))), e < 0 ? -i : i;
}
function yr(e, i) {
for (var s = 2 * Math.cos(2 * i), r = e.length - 1, o = e[r], h = 0, l; --r >= 0; )
l = -h + s * o + e[r], h = o, o = l;
return i + l * Math.sin(2 * i);
}
function Pu(e, i) {
for (var s = 2 * Math.cos(i), r = e.length - 1, o = e[r], h = 0, l; --r >= 0; )
l = -h + s * o + e[r], h = o, o = l;
return Math.sin(i) * l;
}
function Su(e) {
var i = Math.exp(e);
return i = (i + 1 / i) / 2, i;
}
function Ro(e, i, s) {
for (var r = Math.sin(i), o = Math.cos(i), h = ko(s), l = Su(s), u = 2 * o * l, f = -2 * r * h, _ = e.length - 1, v = e[_], m = 0, g = 0, M = 0, E, x; --_ >= 0; )
E = g, x = m, g = v, m = M, v = -E + u * g - f * m + e[_], M = -x + f * g + u * m;
return u = r * l, f = o * h, [u * v - f * M, u * M + f * v];
}
function Au() {
if (!this.approx && (isNaN(this.es) || this.es <= 0))
throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');
this.approx && (ls.init.apply(this), this.forward = ls.forward, this.inverse = ls.inverse), this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0, this.cgb = [], this.cbg = [], this.utg = [], this.gtu = [];
var e = this.es / (1 + Math.sqrt(1 - this.es)), i = e / (2 - e), s = i;
this.cgb[0] = i * (2 + i * (-2 / 3 + i * (-2 + i * (116 / 45 + i * (26 / 45 + i * (-2854 / 675)))))), this.cbg[0] = i * (-2 + i * (2 / 3 + i * (4 / 3 + i * (-82 / 45 + i * (32 / 45 + i * (4642 / 4725)))))), s = s * i, this.cgb[1] = s * (7 / 3 + i * (-8 / 5 + i * (-227 / 45 + i * (2704 / 315 + i * (2323 / 945))))), this.cbg[1] = s * (5 / 3 + i * (-16 / 15 + i * (-13 / 9 + i * (904 / 315 + i * (-1522 / 945))))), s = s * i, this.cgb[2] = s * (56 / 15 + i * (-136 / 35 + i * (-1262 / 105 + i * (73814 / 2835)))), this.cbg[2] = s * (-26 / 15 + i * (34 / 21 + i * (8 / 5 + i * (-12686 / 2835)))), s = s * i, this.cgb[3] = s * (4279 / 630 + i * (-332 / 35 + i * (-399572 / 14175))), this.cbg[3] = s * (1237 / 630 + i * (-12 / 5 + i * (-24832 / 14175))), s = s * i, this.cgb[4] = s * (4174 / 315 + i * (-144838 / 6237)), this.cbg[4] = s * (-734 / 315 + i * (109598 / 31185)), s = s * i, this.cgb[5] = s * (601676 / 22275), this.cbg[5] = s * (444337 / 155925), s = Math.pow(i, 2), this.Qn = this.k0 / (1 + i) * (1 + s * (1 / 4 + s * (1 / 64 + s / 256))), this.utg[0] = i * (-0.5 + i * (2 / 3 + i * (-37 / 96 + i * (1 / 360 + i * (81 / 512 + i * (-96199 / 604800)))))), this.gtu[0] = i * (0.5 + i * (-2 / 3 + i * (5 / 16 + i * (41 / 180 + i * (-127 / 288 + i * (7891 / 37800)))))), this.utg[1] = s * (-1 / 48 + i * (-1 / 15 + i * (437 / 1440 + i * (-46 / 105 + i * (1118711 / 3870720))))), this.gtu[1] = s * (13 / 48 + i * (-3 / 5 + i * (557 / 1440 + i * (281 / 630 + i * (-1983433 / 1935360))))), s = s * i, this.utg[2] = s * (-17 / 480 + i * (37 / 840 + i * (209 / 4480 + i * (-5569 / 90720)))), this.gtu[2] = s * (61 / 240 + i * (-103 / 140 + i * (15061 / 26880 + i * (167603 / 181440)))), s = s * i, this.utg[3] = s * (-4397 / 161280 + i * (11 / 504 + i * (830251 / 7257600))), this.gtu[3] = s * (49561 / 161280 + i * (-179 / 168 + i * (6601661 / 7257600))), s = s * i, this.utg[4] = s * (-4583 / 161280 + i * (108847 / 3991680)), this.gtu[4] = s * (34729 / 80640 + i * (-3418889 / 1995840)), s = s * i, this.utg[5] = s * (-20648693 / 638668800), this.gtu[5] = s * (212378941 / 319334400);
var r = yr(this.cbg, this.lat0);
this.Zb = -this.Qn * (r + Pu(this.gtu, 2 * r));
}
function Lu(e) {
var i = Z(e.x - this.long0), s = e.y;
s = yr(this.cbg, s);
var r = Math.sin(s), o = Math.cos(s), h = Math.sin(i), l = Math.cos(i);
s = Math.atan2(r, l * o), i = Math.atan2(h * o, ie(r, o * l)), i = Eu(Math.tan(i));
var u = Ro(this.gtu, 2 * s, 2 * i);
s = s + u[0], i = i + u[1];
var f, _;
return Math.abs(i) <= 2.623395162778 ? (f = this.a * (this.Qn * i) + this.x0, _ = this.a * (this.Qn * s + this.Zb) + this.y0) : (f = 1 / 0, _ = 1 / 0), e.x = f, e.y = _, e;
}
function Cu(e) {
var i = (e.x - this.x0) * (1 / this.a), s = (e.y - this.y0) * (1 / this.a);
s = (s - this.Zb) / this.Qn, i = i / this.Qn;
var r, o;
if (Math.abs(i) <= 2.623395162778) {
var h = Ro(this.utg, 2 * s, 2 * i);
s = s + h[0], i = i + h[1], i = Math.atan(ko(i));
var l = Math.sin(s), u = Math.cos(s), f = Math.sin(i), _ = Math.cos(i);
s = Math.atan2(l * _, ie(f, _ * u)), i = Math.atan2(f, _ * u), r = Z(i + this.long0), o = yr(this.cgb, s);
} else
r = 1 / 0, o = 1 / 0;
return e.x = r, e.y = o, e;
}
var Tu = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc", "Transverse_Mercator", "Transverse Mercator", "Gauss Kruger", "Gauss_Kruger", "tmerc"];
const cs = {
init: Au,
forward: Lu,
inverse: Cu,
names: Tu
};
function Nu(e, i) {
if (e === void 0) {
if (e = Math.floor((Z(i) + Math.PI) * 30 / Math.PI) + 1, e < 0)
return 0;
if (e > 60)
return 60;
}
return e;
}
var Gu = "etmerc";
function Iu() {
var e = Nu(this.zone, this.long0);
if (e === void 0)
throw new Error("unknown utm zone");
this.lat0 = 0, this.long0 = (6 * Math.abs(e) - 183) * yt, this.x0 = 5e5, this.y0 = this.utmSouth ? 1e7 : 0, this.k0 = 0.9996, cs.init.apply(this), this.forward = cs.forward, this.inverse = cs.inverse;
}
var Ou = ["Universal Transverse Mercator System", "utm"];
const ku = {
init: Iu,
names: Ou,
dependsOn: Gu
};
function Mr(e, i) {
return Math.pow((1 - e) / (1 + e), i);
}
var Ru = 20;
function zu() {
var e = Math.sin(this.lat0), i = Math.cos(this.lat0);
i *= i, this.rc = Math.sqrt(1 - this.es) / (1 - this.es * e * e), this.C = Math.sqrt(1 + this.es * i * i / (1 - this.es)), this.phic0 = Math.asin(e / this.C), this.ratexp = 0.5 * this.C * this.e, this.K = Math.tan(0.5 * this.phic0 + ut) / (Math.pow(Math.tan(0.5 * this.lat0 + ut), this.C) * Mr(this.e * e, this.ratexp));
}
function Du(e) {
var i = e.x, s = e.y;
return e.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * s + ut), this.C) * Mr(this.e * Math.sin(s), this.ratexp)) - O, e.x = this.C * i, e;
}
function Bu(e) {
for (var i = 1e-14, s = e.x / this.C, r = e.y, o = Math.pow(Math.tan(0.5 * r + ut) / this.K, 1 / this.C), h = Ru; h > 0 && (r = 2 * Math.atan(o * Mr(this.e * Math.sin(e.y), -0.5 * this.e)) - O, !(Math.abs(r - e.y) < i)); --h)
e.y = r;
return h ? (e.x = s, e.y = r, e) : null;
}
var Uu = ["gauss"];
const wr = {
init: zu,
forward: Du,
inverse: Bu,
names: Uu
};
function Zu() {
wr.init.apply(this), this.rc && (this.sinc0 = Math.sin(this.phic0), this.cosc0 = Math.cos(this.phic0), this.R2 = 2 * this.rc, this.title || (this.title = "Oblique Stereographic Alternative"));
}
function qu(e) {
var i, s, r, o;
return e.x = Z(e.x - this.long0), wr.forward.apply(this, [e]), i = Math.sin(e.y), s = Math.cos(e.y), r = Math.cos(e.x), o = this.k0 * this.R2 / (1 + this.sinc0 * i + this.cosc0 * s * r), e.x = o * s * Math.sin(e.x), e.y = o * (this.cosc0 * i - this.sinc0 * s * r), e.x = this.a * e.x + this.x0, e.y = this.a * e.y + this.y0, e;
}
function $u(e) {
var i, s, r, o, h;
if (e.x = (e.x - this.x0) / this.a, e.y = (e.y - this.y0) / this.a, e.x /= this.k0, e.y /= this.k0, h = ie(e.x, e.y)) {
var l = 2 * Math.atan2(h, this.R2);
i = Math.sin(l), s = Math.cos(l), o = Math.asin(s * this.sinc0 + e.y * i * this.cosc0 / h), r = Math.atan2(e.x * i, h * this.cosc0 * s - e.y * this.sinc0 * i);
} else
o = this.phic0, r = 0;
return e.x = r, e.y = o, wr.inverse.apply(this, [e]), e.x = Z(e.x + this.long0), e;
}
var Fu = ["Stereographic_North_Pole", "Oblique_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"];
const Hu = {
init: Zu,
forward: qu,
inverse: $u,
names: Fu
};
function Wu(e, i, s) {
return i *= s, Math.tan(0.5 * (O + e)) * Math.pow((1 - i) / (1 + i), 0.5 * s);
}
function ju() {
this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.coslat0 = Math.cos(this.lat0), this.sinlat0 = Math.sin(this.lat0), this.sphere ? this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= B && (this.k0 = 0.5 * (1 + On(this.lat0) * Math.sin(this.lat_ts))) : (Math.abs(this.coslat0) <= B && (this.lat0 > 0 ? this.con = 1 : this.con = -1), this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e)), this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= B && Math.abs(Math.cos(this.lat_ts)) > B && (this.k0 = 0.5 * this.cons * Se(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / ye(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts))), this.ms1 = Se(this.e, this.sinlat0, this.coslat0), this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - O, this.cosX0 = Math.cos(this.X0), this.sinX0 = Math.sin(this.X0));
}
function Ku(e) {
var i = e.x, s = e.y, r = Math.sin(s), o = Math.cos(s), h, l, u, f, _, v, m = Z(i - this.long0);
return Math.abs(Math.abs(i - this.long0) - Math.PI) <= B && Math.abs(s + this.lat0) <= B ? (e.x = NaN, e.y = NaN, e) : this.sphere ? (h = 2 * this.k0 / (1 + this.sinlat0 * r + this.coslat0 * o * Math.cos(m)), e.x = this.a * h * o * Math.sin(m) + this.x0, e.y = this.a * h * (this.coslat0 * r - this.sinlat0 * o * Math.cos(m)) + this.y0, e) : (l = 2 * Math.atan(this.ssfn_(s, r, this.e)) - O, f = Math.cos(l), u = Math.sin(l), Math.abs(this.coslat0) <= B ? (_ = ye(this.e, s * this.con, this.con * r), v = 2 * this.a * this.k0 * _ / this.cons, e.x = this.x0 + v * Math.sin(i - this.long0), e.y = this.y0 - this.con * v * Math.cos(i - this.long0), e) : (Math.abs(this.sinlat0) < B ? (h = 2 * this.a * this.k0 / (1 + f * Math.cos(m)), e.y = h * u) : (h = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * u + this.cosX0 * f * Math.cos(m))), e.y = h * (this.cosX0 * u - this.sinX0 * f * Math.cos(m)) + this.y0), e.x = h * f * Math.sin(m) + this.x0, e));
}
function Vu(e) {
e.x -= this.x0, e.y -= this.y0;
var i, s, r, o, h, l = Math.sqrt(e.x * e.x + e.y * e.y);
if (this.sphere) {
var u = 2 * Math.atan(l / (2 * this.a * this.k0));
return i = this.long0, s = this.lat0, l <= B ? (e.x = i, e.y = s, e) : (s = Math.asin(Math.cos(u) * this.sinlat0 + e.y * Math.sin(u) * this.coslat0 / l), Math.abs(this.coslat0) < B ? this.lat0 > 0 ? i = Z(this.long0 + Math.atan2(e.x, -1 * e.y)) : i = Z(this.long0 + Math.atan2(e.x, e.y)) : i = Z(this.long0 + Math.atan2(e.x * Math.sin(u), l * this.coslat0 * Math.cos(u) - e.y * this.sinlat0 * Math.sin(u))), e.x = i, e.y = s, e);
} else if (Math.abs(this.coslat0) <= B) {
if (l <= B)
return s = this.lat0, i = this.long0, e.x = i, e.y = s, e;
e.x *= this.con, e.y *= this.con, r = l * this.cons / (2 * this.a * this.k0), s = this.con * Tn(this.e, r), i = this.con * Z(this.con * this.long0 + Math.atan2(e.x, -1 * e.y));
} else
o = 2 * Math.atan(l * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), i = this.long0, l <= B ? h = this.X0 : (h = Math.asin(Math.cos(o) * this.sinX0 + e.y * Math.sin(o) * this.cosX0 / l), i = Z(this.long0 + Math.atan2(e.x * Math.sin(o), l * this.cosX0 * Math.cos(o) - e.y * this.sinX0 * Math.sin(o)))), s = -1 * Tn(this.e, Math.tan(0.5 * (O + h)));
return e.x = i, e.y = s, e;
}
var Ju = ["stere", "Stereographic_South_Pole", "Polar_Stereographic_variant_A", "Polar_Stereographic_variant_B", "Polar_Stereographic"];
const Xu = {
init: ju,
forward: Ku,
inverse: Vu,
names: Ju,
ssfn_: Wu
};
function Qu() {
var e = this.lat0;
this.lambda0 = this.long0;
var i = Math.sin(e), s = this.a, r = this.rf, o = 1 / r, h = 2 * o - Math.pow(o, 2), l = this.e = Math.sqrt(h);
this.R = this.k0 * s * Math.sqrt(1 - h) / (1 - h * Math.pow(i, 2)), this.alpha = Math.sqrt(1 + h / (1 - h) * Math.pow(Math.cos(e), 4)), this.b0 = Math.asin(i / this.alpha);
var u = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2)), f = Math.log(Math.tan(Math.PI / 4 + e / 2)), _ = Math.log((1 + l * i) / (1 - l * i));
this.K = u - this.alpha * f + this.alpha * l / 2 * _;
}
function Yu(e) {
var i = Math.log(Math.tan(Math.PI / 4 - e.y / 2)), s = this.e / 2 * Math.log((1 + this.e * Math.sin(e.y)) / (1 - this.e * Math.sin(e.y))), r = -this.alpha * (i + s) + this.K, o = 2 * (Math.atan(Math.exp(r)) - Math.PI / 4), h = this.alpha * (e.x - this.lambda0), l = Math.atan(Math.sin(h) / (Math.sin(this.b0) * Math.tan(o) + Math.cos(this.b0) * Math.cos(h))), u = Math.asin(Math.cos(this.b0) * Math.sin(o) - Math.sin(this.b0) * Math.cos(o) * Math.cos(h));
return e.y = this.R / 2 * Math.log((1 + Math.sin(u)) / (1 - Math.sin(u))) + this.y0, e.x = this.R * l + this.x0, e;
}
function tf(e) {
for (var i = e.x - this.x0, s = e.y - this.y0, r = i / this.R, o = 2 * (Math.atan(Math.exp(s / this.R)) - Math.PI / 4), h = Math.asin(Math.cos(this.b0) * Math.sin(o) + Math.sin(this.b0) * Math.cos(o) * Math.cos(r)), l = Math.atan(Math.sin(r) / (Math.cos(this.b0) * Math.cos(r) - Math.sin(this.b0) * Math.tan(o))), u = this.lambda0 + l / this.alpha, f = 0, _ = h, v = -1e3, m = 0; Math.abs(_ - v) > 1e-7; ) {
if (++m > 20)
return;
f = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + h / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(_)) / 2)), v = _, _ = 2 * Math.atan(Math.exp(f)) - Math.PI / 2;
}
return e.x = u, e.y = _, e;
}
var ef = ["somerc"];
const nf = {
init: Qu,
forward: Yu,
inverse: tf,
names: ef
};
var Ni = 1e-7;
function sf(e) {
var i = ["Hotine_Oblique_Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin"], s = typeof e.projName == "object" ? Object.keys(e.projName)[0] : e.projName;
return "no_uoff" in e || "no_off" in e || i.indexOf(s) !== -1 || i.indexOf(Eo(s)) !== -1;
}
function rf() {
var e, i, s, r, o, h, l, u, f, _, v = 0, m, g = 0, M = 0, E = 0, x = 0, C = 0, D = 0;
this.no_off = sf(this), this.no_rot = "no_rot" in this;
var U = !1;
"alpha" in this && (U = !0);
var $ = !1;
if ("rectified_grid_angle" in this && ($ = !0), U && (D = this.alpha), $ && (v = this.rectified_grid_angle), U || $)
g = this.longc;
else if (M = this.long1, x = this.lat1, E = this.long2, C = this.lat2, Math.abs(x - C) <= Ni || (e = Math.abs(x)) <= Ni || Math.abs(e - O) <= Ni || Math.abs(Math.abs(this.lat0) - O) <= Ni || Math.abs(Math.abs(C) - O) <= Ni)
throw new Error();
var lt = 1 - this.es;
i = Math.sqrt(lt), Math.abs(this.lat0) > B ? (u = Math.sin(this.lat0), s = Math.cos(this.lat0), e = 1 - this.es * u * u, this.B = s * s, this.B = Math.sqrt(1 + this.es * this.B * this.B / lt), this.A = this.B * this.k0 * i / e, r = this.B * i / (s * Math.sqrt(e)), o = r * r - 1, o <= 0 ? o = 0 : (o = Math.sqrt(o), this.lat0 < 0 && (o = -o)), this.E = o += r, this.E *= Math.pow(ye(this.e, this.lat0, u), this.B)) : (this.B = 1 / i, this.A = this.k0, this.E = r = o = 1), U || $ ? (U ? (m = Math.asin(Math.sin(D) / r), $ || (v = D)) : (m = v, D = Math.asin(r * Math.sin(m))), this.lam0 = g - Math.asin(0.5 * (o - 1 / o) * Math.tan(m)) / this.B) : (h = Math.pow(ye(this.e, x, Math.sin(x)), this.B), l = Math.pow(ye(this.e, C, Math.sin(C)), this.B), o = this.E / h, f = (l - h) / (l + h), _ = this.E * this.E, _ = (_ - l * h) / (_ + l * h), e = M - E, e < -Math.pi ? E -= Ln : e > Math.pi && (E += Ln), this.lam0 = Z(0.5 * (M + E) - Math.atan(_ * Math.tan(0.5 * this.B * (M - E)) / f) / this.B), m = Math.atan(2 * Math.sin(this.B * Z(M - this.lam0)) / (o - 1 / o)), v = D = Math.asin(r * Math.sin(m))), this.singam = Math.sin(m), this.cosgam = Math.cos(m), this.sinrot = Math.sin(v), this.cosrot = Math.cos(v), this.rB = 1 / this.B, this.ArB = this.A * this.rB, this.BrA = 1 / this.ArB, this.no_off ? this.u_0 = 0 : (this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(r * r - 1) / Math.cos(D))), this.lat0 < 0 && (this.u_0 = -this.u_0)), o = 0.5 * m, this.v_pole_n = this.ArB * Math.log(Math.tan(ut - o)), this.v_pole_s = this.ArB * Math.log(Math.tan(ut + o));
}
function af(e) {
var i = {}, s, r, o, h, l, u, f, _;
if (e.x = e.x - this.lam0, Math.abs(Math.abs(e.y) - O) > B) {
if (l = this.E / Math.pow(ye(this.e, e.y, Math.sin(e.y)), this.B), u = 1 / l, s = 0.5 * (l - u), r = 0.5 * (l + u), h = Math.sin(this.B * e.x), o = (s * this.singam - h * this.cosgam) / r, Math.abs(Math.abs(o) - 1) < B)
throw new Error();
_ = 0.5 * this.ArB * Math.log((1 - o) / (1 + o)), u = Math.cos(this.B * e.x), Math.abs(u) < Ni ? f = this.A * e.x : f = this.ArB * Math.atan2(s * this.cosgam + h * this.singam, u);
} else
_ = e.y > 0 ? this.v_pole_n : this.v_pole_s, f = this.ArB * e.y;
return this.no_rot ? (i.x = f, i.y = _) : (f -= this.u_0, i.x = _ * this.cosrot + f * this.sinrot, i.y = f * this.cosrot - _ * this.sinrot), i.x = this.a * i.x + this.x0, i.y = this.a * i.y + this.y0, i;
}
function of(e) {
var i, s, r, o, h, l, u, f = {};
if (e.x = (e.x - this.x0) * (1 / this.a), e.y = (e.y - this.y0) * (1 / this.a), this.no_rot ? (s = e.y, i = e.x) : (s = e.x * this.cosrot - e.y * this.sinrot, i = e.y * this.cosrot + e.x * this.sinrot + this.u_0), r = Math.exp(-this.BrA * s), o = 0.5 * (r - 1 / r), h = 0.5 * (r + 1 / r), l = Math.sin(this.BrA * i), u = (l * this.cosgam + o * this.singam) / h, Math.abs(Math.abs(u) - 1) < B)
f.x = 0, f.y = u < 0 ? -O : O;
else {
if (f.y = this.E / Math.sqrt((1 + u) / (1 - u)), f.y = Tn(this.e, Math.pow(f.y, 1 / this.B)), f.y === 1 / 0)
throw new Error();
f.x = -this.rB * Math.atan2(o * this.cosgam - l * this.singam, Math.cos(this.BrA * i));
}
return f.x += this.lam0, f;
}
var hf = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Variant_B", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"];
const lf = {
init: rf,
forward: af,
inverse: of,
names: hf
};
function cf() {
if (this.lat2 || (this.lat2 = this.lat1), this.k0 || (this.k0 = 1), this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, !(Math.abs(this.lat1 + this.lat2) < B)) {
var e = this.b / this.a;
this.e = Math.sqrt(1 - e * e);
var i = Math.sin(this.lat1), s = Math.cos(this.lat1), r = Se(this.e, i, s), o = ye(this.e, this.lat1, i), h = Math.sin(this.lat2), l = Math.cos(this.lat2), u = Se(this.e, h, l), f = ye(this.e, this.lat2, h), _ = Math.abs(Math.abs(this.lat0) - O) < B ? 0 : ye(this.e, this.lat0, Math.sin(this.lat0));
Math.abs(this.lat1 - this.lat2) > B ? this.ns = Math.log(r / u) / Math.log(o / f) : this.ns = i, isNaN(this.ns) && (this.ns = i), this.f0 = r / (this.ns * Math.pow(o, this.ns)), this.rh = this.a * this.f0 * Math.pow(_, this.ns), this.title || (this.title = "Lambert Conformal Conic");
}
}
function uf(e) {
var i = e.x, s = e.y;
Math.abs(2 * Math.abs(s) - Math.PI) <= B && (s = On(s) * (O - 2 * B));
var r = Math.abs(Math.abs(s) - O), o, h;
if (r > B)
o = ye(this.e, s, Math.sin(s)), h = this.a * this.f0 * Math.pow(o, this.ns);
else {
if (r = s * this.ns, r <= 0)
return null;
h = 0;
}
var l = this.ns * Z(i - this.long0);
return e.x = this.k0 * (h * Math.sin(l)) + this.x0, e.y = this.k0 * (this.rh - h * Math.cos(l)) + this.y0, e;
}
function ff(e) {
var i, s, r, o, h, l = (e.x - this.x0) / this.k0, u = this.rh - (e.y - this.y0) / this.k0;
this.ns > 0 ? (i = Math.sqrt(l * l + u * u), s = 1) : (i = -Math.sqrt(l * l + u * u), s = -1);
var f = 0;
if (i !== 0 && (f = Math.atan2(s * l, s * u)), i !== 0 || this.ns > 0) {
if (s = 1 / this.ns, r = Math.pow(i / (this.a * this.f0), s), o = Tn(this.e, r), o === -9999)
return null;
} else
o = -O;
return h = Z(f / this.ns + this.long0), e.x = h, e.y = o, e;
}
var df = [
"Lambert Tangential Conformal Conic Projection",
"Lambert_Conformal_Conic",
"Lambert_Conformal_Conic_1SP",
"Lambert_Conformal_Conic_2SP",
"lcc",
"Lambert Conic Conformal (1SP)",
"Lambert Conic Conformal (2SP)"
];
const _f = {
init: cf,
forward: uf,
inverse: ff,
names: df
};
function pf() {
this.a = 6377397155e-3, this.es = 0.006674372230614, this.e = Math.sqrt(this.es), this.lat0 || (this.lat0 = 0.863937979737193), this.long0 || (this.long0 = 0.7417649320975901 - 0.308341501185665), this.k0 || (this.k0 = 0.9999), this.s45 = 0.785398163397448, this.s90 = 2 * this.s45, this.fi0 = this.lat0, this.e2 = this.es, this.e = Math.sqrt(this.e2), this.alfa = Math.sqrt(1 + this.e2 * Math.pow(Math.cos(this.fi0), 4) / (1 - this.e2)), this.uq = 1.04216856380474, this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa), this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2), this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g, this.k1 = this.k0, this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2)), this.s0 = 1.37008346281555, this.n = Math.sin(this.s0), this.ro0 = this.k1 * this.n0 / Math.tan(this.s0), this.ad = this.s90 - this.uq;
}
function mf(e) {
var i, s, r, o, h, l, u, f = e.x, _ = e.y, v = Z(f - this.long0);
return i = Math.pow((1 + this.e * Math.sin(_)) / (1 - this.e * Math.sin(_)), this.alfa * this.e / 2), s = 2 * (Math.atan(this.k * Math.pow(Math.tan(_ / 2 + this.s45), this.alfa) / i) - this.s45), r = -v * this.alfa, o = Math.asin(Math.cos(this.ad) * Math.sin(s) + Math.sin(this.ad) * Math.cos(s) * Math.cos(r)), h = Math.asin(Math.cos(s) * Math.sin(r) / Math.cos(o)), l = this.n * h, u = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(o / 2 + this.s45), this.n), e.y = u * Math.cos(l) / 1, e.x = u * Math.sin(l) / 1, this.czech || (e.y *= -1, e.x *= -1), e;
}
function gf(e) {
var i, s, r, o, h, l, u, f, _ = e.x;
e.x = e.y, e.y = _, this.czech || (e.y *= -1, e.x *= -1), l = Math.sqrt(e.x * e.x + e.y * e.y), h = Math.atan2(e.y, e.x), o = h / Math.sin(this.s0), r = 2 * (Math.atan(Math.pow(this.ro0 / l, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45), i = Math.asin(Math.cos(this.ad) * Math.sin(r) - Math.sin(this.ad) * Math.cos(r) * Math.cos(o)), s = Math.asin(Math.cos(r) * Math.sin(o) / Math.cos(i)), e.x = this.long0 - s / this.alfa, u = i, f = 0;
var v = 0;
do
e.y = 2 * (Math.atan(Math.pow(this.k, -1 / this.alfa) * Math.pow(Math.tan(i / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(u)) / (1 - this.e * Math.sin(u)), this.e / 2)) - this.s45), Math.abs(u - e.y) < 1e-10 && (f = 1), u = e.y, v += 1;
while (f === 0 && v < 15);
return v >= 15 ? null : e;
}
var vf = ["Krovak", "krovak"];
const yf = {
init: pf,
forward: mf,
inverse: gf,
names: vf
};
function Xt(e, i, s, r, o) {
return e * o - i * Math.sin(2 * o) + s * Math.sin(4 * o) - r * Math.sin(6 * o);
}
function kn(e) {
return 1 - 0.25 * e * (1 + e / 16 * (3 + 1.25 * e));
}
function Rn(e) {
return 0.375 * e * (1 + 0.25 * e * (1 + 0.46875 * e));
}
function zn(e) {
return 0.05859375 * e * e * (1 + 0.75 * e);
}
function Dn(e) {
return e * e * e * (35 / 3072);
}
function xr(e, i, s) {
var r = i * s;
return e / Math.sqrt(1 - r * r);
}
function Ve(e) {
return Math.abs(e) < O ? e : e - On(e) * Math.PI;
}
function gs(e, i, s, r, o) {
var h, l;
h = e / i;
for (var u = 0; u < 15; u++)
if (l = (e - (i * h - s * Math.sin(2 * h) + r * Math.sin(4 * h) - o * Math.sin(6 * h))) / (i - 2 * s * Math.cos(2 * h) + 4 * r * Math.cos(4 * h) - 6 * o * Math.cos(6 * h)), h += l, Math.abs(l) <= 1e-10)
return h;
return NaN;
}
function Mf() {
this.sphere || (this.e0 = kn(this.es), this.e1 = Rn(this.es), this.e2 = zn(this.es), this.e3 = Dn(this.es), this.ml0 = this.a * Xt(this.e0, this.e1, this.e2, this.e3, this.lat0));
}
function wf(e) {
var i, s, r = e.x, o = e.y;
if (r = Z(r - this.long0), this.sphere)
i = this.a * Math.asin(Math.cos(o) * Math.sin(r)), s = this.a * (Math.atan2(Math.tan(o), Math.cos(r)) - this.lat0);
else {
var h = Math.sin(o), l = Math.cos(o), u = xr(this.a, this.e, h), f = Math.tan(o) * Math.tan(o), _ = r * Math.cos(o), v = _ * _, m = this.es * l * l / (1 - this.es), g = this.a * Xt(this.e0, this.e1, this.e2, this.e3, o);
i = u * _ * (1 - v * f * (1 / 6 - (8 - f + 8 * m) * v / 120)), s = g - this.ml0 + u * h / l * v * (0.5 + (5 - f + 6 * m) * v / 24);
}
return e.x = i + this.x0, e.y = s + this.y0, e;
}
function xf(e) {
e.x -= this.x0, e.y -= this.y0;
var i = e.x / this.a, s = e.y / this.a, r, o;
if (this.sphere) {
var h = s + this.lat0;
r = Math.asin(Math.sin(h) * Math.cos(i)), o = Math.atan2(Math.tan(i), Math.cos(h));
} else {
var l = this.ml0 / this.a + s, u = gs(l, this.e0, this.e1, this.e2, this.e3);
if (Math.abs(Math.abs(u) - O) <= B)
return e.x = this.long0, e.y = O, s < 0 && (e.y *= -1), e;
var f = xr(this.a, this.e, Math.sin(u)), _ = f * f * f / this.a / this.a * (1 - this.es), v = Math.pow(Math.tan(u), 2), m = i * this.a / f, g = m * m;
r = u - f * Math.tan(u) / _ * m * m * (0.5 - (1 + 3 * v) * m * m / 24), o = m * (1 - g * (v / 3 + (1 + 3 * v) * v * g / 15)) / Math.cos(u);
}
return e.x = Z(o + this.long0), e.y = Ve(r), e;
}
var bf = ["Cassini", "Cassini_Soldner", "cass"];
const Ef = {
init: Mf,
forward: wf,
inverse: xf,
names: bf
};
function He(e, i) {
var s;
return e > 1e-7 ? (s = e * i, (1 - e * e) * (i / (1 - s * s) - 0.5 / e * Math.log((1 - s) / (1 + s)))) : 2 * i;
}
var Pf = 1, Sf = 2, Af = 3, Lf = 4;
function Cf() {
var e = Math.abs(this.lat0);
if (Math.abs(e - O) < B ? this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE : Math.abs(e) < B ? this.mode = this.EQUIT : this.mode = this.OBLIQ, this.es > 0) {
var i;
switch (this.qp = He(this.e, 1), this.mmf = 0.5 / (1 - this.es), this.apa = Df(this.es), this.mode) {
case this.N_POLE:
this.dd = 1;
break;
case this.S_POLE:
this.dd = 1;
break;
case this.EQUIT:
this.rq = Math.sqrt(0.5 * this.qp), this.dd = 1 / this.rq, this.xmf = 1, this.ymf = 0.5 * this.qp;
break;
case this.OBLIQ:
this.rq = Math.sqrt(0.5 * this.qp), i = Math.sin(this.lat0), this.sinb1 = He(this.e, i) / this.qp, this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1), this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * i * i) * this.rq * this.cosb1), this.ymf = (this.xmf = this.rq) / this.dd, this.xmf *= this.dd;
break;
}
} else
this.mode === this.OBLIQ && (this.sinph0 = Math.sin(this.lat0), this.cosph0 = Math.cos(this.lat0));
}
function Tf(e) {
var i, s, r, o, h, l, u, f, _, v, m = e.x, g = e.y;
if (m = Z(m - this.long0), this.sphere) {
if (h = Math.sin(g), v = Math.cos(g), r = Math.cos(m), this.mode === this.OBLIQ || this.mode === this.EQUIT) {
if (s = this.mode === this.EQUIT ? 1 + v * r : 1 + this.sinph0 * h + this.cosph0 * v * r, s <= B)
return null;
s = Math.sqrt(2 / s), i = s * v * Math.sin(m), s *= this.mode === this.EQUIT ? h : this.cosph0 * h - this.sinph0 * v * r;
} else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
if (this.mode === this.N_POLE && (r = -r), Math.abs(g + this.lat0) < B)
return null;
s = ut - g * 0.5, s = 2 * (this.mode === this.S_POLE ? Math.cos(s) : Math.sin(s)), i = s * Math.sin(m), s *= r;
}
} else {
switch (u = 0, f = 0, _ = 0, r = Math.cos(m), o = Math.sin(m), h = Math.sin(g), l = He(this.e, h), (this.mode === this.OBLIQ || this.mode === this.EQUIT) && (u = l / this.qp, f = Math.sqrt(1 - u * u)), this.mode) {
case this.OBLIQ:
_ = 1 + this.sinb1 * u + this.cosb1 * f * r;
break;
case this.EQUIT:
_ = 1 + f * r;
break;
case this.N_POLE:
_ = O + g, l = this.qp - l;
break;
case this.S_POLE:
_ = g - O, l = this.qp + l;
break;
}
if (Math.abs(_) < B)
return null;
switch (this.mode) {
case this.OBLIQ:
case this.EQUIT:
_ = Math.sqrt(2 / _), this.mode === this.OBLIQ ? s = this.ymf * _ * (this.cosb1 * u - this.sinb1 * f * r) : s = (_ = Math.sqrt(2 / (1 + f * r))) * u * this.ymf, i = this.xmf * _ * f * o;
break;
case this.N_POLE:
case this.S_POLE:
l >= 0 ? (i = (_ = Math.sqrt(l)) * o, s = r * (this.mode === this.S_POLE ? _ : -_)) : i = s = 0;
break;
}
}
return e.x = this.a * i + this.x0, e.y = this.a * s + this.y0, e;
}
function Nf(e) {
e.x -= this.x0, e.y -= this.y0;
var i = e.x / this.a, s = e.y / this.a, r, o, h, l, u, f, _;
if (this.sphere) {
var v = 0, m, g = 0;
if (m = Math.sqrt(i * i + s * s), o = m * 0.5, o > 1)
return null;
switch (o = 2 * Math.asin(o), (this.mode === this.OBLIQ || this.mode === this.EQUIT) && (g = Math.sin(o), v = Math.cos(o)), this.mode) {
case this.EQUIT:
o = Math.abs(m) <= B ? 0 : Math.asin(s * g / m), i *= g, s = v * m;
break;
case this.OBLIQ:
o = Math.abs(m) <= B ? this.lat0 : Math.asin(v * this.sinph0 + s * g * this.cosph0 / m), i *= g * this.cosph0, s = (v - Math.sin(o) * this.sinph0) * m;
break;
case this.N_POLE:
s = -s, o = O - o;
break;
case this.S_POLE:
o -= O;
break;
}
r = s === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ) ? 0 : Math.atan2(i, s);
} else {
if (_ = 0, this.mode === this.OBLIQ || this.mode === this.EQUIT) {
if (i /= this.dd, s *= this.dd, f = Math.sqrt(i * i + s * s), f < B)
return e.x = this.long0, e.y = this.lat0, e;
l = 2 * Math.asin(0.5 * f / this.rq), h = Math.cos(l), i *= l = Math.sin(l), this.mode === this.OBLIQ ? (_ = h * this.sinb1 + s * l * this.cosb1 / f, u = this.qp * _, s = f * this.cosb1 * h - s * this.sinb1 * l) : (_ = s * l / f, u = this.qp * _, s = f * h);
} else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
if (this.mode === this.N_POLE && (s = -s), u = i * i + s * s, !u)
return e.x = this.long0, e.y = this.lat0, e;
_ = 1 - u / this.qp, this.mode === this.S_POLE && (_ = -_);
}
r = Math.atan2(i, s), o = Bf(Math.asin(_), this.apa);
}
return e.x = Z(this.long0 + r), e.y = o, e;
}
var Gf = 0.3333333333333333, If = 0.17222222222222222, Of = 0.10257936507936508, kf = 0.06388888888888888, Rf = 0.0664021164021164, zf = 0.016415012942191543;
function Df(e) {
var i, s = [];
return s[0] = e * Gf, i = e * e, s[0] += i * If, s[1] = i * kf, i *= e, s[0] += i * Of, s[1] += i * Rf, s[2] = i * zf, s;
}
function Bf(e, i) {
var s = e + e;
return e + i[0] * Math.sin(s) + i[1] * Math.sin(s + s) + i[2] * Math.sin(s + s + s);
}
var Uf = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"];
const Zf = {
init: Cf,
forward: Tf,
inverse: Nf,
names: Uf,
S_POLE: Pf,
N_POLE: Sf,
EQUIT: Af,
OBLIQ: Lf
};
function je(e) {
return Math.abs(e) > 1 && (e = e > 1 ? 1 : -1), Math.asin(e);
}
function qf() {
Math.abs(this.lat1 + this.lat2) < B || (this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e3 = Math.sqrt(this.es), this.sin_po = Math.sin(this.lat1), this.cos_po = Math.cos(this.lat1), this.t1 = this.sin_po, this.con = this.sin_po, this.ms1 = Se(this.e3, this.sin_po, this.cos_po), this.qs1 = He(this.e3, this.sin_po), this.sin_po = Math.sin(this.lat2), this.cos_po = Math.cos(this.lat2), this.t2 = this.sin_po, this.ms2 = Se(this.e3, this.sin_po, this.cos_po), this.qs2 = He(this.e3, this.sin_po), this.sin_po = Math.sin(this.lat0), this.cos_po = Math.cos(this.lat0), this.t3 = this.sin_po, this.qs0 = He(this.e3, this.sin_po), Math.abs(this.lat1 - this.lat2) > B ? this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1) : this.ns0 = this.con, this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1, this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0);
}
function $f(e) {
var i = e.x, s = e.y;
this.sin_phi = Math.sin(s), this.cos_phi = Math.cos(s);
var r = He(this.e3, this.sin_phi), o = this.a * Math.sqrt(this.c - this.ns0 * r) / this.ns0, h = this.ns0 * Z(i - this.long0), l = o * Math.sin(h) + this.x0, u = this.rh - o * Math.cos(h) + this.y0;
return e.x = l, e.y = u, e;
}
function Ff(e) {
var i, s, r, o, h, l;
return e.x -= this.x0, e.y = this.rh - e.y + this.y0, this.ns0 >= 0 ? (i = Math.sqrt(e.x * e.x + e.y * e.y), r = 1) : (i = -Math.sqrt(e.x * e.x + e.y * e.y), r = -1), o = 0, i !== 0 && (o = Math.atan2(r * e.x, r * e.y)), r = i * this.ns0 / this.a, this.sphere ? l = Math.asin((this.c - r * r) / (2 * this.ns0)) : (s = (this.c - r * r) / this.ns0, l = this.phi1z(this.e3, s)), h = Z(o / this.ns0 + this.long0), e.x = h, e.y = l, e;
}
function Hf(e, i) {
var s, r, o, h, l, u = je(0.5 * i);
if (e < B)
return u;
for (var f = e * e, _ = 1; _ <= 25; _++)
if (s = Math.sin(u), r = Math.cos(u), o = e * s, h = 1 - o * o, l = 0.5 * h * h / r * (i / (1 - f) - s / h + 0.5 / e * Math.log((1 - o) / (1 + o))), u = u + l, Math.abs(l) <= 1e-7)
return u;
return null;
}
var Wf = ["Albers_Conic_Equal_Area", "Albers_Equal_Area", "Albers", "aea"];
const jf = {
init: qf,
forward: $f,
inverse: Ff,
names: Wf,
phi1z: Hf
};
function Kf() {
this.sin_p14 = Math.sin(this.lat0), this.cos_p14 = Math.cos(this.lat0), this.infinity_dist = 1e3 * this.a, this.rc = 1;
}
function Vf(e) {
var i, s, r, o, h, l, u, f, _ = e.x, v = e.y;
return r = Z(_ - this.long0), i = Math.sin(v), s = Math.cos(v), o = Math.cos(r), l = this.sin_p14 * i + this.cos_p14 * s * o, h = 1, l > 0 || Math.abs(l) <= B ? (u = this.x0 + this.a * h * s * Math.sin(r) / l, f = this.y0 + this.a * h * (this.cos_p14 * i - this.sin_p14 * s * o) / l) : (u = this.x0 + this.infinity_dist * s * Math.sin(r), f = this.y0 + this.infinity_dist * (this.cos_p14 * i - this.sin_p14 * s * o)), e.x = u, e.y = f, e;
}
function Jf(e) {
var i, s, r, o, h, l;
return e.x = (e.x - this.x0) / this.a, e.y = (e.y - this.y0) / this.a, e.x /= this.k0, e.y /= this.k0, (i = Math.sqrt(e.x * e.x + e.y * e.y)) ? (o = Math.atan2(i, this.rc), s = Math.sin(o), r = Math.cos(o), l = je(r * this.sin_p14 + e.y * s * this.cos_p14 / i), h = Math.atan2(e.x * s, i * this.cos_p14 * r - e.y * this.sin_p14 * s), h = Z(this.long0 + h)) : (l = this.phic0, h = 0), e.x = h, e.y = l, e;
}
var Xf = ["gnom"];
const Qf = {
init: Kf,
forward: Vf,
inverse: Jf,
names: Xf
};
function Yf(e, i) {
var s = 1 - (1 - e * e) / (2 * e) * Math.log((1 - e) / (1 + e));
if (Math.abs(Math.abs(i) - s) < 1e-6)
return i < 0 ? -1 * O : O;
for (var r = Math.asin(0.5 * i), o, h, l, u, f = 0; f < 30; f++)
if (h = Math.sin(r), l = Math.cos(r), u = e * h, o = Math.pow(1 - u * u, 2) / (2 * l) * (i / (1 - e * e) - h / (1 - u * u) + 0.5 / e * Math.log((1 - u) / (1 + u))), r += o, Math.abs(o) <= 1e-10)
return r;
return NaN;
}
function td() {
this.sphere || (this.k0 = Se(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)));
}
function ed(e) {
var i = e.x, s = e.y, r, o, h = Z(i - this.long0);
if (this.sphere)
r = this.x0 + this.a * h * Math.cos(this.lat_ts), o = this.y0 + this.a * Math.sin(s) / Math.cos(this.lat_ts);
else {
var l = He(this.e, Math.sin(s));
r = this.x0 + this.a * this.k0 * h, o = this.y0 + this.a * l * 0.5 / this.k0;
}
return e.x = r, e.y = o, e;
}
function id(e) {
e.x -= this.x0, e.y -= this.y0;
var i, s;
return this.sphere ? (i = Z(this.long0 + e.x / this.a / Math.cos(this.lat_ts)), s = Math.asin(e.y / this.a * Math.cos(this.lat_ts))) : (s = Yf(this.e, 2 * e.y * this.k0 / this.a), i = Z(this.long0 + e.x / (this.a * this.k0))), e.x = i, e.y = s, e;
}
var nd = ["cea"];
const sd = {
init: td,
forward: ed,
inverse: id,
names: nd
};
function rd() {
this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Equidistant Cylindrical (Plate Carre)", this.rc = Math.cos(this.lat_ts);
}
function ad(e) {
var i = e.x, s = e.y, r = Z(i - this.long0), o = Ve(s - this.lat0);
return e.x = this.x0 + this.a * r * this.rc, e.y = this.y0 + this.a * o, e;
}
function od(e) {
var i = e.x, s = e.y;
return e.x = Z(this.long0 + (i - this.x0) / (this.a * this.rc)), e.y = Ve(this.lat0 + (s - this.y0) / this.a), e;
}
var hd = ["Equirectangular", "Equidistant_Cylindrical", "Equidistant_Cylindrical_Spherical", "eqc"];
const ld = {
init: rd,
forward: ad,
inverse: od,
names: hd
};
var Ha = 20;
function cd() {
this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = kn(this.es), this.e1 = Rn(this.es), this.e2 = zn(this.es), this.e3 = Dn(this.es), this.ml0 = this.a * Xt(this.e0, this.e1, this.e2, this.e3, this.lat0);
}
function ud(e) {
var i = e.x, s = e.y, r, o, h, l = Z(i - this.long0);
if (h = l * Math.sin(s), this.sphere)
Math.abs(s) <= B ? (r = this.a * l, o = -1 * this.a * this.lat0) : (r = this.a * Math.sin(h) / Math.tan(s), o = this.a * (Ve(s - this.lat0) + (1 - Math.cos(h)) / Math.tan(s)));
else if (Math.abs(s) <= B)
r = this.a * l, o = -1 * this.ml0;
else {
var u = xr(this.a, this.e, Math.sin(s)) / Math.tan(s);
r = u * Math.sin(h), o = this.a * Xt(this.e0, this.e1, this.e2, this.e3, s) - this.ml0 + u * (1 - Math.cos(h));
}
return e.x = r + this.x0, e.y = o + this.y0, e;
}
function fd(e) {
var i, s, r, o, h, l, u, f, _;
if (r = e.x - this.x0, o = e.y - this.y0, this.sphere)
if (Math.abs(o + this.a * this.lat0) <= B)
i = Z(r / this.a + this.long0), s = 0;
else {
l = this.lat0 + o / this.a, u = r * r / this.a / this.a + l * l, f = l;
var v;
for (h = Ha; h; --h)
if (v = Math.tan(f), _ = -1 * (l * (f * v + 1) - f - 0.5 * (f * f + u) * v) / ((f - l) / v - 1), f += _, Math.abs(_) <= B) {
s = f;
break;
}
i = Z(this.long0 + Math.asin(r * Math.tan(f) / this.a) / Math.sin(s));
}
else if (Math.abs(o + this.ml0) <= B)
s = 0, i = Z(this.long0 + r / this.a);
else {
l = (this.ml0 + o) / this.a, u = r * r / this.a / this.a + l * l, f = l;
var m, g, M, E, x;
for (h = Ha; h; --h)
if (x = this.e * Math.sin(f), m = Math.sqrt(1 - x * x) * Math.tan(f), g = this.a * Xt(this.e0, this.e1, this.e2, this.e3, f), M = this.e0 - 2 * this.e1 * Math.cos(2 * f) + 4 * this.e2 * Math.cos(4 * f) - 6 * this.e3 * Math.cos(6 * f), E = g / this.a, _ = (l * (m * E + 1) - E - 0.5 * m * (E * E + u)) / (this.es * Math.sin(2 * f) * (E * E + u - 2 * l * E) / (4 * m) + (l - E) * (m * M - 2 / Math.sin(2 * f)) - M), f -= _, Math.abs(_) <= B) {
s = f;
break;
}
m = Math.sqrt(1 - this.es * Math.pow(Math.sin(s), 2)) * Math.tan(s), i = Z(this.long0 + Math.asin(r * m / this.a) / Math.sin(s));
}
return e.x = i, e.y = s, e;
}
var dd = ["Polyconic", "American_Polyconic", "poly"];
const _d = {
init: cd,
forward: ud,
inverse: fd,
names: dd
};
function pd() {
this.A = [], this.A[1] = 0.6399175073, this.A[2] = -0.1358797613, this.A[3] = 0.063294409, this.A[4] = -0.02526853, this.A[5] = 0.0117879, this.A[6] = -55161e-7, this.A[7] = 26906e-7, this.A[8] = -1333e-6, this.A[9] = 67e-5, this.A[10] = -34e-5, this.B_re = [], this.B_im = [], this.B_re[1] = 0.7557853228, this.B_im[1] = 0, this.B_re[2] = 0.249204646, this.B_im[2] = 3371507e-9, this.B_re[3] = -1541739e-9, this.B_im[3] = 0.04105856, this.B_re[4] = -0.10162907, this.B_im[4] = 0.01727609, this.B_re[5] = -0.26623489, this.B_im[5] = -0.36249218, this.B_re[6] = -0.6870983, this.B_im[6] = -1.1651967, this.C_re = [], this.C_im = [], this.C_re[1] = 1.3231270439, this.C_im[1] = 0, this.C_re[2] = -0.577245789, this.C_im[2] = -7809598e-9, this.C_re[3] = 0.508307513, this.C_im[3] = -0.112208952, this.C_re[4] = -0.15094762, this.C_im[4] = 0.18200602, this.C_re[5] = 1.01418179, this.C_im[5] = 1.64497696, this.C_re[6] = 1.9660549, this.C_im[6] = 2.5127645, this.D = [], this.D[1] = 1.5627014243, this.D[2] = 0.5185406398, this.D[3] = -0.03333098, this.D[4] = -0.1052906, this.D[5] = -0.0368594, this.D[6] = 7317e-6, this.D[7] = 0.0122, this.D[8] = 394e-5, this.D[9] = -13e-4;
}
function md(e) {
var i, s = e.x, r = e.y, o = r - this.lat0, h = s - this.long0, l = o / Mn * 1e-5, u = h, f = 1, _ = 0;
for (i = 1; i <= 10; i++)
f = f * l, _ = _ + this.A[i] * f;
var v = _, m = u, g = 1, M = 0, E, x, C = 0, D = 0;
for (i = 1; i <= 6; i++)
E = g * v - M * m, x = M * v + g * m, g = E, M = x, C = C + this.B_re[i] * g - this.B_im[i] * M, D = D + this.B_im[i] * g + this.B_re[i] * M;
return e.x = D * this.a + this.x0, e.y = C * this.a + this.y0, e;
}
function gd(e) {
var i, s = e.x, r = e.y, o = s - this.x0, h = r - this.y0, l = h / this.a, u = o / this.a, f = 1, _ = 0, v, m, g = 0, M = 0;
for (i = 1; i <= 6; i++)
v = f * l - _ * u, m = _ * l + f * u, f = v, _ = m, g = g + this.C_re[i] * f - this.C_im[i] * _, M = M + this.C_im[i] * f + this.C_re[i] * _;
for (var E = 0; E < this.iterations; E++) {
var x = g, C = M, D, U, $ = l, lt = u;
for (i = 2; i <= 6; i++)
D = x * g - C * M, U = C * g + x * M, x = D, C = U, $ = $ + (i - 1) * (this.B_re[i] * x - this.B_im[i] * C), lt = lt + (i - 1) * (this.B_im[i] * x + this.B_re[i] * C);
x = 1, C = 0;
var mt = this.B_re[1], Mt = this.B_im[1];
for (i = 2; i <= 6; i++)
D = x * g - C * M, U = C * g + x * M, x = D, C = U, mt = mt + i * (this.B_re[i] * x - this.B_im[i] * C), Mt = Mt + i * (this.B_im[i] * x + this.B_re[i] * C);
var Rt = mt * mt + Mt * Mt;
g = ($ * mt + lt * Mt) / Rt, M = (lt * mt - $ * Mt) / Rt;
}
var zt = g, Wt = M, Kt = 1, gt = 0;
for (i = 1; i <= 9; i++)
Kt = Kt * zt, gt = gt + this.D[i] * Kt;
var bt = this.lat0 + gt * Mn * 1e5, re = this.long0 + Wt;
return e.x = re, e.y = bt, e;
}
var vd = ["New_Zealand_Map_Grid", "nzmg"];
const yd = {
init: pd,
forward: md,
inverse: gd,
names: vd
};
function Md() {
}
function wd(e) {
var i = e.x, s = e.y, r = Z(i - this.long0), o = this.x0 + this.a * r, h = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + s / 2.5)) * 1.25;
return e.x = o, e.y = h, e;
}
function xd(e) {
e.x -= this.x0, e.y -= this.y0;
var i = Z(this.long0 + e.x / this.a), s = 2.5 * (Math.atan(Math.exp(0.8 * e.y / this.a)) - Math.PI / 4);
return e.x = i, e.y = s, e;
}
var bd = ["Miller_Cylindrical", "mill"];
const Ed = {
init: Md,
forward: wd,
inverse: xd,
names: bd
};
var Pd = 20;
function Sd() {
this.sphere ? (this.n = 1, this.m = 0, this.es = 0, this.C_y = Math.sqrt((this.m + 1) / this.n), this.C_x = this.C_y / (this.m + 1)) : this.en = gr(this.es);
}
function Ad(e) {
var i, s, r = e.x, o = e.y;
if (r = Z(r - this.long0), this.sphere) {
if (!this.m)
o = this.n !== 1 ? Math.asin(this.n * Math.sin(o)) : o;
else
for (var h = this.n * Math.sin(o), l = Pd; l; --l) {
var u = (this.m * o + Math.sin(o) - h) / (this.m + Math.cos(o));
if (o -= u, Math.abs(u) < B)
break;
}
i = this.a * this.C_x * r * (this.m + Math.cos(o)), s = this.a * this.C_y * o;
} else {
var f = Math.sin(o), _ = Math.cos(o);
s = this.a * qi(o, f, _, this.en), i = this.a * r * _ / Math.sqrt(1 - this.es * f * f);
}
return e.x = i, e.y = s, e;
}
function Ld(e) {
var i, s, r, o;
return e.x -= this.x0, r = e.x / this.a, e.y -= this.y0, i = e.y / this.a, this.sphere ? (i /= this.C_y, r = r / (this.C_x * (this.m + Math.cos(i))), this.m ? i = je((this.m * i + Math.sin(i)) / this.n) : this.n !== 1 && (i = je(Math.sin(i) / this.n)), r = Z(r + this.long0), i = Ve(i)) : (i = vr(e.y / this.a, this.es, this.en), o = Math.abs(i), o < O ? (o = Math.sin(i), s = this.long0 + e.x * Math.sqrt(1 - this.es * o * o) / (this.a * Math.cos(i)), r = Z(s)) : o - B < O && (r = this.long0)), e.x = r, e.y = i, e;
}
var Cd = ["Sinusoidal", "sinu"];
const Td = {
init: Sd,
forward: Ad,
inverse: Ld,
names: Cd
};
function Nd() {
}
function Gd(e) {
for (var i = e.x, s = e.y, r = Z(i - this.long0), o = s, h = Math.PI * Math.sin(s); ; ) {
var l = -(o + Math.sin(o) - h) / (1 + Math.cos(o));
if (o += l, Math.abs(l) < B)
break;
}
o /= 2, Math.PI / 2 - Math.abs(s) < B && (r = 0);
var u = 0.900316316158 * this.a * r * Math.cos(o) + this.x0, f = 1.4142135623731 * this.a * Math.sin(o) + this.y0;
return e.x = u, e.y = f, e;
}
function Id(e) {
var i, s;
e.x -= this.x0, e.y -= this.y0, s = e.y / (1.4142135623731 * this.a), Math.abs(s) > 0.999999999999 && (s = 0.999999999999), i = Math.asin(s);
var r = Z(this.long0 + e.x / (0.900316316158 * this.a * Math.cos(i)));
r < -Math.PI && (r = -Math.PI), r > Math.PI && (r = Math.PI), s = (2 * i + Math.sin(2 * i)) / Math.PI, Math.abs(s) > 1 && (s = 1);
var o = Math.asin(s);
return e.x = r, e.y = o, e;
}
var Od = ["Mollweide", "moll"];
const kd = {
init: Nd,
forward: Gd,
inverse: Id,
names: Od
};
function Rd() {
Math.abs(this.lat1 + this.lat2) < B || (this.lat2 = this.lat2 || this.lat1, this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = kn(this.es), this.e1 = Rn(this.es), this.e2 = zn(this.es), this.e3 = Dn(this.es), this.sinphi = Math.sin(this.lat1), this.cosphi = Math.cos(this.lat1), this.ms1 = Se(this.e, this.sinphi, this.cosphi), this.ml1 = Xt(this.e0, this.e1, this.e2, this.e3, this.lat1), Math.abs(this.lat1 - this.lat2) < B ? this.ns = this.sinphi : (this.sinphi = Math.sin(this.lat2), this.cosphi = Math.cos(this.lat2), this.ms2 = Se(this.e, this.sinphi, this.cosphi), this.ml2 = Xt(this.e0, this.e1, this.e2, this.e3, this.lat2), this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1)), this.g = this.ml1 + this.ms1 / this.ns, this.ml0 = Xt(this.e0, this.e1, this.e2, this.e3, this.lat0), this.rh = this.a * (this.g - this.ml0));
}
function zd(e) {
var i = e.x, s = e.y, r;
if (this.sphere)
r = this.a * (this.g - s);
else {
var o = Xt(this.e0, this.e1, this.e2, this.e3, s);
r = this.a * (this.g - o);
}
var h = this.ns * Z(i - this.long0), l = this.x0 + r * Math.sin(h), u = this.y0 + this.rh - r * Math.cos(h);
return e.x = l, e.y = u, e;
}
function Dd(e) {
e.x -= this.x0, e.y = this.rh - e.y + this.y0;
var i, s, r, o;
this.ns >= 0 ? (s = Math.sqrt(e.x * e.x + e.y * e.y), i = 1) : (s = -Math.sqrt(e.x * e.x + e.y * e.y), i = -1);
var h = 0;
if (s !== 0 && (h = Math.atan2(i * e.x, i * e.y)), this.sphere)
return o = Z(this.long0 + h / this.ns), r = Ve(this.g - s / this.a), e.x = o, e.y = r, e;
var l = this.g - s / this.a;
return r = gs(l, this.e0, this.e1, this.e2, this.e3), o = Z(this.long0 + h / this.ns), e.x = o, e.y = r, e;
}
var Bd = ["Equidistant_Conic", "eqdc"];
const Ud = {
init: Rd,
forward: zd,
inverse: Dd,
names: Bd
};
function Zd() {
this.R = this.a;
}
function qd(e) {
var i = e.x, s = e.y, r = Z(i - this.long0), o, h;
Math.abs(s) <= B && (o = this.x0 + this.R * r, h = this.y0);
var l = je(2 * Math.abs(s / Math.PI));
(Math.abs(r) <= B || Math.abs(Math.abs(s) - O) <= B) && (o = this.x0, s >= 0 ? h = this.y0 + Math.PI * this.R * Math.tan(0.5 * l) : h = this.y0 + Math.PI * this.R * -Math.tan(0.5 * l));
var u = 0.5 * Math.abs(Math.PI / r - r / Math.PI), f = u * u, _ = Math.sin(l), v = Math.cos(l), m = v / (_ + v - 1), g = m * m, M = m * (2 / _ - 1), E = M * M, x = Math.PI * this.R * (u * (m - E) + Math.sqrt(f * (m - E) * (m - E) - (E + f) * (g - E))) / (E + f);
r < 0 && (x = -x), o = this.x0 + x;
var C = f + m;
return x = Math.PI * this.R * (M * C - u * Math.sqrt((E + f) * (f + 1) - C * C)) / (E + f), s >= 0 ? h = this.y0 + x : h = this.y0 - x, e.x = o, e.y = h, e;
}
function $d(e) {
var i, s, r, o, h, l, u, f, _, v, m, g, M;
return e.x -= this.x0, e.y -= this.y0, m = Math.PI * this.R, r = e.x / m, o = e.y / m, h = r * r + o * o, l = -Math.abs(o) * (1 + h), u = l - 2 * o * o + r * r, f = -2 * l + 1 + 2 * o * o + h * h, M = o * o / f + (2 * u * u * u / f / f / f - 9 * l * u / f / f) / 27, _ = (l - u * u / 3 / f) / f, v = 2 * Math.sqrt(-_ / 3), m = 3 * M / _ / v, Math.abs(m) > 1 && (m >= 0 ? m = 1 : m = -1), g = Math.acos(m) / 3, e.y >= 0 ? s = (-v * Math.cos(g + Math.PI / 3) - u / 3 / f) * Math.PI : s = -(-v * Math.cos(g + Math.PI / 3) - u / 3 / f) * Math.PI, Math.abs(r) < B ? i = this.long0 : i = Z(this.long0 + Math.PI * (h - 1 + Math.sqrt(1 + 2 * (r * r - o * o) + h * h)) / 2 / r), e.x = i, e.y = s, e;
}
var Fd = ["Van_der_Grinten_I", "VanDerGrinten", "Van_der_Grinten", "vandg"];
const Hd = {
init: Zd,
forward: qd,
inverse: $d,
names: Fd
};
var zo = { exports: {} };
(function(e) {
(function(i) {
var s = {};
s.Constants = {}, s.Math = {}, s.Accumulator = {}, function(r) {
r.WGS84 = { a: 6378137, f: 1 / 298.257223563 }, r.version = { major: 2, minor: 1, patch: 1 }, r.version_string = "2.1.1";
}(s.Constants), function(r) {
r.digits = 53, r.epsilon = Math.pow(0.5, r.digits - 1), r.degree = Math.PI / 180, r.sq = function(o) {
return o * o;
}, r.hypot = function(o, h) {
return Math.sqrt(o * o + h * h);
}, r.cbrt = Math.cbrt || function(o) {
var h = Math.pow(Math.abs(o), 0.3333333333333333);
return o > 0 ? h : o < 0 ? -h : o;
}, r.log1p = Math.log1p || function(o) {
var h = 1 + o, l = h - 1;
return l === 0 ? o : o * Math.log(h) / l;
}, r.atanh = Math.atanh || function(o) {
var h = Math.abs(o);
return h = r.log1p(2 * h / (1 - h)) / 2, o > 0 ? h : o < 0 ? -h : o;
}, r.copysign = function(o, h) {
return Math.abs(o) * (h < 0 || h === 0 && 1 / h < 0 ? -1 : 1);
}, r.sum = function(o, h) {
var l = o + h, u = l - h, f = l - u, _;
return u -= o, f -= h, _ = l && 0 - (u + f), { s: l, t: _ };
}, r.polyval = function(o, h, l, u) {
for (var f = o < 0 ? 0 : h[l++]; --o >= 0; )
f = f * u + h[l++];
return f;
}, r.AngRound = function(o) {
var h = 0.0625, l = Math.abs(o);
return l = l < h ? h - (h - l) : l, r.copysign(l, o);
}, r.remainder = function(o, h) {
return o %= h, o < -h / 2 ? o + h : o < h / 2 ? o : o - h;
}, r.AngNormalize = function(o) {
var h = r.remainder(o, 360);
return Math.abs(h) === 180 ? r.copysign(180, o) : h;
}, r.LatFix = function(o) {
return Math.abs(o) > 90 ? NaN : o;
}, r.AngDiff = function(o, h) {
var l = r.sum(r.remainder(-o, 360), r.remainder(h, 360)), u, f;
return l = r.sum(r.remainder(l.s, 360), l.t), u = l.s, f = l.t, (u === 0 || Math.abs(u) === 180) && (u = r.copysign(u, f === 0 ? h - o : -f)), { d: u, e: f };
}, r.sincosd = function(o) {
var h, l, u, f, _, v, m;
switch (h = o % 360, u = Math.round(h / 90), h -= 90 * u, l = h * this.degree, f = Math.sin(l), _ = Math.cos(l), Math.abs(h) === 45 ? (_ = Math.sqrt(0.5), f = r.copysign(_, l)) : Math.abs(h) === 30 && (_ = Math.sqrt(0.75), f = r.copysign(0.5, l)), u & 3) {
case 0:
v = f, m = _;
break;
case 1:
v = _, m = -f;
break;
case 2:
v = -f, m = -_;
break;
default:
v = -_, m = f;
break;
}
return m += 0, v === 0 && (v = r.copysign(v, o)), { s: v, c: m };
}, r.sincosde = function(o, h) {
var l, u, f, _, v, m, g;
switch (l = o % 360, f = Math.round(l / 90), l = r.AngRound(l - 90 * f + h), u = l * this.degree, _ = Math.sin(u), v = Math.cos(u), Math.abs(l) === 45 ? (v = Math.sqrt(0.5), _ = r.copysign(v, u)) : Math.abs(l) === 30 && (v = Math.sqrt(0.75), _ = r.copysign(0.5, u)), f & 3) {
case 0:
m = _, g = v;
break;
case 1:
m = v, g = -_;
break;
case 2:
m = -_, g = -v;
break;
default:
m = -v, g = _;
break;
}
return g += 0, m === 0 && (m = r.copysign(m, o + h)), { s: m, c: g };
}, r.atan2d = function(o, h) {
var l = 0, u;
switch (Math.abs(o) > Math.abs(h) && ([o, h] = [h, o], l = 2), r.copysign(1, h) < 0 && (h = -h, ++l), u = Math.atan2(o, h) / this.degree, l) {
case 1:
u = r.copysign(180, o) - u;
break;
case 2:
u = 90 - u;
break;
case 3:
u = -90 + u;
break;
}
return u;
};
}(s.Math), function(r, o) {
r.Accumulator = function(h) {
this.Set(h);
}, r.Accumulator.prototype.Set = function(h) {
h || (h = 0), h.constructor === r.Accumulator ? (this._s = h._s, this._t = h._t) : (this._s = h, this._t = 0);
}, r.Accumulator.prototype.Add = function(h) {
var l = o.sum(h, this._t), u = o.sum(l.s, this._s);
l = l.t, this._s = u.s, this._t = u.t, this._s === 0 ? this._s = l : this._t += l;
}, r.Accumulator.prototype.Sum = function(h) {
var l;
return h ? (l = new r.Accumulator(this), l.Add(h), l._s) : this._s;
}, r.Accumulator.prototype.Negate = function() {
this._s *= -1, this._t *= -1;
}, r.Accumulator.prototype.Remainder = function(h) {
this._s = o.remainder(this._s, h), this.Add(0);
};
}(s.Accumulator, s.Math), s.Geodesic = {}, s.GeodesicLine = {}, s.PolygonArea = {}, function(r, o, h, l, u) {
var f = 6, _ = f, v = f, m = f, g = m, M, E, x = 20, C = x + l.digits + 10, D = l.epsilon, U = 200 * D, $ = Math.sqrt(D), lt = D, mt = 1e3 * $, Mt = 0, Rt = 31, zt = 32640, Wt, Kt, gt, bt, re, Dt, Me, Gt, ae;
r.tiny_ = Math.sqrt(Number.MIN_VALUE / Number.EPSILON), r.nC1_ = f, r.nC1p_ = f, r.nC2_ = f, r.nC3_ = f, r.nC4_ = f, M = r.nC3_ * (r.nC3_ - 1) / 2, E = r.nC4_ * (r.nC4_ + 1) / 2, r.CAP_C1 = 1, r.CAP_C1p = 2, r.CAP_C2 = 4, r.CAP_C3 = 8, r.CAP_C4 = 16, r.NONE = 0, r.ARC = 64, r.LATITUDE = 128 | Mt, r.LONGITUDE = 256 | r.CAP_C3, r.AZIMUTH = 512 | Mt, r.DISTANCE = 1024 | r.CAP_C1, r.STANDARD = r.LATITUDE | r.LONGITUDE | r.AZIMUTH | r.DISTANCE, r.DISTANCE_IN = 2048 | r.CAP_C1 | r.CAP_C1p, r.REDUCEDLENGTH = 4096 | r.CAP_C1 | r.CAP_C2, r.GEODESICSCALE = 8192 | r.CAP_C1 | r.CAP_C2, r.AREA = 16384 | r.CAP_C4, r.ALL = zt | Rt, r.LONG_UNROLL = 32768, r.OUT_MASK = zt | r.LONG_UNROLL, r.SinCosSeries = function(P, k, T, G) {
var A = G.length, N = A - (P ? 1 : 0), R = 2 * (T - k) * (T + k), F = N & 1 ? G[--A] : 0, H = 0;
for (N = Math.floor(N / 2); N--; )
H = R * F - H + G[--A], F = R * H - F + G[--A];
return P ? 2 * k * T * F : T * (F - H);
}, Wt = function(P, k) {
var T, G = l.sq(P), A = l.sq(k), N = (G + A - 1) / 6, R, F, H, K, it, j, tt, rt, z, X, ht;
return A === 0 && N <= 0 ? T = 0 : (R = G * A / 4, F = l.sq(N), H = N * F, K = R * (R + 2 * H), it = N, K >= 0 ? (j = R + H, j += j < 0 ? -Math.sqrt(K) : Math.sqrt(K), tt = l.cbrt(j), it += tt + (tt !== 0 ? F / tt : 0)) : (rt = Math.atan2(Math.sqrt(-K), -(R + H)), it += 2 * N * Math.cos(rt / 3)), z = Math.sqrt(l.sq(it) + A), X = it < 0 ? A / (z - it) : it + z, ht = (X - A) / (2 * z), T = X / (Math.sqrt(X + l.sq(ht)) + ht)), T;
}, Kt = [1, 4, 64, 0, 256], r.A1m1f = function(P) {
var k = Math.floor(_ / 2), T = l.polyval(k, Kt, 0, l.sq(P)) / Kt[k + 1];
return (T + P) / (1 - P);
}, gt = [-1, 6, -16, 32, -9, 64, -128, 2048, 9, -16, 768, 3, -5, 512, -7, 1280, -7, 2048], r.C1f = function(P, k) {
var T = l.sq(P), G = P, A = 0, N, R;
for (N = 1; N <= r.nC1_; ++N)
R = Math.floor((r.nC1_ - N) / 2), k[N] = G * l.polyval(R, gt, A, T) / gt[A + R + 1], A += R + 2, G *= P;
}, bt = [205, -432, 768, 1536, 4005, -4736, 3840, 12288, -225, 116, 384, -7173, 2695, 7680, 3467, 7680, 38081, 61440], r.C1pf = function(P, k) {
var T = l.sq(P), G = P, A = 0, N, R;
for (N = 1; N <= r.nC1p_; ++N)
R = Math.floor((r.nC1p_ - N) / 2), k[N] = G * l.polyval(R, bt, A, T) / bt[A + R + 1], A += R + 2, G *= P;
}, re = [-11, -28, -192, 0, 256], r.A2m1f = function(P) {
var k = Math.floor(v / 2), T = l.polyval(k, re, 0, l.sq(P)) / re[k + 1];
return (T - P) / (1 + P);
}, Dt = [1, 2, 16, 32, 35, 64, 384, 2048, 15, 80, 768, 7, 35, 512, 63, 1280, 77, 2048], r.C2f = function(P, k) {
var T = l.sq(P), G = P, A = 0, N, R;
for (N = 1; N <= r.nC2_; ++N)
R = Math.floor((r.nC2_ - N) / 2), k[N] = G * l.polyval(R, Dt, A, T) / Dt[A + R + 1], A += R + 2, G *= P;
}, r.Geodesic = function(P, k) {
if (this.a = P, this.f = k, this._f1 = 1 - this.f, this._e2 = this.f * (2 - this.f), this._ep2 = this._e2 / l.sq(this._f1), this._n = this.f / (2 - this.f), this._b = this.a * this._f1, this._c2 = (l.sq(this.a) + l.sq(this._b) * (this._e2 === 0 ? 1 : (this._e2 > 0 ? l.atanh(Math.sqrt(this._e2)) : Math.atan(Math.sqrt(-this._e2))) / Math.sqrt(Math.abs(this._e2)))) / 2, this._etol2 = 0.1 * $ / Math.sqrt(Math.max(1e-3, Math.abs(this.f)) * Math.min(1, 1 - this.f / 2) / 2), !(isFinite(this.a) && this.a > 0))
throw new Error("Equatorial radius is not positive");
if (!(isFinite(this._b) && this._b > 0))
throw new Error("Polar semi-axis is not positive");
this._A3x = new Array(g), this._C3x = new Array(M), this._C4x = new Array(E), this.A3coeff(), this.C3coeff(), this.C4coeff();
}, Me = [-3, 128, -2, -3, 64, -1, -3, -1, 16, 3, -1, -2, 8, 1, -1, 2, 1, 1], r.Geodesic.prototype.A3coeff = function() {
var P = 0, k = 0, T, G;
for (T = m - 1; T >= 0; --T)
G = Math.min(m - T - 1, T), this._A3x[k++] = l.polyval(G, Me, P, this._n) / Me[P + G + 1], P += G + 2;
}, Gt = [3, 128, 2, 5, 128, -1, 3, 3, 64, -1, 0, 1, 8, -1, 1, 4, 5, 256, 1, 3, 128, -3, -2, 3, 64, 1, -3, 2, 32, 7, 512, -10, 9, 384, 5, -9, 5, 192, 7, 512, -14, 7, 512, 21, 2560], r.Geodesic.prototype.C3coeff = function() {
var P = 0, k = 0, T, G, A;
for (T = 1; T < r.nC3_; ++T)
for (G = r.nC3_ - 1; G >= T; --G)
A = Math.min(r.nC3_ - G - 1, G), this._C3x[k++] = l.polyval(A, Gt, P, this._n) / Gt[P + A + 1], P += A + 2;
}, ae = [97, 15015, 1088, 156, 45045, -224, -4784, 1573, 45045, -10656, 14144, -4576, -858, 45045, 64, 624, -4576, 6864, -3003, 15015, 100, 208, 572, 3432, -12012, 30030, 45045, 1, 9009, -2944, 468, 135135, 5792, 1040, -1287, 135135, 5952, -11648, 9152, -2574, 135135, -64, -624, 4576, -6864, 3003, 135135, 8, 10725, 1856, -936, 225225, -8448, 4992, -1144, 225225, -1440, 4160, -4576, 1716, 225225, -136, 63063, 1024, -208, 105105, 3584, -3328, 1144, 315315, -128, 135135, -2560, 832, 405405, 128, 99099], r.Geodesic.prototype.C4coeff = function() {
var P = 0, k = 0, T, G, A;
for (T = 0; T < r.nC4_; ++T)
for (G = r.nC4_ - 1; G >= T; --G)
A = r.nC4_ - G - 1, this._C4x[k++] = l.polyval(A, ae, P, this._n) / ae[P + A + 1], P += A + 2;
}, r.Geodesic.prototype.A3f = function(P) {
return l.polyval(g - 1, this._A3x, 0, P);
}, r.Geodesic.prototype.C3f = function(P, k) {
var T = 1, G = 0, A, N;
for (A = 1; A < r.nC3_; ++A)
N = r.nC3_ - A - 1, T *= P, k[A] = T * l.polyval(N, this._C3x, G, P), G += N + 1;
}, r.Geodesic.prototype.C4f = function(P, k) {
var T = 1, G = 0, A, N;
for (A = 0; A < r.nC4_; ++A)
N = r.nC4_ - A - 1, k[A] = T * l.polyval(N, this._C4x, G, P), G += N + 1, T *= P;
}, r.Geodesic.prototype.Lengths = function(P, k, T, G, A, N, R, F, H, K, it, j, tt) {
it &= r.OUT_MASK;
var rt = {}, z = 0, X = 0, ht = 0, dt = 0, vt, _t, pt, At, Lt;
if (it & (r.DISTANCE | r.REDUCEDLENGTH | r.GEODESICSCALE) && (ht = r.A1m1f(P), r.C1f(P, j), it & (r.REDUCEDLENGTH | r.GEODESICSCALE) && (dt = r.A2m1f(P), r.C2f(P, tt), z = ht - dt, dt = 1 + dt), ht = 1 + ht), it & r.DISTANCE)
vt = r.SinCosSeries(!0, N, R, j) - r.SinCosSeries(!0, T, G, j), rt.s12b = ht * (k + vt), it & (r.REDUCEDLENGTH | r.GEODESICSCALE) && (_t = r.SinCosSeries(!0, N, R, tt) - r.SinCosSeries(!0, T, G, tt), X = z * k + (ht * vt - dt * _t));
else if (it & (r.REDUCEDLENGTH | r.GEODESICSCALE)) {
for (pt = 1; pt <= r.nC2_; ++pt)
tt[pt] = ht * j[pt] - dt * tt[pt];
X = z * k + (r.SinCosSeries(!0, N, R, tt) - r.SinCosSeries(!0, T, G, tt));
}
return it & r.REDUCEDLENGTH && (rt.m0 = z, rt.m12b = F * (G * N) - A * (T * R) - G * R * X), it & r.GEODESICSCALE && (At = G * R + T * N, Lt = this._ep2 * (H - K) * (H + K) / (A + F), rt.M12 = At + (Lt * N - R * X) * T / A, rt.M21 = At - (Lt * T - G * X) * N / F), rt;
}, r.Geodesic.prototype.InverseStart = function(P, k, T, G, A, N, R, F, H, K, it) {
var j = {}, tt = G * k - A * P, rt = A * k + G * P, z, X, ht, dt, vt, _t, pt, At, Lt, nt, Q, et, xt, It, oe, pe, ke, he, at, qt, Bt, $t, Ft;
return j.sig12 = -1, z = G * k, z += A * P, X = rt >= 0 && tt < 0.5 && A * R < 0.5, X ? (dt = l.sq(P + G), dt /= dt + l.sq(k + A), j.dnm = Math.sqrt(1 + this._ep2 * dt), ht = R / (this._f1 * j.dnm), vt = Math.sin(ht), _t = Math.cos(ht)) : (vt = F, _t = H), j.salp1 = A * vt, j.calp1 = _t >= 0 ? tt + A * P * l.sq(vt) / (1 + _t) : z - A * P * l.sq(vt) / (1 - _t), At = l.hypot(j.salp1, j.calp1), Lt = P * G + k * A * _t, X && At < this._etol2 ? (j.salp2 = k * vt, j.calp2 = tt - k * G * (_t >= 0 ? l.sq(vt) / (1 + _t) : 1 - _t), pt = l.hypot(j.salp2, j.calp2), j.salp2 /= pt, j.calp2 /= pt, j.sig12 = Math.atan2(At, Lt)) : Math.abs(this._n) > 0.1 || Lt >= 0 || At >= 6 * Math.abs(this._n) * Math.PI * l.sq(k) || (Ft = Math.atan2(-F, -H), this.f >= 0 ? (It = l.sq(P) * this._ep2, oe = It / (2 * (1 + Math.sqrt(1 + It)) + It), et = this.f * k * this.A3f(oe) * Math.PI, xt = et * k, nt = Ft / et, Q = z / xt) : (pe = A * k - G * P, ke = Math.atan2(z, pe), qt = this.Lengths(this._n, Math.PI + ke, P, -k, T, G, A, N, k, A, r.REDUCEDLENGTH, K, it), he = qt.m12b, at = qt.m0, nt = -1 + he / (k * A * at * Math.PI), xt = nt < -0.01 ? z / nt : -this.f * l.sq(k) * Math.PI, et = xt / k, Q = R / et), Q > -U && nt > -1 - mt ? this.f >= 0 ? (j.salp1 = Math.min(1, -nt), j.calp1 = -Math.sqrt(1 - l.sq(j.salp1))) : (j.calp1 = Math.max(nt > -U ? 0 : -1, nt), j.salp1 = Math.sqrt(1 - l.sq(j.calp1))) : (Bt = Wt(nt, Q), $t = et * (this.f >= 0 ? -nt * Bt / (1 + Bt) : -Q * (1 + Bt) / Bt), vt = Math.sin($t), _t = -Math.cos($t), j.salp1 = A * vt, j.calp1 = z - A * P * l.sq(vt) / (1 - _t))), j.salp1 <= 0 ? (j.salp1 = 1, j.calp1 = 0) : (pt = l.hypot(j.salp1, j.calp1), j.salp1 /= pt, j.calp1 /= pt), j;
}, r.Geodesic.prototype.Lambda12 = function(P, k, T, G, A, N, R, F, H, K, it, j, tt, rt) {
var z = {}, X, ht, dt, vt, _t, pt, At, Lt, nt, Q, et, xt, It;
return P === 0 && F === 0 && (F = -r.tiny_), ht = R * k, dt = l.hypot(F, R * P), z.ssig1 = P, vt = ht * P, z.csig1 = _t = F * k, X = l.hypot(z.ssig1, z.csig1), z.ssig1 /= X, z.csig1 /= X, z.salp2 = A !== k ? ht / A : R, z.calp2 = A !== k || Math.abs(G) !== -P ? Math.sqrt(l.sq(F * k) + (k < -P ? (A - k) * (k + A) : (P - G) * (P + G))) / A : Math.abs(F), z.ssig2 = G, pt = ht * G, z.csig2 = At = z.calp2 * A, X = l.hypot(z.ssig2, z.csig2), z.ssig2 /= X, z.csig2 /= X, z.sig12 = Math.atan2(Math.max(0, z.csig1 * z.ssig2 - z.ssig1 * z.csig2), z.csig1 * z.csig2 + z.ssig1 * z.ssig2), Lt = Math.max(0, _t * pt - vt * At), nt = _t * At + vt * pt, et = Math.atan2(Lt * K - nt * H, nt * K + Lt * H), xt = l.sq(dt) * this._ep2, z.eps = xt / (2 * (1 + Math.sqrt(1 + xt)) + xt), this.C3f(z.eps, rt), Q = r.SinCosSeries(!0, z.ssig2, z.csig2, rt) - r.SinCosSeries(!0, z.ssig1, z.csig1, rt), z.domg12 = -this.f * this.A3f(z.eps) * ht * (z.sig12 + Q), z.lam12 = et + z.domg12, it && (z.calp2 === 0 ? z.dlam12 = -2 * this._f1 * T / P : (It = this.Lengths(z.eps, z.sig12, z.ssig1, z.csig1, T, z.ssig2, z.csig2, N, k, A, r.REDUCEDLENGTH, j, tt), z.dlam12 = It.m12b, z.dlam12 *= this._f1 / (z.calp2 * A))), z;
}, r.Geodesic.prototype.Inverse = function(P, k, T, G, A) {
var N, R;
return A || (A = r.STANDARD), A === r.LONG_UNROLL && (A |= r.STANDARD), A &= r.OUT_MASK, N = this.InverseInt(P, k, T, G, A), R = N.vals, A & r.AZIMUTH && (R.azi1 = l.atan2d(N.salp1, N.calp1), R.azi2 = l.atan2d(N.salp2, N.calp2)), R;
}, r.Geodesic.prototype.InverseInt = function(P, k, T, G, A) {
var N = {}, R, F, H, K, it, j, tt, rt, z, X, ht, dt, vt, _t, pt, At, Lt, nt, Q, et, xt, It, oe, pe, ke, he, at, qt, Bt, $t, Ft, Je, _i, le, Ae, Xe, Re, ze, De, pi, $i, Be, Fi, mi, Hi, Qe, Wi, Un, ji, gi, Yt, W, Ki, Ye, Vi, Ji, Le, ti, ce, vi, Xi, yi, Mi, Qi, wi;
if (N.lat1 = P = l.LatFix(P), N.lat2 = T = l.LatFix(T), P = l.AngRound(P), T = l.AngRound(T), R = l.AngDiff(k, G), F = R.e, R = R.d, A & r.LONG_UNROLL ? (N.lon1 = k, N.lon2 = k + R + F) : (N.lon1 = l.AngNormalize(k), N.lon2 = l.AngNormalize(G)), H = l.copysign(1, R), R *= H, F *= H, pt = R * l.degree, K = l.sincosde(R, F), At = K.s, Lt = K.c, F = 180 - R - F, it = Math.abs(P) < Math.abs(T) || isNaN(T) ? -1 : 1, it < 0 && (H *= -1, [T, P] = [P, T]), j = l.copysign(1, -P), P *= j, T *= j, K = l.sincosd(P), tt = this._f1 * K.s, rt = K.c, K = l.hypot(tt, rt), tt /= K, rt /= K, rt = Math.max(r.tiny_, rt), K = l.sincosd(T), z = this._f1 * K.s, X = K.c, K = l.hypot(z, X), z /= K, X /= K, X = Math.max(r.tiny_, X), rt < -tt ? X === rt && (z = l.copysign(tt, z)) : Math.abs(z) === -tt && (X = rt), vt = Math.sqrt(1 + this._ep2 * l.sq(tt)), _t = Math.sqrt(1 + this._ep2 * l.sq(z)), oe = new Array(r.nC1_ + 1), pe = new Array(r.nC2_ + 1), ke = new Array(r.nC3_), he = P === -90 || At === 0, he && (Q = Lt, et = At, xt = 1, It = 0, qt = tt, Bt = Q * rt, $t = z, Ft = xt * X, nt = Math.atan2(Math.max(0, Bt * $t - qt * Ft), Bt * Ft + qt * $t), at = this.Lengths(this._n, nt, qt, Bt, vt, $t, Ft, _t, rt, X, A | r.DISTANCE | r.REDUCEDLENGTH, oe, pe), ht = at.s12b, dt = at.m12b, A & r.GEODESICSCALE && (N.M12 = at.M12, N.M21 = at.M21), nt < 1 || dt >= 0 ? ((nt < 3 * r.tiny_ || nt < D && (ht < 0 || dt < 0)) && (nt = dt = ht = 0), dt *= this._b, ht *= this._b, N.a12 = nt / l.degree) : he = !1), Le = 2, !he && tt === 0 && (this.f <= 0 || F >= this.f * 180))
Q = xt = 0, et = It = 1, ht = this.a * pt, nt = _i = pt / this._f1, dt = this._b * Math.sin(nt), A & r.GEODESICSCALE && (N.M12 = N.M21 = Math.cos(nt)), N.a12 = R / this._f1;
else if (!he)
if (at = this.InverseStart(tt, rt, vt, z, X, _t, pt, At, Lt, oe, pe), nt = at.sig12, et = at.salp1, Q = at.calp1, nt >= 0)
It = at.salp2, xt = at.calp2, le = at.dnm, ht = nt * this._b * le, dt = l.sq(le) * this._b * Math.sin(nt / le), A & r.GEODESICSCALE && (N.M12 = N.M21 = Math.cos(nt / le)), N.a12 = nt / l.degree, _i = pt / (this._f1 * le);
else {
for (Ae = 0, Xe = r.tiny_, Re = 1, ze = r.tiny_, De = -1, pi = !1, $i = !1; at = this.Lambda12(tt, rt, vt, z, X, _t, et, Q, At, Lt, Ae < x, oe, pe, ke), Be = at.lam12, It = at.salp2, xt = at.calp2, nt = at.sig12, qt = at.ssig1, Bt = at.csig1, $t = at.ssig2, Ft = at.csig2, Je = at.eps, ce = at.domg12, Fi = at.dlam12, !($i || !(Math.abs(Be) >= (pi ? 8 : 1) * D) || Ae == C); ++Ae) {
if (Be > 0 && (Ae < x || Q / et > De / ze) ? (ze = et, De = Q) : Be < 0 && (Ae < x || Q / et < Re / Xe) && (Xe = et, Re = Q), Ae < x && Fi > 0 && (mi = -Be / Fi, Math.abs(mi) < Math.PI && (Hi = Math.sin(mi), Qe = Math.cos(mi), Wi = et * Qe + Q * Hi, Wi > 0))) {
Q = Q * Qe - et * Hi, et = Wi, K = l.hypot(et, Q), et /= K, Q /= K, pi = Math.abs(Be) <= 16 * D;
continue;
}
et = (Xe + ze) / 2, Q = (Re + De) / 2, K = l.hypot(et, Q), et /= K, Q /= K, pi = !1, $i = Math.abs(Xe - et) + (Re - Q) < lt || Math.abs(et - ze) + (Q - De) < lt;
}
Un = A | (A & (r.REDUCEDLENGTH | r.GEODESICSCALE) ? r.DISTANCE : r.NONE), at = this.Lengths(Je, nt, qt, Bt, vt, $t, Ft, _t, rt, X, Un, oe, pe), ht = at.s12b, dt = at.m12b, A & r.GEODESICSCALE && (N.M12 = at.M12, N.M21 = at.M21), dt *= this._b, ht *= this._b, N.a12 = nt / l.degree, A & r.AREA && (Qi = Math.sin(ce), wi = Math.cos(ce), Le = At * wi - Lt * Qi, ti = Lt * wi + At * Qi);
}
return A & r.DISTANCE && (N.s12 = 0 + ht), A & r.REDUCEDLENGTH && (N.m12 = 0 + dt), A & r.AREA && (ji = et * rt, gi = l.hypot(Q, et * tt), gi !== 0 && ji !== 0 ? (qt = tt, Bt = Q * rt, $t = z, Ft = xt * X, W = l.sq(gi) * this._ep2, Je = W / (2 * (1 + Math.sqrt(1 + W)) + W), Ki = l.sq(this.a) * gi * ji * this._e2, K = l.hypot(qt, Bt), qt /= K, Bt /= K, K = l.hypot($t, Ft), $t /= K, Ft /= K, Ye = new Array(r.nC4_), this.C4f(Je, Ye), Vi = r.SinCosSeries(!1, qt, Bt, Ye), Ji = r.SinCosSeries(!1, $t, Ft, Ye), N.S12 = Ki * (Ji - Vi)) : N.S12 = 0, !he && Le == 2 && (Le = Math.sin(_i), ti = Math.cos(_i)), !he && ti > -0.7071 && z - tt < 1.75 ? (ce = 1 + ti, vi = 1 + rt, Xi = 1 + X, Yt = 2 * Math.atan2(Le * (tt * Xi + z * vi), ce * (tt * z + vi * Xi))) : (yi = It * Q - xt * et, Mi = xt * Q + It * et, yi === 0 && Mi < 0 && (yi = r.tiny_ * Q, Mi = -1), Yt = Math.atan2(yi, Mi)), N.S12 += this._c2 * Yt, N.S12 *= it * H * j, N.S12 += 0), it < 0 && ([It, et] = [et, It], [xt, Q] = [Q, xt], A & r.GEODESICSCALE && ([N.M21, N.M12] = [N.M12, N.M21])), et *= it * H, Q *= it * j, It *= it * H, xt *= it * j, { vals: N, salp1: et, calp1: Q, salp2: It, calp2: xt };
}, r.Geodesic.prototype.GenDirect = function(P, k, T, G, A, N) {
var R;
return N ? N === r.LONG_UNROLL && (N |= r.STANDARD) : N = r.STANDARD, G || (N |= r.DISTANCE_IN), R = new o.GeodesicLine(this, P, k, T, N), R.GenPosition(G, A, N);
}, r.Geodesic.prototype.Direct = function(P, k, T, G, A) {
return this.GenDirect(P, k, T, !1, G, A);
}, r.Geodesic.prototype.ArcDirect = function(P, k, T, G, A) {
return this.GenDirect(P, k, T, !0, G, A);
}, r.Geodesic.prototype.Line = function(P, k, T, G) {
return new o.GeodesicLine(this, P, k, T, G);
}, r.Geodesic.prototype.DirectLine = function(P, k, T, G, A) {
return this.GenDirectLine(P, k, T, !1, G, A);
}, r.Geodesic.prototype.ArcDirectLine = function(P, k, T, G, A) {
return this.GenDirectLine(P, k, T, !0, G, A);
}, r.Geodesic.prototype.GenDirectLine = function(P, k, T, G, A, N) {
var R;
return N || (N = r.STANDARD | r.DISTANCE_IN), G || (N |= r.DISTANCE_IN), R = new o.GeodesicLine(this, P, k, T, N), R.GenSetDistance(G, A), R;
}, r.Geodesic.prototype.InverseLine = function(P, k, T, G, A) {
var N, R, F;
return A || (A = r.STANDARD | r.DISTANCE_IN), N = this.InverseInt(P, k, T, G, r.ARC), F = l.atan2d(N.salp1, N.calp1), A & (r.OUT_MASK & r.DISTANCE_IN) && (A |= r.DISTANCE), R = new o.GeodesicLine(this, P, k, F, A, N.salp1, N.calp1), R.SetArc(N.vals.a12), R;
}, r.Geodesic.prototype.Polygon = function(P) {
return new h.PolygonArea(this, P);
}, r.WGS84 = new r.Geodesic(u.WGS84.a, u.WGS84.f);
}(s.Geodesic, s.GeodesicLine, s.PolygonArea, s.Math, s.Constants), function(r, o, h) {
o.GeodesicLine = function(l, u, f, _, v, m, g) {
var M, E, x, C, D, U;
v || (v = r.STANDARD | r.DISTANCE_IN), this.a = l.a, this.f = l.f, this._b = l._b, this._c2 = l._c2, this._f1 = l._f1, this.caps = v | r.LATITUDE | r.AZIMUTH | r.LONG_UNROLL, this.lat1 = h.LatFix(u), this.lon1 = f, typeof m > "u" || typeof g > "u" ? (this.azi1 = h.AngNormalize(_), M = h.sincosd(h.AngRound(this.azi1)), this.salp1 = M.s, this.calp1 = M.c) : (this.azi1 = _, this.salp1 = m, this.calp1 = g), M = h.sincosd(h.AngRound(this.lat1)), x = this._f1 * M.s, E = M.c, M = h.hypot(x, E), x /= M, E /= M, E = Math.max(r.tiny_, E), this._dn1 = Math.sqrt(1 + l._ep2 * h.sq(x)), this._salp0 = this.salp1 * E, this._calp0 = h.hypot(this.calp1, this.salp1 * x), this._ssig1 = x, this._somg1 = this._salp0 * x, this._csig1 = this._comg1 = x !== 0 || this.calp1 !== 0 ? E * this.calp1 : 1, M = h.hypot(this._ssig1, this._csig1), this._ssig1 /= M, this._csig1 /= M, this._k2 = h.sq(this._calp0) * l._ep2, C = this._k2 / (2 * (1 + Math.sqrt(1 + this._k2)) + this._k2), this.caps & r.CAP_C1 && (this._A1m1 = r.A1m1f(C), this._C1a = new Array(r.nC1_ + 1), r.C1f(C, this._C1a), this._B11 = r.SinCosSeries(!0, this._ssig1, this._csig1, this._C1a), D = Math.sin(this._B11), U = Math.cos(this._B11), this._stau1 = this._ssig1 * U + this._csig1 * D, this._ctau1 = this._csig1 * U - this._ssig1 * D), this.caps & r.CAP_C1p && (this._C1pa = new Array(r.nC1p_ + 1), r.C1pf(C, this._C1pa)), this.caps & r.CAP_C2 && (this._A2m1 = r.A2m1f(C), this._C2a = new Array(r.nC2_ + 1), r.C2f(C, this._C2a), this._B21 = r.SinCosSeries(!0, this._ssig1, this._csig1, this._C2a)), this.caps & r.CAP_C3 && (this._C3a = new Array(r.nC3_), l.C3f(C, this._C3a), this._A3c = -this.f * this._salp0 * l.A3f(C), this._B31 = r.SinCosSeries(!0, this._ssig1, this._csig1, this._C3a)), this.caps & r.CAP_C4 && (this._C4a = new Array(r.nC4_), l.C4f(C, this._C4a), this._A4 = h.sq(this.a) * this._calp0 * this._salp0 * l._e2, this._B41 = r.SinCosSeries(!1, this._ssig1, this._csig1, this._C4a)), this.a13 = this.s13 = NaN;
}, o.GeodesicLine.prototype.GenPosition = function(l, u, f) {
var _ = {}, v, m, g, M, E, x, C, D, U, $, lt, mt, Mt, Rt, zt, Wt, Kt, gt, bt, re, Dt, Me, Gt, ae, P, k, T, G, A;
return f ? f === r.LONG_UNROLL && (f |= r.STANDARD) : f = r.STANDARD, f &= this.caps & r.OUT_MASK, _.lat1 = this.lat1, _.azi1 = this.azi1, _.lon1 = f & r.LONG_UNROLL ? this.lon1 : h.AngNormalize(this.lon1), l ? _.a12 = u : _.s12 = u, l || this.caps & r.DISTANCE_IN & r.OUT_MASK ? (M = 0, E = 0, l ? (v = u * h.degree, k = h.sincosd(u), m = k.s, g = k.c) : (D = u / (this._b * (1 + this._A1m1)), U = Math.sin(D), $ = Math.cos(D), M = -r.SinCosSeries(!0, this._stau1 * $ + this._ctau1 * U, this._ctau1 * $ - this._stau1 * U, this._C1pa), v = D - (M - this._B11), m = Math.sin(v), g = Math.cos(v), Math.abs(this.f) > 0.01 && (x = this._ssig1 * g + this._csig1 * m, C = this._csig1 * g - this._ssig1 * m, M = r.SinCosSeries(!0, x, C, this._C1a), lt = (1 + this._A1m1) * (v + (M - this._B11)) - u / this._b, v = v - lt / Math.sqrt(1 + this._k2 * h.sq(x)), m = Math.sin(v), g = Math.cos(v))), x = this._ssig1 * g + this._csig1 * m, C = this._csig1 * g - this._ssig1 * m, Me = Math.sqrt(1 + this._k2 * h.sq(x)), f & (r.DISTANCE | r.REDUCEDLENGTH | r.GEODESICSCALE) && ((l || Math.abs(this.f) > 0.01) && (M = r.SinCosSeries(!0, x, C, this._C1a)), E = (1 + this._A1m1) * (M - this._B11)), Wt = this._calp0 * x, Kt = h.hypot(this._salp0, this._calp0 * C), Kt === 0 && (Kt = C = r.tiny_), re = this._salp0, Dt = this._calp0 * C, l && f & r.DISTANCE && (_.s12 = this._b * ((1 + this._A1m1) * v + E)), f & r.LONGITUDE && (gt = this._salp0 * x, bt = C, zt = h.copysign(1, this._salp0), mt = f & r.LONG_UNROLL ? zt * (v - (Math.atan2(x, C) - Math.atan2(this._ssig1, this._csig1)) + (Math.atan2(zt * gt, bt) - Math.atan2(zt * this._somg1, this._comg1))) : Math.atan2(gt * this._comg1 - bt * this._somg1, bt * this._comg1 + gt * this._somg1), Mt = mt + this._A3c * (v + (r.SinCosSeries(!0, x, C, this._C3a) - this._B31)), Rt = Mt / h.degree, _.lon2 = f & r.LONG_UNROLL ? this.lon1 + Rt : h.AngNormalize(h.AngNormalize(this.lon1) + h.AngNormalize(Rt))), f & r.LATITUDE && (_.lat2 = h.atan2d(Wt, this._f1 * Kt)), f & r.AZIMUTH && (_.azi2 = h.atan2d(re, Dt)), f & (r.REDUCEDLENGTH | r.GEODESICSCALE) && (Gt = r.SinCosSeries(!0, x, C, this._C2a), ae = (1 + this._A2m1) * (Gt - this._B21), P = (this._A1m1 - this._A2m1) * v + (E - ae), f & r.REDUCEDLENGTH && (_.m12 = this._b * (Me * (this._csig1 * x) - this._dn1 * (this._ssig1 * C) - this._csig1 * C * P)), f & r.GEODESICSCALE && (k = this._k2 * (x - this._ssig1) * (x + this._ssig1) / (this._dn1 + Me), _.M12 = g + (k * x - C * P) * this._ssig1 / this._dn1, _.M21 = g - (k * this._ssig1 - this._csig1 * P) * x / Me)), f & r.AREA && (T = r.SinCosSeries(!1, x, C, this._C4a), this._calp0 === 0 || this._salp0 === 0 ? (G = re * this.calp1 - Dt * this.salp1, A = Dt * this.calp1 + re * this.salp1) : (G = this._calp0 * this._salp0 * (g <= 0 ? this._csig1 * (1 - g) + m * this._ssig1 : m * (this._csig1 * m / (1 + g) + this._ssig1)), A = h.sq(this._salp0) + h.sq(this._calp0) * this._csig1 * C), _.S12 = this._c2 * Math.atan2(G, A) + this._A4 * (T - this._B41)), l || (_.a12 = v / h.degree), _) : (_.a12 = NaN, _);
}, o.GeodesicLine.prototype.Position = function(l, u) {
return this.GenPosition(!1, l, u);
}, o.GeodesicLine.prototype.ArcPosition = function(l, u) {
return this.GenPosition(!0, l, u);
}, o.GeodesicLine.prototype.GenSetDistance = function(l, u) {
l ? this.SetArc(u) : this.SetDistance(u);
}, o.GeodesicLine.prototype.SetDistance = function(l) {
var u;
this.s13 = l, u = this.GenPosition(!1, this.s13, r.ARC), this.a13 = 0 + u.a12;
}, o.GeodesicLine.prototype.SetArc = function(l) {
var u;
this.a13 = l, u = this.GenPosition(!0, this.a13, r.DISTANCE), this.s13 = 0 + u.s12;
};
}(s.Geodesic, s.GeodesicLine, s.Math), function(r, o, h, l) {
var u, f, _, v;
u = function(m, g) {
var M = h.AngDiff(m, g).d;
return m = h.AngNormalize(m), g = h.AngNormalize(g), M > 0 && (m < 0 && g >= 0 || m > 0 && g === 0) ? 1 : M < 0 && m >= 0 && g < 0 ? -1 : 0;
}, f = function(m, g) {
return m = m % 720, g = g % 720, (0 <= g && g < 360 || g < -360 ? 0 : 1) - (0 <= m && m < 360 || m < -360 ? 0 : 1);
}, _ = function(m, g, M, E, x) {
return m.Remainder(g), M & 1 && m.Add((m.Sum() < 0 ? 1 : -1) * g / 2), E || m.Negate(), x ? m.Sum() > g / 2 ? m.Add(-g) : m.Sum() <= -g / 2 && m.Add(+g) : m.Sum() >= g ? m.Add(-g) : m.Sum() < 0 && m.Add(+g), 0 + m.Sum();
}, v = function(m, g, M, E, x) {
return m = h.remainder(m, g), M & 1 && (m += (m < 0 ? 1 : -1) * g / 2), E || (m *= -1), x ? m > g / 2 ? m -= g : m <= -g / 2 && (m += g) : m >= g ? m -= g : m < 0 && (m += g), 0 + m;
}, r.PolygonArea = function(m, g) {
this._geod = m, this.a = this._geod.a, this.f = this._geod.f, this._area0 = 4 * Math.PI * m._c2, this.polyline = g || !1, this._mask = o.LATITUDE | o.LONGITUDE | o.DISTANCE | (this.polyline ? o.NONE : o.AREA | o.LONG_UNROLL), this.polyline || (this._areasum = new l.Accumulator(0)), this._perimetersum = new l.Accumulator(0), this.Clear();
}, r.PolygonArea.prototype.Clear = function() {
this.num = 0, this._crossings = 0, this.polyline || this._areasum.Set(0), this._perimetersum.Set(0), this._lat0 = this._lon0 = this.lat = this.lon = NaN;
}, r.PolygonArea.prototype.AddPoint = function(m, g) {
var M;
this.num === 0 ? (this._lat0 = this.lat = m, this._lon0 = this.lon = g) : (M = this._geod.Inverse(this.lat, this.lon, m, g, this._mask), this._perimetersum.Add(M.s12), this.polyline || (this._areasum.Add(M.S12), this._crossings += u(this.lon, g)), this.lat = m, this.lon = g), ++this.num;
}, r.PolygonArea.prototype.AddEdge = function(m, g) {
var M;
this.num && (M = this._geod.Direct(this.lat, this.lon, m, g, this._mask), this._perimetersum.Add(g), this.polyline || (this._areasum.Add(M.S12), this._crossings += f(this.lon, M.lon2)), this.lat = M.lat2, this.lon = M.lon2), ++this.num;
}, r.PolygonArea.prototype.Compute = function(m, g) {
var M = { number: this.num }, E, x;
return this.num < 2 ? (M.perimeter = 0, this.polyline || (M.area = 0), M) : this.polyline ? (M.perimeter = this._perimetersum.Sum(), M) : (E = this._geod.Inverse(this.lat, this.lon, this._lat0, this._lon0, this._mask), M.perimeter = this._perimetersum.Sum(E.s12), x = new l.Accumulator(this._areasum), x.Add(E.S12), M.area = _(x, this._area0, this._crossings + u(this.lon, this._lon0), m, g), M);
}, r.PolygonArea.prototype.TestPoint = function(m, g, M, E) {
var x = { number: this.num + 1 }, C, D, U, $;
if (this.num === 0)
return x.perimeter = 0, this.polyline || (x.area = 0), x;
for (x.perimeter = this._perimetersum.Sum(), D = this.polyline ? 0 : this._areasum.Sum(), U = this._crossings, $ = 0; $ < (this.polyline ? 1 : 2); ++$)
C = this._geod.Inverse($ === 0 ? this.lat : m, $ === 0 ? this.lon : g, $ !== 0 ? this._lat0 : m, $ !== 0 ? this._lon0 : g, this._mask), x.perimeter += C.s12, this.polyline || (D += C.S12, U += u($ === 0 ? this.lon : g, $ !== 0 ? this._lon0 : g));
return this.polyline || (x.area = v(D, this._area0, U, M, E)), x;
}, r.PolygonArea.prototype.TestEdge = function(m, g, M, E) {
var x = { number: this.num ? this.num + 1 : 0 }, C, D, U;
return this.num === 0 || (x.perimeter = this._perimetersum.Sum() + g, this.polyline) || (D = this._areasum.Sum(), U = this._crossings, C = this._geod.Direct(this.lat, this.lon, m, g, this._mask), D += C.S12, U += f(this.lon, C.lon2), U += u(C.lon2, this._lon0), C = this._geod.Inverse(C.lat2, C.lon2, this._lat0, this._lon0, this._mask), x.perimeter += C.s12, D += C.S12, x.area = v(D, this._area0, U, M, E)), x;
};
}(s.PolygonArea, s.Geodesic, s.Math, s.Accumulator), i(s);
})(function(i) {
e.exports ? e.exports = i : window.geodesic = i;
});
})(zo);
var Wd = zo.exports;
function jd() {
this.sin_p12 = Math.sin(this.lat0), this.cos_p12 = Math.cos(this.lat0), this.g = new Wd.Geodesic.Geodesic(this.a, this.es / (1 + Math.sqrt(1 - this.es)));
}
function Kd(e) {
var i = e.x, s = e.y, r = Math.sin(e.y), o = Math.cos(e.y), h = Z(i - this.long0), l, u, f, _, v, m, g, M, E, x, C, D, U, $, lt;
return this.sphere ? Math.abs(this.sin_p12 - 1) <= B ? (e.x = this.x0 + this.a * (O - s) * Math.sin(h), e.y = this.y0 - this.a * (O - s) * Math.cos(h), e) : Math.abs(this.sin_p12 + 1) <= B ? (e.x = this.x0 + this.a * (O + s) * Math.sin(h), e.y = this.y0 + this.a * (O + s) * Math.cos(h), e) : (E = this.sin_p12 * r + this.cos_p12 * o * Math.cos(h), g = Math.acos(E), M = g ? g / Math.sin(g) : 1, e.x = this.x0 + this.a * M * o * Math.sin(h), e.y = this.y0 + this.a * M * (this.cos_p12 * r - this.sin_p12 * o * Math.cos(h)), e) : (l = kn(this.es), u = Rn(this.es), f = zn(this.es), _ = Dn(this.es), Math.abs(this.sin_p12 - 1) <= B ? (v = this.a * Xt(l, u, f, _, O), m = this.a * Xt(l, u, f, _, s), e.x = this.x0 + (v - m) * Math.sin(h), e.y = this.y0 - (v - m) * Math.cos(h), e) : Math.abs(this.sin_p12 + 1) <= B ? (v = this.a * Xt(l, u, f, _, O), m = this.a * Xt(l, u, f, _, s), e.x = this.x0 + (v + m) * Math.sin(h), e.y = this.y0 + (v + m) * Math.cos(h), e) : Math.abs(i) < B && Math.abs(s - this.lat0) < B ? (e.x = e.y = 0, e) : (x = this.lat0 / yt, C = this.long0 / yt, D = s / yt, U = i / yt, $ = this.g.Inverse(x, C, D, U, this.g.AZIMUTH), lt = $.azi1 * yt, e.x = $.s12 * Math.sin(lt), e.y = $.s12 * Math.cos(lt), e));
}
function Vd(e) {
e.x -= this.x0, e.y -= this.y0;
var i, s, r, o, h, l, u, f, _, v, m, g, M, E, x, C, D, U;
return this.sphere ? (i = Math.sqrt(e.x * e.x + e.y * e.y), i > 2 * O * this.a ? void 0 : (s = i / this.a, r = Math.sin(s), o = Math.cos(s), h = this.long0, Math.abs(i) <= B ? l = this.lat0 : (l = je(o * this.sin_p12 + e.y * r * this.cos_p12 / i), u = Math.abs(this.lat0) - O, Math.abs(u) <= B ? this.lat0 >= 0 ? h = Z(this.long0 + Math.atan2(e.x, -e.y)) : h = Z(this.long0 - Math.atan2(-e.x, e.y)) : h = Z(this.long0 + Math.atan2(e.x * r, i * this.cos_p12 * o - e.y * this.sin_p12 * r))), e.x = h, e.y = l, e)) : (f = kn(this.es), _ = Rn(this.es), v = zn(this.es), m = Dn(this.es), Math.abs(this.sin_p12 - 1) <= B ? (g = this.a * Xt(f, _, v, m, O), i = Math.sqrt(e.x * e.x + e.y * e.y), M = g - i, l = gs(M / this.a, f, _, v, m), h = Z(this.long0 + Math.atan2(e.x, -1 * e.y)), e.x = h, e.y = l, e) : Math.abs(this.sin_p12 + 1) <= B ? (g = this.a * Xt(f, _, v, m, O), i = Math.sqrt(e.x * e.x + e.y * e.y), M = i - g, l = gs(M / this.a, f, _, v, m), h = Z(this.long0 + Math.atan2(e.x, e.y)), e.x = h, e.y = l, e) : (E = this.lat0 / yt, x = this.long0 / yt, C = Math.atan2(e.x, e.y) / yt, D = Math.sqrt(e.x * e.x + e.y * e.y), U = this.g.Direct(E, x, C, D, this.g.STANDARD), e.x = U.lon2 * yt, e.y = U.lat2 * yt, e));
}
var Jd = ["Azimuthal_Equidistant", "aeqd"];
const Xd = {
init: jd,
forward: Kd,
inverse: Vd,
names: Jd
};
function Qd() {
this.sin_p14 = Math.sin(this.lat0), this.cos_p14 = Math.cos(this.lat0);
}
function Yd(e) {
var i, s, r, o, h, l, u, f, _ = e.x, v = e.y;
return r = Z(_ - this.long0), i = Math.sin(v), s = Math.cos(v), o = Math.cos(r), l = this.sin_p14 * i + this.cos_p14 * s * o, h = 1, (l > 0 || Math.abs(l) <= B) && (u = this.a * h * s * Math.sin(r), f = this.y0 + this.a * h * (this.cos_p14 * i - this.sin_p14 * s * o)), e.x = u, e.y = f, e;
}
function t0(e) {
var i, s, r, o, h, l, u;
return e.x -= this.x0, e.y -= this.y0, i = Math.sqrt(e.x * e.x + e.y * e.y), s = je(i / this.a), r = Math.sin(s), o = Math.cos(s), l = this.long0, Math.abs(i) <= B ? (u = this.lat0, e.x = l, e.y = u, e) : (u = je(o * this.sin_p14 + e.y * r * this.cos_p14 / i), h = Math.abs(this.lat0) - O, Math.abs(h) <= B ? (this.lat0 >= 0 ? l = Z(this.long0 + Math.atan2(e.x, -e.y)) : l = Z(this.long0 - Math.atan2(-e.x, e.y)), e.x = l, e.y = u, e) : (l = Z(this.long0 + Math.atan2(e.x * r, i * this.cos_p14 * o - e.y * this.sin_p14 * r)), e.x = l, e.y = u, e));
}
var e0 = ["ortho"];
const i0 = {
init: Qd,
forward: Yd,
inverse: t0,
names: e0
};
var Pt = {
FRONT: 1,
RIGHT: 2,
BACK: 3,
LEFT: 4,
TOP: 5,
BOTTOM: 6
}, ft = {
AREA_0: 1,
AREA_1: 2,
AREA_2: 3,
AREA_3: 4
};
function n0() {
this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Quadrilateralized Spherical Cube", this.lat0 >= O - ut / 2 ? this.face = Pt.TOP : this.lat0 <= -(O - ut / 2) ? this.face = Pt.BOTTOM : Math.abs(this.long0) <= ut ? this.face = Pt.FRONT : Math.abs(this.long0) <= O + ut ? this.face = this.long0 > 0 ? Pt.RIGHT : Pt.LEFT : this.face = Pt.BACK, this.es !== 0 && (this.one_minus_f = 1 - (this.a - this.b) / this.a, this.one_minus_f_squared = this.one_minus_f * this.one_minus_f);
}
function s0(e) {
var i = { x: 0, y: 0 }, s, r, o, h, l, u, f = { value: 0 };
if (e.x -= this.long0, this.es !== 0 ? s = Math.atan(this.one_minus_f_squared * Math.tan(e.y)) : s = e.y, r = e.x, this.face === Pt.TOP)
h = O - s, r >= ut && r <= O + ut ? (f.value = ft.AREA_0, o = r - O) : r > O + ut || r <= -(O + ut) ? (f.value = ft.AREA_1, o = r > 0 ? r - Tt : r + Tt) : r > -(O + ut) && r <= -ut ? (f.value = ft.AREA_2, o = r + O) : (f.value = ft.AREA_3, o = r);
else if (this.face === Pt.BOTTOM)
h = O + s, r >= ut && r <= O + ut ? (f.value = ft.AREA_0, o = -r + O) : r < ut && r >= -ut ? (f.value = ft.AREA_1, o = -r) : r < -ut && r >= -(O + ut) ? (f.value = ft.AREA_2, o = -r - O) : (f.value = ft.AREA_3, o = r > 0 ? -r + Tt : -r - Tt);
else {
var _, v, m, g, M, E, x;
this.face === Pt.RIGHT ? r = zi(r, +O) : this.face === Pt.BACK ? r = zi(r, +Tt) : this.face === Pt.LEFT && (r = zi(r, -O)), g = Math.sin(s), M = Math.cos(s), E = Math.sin(r), x = Math.cos(r), _ = M * x, v = M * E, m = g, this.face === Pt.FRONT ? (h = Math.acos(_), o = as(h, m, v, f)) : this.face === Pt.RIGHT ? (h = Math.acos(v), o = as(h, m, -_, f)) : this.face === Pt.BACK ? (h = Math.acos(-_), o = as(h, m, -v, f)) : this.face === Pt.LEFT ? (h = Math.acos(-v), o = as(h, m, _, f)) : (h = o = 0, f.value = ft.AREA_0);
}
return u = Math.atan(12 / Tt * (o + Math.acos(Math.sin(o) * Math.cos(ut)) - O)), l = Math.sqrt((1 - Math.cos(h)) / (Math.cos(u) * Math.cos(u)) / (1 - Math.cos(Math.atan(1 / Math.cos(o))))), f.value === ft.AREA_1 ? u += O : f.value === ft.AREA_2 ? u += Tt : f.value === ft.AREA_3 && (u += 1.5 * Tt), i.x = l * Math.cos(u), i.y = l * Math.sin(u), i.x = i.x * this.a + this.x0, i.y = i.y * this.a + this.y0, e.x = i.x, e.y = i.y, e;
}
function r0(e) {
var i = { lam: 0, phi: 0 }, s, r, o, h, l, u, f, _, v, m = { value: 0 };
if (e.x = (e.x - this.x0) / this.a, e.y = (e.y - this.y0) / this.a, r = Math.atan(Math.sqrt(e.x * e.x + e.y * e.y)), s = Math.atan2(e.y, e.x), e.x >= 0 && e.x >= Math.abs(e.y) ? m.value = ft.AREA_0 : e.y >= 0 && e.y >= Math.abs(e.x) ? (m.value = ft.AREA_1, s -= O) : e.x < 0 && -e.x >= Math.abs(e.y) ? (m.value = ft.AREA_2, s = s < 0 ? s + Tt : s - Tt) : (m.value = ft.AREA_3, s += O), v = Tt / 12 * Math.tan(s), l = Math.sin(v) / (Math.cos(v) - 1 / Math.sqrt(2)), u = Math.atan(l), o = Math.cos(s), h = Math.tan(r), f = 1 - o * o * h * h * (1 - Math.cos(Math.atan(1 / Math.cos(u)))), f < -1 ? f = -1 : f > 1 && (f = 1), this.face === Pt.TOP)
_ = Math.acos(f), i.phi = O - _, m.value === ft.AREA_0 ? i.lam = u + O : m.value === ft.AREA_1 ? i.lam = u < 0 ? u + Tt : u - Tt : m.value === ft.AREA_2 ? i.lam = u - O : i.lam = u;
else if (this.face === Pt.BOTTOM)
_ = Math.acos(f), i.phi = _ - O, m.value === ft.AREA_0 ? i.lam = -u + O : m.value === ft.AREA_1 ? i.lam = -u : m.value === ft.AREA_2 ? i.lam = -u - O : i.lam = u < 0 ? -u - Tt : -u + Tt;
else {
var g, M, E;
g = f, v = g * g, v >= 1 ? E = 0 : E = Math.sqrt(1 - v) * Math.sin(u), v += E * E, v >= 1 ? M = 0 : M = Math.sqrt(1 - v), m.value === ft.AREA_1 ? (v = M, M = -E, E = v) : m.value === ft.AREA_2 ? (M = -M, E = -E) : m.value === ft.AREA_3 && (v = M, M = E, E = -v), this.face === Pt.RIGHT ? (v = g, g = -M, M = v) : this.face === Pt.BACK ? (g = -g, M = -M) : this.face === Pt.LEFT && (v = g, g = M, M = -v), i.phi = Math.acos(-E) - O, i.lam = Math.atan2(M, g), this.face === Pt.RIGHT ? i.lam = zi(i.lam, -O) : this.face === Pt.BACK ? i.lam = zi(i.lam, -Tt) : this.face === Pt.LEFT && (i.lam = zi(i.lam, +O));
}
if (this.es !== 0) {
var x, C, D;
x = i.phi < 0 ? 1 : 0, C = Math.tan(i.phi), D = this.b / Math.sqrt(C * C + this.one_minus_f_squared), i.phi = Math.atan(Math.sqrt(this.a * this.a - D * D) / (this.one_minus_f * D)), x && (i.phi = -i.phi);
}
return i.lam += this.long0, e.x = i.lam, e.y = i.phi, e;
}
function as(e, i, s, r) {
var o;
return e < B ? (r.value = ft.AREA_0, o = 0) : (o = Math.atan2(i, s), Math.abs(o) <= ut ? r.value = ft.AREA_0 : o > ut && o <= O + ut ? (r.value = ft.AREA_1, o -= O) : o > O + ut || o <= -(O + ut) ? (r.value = ft.AREA_2, o = o >= 0 ? o - Tt : o + Tt) : (r.value = ft.AREA_3, o += O)), o;
}
function zi(e, i) {
var s = e + i;
return s < -Tt ? s += Ln : s > +Tt && (s -= Ln), s;
}
var a0 = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"];
const o0 = {
init: n0,
forward: s0,
inverse: r0,
names: a0
};
var or = [
[1, 22199e-21, -715515e-10, 31103e-10],
[0.9986, -482243e-9, -24897e-9, -13309e-10],
[0.9954, -83103e-8, -448605e-10, -986701e-12],
[0.99, -135364e-8, -59661e-9, 36777e-10],
[0.9822, -167442e-8, -449547e-11, -572411e-11],
[0.973, -214868e-8, -903571e-10, 18736e-12],
[0.96, -305085e-8, -900761e-10, 164917e-11],
[0.9427, -382792e-8, -653386e-10, -26154e-10],
[0.9216, -467746e-8, -10457e-8, 481243e-11],
[0.8962, -536223e-8, -323831e-10, -543432e-11],
[0.8679, -609363e-8, -113898e-9, 332484e-11],
[0.835, -698325e-8, -640253e-10, 934959e-12],
[0.7986, -755338e-8, -500009e-10, 935324e-12],
[0.7597, -798324e-8, -35971e-9, -227626e-11],
[0.7186, -851367e-8, -701149e-10, -86303e-10],
[0.6732, -986209e-8, -199569e-9, 191974e-10],
[0.6213, -0.010418, 883923e-10, 624051e-11],
[0.5722, -906601e-8, 182e-6, 624051e-11],
[0.5322, -677797e-8, 275608e-9, 624051e-11]
], mn = [
[-520417e-23, 0.0124, 121431e-23, -845284e-16],
[0.062, 0.0124, -126793e-14, 422642e-15],
[0.124, 0.0124, 507171e-14, -160604e-14],
[0.186, 0.0123999, -190189e-13, 600152e-14],
[0.248, 0.0124002, 710039e-13, -224e-10],
[0.31, 0.0123992, -264997e-12, 835986e-13],
[0.372, 0.0124029, 988983e-12, -311994e-12],
[0.434, 0.0123893, -369093e-11, -435621e-12],
[0.4958, 0.0123198, -102252e-10, -345523e-12],
[0.5571, 0.0121916, -154081e-10, -582288e-12],
[0.6176, 0.0119938, -241424e-10, -525327e-12],
[0.6769, 0.011713, -320223e-10, -516405e-12],
[0.7346, 0.0113541, -397684e-10, -609052e-12],
[0.7903, 0.0109107, -489042e-10, -104739e-11],
[0.8435, 0.0103431, -64615e-9, -140374e-14],
[0.8936, 969686e-8, -64636e-9, -8547e-9],
[0.9394, 840947e-8, -192841e-9, -42106e-10],
[0.9761, 616527e-8, -256e-6, -42106e-10],
[1, 328947e-8, -319159e-9, -42106e-10]
], Do = 0.8487, Bo = 1.3523, Uo = Ee / 5, h0 = 1 / Uo, ki = 18, vs = function(e, i) {
return e[0] + i * (e[1] + i * (e[2] + i * e[3]));
}, l0 = function(e, i) {
return e[1] + i * (2 * e[2] + i * 3 * e[3]);
};
function c0(e, i, s, r) {
for (var o = i; r; --r) {
var h = e(o);
if (o -= h, Math.abs(h) < s)
break;
}
return o;
}
function u0() {
this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.long0 = this.long0 || 0, this.es = 0, this.title = this.title || "Robinson";
}
function f0(e) {
var i = Z(e.x - this.long0), s = Math.abs(e.y), r = Math.floor(s * Uo);
r < 0 ? r = 0 : r >= ki && (r = ki - 1), s = Ee * (s - h0 * r);
var o = {
x: vs(or[r], s) * i,
y: vs(mn[r], s)
};
return e.y < 0 && (o.y = -o.y), o.x = o.x * this.a * Do + this.x0, o.y = o.y * this.a * Bo + this.y0, o;
}
function d0(e) {
var i = {
x: (e.x - this.x0) / (this.a * Do),
y: Math.abs(e.y - this.y0) / (this.a * Bo)
};
if (i.y >= 1)
i.x /= or[ki][0], i.y = e.y < 0 ? -O : O;
else {
var s = Math.floor(i.y * ki);
for (s < 0 ? s = 0 : s >= ki && (s = ki - 1); ; )
if (mn[s][0] > i.y)
--s;
else if (mn[s + 1][0] <= i.y)
++s;
else
break;
var r = mn[s], o = 5 * (i.y - r[0]) / (mn[s + 1][0] - r[0]);
o = c0(function(h) {
return (vs(r, h) - i.y) / l0(r, h);
}, o, B, 100), i.x /= vs(or[s], o), i.y = (5 * s + o) * yt, e.y < 0 && (i.y = -i.y);
}
return i.x = Z(i.x + this.long0), i;
}
var _0 = ["Robinson", "robin"];
const p0 = {
init: u0,
forward: f0,
inverse: d0,
names: _0
};
function m0() {
this.name = "geocent";
}
function g0(e) {
var i = So(e, this.es, this.a);
return i;
}
function v0(e) {
var i = Ao(e, this.es, this.a, this.b);
return i;
}
var y0 = ["Geocentric", "geocentric", "geocent", "Geocent"];
const M0 = {
init: m0,
forward: g0,
inverse: v0,
names: y0
};
var jt = {
N_POLE: 0,
S_POLE: 1,
EQUIT: 2,
OBLIQ: 3
}, dn = {
h: { def: 1e5, num: !0 },
// default is Karman line, no default in PROJ.7
azi: { def: 0, num: !0, degrees: !0 },
// default is North
tilt: { def: 0, num: !0, degrees: !0 },
// default is Nadir
long0: { def: 0, num: !0 },
// default is Greenwich, conversion to rad is automatic
lat0: { def: 0, num: !0 }
// default is Equator, conversion to rad is automatic
};
function w0() {
if (Object.keys(dn).forEach((function(s) {
if (typeof this[s] > "u")
this[s] = dn[s].def;
else {
if (dn[s].num && isNaN(this[s]))
throw new Error("Invalid parameter value, must be numeric " + s + " = " + this[s]);
dn[s].num && (this[s] = parseFloat(this[s]));
}
dn[s].degrees && (this[s] = this[s] * yt);
}).bind(this)), Math.abs(Math.abs(this.lat0) - O) < B ? this.mode = this.lat0 < 0 ? jt.S_POLE : jt.N_POLE : Math.abs(this.lat0) < B ? this.mode = jt.EQUIT : (this.mode = jt.OBLIQ, this.sinph0 = Math.sin(this.lat0), this.cosph0 = Math.cos(this.lat0)), this.pn1 = this.h / this.a, this.pn1 <= 0 || this.pn1 > 1e10)
throw new Error("Invalid height");
this.p = 1 + this.pn1, this.rp = 1 / this.p, this.h1 = 1 / this.pn1, this.pfact = (this.p + 1) * this.h1, this.es = 0;
var e = this.tilt, i = this.azi;
this.cg = Math.cos(i), this.sg = Math.sin(i), this.cw = Math.cos(e), this.sw = Math.sin(e);
}
function x0(e) {
e.x -= this.long0;
var i = Math.sin(e.y), s = Math.cos(e.y), r = Math.cos(e.x), o, h;
switch (this.mode) {
case jt.OBLIQ:
h = this.sinph0 * i + this.cosph0 * s * r;
break;
case jt.EQUIT:
h = s * r;
break;
case jt.S_POLE:
h = -i;
break;
case jt.N_POLE:
h = i;
break;
}
switch (h = this.pn1 / (this.p - h), o = h * s * Math.sin(e.x), this.mode) {
case jt.OBLIQ:
h *= this.cosph0 * i - this.sinph0 * s * r;
break;
case jt.EQUIT:
h *= i;
break;
case jt.N_POLE:
h *= -(s * r);
break;
case jt.S_POLE:
h *= s * r;
break;
}
var l, u;
return l = h * this.cg + o * this.sg, u = 1 / (l * this.sw * this.h1 + this.cw), o = (o * this.cg - h * this.sg) * this.cw * u, h = l * u, e.x = o * this.a, e.y = h * this.a, e;
}
function b0(e) {
e.x /= this.a, e.y /= this.a;
var i = { x: e.x, y: e.y }, s, r, o;
o = 1 / (this.pn1 - e.y * this.sw), s = this.pn1 * e.x * o, r = this.pn1 * e.y * this.cw * o, e.x = s * this.cg + r * this.sg, e.y = r * this.cg - s * this.sg;
var h = ie(e.x, e.y);
if (Math.abs(h) < B)
i.x = 0, i.y = e.y;
else {
var l, u;
switch (u = 1 - h * h * this.pfact, u = (this.p - Math.sqrt(u)) / (this.pn1 / h + h / this.pn1), l = Math.sqrt(1 - u * u), this.mode) {
case jt.OBLIQ:
i.y = Math.asin(l * this.sinph0 + e.y * u * this.cosph0 / h), e.y = (l - this.sinph0 * Math.sin(i.y)) * h, e.x *= u * this.cosph0;
break;
case jt.EQUIT:
i.y = Math.asin(e.y * u / h), e.y = l * h, e.x *= u;
break;
case jt.N_POLE:
i.y = Math.asin(l), e.y = -e.y;
break;
case jt.S_POLE:
i.y = -Math.asin(l);
break;
}
i.x = Math.atan2(e.x, e.y);
}
return e.x = i.x + this.long0, e.y = i.y, e;
}
var E0 = ["Tilted_Perspective", "tpers"];
const P0 = {
init: w0,
forward: x0,
inverse: b0,
names: E0
};
function S0() {
if (this.flip_axis = this.sweep === "x" ? 1 : 0, this.h = Number(this.h), this.radius_g_1 = this.h / this.a, this.radius_g_1 <= 0 || this.radius_g_1 > 1e10)
throw new Error();
if (this.radius_g = 1 + this.radius_g_1, this.C = this.radius_g * this.radius_g - 1, this.es !== 0) {
var e = 1 - this.es, i = 1 / e;
this.radius_p = Math.sqrt(e), this.radius_p2 = e, this.radius_p_inv2 = i, this.shape = "ellipse";
} else
this.radius_p = 1, this.radius_p2 = 1, this.radius_p_inv2 = 1, this.shape = "sphere";
this.title || (this.title = "Geostationary Satellite View");
}
function A0(e) {
var i = e.x, s = e.y, r, o, h, l;
if (i = i - this.long0, this.shape === "ellipse") {
s = Math.atan(this.radius_p2 * Math.tan(s));
var u = this.radius_p / ie(this.radius_p * Math.cos(s), Math.sin(s));
if (o = u * Math.cos(i) * Math.cos(s), h = u * Math.sin(i) * Math.cos(s), l = u * Math.sin(s), (this.radius_g - o) * o - h * h - l * l * this.radius_p_inv2 < 0)
return e.x = Number.NaN, e.y = Number.NaN, e;
r = this.radius_g - o, this.flip_axis ? (e.x = this.radius_g_1 * Math.atan(h / ie(l, r)), e.y = this.radius_g_1 * Math.atan(l / r)) : (e.x = this.radius_g_1 * Math.atan(h / r), e.y = this.radius_g_1 * Math.atan(l / ie(h, r)));
} else
this.shape === "sphere" && (r = Math.cos(s), o = Math.cos(i) * r, h = Math.sin(i) * r, l = Math.sin(s), r = this.radius_g - o, this.flip_axis ? (e.x = this.radius_g_1 * Math.atan(h / ie(l, r)), e.y = this.radius_g_1 * Math.atan(l / r)) : (e.x = this.radius_g_1 * Math.atan(h / r), e.y = this.radius_g_1 * Math.atan(l / ie(h, r))));
return e.x = e.x * this.a, e.y = e.y * this.a, e;
}
function L0(e) {
var i = -1, s = 0, r = 0, o, h, l, u;
if (e.x = e.x / this.a, e.y = e.y / this.a, this.shape === "ellipse") {
this.flip_axis ? (r = Math.tan(e.y / this.radius_g_1), s = Math.tan(e.x / this.radius_g_1) * ie(1, r)) : (s = Math.tan(e.x / this.radius_g_1), r = Math.tan(e.y / this.radius_g_1) * ie(1, s));
var f = r / this.radius_p;
if (o = s * s + f * f + i * i, h = 2 * this.radius_g * i, l = h * h - 4 * o * this.C, l < 0)
return e.x = Number.NaN, e.y = Number.NaN, e;
u = (-h - Math.sqrt(l)) / (2 * o), i = this.radius_g + u * i, s *= u, r *= u, e.x = Math.atan2(s, i), e.y = Math.atan(r * Math.cos(e.x) / i), e.y = Math.atan(this.radius_p_inv2 * Math.tan(e.y));
} else if (this.shape === "sphere") {
if (this.flip_axis ? (r = Math.tan(e.y / this.radius_g_1), s = Math.tan(e.x / this.radius_g_1) * Math.sqrt(1 + r * r)) : (s = Math.tan(e.x / this.radius_g_1), r = Math.tan(e.y / this.radius_g_1) * Math.sqrt(1 + s * s)), o = s * s + r * r + i * i, h = 2 * this.radius_g * i, l = h * h - 4 * o * this.C, l < 0)
return e.x = Number.NaN, e.y = Number.NaN, e;
u = (-h - Math.sqrt(l)) / (2 * o), i = this.radius_g + u * i, s *= u, r *= u, e.x = Math.atan2(s, i), e.y = Math.atan(r * Math.cos(e.x) / i);
}
return e.x = e.x + this.long0, e;
}
var C0 = ["Geostationary Satellite View", "Geostationary_Satellite", "geos"];
const T0 = {
init: S0,
forward: A0,
inverse: L0,
names: C0
};
var wn = 1.340264, xn = -0.081106, bn = 893e-6, En = 3796e-6, ys = Math.sqrt(3) / 2;
function N0() {
this.es = 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0;
}
function G0(e) {
var i = Z(e.x - this.long0), s = e.y, r = Math.asin(ys * Math.sin(s)), o = r * r, h = o * o * o;
return e.x = i * Math.cos(r) / (ys * (wn + 3 * xn * o + h * (7 * bn + 9 * En * o))), e.y = r * (wn + xn * o + h * (bn + En * o)), e.x = this.a * e.x + this.x0, e.y = this.a * e.y + this.y0, e;
}
function I0(e) {
e.x = (e.x - this.x0) / this.a, e.y = (e.y - this.y0) / this.a;
var i = 1e-9, s = 12, r = e.y, o, h, l, u, f, _;
for (_ = 0; _ < s && (o = r * r, h = o * o * o, l = r * (wn + xn * o + h * (bn + En * o)) - e.y, u = wn + 3 * xn * o + h * (7 * bn + 9 * En * o), r -= f = l / u, !(Math.abs(f) < i)); ++_)
;
return o = r * r, h = o * o * o, e.x = ys * e.x * (wn + 3 * xn * o + h * (7 * bn + 9 * En * o)) / Math.cos(r), e.y = Math.asin(Math.sin(r) / ys), e.x = Z(e.x + this.long0), e;
}
var O0 = ["eqearth", "Equal Earth", "Equal_Earth"];
const k0 = {
init: N0,
forward: G0,
inverse: I0,
names: O0
};
var Nn = 1e-10;
function R0() {
var e;
if (this.phi1 = this.lat1, Math.abs(this.phi1) < Nn)
throw new Error();
this.es ? (this.en = gr(this.es), this.m1 = qi(
this.phi1,
this.am1 = Math.sin(this.phi1),
e = Math.cos(this.phi1),
this.en
), this.am1 = e / (Math.sqrt(1 - this.es * this.am1 * this.am1) * this.am1), this.inverse = D0, this.forward = z0) : (Math.abs(this.phi1) + Nn >= O ? this.cphi1 = 0 : this.cphi1 = 1 / Math.tan(this.phi1), this.inverse = U0, this.forward = B0);
}
function z0(e) {
var i = Z(e.x - (this.long0 || 0)), s = e.y, r, o, h;
return r = this.am1 + this.m1 - qi(s, o = Math.sin(s), h = Math.cos(s), this.en), o = h * i / (r * Math.sqrt(1 - this.es * o * o)), e.x = r * Math.sin(o), e.y = this.am1 - r * Math.cos(o), e.x = this.a * e.x + (this.x0 || 0), e.y = this.a * e.y + (this.y0 || 0), e;
}
function D0(e) {
e.x = (e.x - (this.x0 || 0)) / this.a, e.y = (e.y - (this.y0 || 0)) / this.a;
var i, s, r, o;
if (s = ie(e.x, e.y = this.am1 - e.y), o = vr(this.am1 + this.m1 - s, this.es, this.en), (i = Math.abs(o)) < O)
i = Math.sin(o), r = s * Math.atan2(e.x, e.y) * Math.sqrt(1 - this.es * i * i) / Math.cos(o);
else if (Math.abs(i - O) <= Nn)
r = 0;
else
throw new Error();
return e.x = Z(r + (this.long0 || 0)), e.y = Ve(o), e;
}
function B0(e) {
var i = Z(e.x - (this.long0 || 0)), s = e.y, r, o;
return o = this.cphi1 + this.phi1 - s, Math.abs(o) > Nn ? (e.x = o * Math.sin(r = i * Math.cos(s) / o), e.y = this.cphi1 - o * Math.cos(r)) : e.x = e.y = 0, e.x = this.a * e.x + (this.x0 || 0), e.y = this.a * e.y + (this.y0 || 0), e;
}
function U0(e) {
e.x = (e.x - (this.x0 || 0)) / this.a, e.y = (e.y - (this.y0 || 0)) / this.a;
var i, s, r = ie(e.x, e.y = this.cphi1 - e.y);
if (s = this.cphi1 + this.phi1 - r, Math.abs(s) > O)
throw new Error();
return Math.abs(Math.abs(s) - O) <= Nn ? i = 0 : i = r * Math.atan2(e.x, e.y) / Math.cos(s), e.x = Z(i + (this.long0 || 0)), e.y = Ve(s), e;
}
var Z0 = ["bonne", "Bonne (Werner lat_1=90)"];
const q0 = {
init: R0,
names: Z0
};
function $0(e) {
e.Proj.projections.add(ls), e.Proj.projections.add(cs), e.Proj.projections.add(ku), e.Proj.projections.add(Hu), e.Proj.projections.add(Xu), e.Proj.projections.add(nf), e.Proj.projections.add(lf), e.Proj.projections.add(_f), e.Proj.projections.add(yf), e.Proj.projections.add(Ef), e.Proj.projections.add(Zf), e.Proj.projections.add(jf), e.Proj.projections.add(Qf), e.Proj.projections.add(sd), e.Proj.projections.add(ld), e.Proj.projections.add(_d), e.Proj.projections.add(yd), e.Proj.projections.add(Ed), e.Proj.projections.add(Td), e.Proj.projections.add(kd), e.Proj.projections.add(Ud), e.Proj.projections.add(Hd), e.Proj.projections.add(Xd), e.Proj.projections.add(i0), e.Proj.projections.add(o0), e.Proj.projections.add(p0), e.Proj.projections.add(M0), e.Proj.projections.add(P0), e.Proj.projections.add(T0), e.Proj.projections.add(k0), e.Proj.projections.add(q0);
}
Nt.defaultDatum = "WGS84";
Nt.Proj = Pe;
Nt.WGS84 = new Nt.Proj("WGS84");
Nt.Point = Ui;
Nt.toPoint = Lo;
Nt.defs = Jt;
Nt.nadgrid = kc;
Nt.transform = ms;
Nt.mgrs = Yc;
Nt.version = "__VERSION__";
$0(Nt);
const Ie = "EPSG:4326", br = (e, i) => {
const s = Math.floor((i + 180) / 6) + 1;
return `EPSG:32${e >= 0 ? "6" : "7"}${s.toString().padStart(2, "0")}`;
}, Er = (e) => e.toLowerCase().replace(/ /g, "-").replace(/[^a-z0-9-]/g, ""), F0 = (e, i) => {
const [s, r] = Array.isArray(e) ? e : [e.lat, e.lng], [o, h] = Array.isArray(i) ? i : [i.lat, i.lng], l = br(s, r), [u, f] = Nt(Ie, l, [
h,
o
]), [_, v] = Nt(Ie, l, [r, s]), m = _ - u, g = v - f;
return { xDiff: m, yDiff: g, targetUTM: l };
}, Pr = (e, i, s) => {
const { xDiff: r, yDiff: o, targetUTM: h } = F0(e, i);
return s.map((l) => {
const [u, f] = Array.isArray(l.position) ? l.position : [l.position.lat, l.position.lng], [_, v] = Nt(Ie, h, [f, u]), m = _ + r, g = v + o, [M, E] = Nt(h, Ie, [m, g]);
return {
...l,
position: [E, M]
};
});
};
class Bn {
constructor(i, s, r, o, h, l) {
this.name = i, this.center = w.latLng(s), this.radius = r, this.pointsOfInterest = o, this.color = h, this.circleOptions = {
radius: this.radius,
fill: !1,
color: this.color,
className: `accelerator accelerator-circle ${Er(this.name)}`,
...l
};
}
getName() {
return this.name;
}
getReferencePoint() {
return this.center;
}
getTranslatedPath(i) {
return new w.Circle(i, this.circleOptions);
}
getTranslatedPointsOfInterest(i) {
return Pr(i, this.center, this.pointsOfInterest);
}
}
class Zo {
constructor(i, s, r, o, h, l) {
this.name = i, this.midpoint = w.latLng(s), this.length = r, this.direction = o, this.pointsOfInterest = h, this.color = l;
}
getName() {
return this.name;
}
getReferencePoint() {
return this.midpoint;
}
getTranslatedPath(i) {
const s = this.direction * Math.PI / 180, r = this.length / 2, [o, h] = Array.isArray(i) ? i : [i.lat, i.lng], l = br(o, h), [u, f] = Nt(Ie, l, [h, o]), _ = u - r * Math.sin(s), v = f - r * Math.cos(s), m = u + r * Math.sin(s), g = f + r * Math.cos(s), [M, E] = Nt(l, Ie, [_, v]), [x, C] = Nt(l, Ie, [m, g]);
return new w.Polyline(
[
[E, M],
[C, x]
],
{
color: this.color,
className: `accelerator accelerator-linear ${Er(this.name)}`
}
);
}
getTranslatedPointsOfInterest(i) {
return Pr(i, this.midpoint, this.pointsOfInterest);
}
}
const H0 = 4300, W0 = [
{
name: "ATLAS",
position: [46.23497502511518, 6.0536309870679235]
},
{
name: "Point 2",
position: [46.251544268663615, 6.021434048433471]
},
{
name: "Point 3",
position: [46.277518302316, 6.012012123858463]
},
{
name: "Point 4",
position: [46.30445011831323, 6.037082600001055]
},
{
name: "CMS",
position: [46.31026650910126, 6.078887140749957]
},
{
name: "Point 6",
position: [46.29351162288481, 6.111756560082773]
},
{
name: "Point 7",
position: [46.266418692548335, 6.115151115340182]
},
{
name: "Point 8",
position: [46.2417904558472, 6.097942093891781]
}
], j0 = new w.LatLng(46.2725593743487, 6.065987083678201), K0 = new Bn(
"Large Hadron Collider",
j0,
H0,
W0,
"#00BFFF"
), V0 = 1100, J0 = new w.LatLng(46.2447, 6.056), X0 = new Bn("Super Proton Synchrotron", J0, V0, [], "#FFA500"), Q0 = 100, Y0 = new w.LatLng(46.232129436307034, 6.048649235698542), t_ = new Bn("Proton Synchrotron", Y0, Q0, [], "#228B22"), e_ = 25, i_ = new w.LatLng(46.232875, 6.04718), n_ = new Bn("PS Booster", i_, e_, [], "#C71585"), s_ = 14500, r_ = new w.LatLng(46.12280614864221, 6.131499400104788), a_ = new Bn("Future Circular Collider", r_, s_, [], "#DC143C"), o_ = new w.LatLng(46.23121030223552, 6.046594519834996), h_ = 78, l_ = -12, c_ = new Zo("LINAC4", o_, h_, l_, [], "#FF0000"), u_ = new w.LatLng(46.23163551273157, 6.046979545777202), f_ = 10, d_ = 20, __ = new Zo("LINAC3", u_, f_, d_, [], "#C71585");
class p_ {
constructor(i, s, r, o, h, l, u) {
this.name = i, this.center = w.latLng(s), this.width = r, this.height = o, this.rotation = h, this.pointsOfInterest = l, this.color = u;
}
getName() {
return this.name;
}
getReferencePoint() {
return this.center;
}
createRoundedRectangle(i, s, r, o = 6) {
const h = [], l = [
{ cx: i - r, cy: -s + r, start: -Math.PI / 2, end: 0 },
// top-right
{ cx: i - r, cy: s - r, start: 0, end: Math.PI / 2 },
// bottom-right
{ cx: -i + r, cy: s - r, start: Math.PI / 2, end: Math.PI },
// bottom-left
{ cx: -i + r, cy: -s + r, start: Math.PI, end: 1.5 * Math.PI }
// top-left
];
for (const { cx: u, cy: f, start: _, end: v } of l)
for (let m = 0; m <= o; m++) {
const g = m / o, M = _ + (v - _) * g, E = u + r * Math.cos(M), x = f + r * Math.sin(M);
h.push([E, x]);
}
return h;
}
getTranslatedPath(i) {
const [s, r] = Array.isArray(i) ? i : [i.lat, i.lng], o = br(s, r), [h, l] = Nt(Ie, o, [r, s]), u = this.width / 2, f = this.height / 2, _ = this.createRoundedRectangle(u, f, 3), v = Math.cos(this.rotation * Math.PI / 180), m = Math.sin(this.rotation * Math.PI / 180), g = _.map(([M, E]) => {
const x = M * v - E * m, C = M * m + E * v, D = h + x, U = l + C, [$, lt] = Nt(o, Ie, [D, U]);
return [lt, $];
});
return new w.Polygon(g, {
color: this.color,
fill: !1,
className: `accelerator accelerator-rounded-rectangle ${Er(this.name)}`
});
}
getTranslatedPointsOfInterest(i) {
return Pr(i, this.center, this.pointsOfInterest);
}
}
const m_ = new p_(
"LEIR",
[46.231557004669, 6.047967826365111],
// Center coordinates (approximate CERN location)
20,
// Width in meters
20,
// Height in meters
54,
// Rotation in degrees
[],
// Points of interest (empty for now)
"#ff6b6b"
// Color
), Wa = {
LHC: K0,
SPS: X0,
PS: t_,
PSB: n_,
FCC: a_,
LINAC4: c_,
LINAC3: __,
LEIR: m_
}, g_ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=", v_ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==", y_ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";
var M_ = Object.defineProperty, w_ = Object.getOwnPropertyDescriptor, di = (e, i, s, r) => {
for (var o = r > 1 ? void 0 : r ? w_(i, s) : i, h = e.length - 1, l; h >= 0; h--)
(l = e[h]) && (o = (r ? l(i, s, o) : l(o)) || o);
return r && o && M_(i, s, o), o;
};
delete ds.Icon.Default.prototype._getIconUrl;
ds.Icon.Default.mergeOptions({
iconRetinaUrl: v_,
iconUrl: g_,
shadowUrl: y_
});
const x_ = `
cern-map-overlay {
display: block;
height: var(--cern-map-height, 400px);
width: 100%;
}
cern-map-overlay>div {
display: block;
height: 100%;
width: 100%;
}
`;
let Ke = class extends yn {
constructor() {
super(...arguments), this._mapId = `map-${Math.random().toString(36).substring(2, 9)}`, this.map = null, this.geocoder = null, this.DEFAULT_LAT = 46.23497502511518, this.DEFAULT_LNG = 6.0536309870679235, this.lat = null, this.lng = null, this.zoom = null, this.geocoderEnabled = !1, this.followLocation = !1, this.showAccelerators = "", this.onGeocode = (e) => {
this.dispatchEvent(
new CustomEvent("markgeocode", {
detail: e,
bubbles: !0,
composed: !0
})
);
};
}
// Disable shadow DOM
createRenderRoot() {
return this;
}
addStylesToDocument(e, i) {
if (document.getElementById(i))
return;
const s = document.createElement("style");
s.id = i, s.textContent = e, document.head.appendChild(s);
}
firstUpdated() {
this.addStylesToDocument(x_, "cern-map-overlay-styles");
const e = this.querySelector(`#${this._mapId}`);
if (!e)
throw new Error("Map element not found");
this.map = ds.map(e), ds.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: "© OpenStreetMap contributors"
}).addTo(this.map), this.addStylesToDocument($l, "leaflet-styles"), this.addStylesToDocument(ql, "geocoder-styles"), this.loadAcceleratorsFromProperty(), (this.lat === null || this.lng === null || this.zoom === null) && (this.map.setView([this.DEFAULT_LAT, this.DEFAULT_LNG], 12), this.fitBounds()), this.map.on("moveend", this.onMoveEnd.bind(this));
}
getLayers() {
var i;
const e = [];
return (i = this.map) == null || i.eachLayer((s) => {
"accelerator" in s && e.push(s);
}), e;
}
fitBounds() {
if (!this.map)
return;
const e = this.getLayers();
if (!e.length)
return;
let i = 1 / 0, s = -1 / 0, r = 1 / 0, o = -1 / 0;
e.forEach((h) => {
const l = h.getBounds();
l && (i = Math.min(i, l.getSouth()), s = Math.max(s, l.getNorth()), r = Math.min(r, l.getWest()), o = Math.max(o, l.getEast()));
}), this.map.fitBounds([
[i, r],
[s, o]
]);
}
updated(e) {
this.map && (this.syncMapView(e), this.syncGeocoder(e), this.syncAccelerators(e), this.syncFollowLocation(e));
}
syncMapView(e) {
(e.has("lat") || e.has("lng")) && this.lat !== null && this.lng !== null && this.map.setView([this.lat, this.lng], this.zoom ?? 12), e.has("zoom") && this.zoom !== null && this.map.setZoom(this.zoom);
}
syncGeocoder(e) {
e.has("geocoderEnabled") && (this.geocoderEnabled ? (this.geocoder = new ws(), this.geocoder.addTo(this.map), this.geocoder.on("markgeocode", this.onGeocode)) : this.geocoder && (this.geocoder.remove(), this.geocoder = null));
}
syncAccelerators(e) {
e.has("showAccelerators") && this.loadAcceleratorsFromProperty();
}
syncFollowLocation(e) {
e.has("followLocation") && this.updateMap();
}
onMoveEnd() {
var s, r;
const e = (s = this.map) == null ? void 0 : s.getCenter(), i = (r = this.map) == null ? void 0 : r.getZoom();
e && (this.lat = e.lat, this.lng = e.lng), i !== void 0 && (this.zoom = i), this.followLocation && this.updateMap();
}
loadAcceleratorsFromProperty() {
const e = [];
this.getLayers().forEach((i) => {
var s;
(s = i.name) != null && s.startsWith("__auto_") && e.push(i.name);
}), e.forEach((i) => this.removeAcceleratorLayer(i)), this.showAccelerators.trim() && this.showAccelerators.split(",").map((s) => s.trim().toUpperCase()).filter((s) => s.length > 0).forEach((s) => {
const r = Wa[s];
r ? this.addAcceleratorLayer(r, `__auto_${s}`) : console.warn(
`Unknown accelerator: ${s}. Available accelerators: ${Object.keys(Wa).join(", ")}`
);
});
}
addAccelerator(e, i) {
typeof e == "string" && i ? this.addAcceleratorLayer(i, e) : typeof e == "object" && this.addAcceleratorLayer(e), this.updateMap();
}
removeAccelerator(e) {
if (typeof e == "string")
this.removeAcceleratorLayer(e);
else {
const i = this.getLayers().find((s) => s.accelerator === e);
i && this.removeAcceleratorLayer(i.name);
}
this.updateMap();
}
getRefPointKey(e) {
return e instanceof w.LatLng ? `${e.lat},${e.lng}` : `${e.lat},${e.lng}`;
}
addAcceleratorLayer(e, i) {
if (!this.map)
throw new Error("Map not initialized");
const s = this.followLocation ? new w.LatLng(this.lat ?? this.DEFAULT_LAT, this.lng ?? this.DEFAULT_LNG) : e.getReferencePoint(), r = this.getRefPointKey(s), o = e.getTranslatedPath(s);
return o.name = i ?? e.getName(), o.accelerator = e, o.cernLocationRefKey = r, o.addTo(this.map), o;
}
removeAcceleratorLayer(e) {
if (!this.map)
throw new Error("Map not initialized");
const i = this.getLayers().find((s) => s.name === e);
return i && this.map.removeLayer(i), i;
}
/**
* Update the map with the current state of the accelerators - used when the followLocation property is set and the map is moved
* @returns The map instance
*/
updateMap() {
this.getLayers().forEach((i) => {
const s = i.name, r = i.accelerator, o = this.followLocation ? new w.LatLng(this.lat ?? 0, this.lng ?? 0) : r.getReferencePoint(), h = this.getRefPointKey(o);
i.cernLocationRefKey !== h && (this.removeAcceleratorLayer(s), this.addAcceleratorLayer(r, s));
});
}
render() {
return il`<div id="${this._mapId}"></div>`;
}
};
di([
Zi({ type: Number })
], Ke.prototype, "lat", 2);
di([
Zi({ type: Number })
], Ke.prototype, "lng", 2);
di([
Zi({ type: Number })
], Ke.prototype, "zoom", 2);
di([
Zi({ type: Boolean, attribute: "geocoder-enabled" })
], Ke.prototype, "geocoderEnabled", 2);
di([
Zi({ type: Boolean, attribute: "follow-location" })
], Ke.prototype, "followLocation", 2);
di([
Zi({ type: String, attribute: "show-accelerators" })
], Ke.prototype, "showAccelerators", 2);
Ke = di([
cl("cern-map-overlay")
], Ke);
export {
Ke as CERNMapOverlay,
Bn as CircularCollider,
a_ as FCC,
ds as L,
m_ as LEIR,
K0 as LHC,
__ as LINAC3,
c_ as LINAC4,
Zo as LinearAccelerator,
t_ as PS,
n_ as PSB,
X0 as SPS,
Wa as cernMap
};