mapboxgl-tools 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +14 -0
- package/.env +8 -0
- package/.env.development +23 -0
- package/.eslintcache +1 -0
- package/.eslintrc.cjs +24 -0
- package/.prettierrc.json +23 -0
- package/LICENSE +22 -0
- package/README.md +69 -0
- package/dist/sfmap.min.js +65 -0
- package/dist/style.css +1 -0
- package/dist/ui.es.js +80717 -0
- package/dist/ui.umd.js +1 -0
- package/index.html +16 -0
- package/jsconfig.json +9 -0
- package/package.json +55 -0
- package/postcss.config.cjs +5 -0
- package/publish.sh +26 -0
- package/vite.config.js +119 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* @preserve
|
|
2
|
+
* SFMap 3.1, 椤轰赴鍦板浘Javascript Web SDK.
|
|
3
|
+
* Built at 2021-12-28 18:17:10
|
|
4
|
+
* https://lbs.sf-express.com
|
|
5
|
+
* (c) 2017-2021 涓板浘绉戞妧 鐗堟潈鎵€鏈�
|
|
6
|
+
*/
|
|
7
|
+
(function (global, factory) {
|
|
8
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
9
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
10
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.SFMap = {}));
|
|
11
|
+
})(this, (function (exports) {
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
/* eslint-disable */
|
|
15
|
+
|
|
16
|
+
var shared, worker, mapboxgl;
|
|
17
|
+
// define gets called three times: one for each chunk. we rely on the order
|
|
18
|
+
// they're imported to know which is which
|
|
19
|
+
function define(_, chunk) {
|
|
20
|
+
if (!shared) {
|
|
21
|
+
shared = chunk;
|
|
22
|
+
} else if (!worker) {
|
|
23
|
+
worker = chunk;
|
|
24
|
+
} else {
|
|
25
|
+
var workerBundleString = "self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/api/#transpiling-v2'); }; var sharedChunk = {}; (" + shared + ")(sharedChunk); (" + worker + ")(sharedChunk); self.onerror = null;"
|
|
26
|
+
|
|
27
|
+
var sharedChunk = {};
|
|
28
|
+
shared(sharedChunk);
|
|
29
|
+
mapboxgl = chunk(sharedChunk);
|
|
30
|
+
if (typeof window !== 'undefined') {
|
|
31
|
+
mapboxgl.workerUrl = window.URL.createObjectURL(new Blob([workerBundleString], { type: 'text/javascript' }));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
define(["exports"], (function (t) {
|
|
38
|
+
"use strict"; var e = "3.1.0", i = r; function r(t, e) { this.x = t, this.y = e; } r.prototype = { clone: function () { return new r(this.x, this.y) }, add: function (t) { return this.clone()._add(t) }, sub: function (t) { return this.clone()._sub(t) }, multByPoint: function (t) { return this.clone()._multByPoint(t) }, divByPoint: function (t) { return this.clone()._divByPoint(t) }, mult: function (t) { return this.clone()._mult(t) }, div: function (t) { return this.clone()._div(t) }, rotate: function (t) { return this.clone()._rotate(t) }, rotateAround: function (t, e) { return this.clone()._rotateAround(t, e) }, matMult: function (t) { return this.clone()._matMult(t) }, unit: function () { return this.clone()._unit() }, perp: function () { return this.clone()._perp() }, round: function () { return this.clone()._round() }, mag: function () { return Math.sqrt(this.x * this.x + this.y * this.y) }, equals: function (t) { return this.x === t.x && this.y === t.y }, dist: function (t) { return Math.sqrt(this.distSqr(t)) }, distSqr: function (t) { var e = t.x - this.x, i = t.y - this.y; return e * e + i * i }, angle: function () { return Math.atan2(this.y, this.x) }, angleTo: function (t) { return Math.atan2(this.y - t.y, this.x - t.x) }, angleWith: function (t) { return this.angleWithSep(t.x, t.y) }, angleWithSep: function (t, e) { return Math.atan2(this.x * e - this.y * t, this.x * t + this.y * e) }, _matMult: function (t) { var e = t[2] * this.x + t[3] * this.y; return this.x = t[0] * this.x + t[1] * this.y, this.y = e, this }, _add: function (t) { return this.x += t.x, this.y += t.y, this }, _sub: function (t) { return this.x -= t.x, this.y -= t.y, this }, _mult: function (t) { return this.x *= t, this.y *= t, this }, _div: function (t) { return this.x /= t, this.y /= t, this }, _multByPoint: function (t) { return this.x *= t.x, this.y *= t.y, this }, _divByPoint: function (t) { return this.x /= t.x, this.y /= t.y, this }, _unit: function () { return this._div(this.mag()), this }, _perp: function () { var t = this.y; return this.y = this.x, this.x = -t, this }, _rotate: function (t) { var e = Math.cos(t), i = Math.sin(t), r = i * this.x + e * this.y; return this.x = e * this.x - i * this.y, this.y = r, this }, _rotateAround: function (t, e) { var i = Math.cos(t), r = Math.sin(t), n = e.y + r * (this.x - e.x) + i * (this.y - e.y); return this.x = e.x + i * (this.x - e.x) - r * (this.y - e.y), this.y = n, this }, _round: function () { return this.x = Math.round(this.x), this.y = Math.round(this.y), this } }, r.convert = function (t) { return t instanceof r ? t : Array.isArray(t) ? new r(t[0], t[1]) : t }; var n = "undefined" != typeof self ? self : {}, s = a; function a(t, e, i, r) { this.cx = 3 * t, this.bx = 3 * (i - t) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * e, this.by = 3 * (r - e) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = t, this.p1y = r, this.p2x = i, this.p2y = r; } a.prototype.sampleCurveX = function (t) { return ((this.ax * t + this.bx) * t + this.cx) * t }, a.prototype.sampleCurveY = function (t) { return ((this.ay * t + this.by) * t + this.cy) * t }, a.prototype.sampleCurveDerivativeX = function (t) { return (3 * this.ax * t + 2 * this.bx) * t + this.cx }, a.prototype.solveCurveX = function (t, e) { var i, r, n, s, a; for (void 0 === e && (e = 1e-6), n = t, a = 0; a < 8; a++) { if (s = this.sampleCurveX(n) - t, Math.abs(s) < e) return n; var o = this.sampleCurveDerivativeX(n); if (Math.abs(o) < 1e-6) break; n -= s / o; } if ((n = t) < (i = 0)) return i; if (n > (r = 1)) return r; for (; i < r;) { if (s = this.sampleCurveX(n), Math.abs(s - t) < e) return n; t > s ? i = n : r = n, n = .5 * (r - i) + i; } return n }, a.prototype.solve = function (t, e) { return this.sampleCurveY(this.solveCurveX(t, e)) }; const o = Math.pow(2, 53) - 1, l = Math.PI / 180, h = 180 / Math.PI; function u(t) { return t * l } const c = [[0, 0], [1, 0], [1, 1], [0, 1]]; function p(t) { if (t <= 0) return 0; if (t >= 1) return 1; const e = t * t, i = e * t; return 4 * (t < .5 ? i : 3 * (t - e) + i - .75) } function d(t, e, i, r) { const n = new s(t, e, i, r); return function (t) { return n.solve(t) } } const f = d(.25, .1, .25, 1); function y(t, e, i) { return Math.min(i, Math.max(e, t)) } function m(t, e, i) { const r = i - e, n = ((t - e) % r + r) % r + e; return n === e ? i : n } function g(t, e, i) { if (!t.length) return i(null, []); let r = t.length; const n = new Array(t.length); let s = null; t.forEach(((t, a) => { e(t, ((t, e) => { t && (s = t), n[a] = e, 0 == --r && i(s, n); })); })); } function x(t) { const e = []; for (const i in t) e.push(t[i]); return e } function _(t, ...e) { for (const i of e) for (const e in i) t[e] = i[e]; return t } let v = 1; function b() { return v++ } function w() { return function t(e) { return e ? (e ^ 16 * Math.random() >> e / 4).toString(16) : ([1e7] + -[1e3] + -4e3 + -8e3 + -1e11).replace(/[018]/g, t) }() } function k(t) { return t <= 1 ? 1 : Math.pow(2, Math.ceil(Math.log(t) / Math.LN2)) } function A(t) { return !!t && /^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t) } function S(t, e) { t.forEach((t => { e[t] && (e[t] = e[t].bind(e)); })); } function z(t, e) { return -1 !== t.indexOf(e, t.length - e.length) } function I(t, e, i) { const r = {}; for (const n in t) r[n] = e.call(i || this, t[n], n, t); return r } function M(t, e, i) { const r = {}; for (const n in t) e.call(i || this, t[n], n, t) && (r[n] = t[n]); return r } function T(t) { return Array.isArray(t) ? t.map(T) : "object" == typeof t && t ? I(t, T) : t } const E = {}; function C(t) { E[t] || ("undefined" != typeof console && console.warn(t), E[t] = !0); } function P(t, e, i) { return (i.y - t.y) * (e.x - t.x) > (e.y - t.y) * (i.x - t.x) } function D(t) { let e = 0; for (let i, r, n = 0, s = t.length, a = s - 1; n < s; a = n++)i = t[n], r = t[a], e += (r.x - i.x) * (i.y + r.y); return e } function B() { return "undefined" != typeof WorkerGlobalScope && "undefined" != typeof self && self instanceof WorkerGlobalScope } function V(t) { const e = {}; if (t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g, ((t, i, r, n) => { const s = r || n; return e[i] = !s || s.toLowerCase(), "" })), e["max-age"]) { const t = parseInt(e["max-age"], 10); isNaN(t) ? delete e["max-age"] : e["max-age"] = t; } return e } let L = null; function F(t) { if (null == L) { const e = t.navigator ? t.navigator.userAgent : null; L = !!t.safari || !(!e || !(/\b(iPad|iPhone|iPod)\b/.test(e) || e.match("Safari") && !e.match("Chrome"))); } return L } function R(t) { try { const e = n[t]; return e.setItem("_mapbox_test_", 1), e.removeItem("_mapbox_test_"), !0 } catch (t) { return !1 } } function O(t, e, i) { i[t] && -1 !== i[t].indexOf(e) || (i[t] = i[t] || [], i[t].push(e)); } function U(t, e, i) { if (i && i[t]) { const r = i[t].indexOf(e); -1 !== r && i[t].splice(r, 1); } } class $ { constructor(t, e = {}) { _(this, e), this.type = t; } } class Z extends $ { constructor(t, e = {}) { super("error", _({ error: t }, e)); } } class q { on(t, e) { return this._listeners = this._listeners || {}, O(t, e, this._listeners), this } off(t, e) { return U(t, e, this._listeners), U(t, e, this._oneTimeListeners), this } once(t, e) { return e ? (this._oneTimeListeners = this._oneTimeListeners || {}, O(t, e, this._oneTimeListeners), this) : new Promise((e => this.once(t, e))) } fire(t, e) { "string" == typeof t && (t = new $(t, e || {})); const i = t.type; if (this.listens(i)) { t.target = this; const e = this._listeners && this._listeners[i] ? this._listeners[i].slice() : []; for (const i of e) i.call(this, t); const r = this._oneTimeListeners && this._oneTimeListeners[i] ? this._oneTimeListeners[i].slice() : []; for (const e of r) U(i, e, this._oneTimeListeners), e.call(this, t); const n = this._eventedParent; n && (_(t, "function" == typeof this._eventedParentData ? this._eventedParentData() : this._eventedParentData), n.fire(t)); } else t instanceof Z && console.error(t.error); return this } listens(t) { return !!(this._listeners && this._listeners[t] && this._listeners[t].length > 0 || this._oneTimeListeners && this._oneTimeListeners[t] && this._oneTimeListeners[t].length > 0 || this._eventedParent && this._eventedParent.listens(t)) } setEventedParent(t, e) { return this._eventedParent = t, this._eventedParentData = e, this } } class N { constructor(t, e) { t && (e ? this.setSouthWest(t).setNorthEast(e) : 4 === t.length ? this.setSouthWest([t[0], t[1]]).setNorthEast([t[2], t[3]]) : this.setSouthWest(t[0]).setNorthEast(t[1])); } setNorthEast(t) { return this._ne = t instanceof G ? new G(t.lng, t.lat) : G.convert(t), this } setSouthWest(t) { return this._sw = t instanceof G ? new G(t.lng, t.lat) : G.convert(t), this } extend(t) { const e = this._sw, i = this._ne; let r, n; if (t instanceof G) r = t, n = t; else { if (!(t instanceof N)) return Array.isArray(t) ? 4 === t.length || t.every(Array.isArray) ? this.extend(N.convert(t)) : this.extend(G.convert(t)) : this; if (r = t._sw, n = t._ne, !r || !n) return this } return e || i ? (e.lng = Math.min(r.lng, e.lng), e.lat = Math.min(r.lat, e.lat), i.lng = Math.max(n.lng, i.lng), i.lat = Math.max(n.lat, i.lat)) : (this._sw = new G(r.lng, r.lat), this._ne = new G(n.lng, n.lat)), this } getCenter() { return new G((this._sw.lng + this._ne.lng) / 2, (this._sw.lat + this._ne.lat) / 2) } getSouthWest() { return this._sw } getNorthEast() { return this._ne } getNorthWest() { return new G(this.getWest(), this.getNorth()) } getSouthEast() { return new G(this.getEast(), this.getSouth()) } getWest() { return this._sw.lng } getSouth() { return this._sw.lat } getEast() { return this._ne.lng } getNorth() { return this._ne.lat } toArray() { return [this._sw.toArray(), this._ne.toArray()] } toString() { return `LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})` } isEmpty() { return !(this._sw && this._ne) } contains(t) { const { lng: e, lat: i } = G.convert(t); let r = this._sw.lng <= e && e <= this._ne.lng; return this._sw.lng > this._ne.lng && (r = this._sw.lng >= e && e >= this._ne.lng), this._sw.lat <= i && i <= this._ne.lat && r } static convert(t) { return !t || t instanceof N ? t : new N(t) } } const j = 6371008.8; class G { constructor(t, e) { if (isNaN(t) || isNaN(e)) throw new Error(`Invalid LngLat object: (${t}, ${e})`); if (this.lng = +t, this.lat = +e, this.lat > 90 || this.lat < -90) throw new Error("Invalid LngLat latitude value: must be between -90 and 90") } wrap() { return new G(m(this.lng, -180, 180), this.lat) } toArray() { return [this.lng, this.lat] } toString() { return `LngLat(${this.lng}, ${this.lat})` } distanceTo(t) { const e = Math.PI / 180, i = this.lat * e, r = t.lat * e, n = Math.sin(i) * Math.sin(r) + Math.cos(i) * Math.cos(r) * Math.cos((t.lng - this.lng) * e); return j * Math.acos(Math.min(n, 1)) } toBounds(t = 0) { const e = 360 * t / 40075017, i = e / Math.cos(Math.PI / 180 * this.lat); return new N(new G(this.lng - i, this.lat - e), new G(this.lng + i, this.lat + e)) } static convert(t) { if (t instanceof G) return t; if (Array.isArray(t) && (2 === t.length || 3 === t.length)) return new G(Number(t[0]), Number(t[1])); if (!Array.isArray(t) && "object" == typeof t && null !== t) return new G(Number("lng" in t ? t.lng : t.lon), Number(t.lat)); throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]") } } var X = { $version: 8, $root: { version: { required: !0, type: "enum", values: [8] }, name: { type: "string" }, metadata: { type: "*" }, center: { type: "array", value: "number" }, zoom: { type: "number" }, bearing: { type: "number", default: 0, period: 360, units: "degrees" }, pitch: { type: "number", default: 0, units: "degrees" }, light: { type: "light" }, terrain: { type: "terrain" }, fog: { type: "fog" }, sources: { required: !0, type: "sources" }, sprite: { type: "string" }, glyphs: { type: "string" }, transition: { type: "transition" }, layers: { required: !0, type: "array", value: "layer" } }, sources: { "*": { type: "source" } }, source: ["source_vector", "source_raster", "source_raster_dem", "source_geojson", "source_video", "source_image"], source_vector: { type: { required: !0, type: "enum", values: { vector: {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, scheme: { type: "enum", values: { xyz: {}, tms: {} }, default: "xyz" }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, attribution: { type: "string" }, promoteId: { type: "promoteId" }, volatile: { type: "boolean", default: !1 }, "*": { type: "*" } }, source_raster: { type: { required: !0, type: "enum", values: { raster: {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, tileSize: { type: "number", default: 512, units: "pixels" }, scheme: { type: "enum", values: { xyz: {}, tms: {} }, default: "xyz" }, attribution: { type: "string" }, volatile: { type: "boolean", default: !1 }, "*": { type: "*" } }, source_raster_dem: { type: { required: !0, type: "enum", values: { "raster-dem": {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, tileSize: { type: "number", default: 512, units: "pixels" }, attribution: { type: "string" }, encoding: { type: "enum", values: { terrarium: {}, mapbox: {} }, default: "mapbox" }, volatile: { type: "boolean", default: !1 }, "*": { type: "*" } }, source_geojson: { type: { required: !0, type: "enum", values: { geojson: {} } }, data: { type: "*" }, maxzoom: { type: "number", default: 18 }, attribution: { type: "string" }, buffer: { type: "number", default: 128, maximum: 512, minimum: 0 }, filter: { type: "*" }, tolerance: { type: "number", default: .375 }, cluster: { type: "boolean", default: !1 }, clusterRadius: { type: "number", default: 50, minimum: 0 }, clusterMaxZoom: { type: "number" }, clusterMinPoints: { type: "number" }, clusterProperties: { type: "*" }, lineMetrics: { type: "boolean", default: !1 }, generateId: { type: "boolean", default: !1 }, promoteId: { type: "promoteId" } }, source_video: { type: { required: !0, type: "enum", values: { video: {} } }, urls: { required: !0, type: "array", value: "string" }, coordinates: { required: !0, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, source_image: { type: { required: !0, type: "enum", values: { image: {} } }, url: { required: !0, type: "string" }, coordinates: { required: !0, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, layer: { id: { type: "string", required: !0 }, type: { type: "enum", values: { fill: {}, line: {}, symbol: {}, circle: {}, heatmap: {}, "fill-extrusion": {}, raster: {}, hillshade: {}, background: {}, sky: {} }, required: !0 }, metadata: { type: "*" }, source: { type: "string" }, "source-layer": { type: "string" }, minzoom: { type: "number", minimum: 0, maximum: 24 }, maxzoom: { type: "number", minimum: 0, maximum: 24 }, filter: { type: "filter" }, layout: { type: "layout" }, paint: { type: "paint" } }, layout: ["layout_fill", "layout_line", "layout_circle", "layout_heatmap", "layout_fill-extrusion", "layout_symbol", "layout_raster", "layout_hillshade", "layout_background", "layout_sky"], layout_background: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_sky: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_fill: { "fill-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_circle: { "circle-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_heatmap: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, "layout_fill-extrusion": { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_line: { "line-cap": { type: "enum", values: { butt: {}, round: {}, square: {} }, default: "butt", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "line-join": { type: "enum", values: { bevel: {}, round: {}, miter: {} }, default: "miter", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "line-miter-limit": { type: "number", default: 2, requires: [{ "line-join": "miter" }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-round-limit": { type: "number", default: 1.05, requires: [{ "line-join": "round" }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_symbol: { "symbol-placement": { type: "enum", values: { point: {}, line: {}, "line-center": {} }, default: "point", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-spacing": { type: "number", default: 250, minimum: 1, units: "pixels", requires: [{ "symbol-placement": "line" }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-avoid-edges": { type: "boolean", default: !1, expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "symbol-z-order": { type: "enum", values: { auto: {}, "viewport-y": {}, source: {} }, default: "auto", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-allow-overlap": { type: "boolean", default: !1, requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-ignore-placement": { type: "boolean", default: !1, requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-optional": { type: "boolean", default: !1, requires: ["icon-image", "text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-rotation-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-size": { type: "number", default: 1, minimum: 0, units: "factor of the original icon size", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-text-fit": { type: "enum", values: { none: {}, width: {}, height: {}, both: {} }, default: "none", requires: ["icon-image", "text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-text-fit-padding": { type: "array", value: "number", length: 4, default: [0, 0, 0, 0], units: "pixels", requires: ["icon-image", "text-field", { "icon-text-fit": ["both", "width", "height"] }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-image": { type: "resolvedImage", tokens: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-rotate": { type: "number", default: 0, period: 360, units: "degrees", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-padding": { type: "number", default: 2, minimum: 0, units: "pixels", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-keep-upright": { type: "boolean", default: !1, requires: ["icon-image", { "icon-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-offset": { type: "array", value: "number", length: 2, default: [0, 0], requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-anchor": { type: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, default: "center", requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-pitch-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-pitch-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-rotation-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-field": { type: "formatted", default: "", tokens: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-font": { type: "array", value: "string", default: ["Open Sans Regular", "Arial Unicode MS Regular"], requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-size": { type: "number", default: 16, minimum: 0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-width": { type: "number", default: 10, minimum: 0, units: "ems", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-line-height": { type: "number", default: 1.2, units: "ems", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-letter-spacing": { type: "number", default: 0, units: "ems", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-justify": { type: "enum", values: { auto: {}, left: {}, center: {}, right: {} }, default: "center", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-radial-offset": { type: "number", units: "ems", default: 0, requires: ["text-field"], "property-type": "data-driven", expression: { interpolated: !0, parameters: ["zoom", "feature"] } }, "text-variable-anchor": { type: "array", value: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, requires: ["text-field", { "symbol-placement": ["point"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-anchor": { type: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, default: "center", requires: ["text-field", { "!": "text-variable-anchor" }], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-angle": { type: "number", default: 45, units: "degrees", requires: ["text-field", { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-writing-mode": { type: "array", value: "enum", values: { horizontal: {}, vertical: {} }, requires: ["text-field", { "symbol-placement": ["point"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-rotate": { type: "number", default: 0, period: 360, units: "degrees", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-padding": { type: "number", default: 2, minimum: 0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-keep-upright": { type: "boolean", default: !0, requires: ["text-field", { "text-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-transform": { type: "enum", values: { none: {}, uppercase: {}, lowercase: {} }, default: "none", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-offset": { type: "array", value: "number", units: "ems", length: 2, default: [0, 0], requires: ["text-field", { "!": "text-radial-offset" }], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-allow-overlap": { type: "boolean", default: !1, requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-ignore-placement": { type: "boolean", default: !1, requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-optional": { type: "boolean", default: !1, requires: ["text-field", "icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_raster: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_hillshade: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, filter: { type: "array", value: "*" }, filter_operator: { type: "enum", values: { "==": {}, "!=": {}, ">": {}, ">=": {}, "<": {}, "<=": {}, in: {}, "!in": {}, all: {}, any: {}, none: {}, has: {}, "!has": {}, within: {} } }, geometry_type: { type: "enum", values: { Point: {}, LineString: {}, Polygon: {} } }, function: { expression: { type: "expression" }, stops: { type: "array", value: "function_stop" }, base: { type: "number", default: 1, minimum: 0 }, property: { type: "string", default: "$zoom" }, type: { type: "enum", values: { identity: {}, exponential: {}, interval: {}, categorical: {} }, default: "exponential" }, colorSpace: { type: "enum", values: { rgb: {}, lab: {}, hcl: {} }, default: "rgb" }, default: { type: "*", required: !1 } }, function_stop: { type: "array", minimum: 0, maximum: 24, value: ["number", "color"], length: 2 }, expression: { type: "array", value: "*", minimum: 1 }, fog: { range: { type: "array", default: [.5, 10], minimum: -20, maximum: 20, length: 2, value: "number", "property-type": "data-constant", transition: !0, expression: { interpolated: !0, parameters: ["zoom"] } }, color: { type: "color", "property-type": "data-constant", default: "#ffffff", expression: { interpolated: !0, parameters: ["zoom"] }, transition: !0 }, "horizon-blend": { type: "number", "property-type": "data-constant", default: .1, minimum: 0, maximum: 1, expression: { interpolated: !0, parameters: ["zoom"] }, transition: !0 } }, light: { anchor: { type: "enum", default: "viewport", values: { map: {}, viewport: {} }, "property-type": "data-constant", transition: !1, expression: { interpolated: !1, parameters: ["zoom"] } }, position: { type: "array", default: [1.15, 210, 30], length: 3, value: "number", "property-type": "data-constant", transition: !0, expression: { interpolated: !0, parameters: ["zoom"] } }, color: { type: "color", "property-type": "data-constant", default: "#ffffff", expression: { interpolated: !0, parameters: ["zoom"] }, transition: !0 }, intensity: { type: "number", "property-type": "data-constant", default: .5, minimum: 0, maximum: 1, expression: { interpolated: !0, parameters: ["zoom"] }, transition: !0 } }, terrain: { source: { type: "string", required: !0 }, exaggeration: { type: "number", "property-type": "data-constant", default: 1, minimum: 0, maximum: 1e3, expression: { interpolated: !0, parameters: ["zoom"] }, transition: !0 } }, paint: ["paint_fill", "paint_line", "paint_circle", "paint_heatmap", "paint_fill-extrusion", "paint_symbol", "paint_raster", "paint_hillshade", "paint_background", "paint_sky"], paint_fill: { "fill-antialias": { type: "boolean", default: !0, expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-color": { type: "color", default: "#000000", transition: !0, requires: [{ "!": "fill-pattern" }], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-outline-color": { type: "color", transition: !0, requires: [{ "!": "fill-pattern" }, { "fill-antialias": !0 }], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["fill-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-pattern": { type: "resolvedImage", transition: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" } }, "paint_fill-extrusion": { "fill-extrusion-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-pattern-topColor": { type: "color", default: "#000000", transition: !0, requires: [{ "!": "fill-extrusion-pattern-topColor" }], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "fill-extrusion-color": { type: "color", default: "#000000", transition: !0, requires: [{ "!": "fill-extrusion-pattern" }], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["fill-extrusion-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-pattern": { type: "resolvedImage", transition: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "fill-extrusion-height": { type: "number", default: 0, minimum: 0, units: "meters", transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-base": { type: "number", default: 0, minimum: 0, units: "meters", transition: !0, requires: ["fill-extrusion-height"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-vertical-gradient": { type: "boolean", default: !0, transition: !1, expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_line: { "line-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-color": { type: "color", default: "#000000", transition: !0, requires: [{ "!": "line-pattern" }], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["line-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-width": { type: "number", default: 1, minimum: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-gap-width": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-offset": { type: "number", default: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-blur": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-dasharray": { type: "array", value: "number", minimum: 0, transition: !0, units: "line widths", requires: [{ "!": "line-pattern" }], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "line-pattern": { type: "resolvedImage", transition: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "line-gradient": { type: "color", transition: !1, requires: [{ "!": "line-dasharray" }, { "!": "line-pattern" }, { source: "geojson", has: { lineMetrics: !0 } }], expression: { interpolated: !0, parameters: ["line-progress"] }, "property-type": "color-ramp" } }, paint_circle: { "circle-radius": { type: "number", default: 5, minimum: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-color": { type: "color", default: "#000000", transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-blur": { type: "number", default: 0, transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["circle-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-pitch-scale": { type: "enum", values: { map: {}, viewport: {} }, default: "map", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-pitch-alignment": { type: "enum", values: { map: {}, viewport: {} }, default: "viewport", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-stroke-width": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-stroke-color": { type: "color", default: "#000000", transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-stroke-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" } }, paint_heatmap: { "heatmap-radius": { type: "number", default: 30, minimum: 1, transition: !0, units: "pixels", expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "heatmap-weight": { type: "number", default: 1, minimum: 0, transition: !1, expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "heatmap-intensity": { type: "number", default: 1, minimum: 0, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "heatmap-color": { type: "color", default: ["interpolate", ["linear"], ["heatmap-density"], 0, "rgba(0, 0, 255, 0)", .1, "royalblue", .3, "cyan", .5, "lime", .7, "yellow", 1, "red"], transition: !1, expression: { interpolated: !0, parameters: ["heatmap-density"] }, "property-type": "color-ramp" }, "heatmap-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_symbol: { "icon-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-color": { type: "color", default: "#000000", transition: !0, requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-color": { type: "color", default: "rgba(0, 0, 0, 0)", transition: !0, requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-width": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-blur": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["icon-image", "icon-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-color": { type: "color", default: "#000000", transition: !0, overridable: !0, requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-color": { type: "color", default: "rgba(0, 0, 0, 0)", transition: !0, requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-width": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-blur": { type: "number", default: 0, minimum: 0, transition: !0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: !0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["text-field", "text-translate"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_raster: { "raster-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-hue-rotate": { type: "number", default: 0, period: 360, transition: !0, units: "degrees", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-brightness-min": { type: "number", default: 0, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-brightness-max": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-saturation": { type: "number", default: 0, minimum: -1, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-contrast": { type: "number", default: 0, minimum: -1, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-resampling": { type: "enum", values: { linear: {}, nearest: {} }, default: "linear", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-fade-duration": { type: "number", default: 300, minimum: 0, transition: !1, units: "milliseconds", expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_hillshade: { "hillshade-illumination-direction": { type: "number", default: 335, minimum: 0, maximum: 359, transition: !1, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-illumination-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "viewport", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-exaggeration": { type: "number", default: .5, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-shadow-color": { type: "color", default: "#000000", transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-highlight-color": { type: "color", default: "#FFFFFF", transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-accent-color": { type: "color", default: "#000000", transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_background: { "background-color": { type: "color", default: "#000000", transition: !0, requires: [{ "!": "background-pattern" }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "background-pattern": { type: "resolvedImage", transition: !0, expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "cross-faded" }, "background-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_sky: { "sky-type": { type: "enum", values: { gradient: {}, atmosphere: {} }, default: "atmosphere", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "sky-atmosphere-sun": { type: "array", value: "number", length: 2, units: "degrees", minimum: [0, 0], maximum: [360, 180], transition: !1, requires: [{ "sky-type": "atmosphere" }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "sky-atmosphere-sun-intensity": { type: "number", requires: [{ "sky-type": "atmosphere" }], default: 10, minimum: 0, maximum: 100, transition: !1, "property-type": "data-constant" }, "sky-gradient-center": { type: "array", requires: [{ "sky-type": "gradient" }], value: "number", default: [0, 0], length: 2, units: "degrees", minimum: [0, 0], maximum: [360, 180], transition: !1, expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "sky-gradient-radius": { type: "number", requires: [{ "sky-type": "gradient" }], default: 90, minimum: 0, maximum: 180, transition: !1, expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "sky-gradient": { type: "color", default: ["interpolate", ["linear"], ["sky-radial-progress"], .8, "#87ceeb", 1, "white"], transition: !1, requires: [{ "sky-type": "gradient" }], expression: { interpolated: !0, parameters: ["sky-radial-progress"] }, "property-type": "color-ramp" }, "sky-atmosphere-halo-color": { type: "color", default: "white", transition: !1, requires: [{ "sky-type": "atmosphere" }], "property-type": "data-constant" }, "sky-atmosphere-color": { type: "color", default: "white", transition: !1, requires: [{ "sky-type": "atmosphere" }], "property-type": "data-constant" }, "sky-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: !0, expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" } }, transition: { duration: { type: "number", default: 300, minimum: 0, units: "milliseconds" }, delay: { type: "number", default: 0, minimum: 0, units: "milliseconds" } }, "property-type": { "data-driven": { type: "property-type" }, "cross-faded": { type: "property-type" }, "cross-faded-data-driven": { type: "property-type" }, "color-ramp": { type: "property-type" }, "data-constant": { type: "property-type" }, constant: { type: "property-type" } }, promoteId: { "*": { type: "string" } } }; class K { constructor(t, e, i, r) { this.message = (t ? `${t}: ` : "") + i, r && (this.identifier = r), null != e && e.__line__ && (this.line = e.__line__); } } function H(t) { const e = t.value; return e ? [new K(t.key, e, "constants have been deprecated as of v8")] : [] } function W(t, ...e) { for (const i of e) for (const e in i) t[e] = i[e]; return t } function Y(t) { return t instanceof Number || t instanceof String || t instanceof Boolean ? t.valueOf() : t } function J(t) { if (Array.isArray(t)) return t.map(J); if (t instanceof Object && !(t instanceof Number || t instanceof String || t instanceof Boolean)) { const e = {}; for (const i in t) e[i] = J(t[i]); return e } return Y(t) } class Q extends Error { constructor(t, e) { super(e), this.message = e, this.key = t; } } var tt = Q; class et { constructor(t, e = []) { this.parent = t, this.bindings = {}; for (const [t, i] of e) this.bindings[t] = i; } concat(t) { return new et(this, t) } get(t) { if (this.bindings[t]) return this.bindings[t]; if (this.parent) return this.parent.get(t); throw new Error(`${t} not found in scope.`) } has(t) { return !!this.bindings[t] || !!this.parent && this.parent.has(t) } } var it = et; const rt = { kind: "null" }, nt = { kind: "number" }, st = { kind: "string" }, at = { kind: "boolean" }, ot = { kind: "color" }, lt = { kind: "object" }, ht = { kind: "value" }, ut = { kind: "collator" }, ct = { kind: "formatted" }, pt = { kind: "resolvedImage" }; function dt(t, e) { return { kind: "array", itemType: t, N: e } } function ft(t) { if ("array" === t.kind) { const e = ft(t.itemType); return "number" == typeof t.N ? `array<${e}, ${t.N}>` : "value" === t.itemType.kind ? "array" : `array<${e}>` } return t.kind } const yt = [rt, nt, st, at, ot, ct, lt, dt(ht), pt]; function mt(t, e) { if ("error" === e.kind) return null; if ("array" === t.kind) { if ("array" === e.kind && (0 === e.N && "value" === e.itemType.kind || !mt(t.itemType, e.itemType)) && ("number" != typeof t.N || t.N === e.N)) return null } else { if (t.kind === e.kind) return null; if ("value" === t.kind) for (const t of yt) if (!mt(t, e)) return null } return `Expected ${ft(t)} but found ${ft(e)} instead.` } function gt(t, e) { return e.some((e => e.kind === t.kind)) } function xt(t, e) { return e.some((e => "null" === e ? null === t : "array" === e ? Array.isArray(t) : "object" === e ? t && !Array.isArray(t) && "object" == typeof t : e === typeof t)) } function _t(t) { var e = { exports: {} }; return t(e, e.exports), e.exports } var vt = _t((function (t, e) { var i = { transparent: [0, 0, 0, 0], aliceblue: [240, 248, 255, 1], antiquewhite: [250, 235, 215, 1], aqua: [0, 255, 255, 1], aquamarine: [127, 255, 212, 1], azure: [240, 255, 255, 1], beige: [245, 245, 220, 1], bisque: [255, 228, 196, 1], black: [0, 0, 0, 1], blanchedalmond: [255, 235, 205, 1], blue: [0, 0, 255, 1], blueviolet: [138, 43, 226, 1], brown: [165, 42, 42, 1], burlywood: [222, 184, 135, 1], cadetblue: [95, 158, 160, 1], chartreuse: [127, 255, 0, 1], chocolate: [210, 105, 30, 1], coral: [255, 127, 80, 1], cornflowerblue: [100, 149, 237, 1], cornsilk: [255, 248, 220, 1], crimson: [220, 20, 60, 1], cyan: [0, 255, 255, 1], darkblue: [0, 0, 139, 1], darkcyan: [0, 139, 139, 1], darkgoldenrod: [184, 134, 11, 1], darkgray: [169, 169, 169, 1], darkgreen: [0, 100, 0, 1], darkgrey: [169, 169, 169, 1], darkkhaki: [189, 183, 107, 1], darkmagenta: [139, 0, 139, 1], darkolivegreen: [85, 107, 47, 1], darkorange: [255, 140, 0, 1], darkorchid: [153, 50, 204, 1], darkred: [139, 0, 0, 1], darksalmon: [233, 150, 122, 1], darkseagreen: [143, 188, 143, 1], darkslateblue: [72, 61, 139, 1], darkslategray: [47, 79, 79, 1], darkslategrey: [47, 79, 79, 1], darkturquoise: [0, 206, 209, 1], darkviolet: [148, 0, 211, 1], deeppink: [255, 20, 147, 1], deepskyblue: [0, 191, 255, 1], dimgray: [105, 105, 105, 1], dimgrey: [105, 105, 105, 1], dodgerblue: [30, 144, 255, 1], firebrick: [178, 34, 34, 1], floralwhite: [255, 250, 240, 1], forestgreen: [34, 139, 34, 1], fuchsia: [255, 0, 255, 1], gainsboro: [220, 220, 220, 1], ghostwhite: [248, 248, 255, 1], gold: [255, 215, 0, 1], goldenrod: [218, 165, 32, 1], gray: [128, 128, 128, 1], green: [0, 128, 0, 1], greenyellow: [173, 255, 47, 1], grey: [128, 128, 128, 1], honeydew: [240, 255, 240, 1], hotpink: [255, 105, 180, 1], indianred: [205, 92, 92, 1], indigo: [75, 0, 130, 1], ivory: [255, 255, 240, 1], khaki: [240, 230, 140, 1], lavender: [230, 230, 250, 1], lavenderblush: [255, 240, 245, 1], lawngreen: [124, 252, 0, 1], lemonchiffon: [255, 250, 205, 1], lightblue: [173, 216, 230, 1], lightcoral: [240, 128, 128, 1], lightcyan: [224, 255, 255, 1], lightgoldenrodyellow: [250, 250, 210, 1], lightgray: [211, 211, 211, 1], lightgreen: [144, 238, 144, 1], lightgrey: [211, 211, 211, 1], lightpink: [255, 182, 193, 1], lightsalmon: [255, 160, 122, 1], lightseagreen: [32, 178, 170, 1], lightskyblue: [135, 206, 250, 1], lightslategray: [119, 136, 153, 1], lightslategrey: [119, 136, 153, 1], lightsteelblue: [176, 196, 222, 1], lightyellow: [255, 255, 224, 1], lime: [0, 255, 0, 1], limegreen: [50, 205, 50, 1], linen: [250, 240, 230, 1], magenta: [255, 0, 255, 1], maroon: [128, 0, 0, 1], mediumaquamarine: [102, 205, 170, 1], mediumblue: [0, 0, 205, 1], mediumorchid: [186, 85, 211, 1], mediumpurple: [147, 112, 219, 1], mediumseagreen: [60, 179, 113, 1], mediumslateblue: [123, 104, 238, 1], mediumspringgreen: [0, 250, 154, 1], mediumturquoise: [72, 209, 204, 1], mediumvioletred: [199, 21, 133, 1], midnightblue: [25, 25, 112, 1], mintcream: [245, 255, 250, 1], mistyrose: [255, 228, 225, 1], moccasin: [255, 228, 181, 1], navajowhite: [255, 222, 173, 1], navy: [0, 0, 128, 1], oldlace: [253, 245, 230, 1], olive: [128, 128, 0, 1], olivedrab: [107, 142, 35, 1], orange: [255, 165, 0, 1], orangered: [255, 69, 0, 1], orchid: [218, 112, 214, 1], palegoldenrod: [238, 232, 170, 1], palegreen: [152, 251, 152, 1], paleturquoise: [175, 238, 238, 1], palevioletred: [219, 112, 147, 1], papayawhip: [255, 239, 213, 1], peachpuff: [255, 218, 185, 1], peru: [205, 133, 63, 1], pink: [255, 192, 203, 1], plum: [221, 160, 221, 1], powderblue: [176, 224, 230, 1], purple: [128, 0, 128, 1], rebeccapurple: [102, 51, 153, 1], red: [255, 0, 0, 1], rosybrown: [188, 143, 143, 1], royalblue: [65, 105, 225, 1], saddlebrown: [139, 69, 19, 1], salmon: [250, 128, 114, 1], sandybrown: [244, 164, 96, 1], seagreen: [46, 139, 87, 1], seashell: [255, 245, 238, 1], sienna: [160, 82, 45, 1], silver: [192, 192, 192, 1], skyblue: [135, 206, 235, 1], slateblue: [106, 90, 205, 1], slategray: [112, 128, 144, 1], slategrey: [112, 128, 144, 1], snow: [255, 250, 250, 1], springgreen: [0, 255, 127, 1], steelblue: [70, 130, 180, 1], tan: [210, 180, 140, 1], teal: [0, 128, 128, 1], thistle: [216, 191, 216, 1], tomato: [255, 99, 71, 1], turquoise: [64, 224, 208, 1], violet: [238, 130, 238, 1], wheat: [245, 222, 179, 1], white: [255, 255, 255, 1], whitesmoke: [245, 245, 245, 1], yellow: [255, 255, 0, 1], yellowgreen: [154, 205, 50, 1] }; function r(t) { return (t = Math.round(t)) < 0 ? 0 : t > 255 ? 255 : t } function n(t) { return r("%" === t[t.length - 1] ? parseFloat(t) / 100 * 255 : parseInt(t)) } function s(t) { return (e = "%" === t[t.length - 1] ? parseFloat(t) / 100 : parseFloat(t)) < 0 ? 0 : e > 1 ? 1 : e; var e; } function a(t, e, i) { return i < 0 ? i += 1 : i > 1 && (i -= 1), 6 * i < 1 ? t + (e - t) * i * 6 : 2 * i < 1 ? e : 3 * i < 2 ? t + (e - t) * (2 / 3 - i) * 6 : t } try { e.parseCSSColor = function (t) { var e, o = t.replace(/ /g, "").toLowerCase(); if (o in i) return i[o].slice(); if ("#" === o[0]) return 4 === o.length ? (e = parseInt(o.substr(1), 16)) >= 0 && e <= 4095 ? [(3840 & e) >> 4 | (3840 & e) >> 8, 240 & e | (240 & e) >> 4, 15 & e | (15 & e) << 4, 1] : null : 7 === o.length && (e = parseInt(o.substr(1), 16)) >= 0 && e <= 16777215 ? [(16711680 & e) >> 16, (65280 & e) >> 8, 255 & e, 1] : null; var l = o.indexOf("("), h = o.indexOf(")"); if (-1 !== l && h + 1 === o.length) { var u = o.substr(0, l), c = o.substr(l + 1, h - (l + 1)).split(","), p = 1; switch (u) { case "rgba": if (4 !== c.length) return null; p = s(c.pop()); case "rgb": return 3 !== c.length ? null : [n(c[0]), n(c[1]), n(c[2]), p]; case "hsla": if (4 !== c.length) return null; p = s(c.pop()); case "hsl": if (3 !== c.length) return null; var d = (parseFloat(c[0]) % 360 + 360) % 360 / 360, f = s(c[1]), y = s(c[2]), m = y <= .5 ? y * (f + 1) : y + f - y * f, g = 2 * y - m; return [r(255 * a(g, m, d + 1 / 3)), r(255 * a(g, m, d)), r(255 * a(g, m, d - 1 / 3)), p]; default: return null } } return null }; } catch (t) { } })); class bt { constructor(t, e, i, r = 1) { this.r = t, this.g = e, this.b = i, this.a = r; } static parse(t) { if (!t) return; if (t instanceof bt) return t; if ("string" != typeof t) return; const e = vt.parseCSSColor(t); return e ? new bt(e[0] / 255 * e[3], e[1] / 255 * e[3], e[2] / 255 * e[3], e[3]) : void 0 } toString() { const [t, e, i, r] = this.toArray(); return `rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${r})` } toArray() { const { r: t, g: e, b: i, a: r } = this; return 0 === r ? [0, 0, 0, 0] : [255 * t / r, 255 * e / r, 255 * i / r, r] } } bt.black = new bt(0, 0, 0, 1), bt.white = new bt(1, 1, 1, 1), bt.transparent = new bt(0, 0, 0, 0), bt.red = new bt(1, 0, 0, 1), bt.blue = new bt(0, 0, 1, 1); var wt = bt; class kt { constructor(t, e, i) { this.sensitivity = t ? e ? "variant" : "case" : e ? "accent" : "base", this.locale = i, this.collator = new Intl.Collator(this.locale ? this.locale : [], { sensitivity: this.sensitivity, usage: "search" }); } compare(t, e) { return this.collator.compare(t, e) } resolvedLocale() { return new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale } } class At { constructor(t, e, i, r, n) { this.text = t, this.image = e, this.scale = i, this.fontStack = r, this.textColor = n; } } class St { constructor(t) { this.sections = t; } static fromString(t) { return new St([new At(t, null, null, null, null)]) } isEmpty() { return 0 === this.sections.length || !this.sections.some((t => 0 !== t.text.length || t.image && 0 !== t.image.name.length)) } static factory(t) { return t instanceof St ? t : St.fromString(t) } toString() { return 0 === this.sections.length ? "" : this.sections.map((t => t.text)).join("") } serialize() { const t = ["format"]; for (const e of this.sections) { if (e.image) { t.push(["image", e.image.name]); continue } t.push(e.text); const i = {}; e.fontStack && (i["text-font"] = ["literal", e.fontStack.split(",")]), e.scale && (i["font-scale"] = e.scale), e.textColor && (i["text-color"] = ["rgba"].concat(e.textColor.toArray())), t.push(i); } return t } } class zt { constructor(t) { this.name = t.name, this.available = t.available; } toString() { return this.name } static fromString(t) { return t ? new zt({ name: t, available: !1 }) : null } serialize() { return ["image", this.name] } } function It(t, e, i, r) { return "number" == typeof t && t >= 0 && t <= 255 && "number" == typeof e && e >= 0 && e <= 255 && "number" == typeof i && i >= 0 && i <= 255 ? void 0 === r || "number" == typeof r && r >= 0 && r <= 1 ? null : `Invalid rgba value [${[t, e, i, r].join(", ")}]: 'a' must be between 0 and 1.` : `Invalid rgba value [${("number" == typeof r ? [t, e, i, r] : [t, e, i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.` } function Mt(t) { if (null === t) return !0; if ("string" == typeof t) return !0; if ("boolean" == typeof t) return !0; if ("number" == typeof t) return !0; if (t instanceof wt) return !0; if (t instanceof kt) return !0; if (t instanceof St) return !0; if (t instanceof zt) return !0; if (Array.isArray(t)) { for (const e of t) if (!Mt(e)) return !1; return !0 } if ("object" == typeof t) { for (const e in t) if (!Mt(t[e])) return !1; return !0 } return !1 } function Tt(t) { if (null === t) return rt; if ("string" == typeof t) return st; if ("boolean" == typeof t) return at; if ("number" == typeof t) return nt; if (t instanceof wt) return ot; if (t instanceof kt) return ut; if (t instanceof St) return ct; if (t instanceof zt) return pt; if (Array.isArray(t)) { const e = t.length; let i; for (const e of t) { const t = Tt(e); if (i) { if (i === t) continue; i = ht; break } i = t; } return dt(i || ht, e) } return lt } function Et(t) { const e = typeof t; return null === t ? "" : "string" === e || "number" === e || "boolean" === e ? String(t) : t instanceof wt || t instanceof St || t instanceof zt ? t.toString() : JSON.stringify(t) } class Ct { constructor(t, e) { this.type = t, this.value = e; } static parse(t, e) { if (2 !== t.length) return e.error(`'literal' expression requires exactly one argument, but found ${t.length - 1} instead.`); if (!Mt(t[1])) return e.error("invalid value"); const i = t[1]; let r = Tt(i); const n = e.expectedType; return "array" !== r.kind || 0 !== r.N || !n || "array" !== n.kind || "number" == typeof n.N && 0 !== n.N || (r = n), new Ct(r, i) } evaluate() { return this.value } eachChild() { } outputDefined() { return !0 } serialize() { return "array" === this.type.kind || "object" === this.type.kind ? ["literal", this.value] : this.value instanceof wt ? ["rgba"].concat(this.value.toArray()) : this.value instanceof St ? this.value.serialize() : this.value } } var Pt = Ct, Dt = class { constructor(t) { this.name = "ExpressionEvaluationError", this.message = t; } toJSON() { return this.message } }; const Bt = { string: st, number: nt, boolean: at, object: lt }; class Vt { constructor(t, e) { this.type = t, this.args = e; } static parse(t, e) { if (t.length < 2) return e.error("Expected at least one argument."); let i, r = 1; const n = t[0]; if ("array" === n) { let n, s; if (t.length > 2) { const i = t[1]; if ("string" != typeof i || !(i in Bt) || "object" === i) return e.error('The item type argument of "array" must be one of string, number, boolean', 1); n = Bt[i], r++; } else n = ht; if (t.length > 3) { if (null !== t[2] && ("number" != typeof t[2] || t[2] < 0 || t[2] !== Math.floor(t[2]))) return e.error('The length argument to "array" must be a positive integer literal', 2); s = t[2], r++; } i = dt(n, s); } else i = Bt[n]; const s = []; for (; r < t.length; r++) { const i = e.parse(t[r], r, ht); if (!i) return null; s.push(i); } return new Vt(i, s) } evaluate(t) { for (let e = 0; e < this.args.length; e++) { const i = this.args[e].evaluate(t); if (!mt(this.type, Tt(i))) return i; if (e === this.args.length - 1) throw new Dt(`Expected value to be of type ${ft(this.type)}, but found ${ft(Tt(i))} instead.`) } return null } eachChild(t) { this.args.forEach(t); } outputDefined() { return this.args.every((t => t.outputDefined())) } serialize() { const t = this.type, e = [t.kind]; if ("array" === t.kind) { const i = t.itemType; if ("string" === i.kind || "number" === i.kind || "boolean" === i.kind) { e.push(i.kind); const r = t.N; ("number" == typeof r || this.args.length > 1) && e.push(r); } } return e.concat(this.args.map((t => t.serialize()))) } } var Lt = Vt; class Ft { constructor(t) { this.type = ct, this.sections = t; } static parse(t, e) { if (t.length < 2) return e.error("Expected at least one argument."); const i = t[1]; if (!Array.isArray(i) && "object" == typeof i) return e.error("First argument must be an image or text section."); const r = []; let n = !1; for (let i = 1; i <= t.length - 1; ++i) { const s = t[i]; if (n && "object" == typeof s && !Array.isArray(s)) { n = !1; let t = null; if (s["font-scale"] && (t = e.parse(s["font-scale"], 1, nt), !t)) return null; let i = null; if (s["text-font"] && (i = e.parse(s["text-font"], 1, dt(st)), !i)) return null; let a = null; if (s["text-color"] && (a = e.parse(s["text-color"], 1, ot), !a)) return null; const o = r[r.length - 1]; o.scale = t, o.font = i, o.textColor = a; } else { const s = e.parse(t[i], 1, ht); if (!s) return null; const a = s.type.kind; if ("string" !== a && "value" !== a && "null" !== a && "resolvedImage" !== a) return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'."); n = !0, r.push({ content: s, scale: null, font: null, textColor: null }); } } return new Ft(r) } evaluate(t) { return new St(this.sections.map((e => { const i = e.content.evaluate(t); return Tt(i) === pt ? new At("", i, null, null, null) : new At(Et(i), null, e.scale ? e.scale.evaluate(t) : null, e.font ? e.font.evaluate(t).join(",") : null, e.textColor ? e.textColor.evaluate(t) : null) }))) } eachChild(t) { for (const e of this.sections) t(e.content), e.scale && t(e.scale), e.font && t(e.font), e.textColor && t(e.textColor); } outputDefined() { return !1 } serialize() { const t = ["format"]; for (const e of this.sections) { t.push(e.content.serialize()); const i = {}; e.scale && (i["font-scale"] = e.scale.serialize()), e.font && (i["text-font"] = e.font.serialize()), e.textColor && (i["text-color"] = e.textColor.serialize()), t.push(i); } return t } } class Rt { constructor(t) { this.type = pt, this.input = t; } static parse(t, e) { if (2 !== t.length) return e.error("Expected two arguments."); const i = e.parse(t[1], 1, st); return i ? new Rt(i) : e.error("No image name provided.") } evaluate(t) { const e = this.input.evaluate(t), i = zt.fromString(e); return i && t.availableImages && (i.available = t.availableImages.indexOf(e) > -1), i } eachChild(t) { t(this.input); } outputDefined() { return !1 } serialize() { return ["image", this.input.serialize()] } } const Ot = { "to-boolean": at, "to-color": ot, "to-number": nt, "to-string": st }; class Ut { constructor(t, e) { this.type = t, this.args = e; } static parse(t, e) { if (t.length < 2) return e.error("Expected at least one argument."); const i = t[0]; if (("to-boolean" === i || "to-string" === i) && 2 !== t.length) return e.error("Expected one argument."); const r = Ot[i], n = []; for (let i = 1; i < t.length; i++) { const r = e.parse(t[i], i, ht); if (!r) return null; n.push(r); } return new Ut(r, n) } evaluate(t) { if ("boolean" === this.type.kind) return Boolean(this.args[0].evaluate(t)); if ("color" === this.type.kind) { let e, i; for (const r of this.args) { if (e = r.evaluate(t), i = null, e instanceof wt) return e; if ("string" == typeof e) { const i = t.parseColor(e); if (i) return i } else if (Array.isArray(e) && (i = e.length < 3 || e.length > 4 ? `Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.` : It(e[0], e[1], e[2], e[3]), !i)) return new wt(e[0] / 255, e[1] / 255, e[2] / 255, e[3]) } throw new Dt(i || `Could not parse color from value '${"string" == typeof e ? e : String(JSON.stringify(e))}'`) } if ("number" === this.type.kind) { let e = null; for (const i of this.args) { if (e = i.evaluate(t), null === e) return 0; const r = Number(e); if (!isNaN(r)) return r } throw new Dt(`Could not convert ${JSON.stringify(e)} to number.`) } return "formatted" === this.type.kind ? St.fromString(Et(this.args[0].evaluate(t))) : "resolvedImage" === this.type.kind ? zt.fromString(Et(this.args[0].evaluate(t))) : Et(this.args[0].evaluate(t)) } eachChild(t) { this.args.forEach(t); } outputDefined() { return this.args.every((t => t.outputDefined())) } serialize() { if ("formatted" === this.type.kind) return new Ft([{ content: this.args[0], scale: null, font: null, textColor: null }]).serialize(); if ("resolvedImage" === this.type.kind) return new Rt(this.args[0]).serialize(); const t = [`to-${this.type.kind}`]; return this.eachChild((e => { t.push(e.serialize()); })), t } } var $t = Ut; const Zt = ["Unknown", "Point", "LineString", "Polygon"]; var qt = class { constructor() { this.globals = null, this.feature = null, this.featureState = null, this.formattedSection = null, this._parseColorCache = {}, this.availableImages = null, this.canonical = null; } id() { return this.feature && "id" in this.feature ? this.feature.id : null } geometryType() { return this.feature ? "number" == typeof this.feature.type ? Zt[this.feature.type] : this.feature.type : null } geometry() { return this.feature && "geometry" in this.feature ? this.feature.geometry : null } canonicalID() { return this.canonical } properties() { return this.feature && this.feature.properties || {} } parseColor(t) { let e = this._parseColorCache[t]; return e || (e = this._parseColorCache[t] = wt.parse(t)), e } }; class Nt { constructor(t, e, i, r) { this.name = t, this.type = e, this._evaluate = i, this.args = r; } evaluate(t) { return this._evaluate(t, this.args) } eachChild(t) { this.args.forEach(t); } outputDefined() { return !1 } serialize() { return [this.name].concat(this.args.map((t => t.serialize()))) } static parse(t, e) { const i = t[0], r = Nt.definitions[i]; if (!r) return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`, 0); const n = Array.isArray(r) ? r[0] : r.type, s = Array.isArray(r) ? [[r[1], r[2]]] : r.overloads, a = s.filter((([e]) => !Array.isArray(e) || e.length === t.length - 1)); let o = null; for (const [r, s] of a) { o = new ge(e.registry, e.path, null, e.scope); const a = []; let l = !1; for (let e = 1; e < t.length; e++) { const i = t[e], n = Array.isArray(r) ? r[e - 1] : r.type, s = o.parse(i, 1 + a.length, n); if (!s) { l = !0; break } a.push(s); } if (!l) if (Array.isArray(r) && r.length !== a.length) o.error(`Expected ${r.length} arguments, but found ${a.length} instead.`); else { for (let t = 0; t < a.length; t++) { const e = Array.isArray(r) ? r[t] : r.type, i = a[t]; o.concat(t + 1).checkSubtype(e, i.type); } if (0 === o.errors.length) return new Nt(i, n, s, a) } } if (1 === a.length) e.errors.push(...o.errors); else { const i = (a.length ? a : s).map((([t]) => { return e = t, Array.isArray(e) ? `(${e.map(ft).join(", ")})` : `(${ft(e.type)}...)`; var e; })).join(" | "), r = []; for (let i = 1; i < t.length; i++) { const n = e.parse(t[i], 1 + r.length); if (!n) return null; r.push(ft(n.type)); } e.error(`Expected arguments of type ${i}, but found (${r.join(", ")}) instead.`); } return null } static register(t, e) { Nt.definitions = e; for (const i in e) t[i] = Nt; } } var jt = Nt; class Gt { constructor(t, e, i) { this.type = ut, this.locale = i, this.caseSensitive = t, this.diacriticSensitive = e; } static parse(t, e) { if (2 !== t.length) return e.error("Expected one argument."); const i = t[1]; if ("object" != typeof i || Array.isArray(i)) return e.error("Collator options argument must be an object."); const r = e.parse(void 0 !== i["case-sensitive"] && i["case-sensitive"], 1, at); if (!r) return null; const n = e.parse(void 0 !== i["diacritic-sensitive"] && i["diacritic-sensitive"], 1, at); if (!n) return null; let s = null; return i.locale && (s = e.parse(i.locale, 1, st), !s) ? null : new Gt(r, n, s) } evaluate(t) { return new kt(this.caseSensitive.evaluate(t), this.diacriticSensitive.evaluate(t), this.locale ? this.locale.evaluate(t) : null) } eachChild(t) { t(this.caseSensitive), t(this.diacriticSensitive), this.locale && t(this.locale); } outputDefined() { return !1 } serialize() { const t = {}; return t["case-sensitive"] = this.caseSensitive.serialize(), t["diacritic-sensitive"] = this.diacriticSensitive.serialize(), this.locale && (t.locale = this.locale.serialize()), ["collator", t] } } const Xt = 8192; function Kt(t, e) { t[0] = Math.min(t[0], e[0]), t[1] = Math.min(t[1], e[1]), t[2] = Math.max(t[2], e[0]), t[3] = Math.max(t[3], e[1]); } function Ht(t, e) { return !(t[0] <= e[0] || t[2] >= e[2] || t[1] <= e[1] || t[3] >= e[3]) } function Wt(t, e) { const i = (180 + t[0]) / 360, r = (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + t[1] * Math.PI / 360))) / 360, n = Math.pow(2, e.z); return [Math.round(i * n * Xt), Math.round(r * n * Xt)] } function Yt(t, e, i) { const r = t[0] - e[0], n = t[1] - e[1], s = t[0] - i[0], a = t[1] - i[1]; return r * a - s * n == 0 && r * s <= 0 && n * a <= 0 } function Jt(t, e) { let i = !1; for (let a = 0, o = e.length; a < o; a++) { const o = e[a]; for (let e = 0, a = o.length; e < a - 1; e++) { if (Yt(t, o[e], o[e + 1])) return !1; (n = o[e])[1] > (r = t)[1] != (s = o[e + 1])[1] > r[1] && r[0] < (s[0] - n[0]) * (r[1] - n[1]) / (s[1] - n[1]) + n[0] && (i = !i); } } var r, n, s; return i } function Qt(t, e) { for (let i = 0; i < e.length; i++)if (Jt(t, e[i])) return !0; return !1 } function te(t, e, i, r) { const n = r[0] - i[0], s = r[1] - i[1], a = (t[0] - i[0]) * s - n * (t[1] - i[1]), o = (e[0] - i[0]) * s - n * (e[1] - i[1]); return a > 0 && o < 0 || a < 0 && o > 0 } function ee(t, e, i) { for (const h of i) for (let i = 0; i < h.length - 1; ++i)if (0 != (o = [(a = h[i + 1])[0] - (s = h[i])[0], a[1] - s[1]])[0] * (l = [(n = e)[0] - (r = t)[0], n[1] - r[1]])[1] - o[1] * l[0] && te(r, n, s, a) && te(s, a, r, n)) return !0; var r, n, s, a, o, l; return !1 } function ie(t, e) { for (let i = 0; i < t.length; ++i)if (!Jt(t[i], e)) return !1; for (let i = 0; i < t.length - 1; ++i)if (ee(t[i], t[i + 1], e)) return !1; return !0 } function re(t, e) { for (let i = 0; i < e.length; i++)if (ie(t, e[i])) return !0; return !1 } function ne(t, e, i) { const r = []; for (let n = 0; n < t.length; n++) { const s = []; for (let r = 0; r < t[n].length; r++) { const a = Wt(t[n][r], i); Kt(e, a), s.push(a); } r.push(s); } return r } function se(t, e, i) { const r = []; for (let n = 0; n < t.length; n++) { const s = ne(t[n], e, i); r.push(s); } return r } function ae(t, e, i, r) { if (t[0] < i[0] || t[0] > i[2]) { const e = .5 * r; let n = t[0] - i[0] > e ? -r : i[0] - t[0] > e ? r : 0; 0 === n && (n = t[0] - i[2] > e ? -r : i[2] - t[0] > e ? r : 0), t[0] += n; } Kt(e, t); } function oe(t, e, i, r) { const n = Math.pow(2, r.z) * Xt, s = [r.x * Xt, r.y * Xt], a = []; for (const r of t) for (const t of r) { const r = [t.x + s[0], t.y + s[1]]; ae(r, e, i, n), a.push(r); } return a } function le(t, e, i, r) { const n = Math.pow(2, r.z) * Xt, s = [r.x * Xt, r.y * Xt], a = []; for (const i of t) { const t = []; for (const r of i) { const i = [r.x + s[0], r.y + s[1]]; Kt(e, i), t.push(i); } a.push(t); } if (e[2] - e[0] <= n / 2) { (o = e)[0] = o[1] = 1 / 0, o[2] = o[3] = -1 / 0; for (const t of a) for (const r of t) ae(r, e, i, n); } var o; return a } class he { constructor(t, e) { this.type = at, this.geojson = t, this.geometries = e; } static parse(t, e) { if (2 !== t.length) return e.error(`'within' expression requires exactly one argument, but found ${t.length - 1} instead.`); if (Mt(t[1])) { const e = t[1]; if ("FeatureCollection" === e.type) for (let t = 0; t < e.features.length; ++t) { const i = e.features[t].geometry.type; if ("Polygon" === i || "MultiPolygon" === i) return new he(e, e.features[t].geometry) } else if ("Feature" === e.type) { const t = e.geometry.type; if ("Polygon" === t || "MultiPolygon" === t) return new he(e, e.geometry) } else if ("Polygon" === e.type || "MultiPolygon" === e.type) return new he(e, e) } return e.error("'within' expression requires valid geojson object that contains polygon geometry type.") } evaluate(t) { if (null != t.geometry() && null != t.canonicalID()) { if ("Point" === t.geometryType()) return function (t, e) { const i = [1 / 0, 1 / 0, -1 / 0, -1 / 0], r = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = t.canonicalID(); if ("Polygon" === e.type) { const s = ne(e.coordinates, r, n), a = oe(t.geometry(), i, r, n); if (!Ht(i, r)) return !1; for (const t of a) if (!Jt(t, s)) return !1 } if ("MultiPolygon" === e.type) { const s = se(e.coordinates, r, n), a = oe(t.geometry(), i, r, n); if (!Ht(i, r)) return !1; for (const t of a) if (!Qt(t, s)) return !1 } return !0 }(t, this.geometries); if ("LineString" === t.geometryType()) return function (t, e) { const i = [1 / 0, 1 / 0, -1 / 0, -1 / 0], r = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = t.canonicalID(); if ("Polygon" === e.type) { const s = ne(e.coordinates, r, n), a = le(t.geometry(), i, r, n); if (!Ht(i, r)) return !1; for (const t of a) if (!ie(t, s)) return !1 } if ("MultiPolygon" === e.type) { const s = se(e.coordinates, r, n), a = le(t.geometry(), i, r, n); if (!Ht(i, r)) return !1; for (const t of a) if (!re(t, s)) return !1 } return !0 }(t, this.geometries) } return !1 } eachChild() { } outputDefined() { return !0 } serialize() { return ["within", this.geojson] } } var ue = he; function ce(t) { if (t instanceof jt) { if ("get" === t.name && 1 === t.args.length) return !1; if ("feature-state" === t.name) return !1; if ("has" === t.name && 1 === t.args.length) return !1; if ("properties" === t.name || "geometry-type" === t.name || "id" === t.name) return !1; if (/^filter-/.test(t.name)) return !1 } if (t instanceof ue) return !1; let e = !0; return t.eachChild((t => { e && !ce(t) && (e = !1); })), e } function pe(t) { if (t instanceof jt && "feature-state" === t.name) return !1; let e = !0; return t.eachChild((t => { e && !pe(t) && (e = !1); })), e } function de(t, e) { if (t instanceof jt && e.indexOf(t.name) >= 0) return !1; let i = !0; return t.eachChild((t => { i && !de(t, e) && (i = !1); })), i } class fe { constructor(t, e) { this.type = e.type, this.name = t, this.boundExpression = e; } static parse(t, e) { if (2 !== t.length || "string" != typeof t[1]) return e.error("'var' expression requires exactly one string literal argument."); const i = t[1]; return e.scope.has(i) ? new fe(i, e.scope.get(i)) : e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`, 1) } evaluate(t) { return this.boundExpression.evaluate(t) } eachChild() { } outputDefined() { return !1 } serialize() { return ["var", this.name] } } var ye = fe; class me { constructor(t, e = [], i, r = new it, n = []) { this.registry = t, this.path = e, this.key = e.map((t => `[${t}]`)).join(""), this.scope = r, this.errors = n, this.expectedType = i; } parse(t, e, i, r, n = {}) { return e ? this.concat(e, i, r)._parse(t, n) : this._parse(t, n) } _parse(t, e) { function i(t, e, i) { return "assert" === i ? new Lt(e, [t]) : "coerce" === i ? new $t(e, [t]) : t } if (null !== t && "string" != typeof t && "boolean" != typeof t && "number" != typeof t || (t = ["literal", t]), Array.isArray(t)) { if (0 === t.length) return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].'); const r = t[0]; if ("string" != typeof r) return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`, 0), null; const n = this.registry[r]; if (n) { let r = n.parse(t, this); if (!r) return null; if (this.expectedType) { const t = this.expectedType, n = r.type; if ("string" !== t.kind && "number" !== t.kind && "boolean" !== t.kind && "object" !== t.kind && "array" !== t.kind || "value" !== n.kind) if ("color" !== t.kind && "formatted" !== t.kind && "resolvedImage" !== t.kind || "value" !== n.kind && "string" !== n.kind) { if (this.checkSubtype(t, n)) return null } else r = i(r, t, e.typeAnnotation || "coerce"); else r = i(r, t, e.typeAnnotation || "assert"); } if (!(r instanceof Pt) && "resolvedImage" !== r.type.kind && xe(r)) { const t = new qt; try { r = new Pt(r.type, r.evaluate(t)); } catch (t) { return this.error(t.message), null } } return r } return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`, 0) } return this.error(void 0 === t ? "'undefined' value invalid. Use null instead." : "object" == typeof t ? 'Bare objects invalid. Use ["literal", {...}] instead.' : `Expected an array, but found ${typeof t} instead.`) } concat(t, e, i) { const r = "number" == typeof t ? this.path.concat(t) : this.path, n = i ? this.scope.concat(i) : this.scope; return new me(this.registry, r, e || null, n, this.errors) } error(t, ...e) { const i = `${this.key}${e.map((t => `[${t}]`)).join("")}`; this.errors.push(new tt(i, t)); } checkSubtype(t, e) { const i = mt(t, e); return i && this.error(i), i } } var ge = me; function xe(t) { if (t instanceof ye) return xe(t.boundExpression); if (t instanceof jt && "error" === t.name) return !1; if (t instanceof Gt) return !1; if (t instanceof ue) return !1; const e = t instanceof $t || t instanceof Lt; let i = !0; return t.eachChild((t => { i = e ? i && xe(t) : i && t instanceof Pt; })), !!i && ce(t) && de(t, ["zoom", "heatmap-density", "line-progress", "sky-radial-progress", "accumulated", "is-supported-script"]) } function _e(t, e) { const i = t.length - 1; let r, n, s = 0, a = i, o = 0; for (; s <= a;)if (o = Math.floor((s + a) / 2), r = t[o], n = t[o + 1], r <= e) { if (o === i || e < n) return o; s = o + 1; } else { if (!(r > e)) throw new Dt("Input is not a number."); a = o - 1; } return 0 } class ve { constructor(t, e, i) { this.type = t, this.input = e, this.labels = [], this.outputs = []; for (const [t, e] of i) this.labels.push(t), this.outputs.push(e); } static parse(t, e) { if (t.length - 1 < 4) return e.error(`Expected at least 4 arguments, but found only ${t.length - 1}.`); if ((t.length - 1) % 2 != 0) return e.error("Expected an even number of arguments."); const i = e.parse(t[1], 1, nt); if (!i) return null; const r = []; let n = null; e.expectedType && "value" !== e.expectedType.kind && (n = e.expectedType); for (let i = 1; i < t.length; i += 2) { const s = 1 === i ? -1 / 0 : t[i], a = t[i + 1], o = i, l = i + 1; if ("number" != typeof s) return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.', o); if (r.length && r[r.length - 1][0] >= s) return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.', o); const h = e.parse(a, l, n); if (!h) return null; n = n || h.type, r.push([s, h]); } return new ve(n, i, r) } evaluate(t) { const e = this.labels, i = this.outputs; if (1 === e.length) return i[0].evaluate(t); const r = this.input.evaluate(t); if (r <= e[0]) return i[0].evaluate(t); const n = e.length; return r >= e[n - 1] ? i[n - 1].evaluate(t) : i[_e(e, r)].evaluate(t) } eachChild(t) { t(this.input); for (const e of this.outputs) t(e); } outputDefined() { return this.outputs.every((t => t.outputDefined())) } serialize() { const t = ["step", this.input.serialize()]; for (let e = 0; e < this.labels.length; e++)e > 0 && t.push(this.labels[e]), t.push(this.outputs[e].serialize()); return t } } var be = ve, we = ke; function ke(t, e, i, r) { this.cx = 3 * t, this.bx = 3 * (i - t) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * e, this.by = 3 * (r - e) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = t, this.p1y = r, this.p2x = i, this.p2y = r; } function Ae(t, e, i) { return t * (1 - i) + e * i } ke.prototype.sampleCurveX = function (t) { return ((this.ax * t + this.bx) * t + this.cx) * t }, ke.prototype.sampleCurveY = function (t) { return ((this.ay * t + this.by) * t + this.cy) * t }, ke.prototype.sampleCurveDerivativeX = function (t) { return (3 * this.ax * t + 2 * this.bx) * t + this.cx }, ke.prototype.solveCurveX = function (t, e) { var i, r, n, s, a; for (void 0 === e && (e = 1e-6), n = t, a = 0; a < 8; a++) { if (s = this.sampleCurveX(n) - t, Math.abs(s) < e) return n; var o = this.sampleCurveDerivativeX(n); if (Math.abs(o) < 1e-6) break; n -= s / o; } if ((n = t) < (i = 0)) return i; if (n > (r = 1)) return r; for (; i < r;) { if (s = this.sampleCurveX(n), Math.abs(s - t) < e) return n; t > s ? i = n : r = n, n = .5 * (r - i) + i; } return n }, ke.prototype.solve = function (t, e) { return this.sampleCurveY(this.solveCurveX(t, e)) }; var Se = Object.freeze({ __proto__: null, number: Ae, color: function (t, e, i) { return new wt(Ae(t.r, e.r, i), Ae(t.g, e.g, i), Ae(t.b, e.b, i), Ae(t.a, e.a, i)) }, array: function (t, e, i) { return t.map(((t, r) => Ae(t, e[r], i))) } }); const ze = .95047, Ie = 1.08883, Me = 4 / 29, Te = 6 / 29, Ee = 3 * Te * Te, Ce = Math.PI / 180, Pe = 180 / Math.PI; function De(t) { return t > .008856451679035631 ? Math.pow(t, 1 / 3) : t / Ee + Me } function Be(t) { return t > Te ? t * t * t : Ee * (t - Me) } function Ve(t) { return 255 * (t <= .0031308 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - .055) } function Le(t) { return (t /= 255) <= .04045 ? t / 12.92 : Math.pow((t + .055) / 1.055, 2.4) } function Fe(t) { const e = Le(t.r), i = Le(t.g), r = Le(t.b), n = De((.4124564 * e + .3575761 * i + .1804375 * r) / ze), s = De((.2126729 * e + .7151522 * i + .072175 * r) / 1); return { l: 116 * s - 16, a: 500 * (n - s), b: 200 * (s - De((.0193339 * e + .119192 * i + .9503041 * r) / Ie)), alpha: t.a } } function Re(t) { let e = (t.l + 16) / 116, i = isNaN(t.a) ? e : e + t.a / 500, r = isNaN(t.b) ? e : e - t.b / 200; return e = 1 * Be(e), i = ze * Be(i), r = Ie * Be(r), new wt(Ve(3.2404542 * i - 1.5371385 * e - .4985314 * r), Ve(-.969266 * i + 1.8760108 * e + .041556 * r), Ve(.0556434 * i - .2040259 * e + 1.0572252 * r), t.alpha) } function Oe(t, e, i) { const r = e - t; return t + i * (r > 180 || r < -180 ? r - 360 * Math.round(r / 360) : r) } const Ue = { forward: Fe, reverse: Re, interpolate: function (t, e, i) { return { l: Ae(t.l, e.l, i), a: Ae(t.a, e.a, i), b: Ae(t.b, e.b, i), alpha: Ae(t.alpha, e.alpha, i) } } }, $e = { forward: function (t) { const { l: e, a: i, b: r } = Fe(t), n = Math.atan2(r, i) * Pe; return { h: n < 0 ? n + 360 : n, c: Math.sqrt(i * i + r * r), l: e, alpha: t.a } }, reverse: function (t) { const e = t.h * Ce, i = t.c; return Re({ l: t.l, a: Math.cos(e) * i, b: Math.sin(e) * i, alpha: t.alpha }) }, interpolate: function (t, e, i) { return { h: Oe(t.h, e.h, i), c: Ae(t.c, e.c, i), l: Ae(t.l, e.l, i), alpha: Ae(t.alpha, e.alpha, i) } } }; var Ze = Object.freeze({ __proto__: null, lab: Ue, hcl: $e }); class qe { constructor(t, e, i, r, n) { this.type = t, this.operator = e, this.interpolation = i, this.input = r, this.labels = [], this.outputs = []; for (const [t, e] of n) this.labels.push(t), this.outputs.push(e); } static interpolationFactor(t, e, i, r) { let n = 0; if ("exponential" === t.name) n = Ne(e, t.base, i, r); else if ("linear" === t.name) n = Ne(e, 1, i, r); else if ("cubic-bezier" === t.name) { const s = t.controlPoints; n = new we(s[0], s[1], s[2], s[3]).solve(Ne(e, 1, i, r)); } return n } static parse(t, e) { let [i, r, n, ...s] = t; if (!Array.isArray(r) || 0 === r.length) return e.error("Expected an interpolation type expression.", 1); if ("linear" === r[0]) r = { name: "linear" }; else if ("exponential" === r[0]) { const t = r[1]; if ("number" != typeof t) return e.error("Exponential interpolation requires a numeric base.", 1, 1); r = { name: "exponential", base: t }; } else { if ("cubic-bezier" !== r[0]) return e.error(`Unknown interpolation type ${String(r[0])}`, 1, 0); { const t = r.slice(1); if (4 !== t.length || t.some((t => "number" != typeof t || t < 0 || t > 1))) return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.", 1); r = { name: "cubic-bezier", controlPoints: t }; } } if (t.length - 1 < 4) return e.error(`Expected at least 4 arguments, but found only ${t.length - 1}.`); if ((t.length - 1) % 2 != 0) return e.error("Expected an even number of arguments."); if (n = e.parse(n, 2, nt), !n) return null; const a = []; let o = null; "interpolate-hcl" === i || "interpolate-lab" === i ? o = ot : e.expectedType && "value" !== e.expectedType.kind && (o = e.expectedType); for (let t = 0; t < s.length; t += 2) { const i = s[t], r = s[t + 1], n = t + 3, l = t + 4; if ("number" != typeof i) return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.', n); if (a.length && a[a.length - 1][0] >= i) return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.', n); const h = e.parse(r, l, o); if (!h) return null; o = o || h.type, a.push([i, h]); } return "number" === o.kind || "color" === o.kind || "array" === o.kind && "number" === o.itemType.kind && "number" == typeof o.N ? new qe(o, i, r, n, a) : e.error(`Type ${ft(o)} is not interpolatable.`) } evaluate(t) { const e = this.labels, i = this.outputs; if (1 === e.length) return i[0].evaluate(t); const r = this.input.evaluate(t); if (r <= e[0]) return i[0].evaluate(t); const n = e.length; if (r >= e[n - 1]) return i[n - 1].evaluate(t); const s = _e(e, r), a = qe.interpolationFactor(this.interpolation, r, e[s], e[s + 1]), o = i[s].evaluate(t), l = i[s + 1].evaluate(t); return "interpolate" === this.operator ? Se[this.type.kind.toLowerCase()](o, l, a) : "interpolate-hcl" === this.operator ? $e.reverse($e.interpolate($e.forward(o), $e.forward(l), a)) : Ue.reverse(Ue.interpolate(Ue.forward(o), Ue.forward(l), a)) } eachChild(t) { t(this.input); for (const e of this.outputs) t(e); } outputDefined() { return this.outputs.every((t => t.outputDefined())) } serialize() { let t; t = "linear" === this.interpolation.name ? ["linear"] : "exponential" === this.interpolation.name ? 1 === this.interpolation.base ? ["linear"] : ["exponential", this.interpolation.base] : ["cubic-bezier"].concat(this.interpolation.controlPoints); const e = [this.operator, t, this.input.serialize()]; for (let t = 0; t < this.labels.length; t++)e.push(this.labels[t], this.outputs[t].serialize()); return e } } function Ne(t, e, i, r) { const n = r - i, s = t - i; return 0 === n ? 0 : 1 === e ? s / n : (Math.pow(e, s) - 1) / (Math.pow(e, n) - 1) } var je = qe; class Ge { constructor(t, e) { this.type = t, this.args = e; } static parse(t, e) { if (t.length < 2) return e.error("Expectected at least one argument."); let i = null; const r = e.expectedType; r && "value" !== r.kind && (i = r); const n = []; for (const r of t.slice(1)) { const t = e.parse(r, 1 + n.length, i, void 0, { typeAnnotation: "omit" }); if (!t) return null; i = i || t.type, n.push(t); } const s = r && n.some((t => mt(r, t.type))); return new Ge(s ? ht : i, n) } evaluate(t) { let e, i = null, r = 0; for (const n of this.args) if (r++, i = n.evaluate(t), i && i instanceof zt && !i.available && (e || (e = i.name), i = null, r === this.args.length && (i = e)), null !== i) break; return i } eachChild(t) { this.args.forEach(t); } outputDefined() { return this.args.every((t => t.outputDefined())) } serialize() { const t = ["coalesce"]; return this.eachChild((e => { t.push(e.serialize()); })), t } } var Xe = Ge; class Ke { constructor(t, e) { this.type = e.type, this.bindings = [].concat(t), this.result = e; } evaluate(t) { return this.result.evaluate(t) } eachChild(t) { for (const e of this.bindings) t(e[1]); t(this.result); } static parse(t, e) { if (t.length < 4) return e.error(`Expected at least 3 arguments, but found ${t.length - 1} instead.`); const i = []; for (let r = 1; r < t.length - 1; r += 2) { const n = t[r]; if ("string" != typeof n) return e.error(`Expected string, but found ${typeof n} instead.`, r); if (/[^a-zA-Z0-9_]/.test(n)) return e.error("Variable names must contain only alphanumeric characters or '_'.", r); const s = e.parse(t[r + 1], r + 1); if (!s) return null; i.push([n, s]); } const r = e.parse(t[t.length - 1], t.length - 1, e.expectedType, i); return r ? new Ke(i, r) : null } outputDefined() { return this.result.outputDefined() } serialize() { const t = ["let"]; for (const [e, i] of this.bindings) t.push(e, i.serialize()); return t.push(this.result.serialize()), t } } var He = Ke; class We { constructor(t, e, i) { this.type = t, this.index = e, this.input = i; } static parse(t, e) { if (3 !== t.length) return e.error(`Expected 2 arguments, but found ${t.length - 1} instead.`); const i = e.parse(t[1], 1, nt), r = e.parse(t[2], 2, dt(e.expectedType || ht)); return i && r ? new We(r.type.itemType, i, r) : null } evaluate(t) { const e = this.index.evaluate(t), i = this.input.evaluate(t); if (e < 0) throw new Dt(`Array index out of bounds: ${e} < 0.`); if (e >= i.length) throw new Dt(`Array index out of bounds: ${e} > ${i.length - 1}.`); if (e !== Math.floor(e)) throw new Dt(`Array index must be an integer, but found ${e} instead.`); return i[e] } eachChild(t) { t(this.index), t(this.input); } outputDefined() { return !1 } serialize() { return ["at", this.index.serialize(), this.input.serialize()] } } var Ye = We; class Je { constructor(t, e) { this.type = at, this.needle = t, this.haystack = e; } static parse(t, e) { if (3 !== t.length) return e.error(`Expected 2 arguments, but found ${t.length - 1} instead.`); const i = e.parse(t[1], 1, ht), r = e.parse(t[2], 2, ht); return i && r ? gt(i.type, [at, st, nt, rt, ht]) ? new Je(i, r) : e.error(`Expected first argument to be of type boolean, string, number or null, but found ${ft(i.type)} instead`) : null } evaluate(t) { const e = this.needle.evaluate(t), i = this.haystack.evaluate(t); if (!i) return !1; if (!xt(e, ["boolean", "string", "number", "null"])) throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${ft(Tt(e))} instead.`); if (!xt(i, ["string", "array"])) throw new Dt(`Expected second argument to be of type array or string, but found ${ft(Tt(i))} instead.`); return i.indexOf(e) >= 0 } eachChild(t) { t(this.needle), t(this.haystack); } outputDefined() { return !0 } serialize() { return ["in", this.needle.serialize(), this.haystack.serialize()] } } var Qe = Je; class ti { constructor(t, e, i) { this.type = nt, this.needle = t, this.haystack = e, this.fromIndex = i; } static parse(t, e) { if (t.length <= 2 || t.length >= 5) return e.error(`Expected 3 or 4 arguments, but found ${t.length - 1} instead.`); const i = e.parse(t[1], 1, ht), r = e.parse(t[2], 2, ht); if (!i || !r) return null; if (!gt(i.type, [at, st, nt, rt, ht])) return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${ft(i.type)} instead`); if (4 === t.length) { const n = e.parse(t[3], 3, nt); return n ? new ti(i, r, n) : null } return new ti(i, r) } evaluate(t) { const e = this.needle.evaluate(t), i = this.haystack.evaluate(t); if (!xt(e, ["boolean", "string", "number", "null"])) throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${ft(Tt(e))} instead.`); if (!xt(i, ["string", "array"])) throw new Dt(`Expected second argument to be of type array or string, but found ${ft(Tt(i))} instead.`); if (this.fromIndex) { const r = this.fromIndex.evaluate(t); return i.indexOf(e, r) } return i.indexOf(e) } eachChild(t) { t(this.needle), t(this.haystack), this.fromIndex && t(this.fromIndex); } outputDefined() { return !1 } serialize() { if (null != this.fromIndex && void 0 !== this.fromIndex) { const t = this.fromIndex.serialize(); return ["index-of", this.needle.serialize(), this.haystack.serialize(), t] } return ["index-of", this.needle.serialize(), this.haystack.serialize()] } } var ei = ti; class ii { constructor(t, e, i, r, n, s) { this.inputType = t, this.type = e, this.input = i, this.cases = r, this.outputs = n, this.otherwise = s; } static parse(t, e) { if (t.length < 5) return e.error(`Expected at least 4 arguments, but found only ${t.length - 1}.`); if (t.length % 2 != 1) return e.error("Expected an even number of arguments."); let i, r; e.expectedType && "value" !== e.expectedType.kind && (r = e.expectedType); const n = {}, s = []; for (let a = 2; a < t.length - 1; a += 2) { let o = t[a]; const l = t[a + 1]; Array.isArray(o) || (o = [o]); const h = e.concat(a); if (0 === o.length) return h.error("Expected at least one branch label."); for (const t of o) { if ("number" != typeof t && "string" != typeof t) return h.error("Branch labels must be numbers or strings."); if ("number" == typeof t && Math.abs(t) > Number.MAX_SAFE_INTEGER) return h.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`); if ("number" == typeof t && Math.floor(t) !== t) return h.error("Numeric branch labels must be integer values."); if (i) { if (h.checkSubtype(i, Tt(t))) return null } else i = Tt(t); if (void 0 !== n[String(t)]) return h.error("Branch labels must be unique."); n[String(t)] = s.length; } const u = e.parse(l, a, r); if (!u) return null; r = r || u.type, s.push(u); } const a = e.parse(t[1], 1, ht); if (!a) return null; const o = e.parse(t[t.length - 1], t.length - 1, r); return o ? "value" !== a.type.kind && e.concat(1).checkSubtype(i, a.type) ? null : new ii(i, r, a, n, s, o) : null } evaluate(t) { const e = this.input.evaluate(t); return (Tt(e) === this.inputType && this.outputs[this.cases[e]] || this.otherwise).evaluate(t) } eachChild(t) { t(this.input), this.outputs.forEach(t), t(this.otherwise); } outputDefined() { return this.outputs.every((t => t.outputDefined())) && this.otherwise.outputDefined() } serialize() { const t = ["match", this.input.serialize()], e = Object.keys(this.cases).sort(), i = [], r = {}; for (const t of e) { const e = r[this.cases[t]]; void 0 === e ? (r[this.cases[t]] = i.length, i.push([this.cases[t], [t]])) : i[e][1].push(t); } const n = t => "number" === this.inputType.kind ? Number(t) : t; for (const [e, r] of i) t.push(1 === r.length ? n(r[0]) : r.map(n)), t.push(this.outputs[e].serialize()); return t.push(this.otherwise.serialize()), t } } var ri = ii; class ni { constructor(t, e, i) { this.type = t, this.branches = e, this.otherwise = i; } static parse(t, e) { if (t.length < 4) return e.error(`Expected at least 3 arguments, but found only ${t.length - 1}.`); if (t.length % 2 != 0) return e.error("Expected an odd number of arguments."); let i; e.expectedType && "value" !== e.expectedType.kind && (i = e.expectedType); const r = []; for (let n = 1; n < t.length - 1; n += 2) { const s = e.parse(t[n], n, at); if (!s) return null; const a = e.parse(t[n + 1], n + 1, i); if (!a) return null; r.push([s, a]), i = i || a.type; } const n = e.parse(t[t.length - 1], t.length - 1, i); return n ? new ni(i, r, n) : null } evaluate(t) { for (const [e, i] of this.branches) if (e.evaluate(t)) return i.evaluate(t); return this.otherwise.evaluate(t) } eachChild(t) { for (const [e, i] of this.branches) t(e), t(i); t(this.otherwise); } outputDefined() { return this.branches.every((([t, e]) => e.outputDefined())) && this.otherwise.outputDefined() } serialize() { const t = ["case"]; return this.eachChild((e => { t.push(e.serialize()); })), t } } var si = ni; class ai { constructor(t, e, i, r) { this.type = t, this.input = e, this.beginIndex = i, this.endIndex = r; } static parse(t, e) { if (t.length <= 2 || t.length >= 5) return e.error(`Expected 3 or 4 arguments, but found ${t.length - 1} instead.`); const i = e.parse(t[1], 1, ht), r = e.parse(t[2], 2, nt); if (!i || !r) return null; if (!gt(i.type, [dt(ht), st, ht])) return e.error(`Expected first argument to be of type array or string, but found ${ft(i.type)} instead`); if (4 === t.length) { const n = e.parse(t[3], 3, nt); return n ? new ai(i.type, i, r, n) : null } return new ai(i.type, i, r) } evaluate(t) { const e = this.input.evaluate(t), i = this.beginIndex.evaluate(t); if (!xt(e, ["string", "array"])) throw new Dt(`Expected first argument to be of type array or string, but found ${ft(Tt(e))} instead.`); if (this.endIndex) { const r = this.endIndex.evaluate(t); return e.slice(i, r) } return e.slice(i) } eachChild(t) { t(this.input), t(this.beginIndex), this.endIndex && t(this.endIndex); } outputDefined() { return !1 } serialize() { if (null != this.endIndex && void 0 !== this.endIndex) { const t = this.endIndex.serialize(); return ["slice", this.input.serialize(), this.beginIndex.serialize(), t] } return ["slice", this.input.serialize(), this.beginIndex.serialize()] } } var oi = ai; function li(t, e) { return "==" === t || "!=" === t ? "boolean" === e.kind || "string" === e.kind || "number" === e.kind || "null" === e.kind || "value" === e.kind : "string" === e.kind || "number" === e.kind || "value" === e.kind } function hi(t, e, i, r) { return 0 === r.compare(e, i) } function ui(t, e, i) { const r = "==" !== t && "!=" !== t; return class n { constructor(t, e, i) { this.type = at, this.lhs = t, this.rhs = e, this.collator = i, this.hasUntypedArgument = "value" === t.type.kind || "value" === e.type.kind; } static parse(t, e) { if (3 !== t.length && 4 !== t.length) return e.error("Expected two or three arguments."); const i = t[0]; let s = e.parse(t[1], 1, ht); if (!s) return null; if (!li(i, s.type)) return e.concat(1).error(`"${i}" comparisons are not supported for type '${ft(s.type)}'.`); let a = e.parse(t[2], 2, ht); if (!a) return null; if (!li(i, a.type)) return e.concat(2).error(`"${i}" comparisons are not supported for type '${ft(a.type)}'.`); if (s.type.kind !== a.type.kind && "value" !== s.type.kind && "value" !== a.type.kind) return e.error(`Cannot compare types '${ft(s.type)}' and '${ft(a.type)}'.`); r && ("value" === s.type.kind && "value" !== a.type.kind ? s = new Lt(a.type, [s]) : "value" !== s.type.kind && "value" === a.type.kind && (a = new Lt(s.type, [a]))); let o = null; if (4 === t.length) { if ("string" !== s.type.kind && "string" !== a.type.kind && "value" !== s.type.kind && "value" !== a.type.kind) return e.error("Cannot use collator to compare non-string types."); if (o = e.parse(t[3], 3, ut), !o) return null } return new n(s, a, o) } evaluate(n) { const s = this.lhs.evaluate(n), a = this.rhs.evaluate(n); if (r && this.hasUntypedArgument) { const e = Tt(s), i = Tt(a); if (e.kind !== i.kind || "string" !== e.kind && "number" !== e.kind) throw new Dt(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`) } if (this.collator && !r && this.hasUntypedArgument) { const t = Tt(s), i = Tt(a); if ("string" !== t.kind || "string" !== i.kind) return e(n, s, a) } return this.collator ? i(n, s, a, this.collator.evaluate(n)) : e(n, s, a) } eachChild(t) { t(this.lhs), t(this.rhs), this.collator && t(this.collator); } outputDefined() { return !0 } serialize() { const e = [t]; return this.eachChild((t => { e.push(t.serialize()); })), e } } } const ci = ui("==", (function (t, e, i) { return e === i }), hi), pi = ui("!=", (function (t, e, i) { return e !== i }), (function (t, e, i, r) { return !hi(0, e, i, r) })), di = ui("<", (function (t, e, i) { return e < i }), (function (t, e, i, r) { return r.compare(e, i) < 0 })), fi = ui(">", (function (t, e, i) { return e > i }), (function (t, e, i, r) { return r.compare(e, i) > 0 })), yi = ui("<=", (function (t, e, i) { return e <= i }), (function (t, e, i, r) { return r.compare(e, i) <= 0 })), mi = ui(">=", (function (t, e, i) { return e >= i }), (function (t, e, i, r) { return r.compare(e, i) >= 0 })); class gi { constructor(t, e, i, r, n) { this.type = st, this.number = t, this.locale = e, this.currency = i, this.minFractionDigits = r, this.maxFractionDigits = n; } static parse(t, e) { if (3 !== t.length) return e.error("Expected two arguments."); const i = e.parse(t[1], 1, nt); if (!i) return null; const r = t[2]; if ("object" != typeof r || Array.isArray(r)) return e.error("NumberFormat options argument must be an object."); let n = null; if (r.locale && (n = e.parse(r.locale, 1, st), !n)) return null; let s = null; if (r.currency && (s = e.parse(r.currency, 1, st), !s)) return null; let a = null; if (r["min-fraction-digits"] && (a = e.parse(r["min-fraction-digits"], 1, nt), !a)) return null; let o = null; return r["max-fraction-digits"] && (o = e.parse(r["max-fraction-digits"], 1, nt), !o) ? null : new gi(i, n, s, a, o) } evaluate(t) { return new Intl.NumberFormat(this.locale ? this.locale.evaluate(t) : [], { style: this.currency ? "currency" : "decimal", currency: this.currency ? this.currency.evaluate(t) : void 0, minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(t) : void 0, maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(t) : void 0 }).format(this.number.evaluate(t)) } eachChild(t) { t(this.number), this.locale && t(this.locale), this.currency && t(this.currency), this.minFractionDigits && t(this.minFractionDigits), this.maxFractionDigits && t(this.maxFractionDigits); } outputDefined() { return !1 } serialize() { const t = {}; return this.locale && (t.locale = this.locale.serialize()), this.currency && (t.currency = this.currency.serialize()), this.minFractionDigits && (t["min-fraction-digits"] = this.minFractionDigits.serialize()), this.maxFractionDigits && (t["max-fraction-digits"] = this.maxFractionDigits.serialize()), ["number-format", this.number.serialize(), t] } } class xi { constructor(t) { this.type = nt, this.input = t; } static parse(t, e) { if (2 !== t.length) return e.error(`Expected 1 argument, but found ${t.length - 1} instead.`); const i = e.parse(t[1], 1); return i ? "array" !== i.type.kind && "string" !== i.type.kind && "value" !== i.type.kind ? e.error(`Expected argument of type string or array, but found ${ft(i.type)} instead.`) : new xi(i) : null } evaluate(t) { const e = this.input.evaluate(t); if ("string" == typeof e) return e.length; if (Array.isArray(e)) return e.length; throw new Dt(`Expected value to be of type string or array, but found ${ft(Tt(e))} instead.`) } eachChild(t) { t(this.input); } outputDefined() { return !1 } serialize() { const t = ["length"]; return this.eachChild((e => { t.push(e.serialize()); })), t } } const _i = { "==": ci, "!=": pi, ">": fi, "<": di, ">=": mi, "<=": yi, array: Lt, at: Ye, boolean: Lt, case: si, coalesce: Xe, collator: Gt, format: Ft, image: Rt, in: Qe, "index-of": ei, interpolate: je, "interpolate-hcl": je, "interpolate-lab": je, length: xi, let: He, literal: Pt, match: ri, number: Lt, "number-format": gi, object: Lt, slice: oi, step: be, string: Lt, "to-boolean": $t, "to-color": $t, "to-number": $t, "to-string": $t, var: ye, within: ue }; function vi(t, [e, i, r, n]) { e = e.evaluate(t), i = i.evaluate(t), r = r.evaluate(t); const s = n ? n.evaluate(t) : 1, a = It(e, i, r, s); if (a) throw new Dt(a); return new wt(e / 255 * s, i / 255 * s, r / 255 * s, s) } function bi(t, e) { return t in e } function wi(t, e) { const i = e[t]; return void 0 === i ? null : i } function ki(t) { return { type: t } } jt.register(_i, { error: [{ kind: "error" }, [st], (t, [e]) => { throw new Dt(e.evaluate(t)) }], typeof: [st, [ht], (t, [e]) => ft(Tt(e.evaluate(t)))], "to-rgba": [dt(nt, 4), [ot], (t, [e]) => e.evaluate(t).toArray()], rgb: [ot, [nt, nt, nt], vi], rgba: [ot, [nt, nt, nt, nt], vi], has: { type: at, overloads: [[[st], (t, [e]) => bi(e.evaluate(t), t.properties())], [[st, lt], (t, [e, i]) => bi(e.evaluate(t), i.evaluate(t))]] }, get: { type: ht, overloads: [[[st], (t, [e]) => wi(e.evaluate(t), t.properties())], [[st, lt], (t, [e, i]) => wi(e.evaluate(t), i.evaluate(t))]] }, "feature-state": [ht, [st], (t, [e]) => wi(e.evaluate(t), t.featureState || {})], properties: [lt, [], t => t.properties()], "geometry-type": [st, [], t => t.geometryType()], id: [ht, [], t => t.id()], zoom: [nt, [], t => t.globals.zoom], "heatmap-density": [nt, [], t => t.globals.heatmapDensity || 0], "line-progress": [nt, [], t => t.globals.lineProgress || 0], "sky-radial-progress": [nt, [], t => t.globals.skyRadialProgress || 0], accumulated: [ht, [], t => void 0 === t.globals.accumulated ? null : t.globals.accumulated], "+": [nt, ki(nt), (t, e) => { let i = 0; for (const r of e) i += r.evaluate(t); return i }], "*": [nt, ki(nt), (t, e) => { let i = 1; for (const r of e) i *= r.evaluate(t); return i }], "-": { type: nt, overloads: [[[nt, nt], (t, [e, i]) => e.evaluate(t) - i.evaluate(t)], [[nt], (t, [e]) => -e.evaluate(t)]] }, "/": [nt, [nt, nt], (t, [e, i]) => e.evaluate(t) / i.evaluate(t)], "%": [nt, [nt, nt], (t, [e, i]) => e.evaluate(t) % i.evaluate(t)], ln2: [nt, [], () => Math.LN2], pi: [nt, [], () => Math.PI], e: [nt, [], () => Math.E], "^": [nt, [nt, nt], (t, [e, i]) => Math.pow(e.evaluate(t), i.evaluate(t))], sqrt: [nt, [nt], (t, [e]) => Math.sqrt(e.evaluate(t))], log10: [nt, [nt], (t, [e]) => Math.log(e.evaluate(t)) / Math.LN10], ln: [nt, [nt], (t, [e]) => Math.log(e.evaluate(t))], log2: [nt, [nt], (t, [e]) => Math.log(e.evaluate(t)) / Math.LN2], sin: [nt, [nt], (t, [e]) => Math.sin(e.evaluate(t))], cos: [nt, [nt], (t, [e]) => Math.cos(e.evaluate(t))], tan: [nt, [nt], (t, [e]) => Math.tan(e.evaluate(t))], asin: [nt, [nt], (t, [e]) => Math.asin(e.evaluate(t))], acos: [nt, [nt], (t, [e]) => Math.acos(e.evaluate(t))], atan: [nt, [nt], (t, [e]) => Math.atan(e.evaluate(t))], min: [nt, ki(nt), (t, e) => Math.min(...e.map((e => e.evaluate(t))))], max: [nt, ki(nt), (t, e) => Math.max(...e.map((e => e.evaluate(t))))], abs: [nt, [nt], (t, [e]) => Math.abs(e.evaluate(t))], round: [nt, [nt], (t, [e]) => { const i = e.evaluate(t); return i < 0 ? -Math.round(-i) : Math.round(i) }], floor: [nt, [nt], (t, [e]) => Math.floor(e.evaluate(t))], ceil: [nt, [nt], (t, [e]) => Math.ceil(e.evaluate(t))], "filter-==": [at, [st, ht], (t, [e, i]) => t.properties()[e.value] === i.value], "filter-id-==": [at, [ht], (t, [e]) => t.id() === e.value], "filter-type-==": [at, [st], (t, [e]) => t.geometryType() === e.value], "filter-<": [at, [st, ht], (t, [e, i]) => { const r = t.properties()[e.value], n = i.value; return typeof r == typeof n && r < n }], "filter-id-<": [at, [ht], (t, [e]) => { const i = t.id(), r = e.value; return typeof i == typeof r && i < r }], "filter->": [at, [st, ht], (t, [e, i]) => { const r = t.properties()[e.value], n = i.value; return typeof r == typeof n && r > n }], "filter-id->": [at, [ht], (t, [e]) => { const i = t.id(), r = e.value; return typeof i == typeof r && i > r }], "filter-<=": [at, [st, ht], (t, [e, i]) => { const r = t.properties()[e.value], n = i.value; return typeof r == typeof n && r <= n }], "filter-id-<=": [at, [ht], (t, [e]) => { const i = t.id(), r = e.value; return typeof i == typeof r && i <= r }], "filter->=": [at, [st, ht], (t, [e, i]) => { const r = t.properties()[e.value], n = i.value; return typeof r == typeof n && r >= n }], "filter-id->=": [at, [ht], (t, [e]) => { const i = t.id(), r = e.value; return typeof i == typeof r && i >= r }], "filter-has": [at, [ht], (t, [e]) => e.value in t.properties()], "filter-has-id": [at, [], t => null !== t.id() && void 0 !== t.id()], "filter-type-in": [at, [dt(st)], (t, [e]) => e.value.indexOf(t.geometryType()) >= 0], "filter-id-in": [at, [dt(ht)], (t, [e]) => e.value.indexOf(t.id()) >= 0], "filter-in-small": [at, [st, dt(ht)], (t, [e, i]) => i.value.indexOf(t.properties()[e.value]) >= 0], "filter-in-large": [at, [st, dt(ht)], (t, [e, i]) => function (t, e, i, r) { for (; i <= r;) { const n = i + r >> 1; if (e[n] === t) return !0; e[n] > t ? r = n - 1 : i = n + 1; } return !1 }(t.properties()[e.value], i.value, 0, i.value.length - 1)], all: { type: at, overloads: [[[at, at], (t, [e, i]) => e.evaluate(t) && i.evaluate(t)], [ki(at), (t, e) => { for (const i of e) if (!i.evaluate(t)) return !1; return !0 }]] }, any: { type: at, overloads: [[[at, at], (t, [e, i]) => e.evaluate(t) || i.evaluate(t)], [ki(at), (t, e) => { for (const i of e) if (i.evaluate(t)) return !0; return !1 }]] }, "!": [at, [at], (t, [e]) => !e.evaluate(t)], "is-supported-script": [at, [st], (t, [e]) => { const i = t.globals && t.globals.isSupportedScript; return !i || i(e.evaluate(t)) }], upcase: [st, [st], (t, [e]) => e.evaluate(t).toUpperCase()], downcase: [st, [st], (t, [e]) => e.evaluate(t).toLowerCase()], concat: [st, ki(ht), (t, e) => e.map((e => Et(e.evaluate(t)))).join("")], "resolved-locale": [st, [ut], (t, [e]) => e.evaluate(t).resolvedLocale()] }); var Ai = _i; function Si(t) { return { result: "success", value: t } } function zi(t) { return { result: "error", value: t } } function Ii(t) { return t && "data-driven" === t["property-type"] || t && "cross-faded-data-driven" === t["property-type"] } function Mi(t) { return !!t.expression && t.expression.parameters.indexOf("zoom") > -1 } function Ti(t) { return !!t.expression && t.expression.interpolated } function Ei(t) { return t instanceof Number ? "number" : t instanceof String ? "string" : t instanceof Boolean ? "boolean" : Array.isArray(t) ? "array" : null === t ? "null" : typeof t } function Ci(t) { return "object" == typeof t && null !== t && !Array.isArray(t) } function Pi(t) { return t } function Di(t, e) { const i = "color" === e.type, r = t.stops && "object" == typeof t.stops[0][0], n = r || !(r || void 0 !== t.property), s = t.type || (Ti(e) ? "exponential" : "interval"); if (i && ((t = W({}, t)).stops && (t.stops = t.stops.map((t => [t[0], wt.parse(t[1])]))), t.default = wt.parse(t.default ? t.default : e.default)), t.colorSpace && "rgb" !== t.colorSpace && !Ze[t.colorSpace]) throw new Error(`Unknown color space: ${t.colorSpace}`); let a, o, l; if ("exponential" === s) a = Fi; else if ("interval" === s) a = Li; else if ("categorical" === s) { a = Vi, o = Object.create(null); for (const e of t.stops) o[e[0]] = e[1]; l = typeof t.stops[0][0]; } else { if ("identity" !== s) throw new Error(`Unknown function type "${s}"`); a = Ri; } if (r) { const i = {}, r = []; for (let e = 0; e < t.stops.length; e++) { const n = t.stops[e], s = n[0].zoom; void 0 === i[s] && (i[s] = { zoom: s, type: t.type, property: t.property, default: t.default, stops: [] }, r.push(s)), i[s].stops.push([n[0].value, n[1]]); } const n = []; for (const t of r) n.push([i[t].zoom, Di(i[t], e)]); const s = { name: "linear" }; return { kind: "composite", interpolationType: s, interpolationFactor: je.interpolationFactor.bind(void 0, s), zoomStops: n.map((t => t[0])), evaluate: ({ zoom: i }, r) => Fi({ stops: n, base: t.base }, e, i).evaluate(i, r) } } if (n) { const i = "exponential" === s ? { name: "exponential", base: void 0 !== t.base ? t.base : 1 } : null; return { kind: "camera", interpolationType: i, interpolationFactor: je.interpolationFactor.bind(void 0, i), zoomStops: t.stops.map((t => t[0])), evaluate: ({ zoom: i }) => a(t, e, i, o, l) } } return { kind: "source", evaluate(i, r) { const n = r && r.properties ? r.properties[t.property] : void 0; return void 0 === n ? Bi(t.default, e.default) : a(t, e, n, o, l) } } } function Bi(t, e, i) { return void 0 !== t ? t : void 0 !== e ? e : void 0 !== i ? i : void 0 } function Vi(t, e, i, r, n) { return Bi(typeof i === n ? r[i] : void 0, t.default, e.default) } function Li(t, e, i) { if ("number" !== Ei(i)) return Bi(t.default, e.default); const r = t.stops.length; if (1 === r) return t.stops[0][1]; if (i <= t.stops[0][0]) return t.stops[0][1]; if (i >= t.stops[r - 1][0]) return t.stops[r - 1][1]; const n = _e(t.stops.map((t => t[0])), i); return t.stops[n][1] } function Fi(t, e, i) { const r = void 0 !== t.base ? t.base : 1; if ("number" !== Ei(i)) return Bi(t.default, e.default); const n = t.stops.length; if (1 === n) return t.stops[0][1]; if (i <= t.stops[0][0]) return t.stops[0][1]; if (i >= t.stops[n - 1][0]) return t.stops[n - 1][1]; const s = _e(t.stops.map((t => t[0])), i), a = function (t, e, i, r) { const n = r - i, s = t - i; return 0 === n ? 0 : 1 === e ? s / n : (Math.pow(e, s) - 1) / (Math.pow(e, n) - 1) }(i, r, t.stops[s][0], t.stops[s + 1][0]), o = t.stops[s][1], l = t.stops[s + 1][1]; let h = Se[e.type] || Pi; if (t.colorSpace && "rgb" !== t.colorSpace) { const e = Ze[t.colorSpace]; h = (t, i) => e.reverse(e.interpolate(e.forward(t), e.forward(i), a)); } return "function" == typeof o.evaluate ? { evaluate(...t) { const e = o.evaluate.apply(void 0, t), i = l.evaluate.apply(void 0, t); if (void 0 !== e && void 0 !== i) return h(e, i, a) } } : h(o, l, a) } function Ri(t, e, i) { return "color" === e.type ? i = wt.parse(i) : "formatted" === e.type ? i = St.fromString(i.toString()) : "resolvedImage" === e.type ? i = zt.fromString(i.toString()) : Ei(i) === e.type || "enum" === e.type && e.values[i] || (i = void 0), Bi(i, t.default, e.default) } class Oi { constructor(t, e) { this.expression = t, this._warningHistory = {}, this._evaluator = new qt, this._defaultValue = e ? function (t) { return "color" === t.type && Ci(t.default) ? new wt(0, 0, 0, 0) : "color" === t.type ? wt.parse(t.default) || null : void 0 === t.default ? null : t.default }(e) : null, this._enumValues = e && "enum" === e.type ? e.values : null; } evaluateWithoutErrorHandling(t, e, i, r, n, s) { return this._evaluator.globals = t, this._evaluator.feature = e, this._evaluator.featureState = i, this._evaluator.canonical = r, this._evaluator.availableImages = n || null, this._evaluator.formattedSection = s, this.expression.evaluate(this._evaluator) } evaluate(t, e, i, r, n, s) { this._evaluator.globals = t, this._evaluator.feature = e || null, this._evaluator.featureState = i || null, this._evaluator.canonical = r, this._evaluator.availableImages = n || null, this._evaluator.formattedSection = s || null; try { const t = this.expression.evaluate(this._evaluator); if (null == t || "number" == typeof t && t != t) return this._defaultValue; if (this._enumValues && !(t in this._enumValues)) throw new Dt(`Expected value to be one of ${Object.keys(this._enumValues).map((t => JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`); return t } catch (t) { return this._warningHistory[t.message] || (this._warningHistory[t.message] = !0, "undefined" != typeof console && console.warn(t.message)), this._defaultValue } } } function Ui(t) { return Array.isArray(t) && t.length > 0 && "string" == typeof t[0] && t[0] in Ai } function $i(t, e) { const i = new ge(Ai, [], e ? function (t) { const e = { color: ot, string: st, number: nt, enum: st, boolean: at, formatted: ct, resolvedImage: pt }; return "array" === t.type ? dt(e[t.value] || ht, t.length) : e[t.type] }(e) : void 0), r = i.parse(t, void 0, void 0, void 0, e && "string" === e.type ? { typeAnnotation: "coerce" } : void 0); return r ? Si(new Oi(r, e)) : zi(i.errors) } class Zi { constructor(t, e) { this.kind = t, this._styleExpression = e, this.isStateDependent = "constant" !== t && !pe(e.expression); } evaluateWithoutErrorHandling(t, e, i, r, n, s) { return this._styleExpression.evaluateWithoutErrorHandling(t, e, i, r, n, s) } evaluate(t, e, i, r, n, s) { return this._styleExpression.evaluate(t, e, i, r, n, s) } } class qi { constructor(t, e, i, r) { this.kind = t, this.zoomStops = i, this._styleExpression = e, this.isStateDependent = "camera" !== t && !pe(e.expression), this.interpolationType = r; } evaluateWithoutErrorHandling(t, e, i, r, n, s) { return this._styleExpression.evaluateWithoutErrorHandling(t, e, i, r, n, s) } evaluate(t, e, i, r, n, s) { return this._styleExpression.evaluate(t, e, i, r, n, s) } interpolationFactor(t, e, i) { return this.interpolationType ? je.interpolationFactor(this.interpolationType, t, e, i) : 0 } } function Ni(t, e) { if ("error" === (t = $i(t, e)).result) return t; const i = t.value.expression, r = ce(i); if (!r && !Ii(e)) return zi([new tt("", "data expressions not supported")]); const n = de(i, ["zoom"]); if (!n && !Mi(e)) return zi([new tt("", "zoom expressions not supported")]); const s = Gi(i); return s || n ? s instanceof tt ? zi([s]) : s instanceof je && !Ti(e) ? zi([new tt("", '"interpolate" expressions cannot be used with this property')]) : Si(s ? new qi(r ? "camera" : "composite", t.value, s.labels, s instanceof je ? s.interpolation : void 0) : new Zi(r ? "constant" : "source", t.value)) : zi([new tt("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]) } class ji { constructor(t, e) { this._parameters = t, this._specification = e, W(this, Di(this._parameters, this._specification)); } static deserialize(t) { return new ji(t._parameters, t._specification) } static serialize(t) { return { _parameters: t._parameters, _specification: t._specification } } } function Gi(t) { let e = null; if (t instanceof He) e = Gi(t.result); else if (t instanceof Xe) { for (const i of t.args) if (e = Gi(i), e) break } else (t instanceof be || t instanceof je) && t.input instanceof jt && "zoom" === t.input.name && (e = t); return e instanceof tt || t.eachChild((t => { const i = Gi(t); i instanceof tt ? e = i : !e && i ? e = new tt("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : e && i && e !== i && (e = new tt("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.')); })), e } function Xi(t) { const e = t.key, i = t.value, r = t.valueSpec || {}, n = t.objectElementValidators || {}, s = t.style, a = t.styleSpec; let o = []; const l = Ei(i); if ("object" !== l) return [new K(e, i, `object expected, ${l} found`)]; for (const t in i) { const l = t.split(".")[0], h = r[l] || r["*"]; if (t.indexOf("fill-extrusion-pattern-topColor") >= 0) continue; let u; if (n[l]) u = n[l]; else if (r[l]) u = wr; else if (n["*"]) u = n["*"]; else { if (!r["*"]) { o.push(new K(e, i[t], `unknown property "${t}"`)); continue } u = wr; } o = o.concat(u({ key: (e ? `${e}.` : e) + t, value: i[t], valueSpec: h, style: s, styleSpec: a, object: i, objectKey: t }, i)); } for (const t in r) n[t] || r[t].required && void 0 === r[t].default && void 0 === i[t] && o.push(new K(e, i, `missing required property "${t}"`)); return o } function Ki(t) { const e = t.value, i = t.valueSpec, r = t.style, n = t.styleSpec, s = t.key, a = t.arrayElementValidator || wr; if ("array" !== Ei(e)) return [new K(s, e, `array expected, ${Ei(e)} found`)]; if (i.length && e.length !== i.length) return [new K(s, e, `array length ${i.length} expected, length ${e.length} found`)]; if (i["min-length"] && e.length < i["min-length"]) return [new K(s, e, `array length at least ${i["min-length"]} expected, length ${e.length} found`)]; let o = { type: i.value, values: i.values, minimum: i.minimum, maximum: i.maximum }; n.$version < 7 && (o.function = i.function), "object" === Ei(i.value) && (o = i.value); let l = []; for (let t = 0; t < e.length; t++)l = l.concat(a({ array: e, arrayIndex: t, value: e[t], valueSpec: o, style: r, styleSpec: n, key: `${s}[${t}]` })); return l } function Hi(t) { const e = t.key, i = t.value, r = t.valueSpec; let n = Ei(i); if ("number" === n && i != i && (n = "NaN"), "number" !== n) return [new K(e, i, `number expected, ${n} found`)]; if ("minimum" in r) { let n = r.minimum; if ("array" === Ei(r.minimum) && (n = r.minimum[t.arrayIndex]), i < n) return [new K(e, i, `${i} is less than the minimum value ${n}`)] } if ("maximum" in r) { let n = r.maximum; if ("array" === Ei(r.maximum) && (n = r.maximum[t.arrayIndex]), i > n) return [new K(e, i, `${i} is greater than the maximum value ${n}`)] } return [] } function Wi(t) { const e = t.valueSpec, i = Y(t.value.type); let r, n, s, a = {}; const o = "categorical" !== i && void 0 === t.value.property, l = !o, h = "array" === Ei(t.value.stops) && "array" === Ei(t.value.stops[0]) && "object" === Ei(t.value.stops[0][0]), u = Xi({ key: t.key, value: t.value, valueSpec: t.styleSpec.function, style: t.style, styleSpec: t.styleSpec, objectElementValidators: { stops: function (t) { if ("identity" === i) return [new K(t.key, t.value, 'identity function may not have a "stops" property')]; let e = []; const r = t.value; return e = e.concat(Ki({ key: t.key, value: r, valueSpec: t.valueSpec, style: t.style, styleSpec: t.styleSpec, arrayElementValidator: c })), "array" === Ei(r) && 0 === r.length && e.push(new K(t.key, r, "array must have at least one stop")), e }, default: function (t) { return wr({ key: t.key, value: t.value, valueSpec: e, style: t.style, styleSpec: t.styleSpec }) } } }); return "identity" === i && o && u.push(new K(t.key, t.value, 'missing required property "property"')), "identity" === i || t.value.stops || u.push(new K(t.key, t.value, 'missing required property "stops"')), "exponential" === i && t.valueSpec.expression && !Ti(t.valueSpec) && u.push(new K(t.key, t.value, "exponential functions not supported")), t.styleSpec.$version >= 8 && (l && !Ii(t.valueSpec) ? u.push(new K(t.key, t.value, "property functions not supported")) : o && !Mi(t.valueSpec) && u.push(new K(t.key, t.value, "zoom functions not supported"))), "categorical" !== i && !h || void 0 !== t.value.property || u.push(new K(t.key, t.value, '"property" property is required')), u; function c(t) { let i = []; const r = t.value, o = t.key; if ("array" !== Ei(r)) return [new K(o, r, `array expected, ${Ei(r)} found`)]; if (2 !== r.length) return [new K(o, r, `array length 2 expected, length ${r.length} found`)]; if (h) { if ("object" !== Ei(r[0])) return [new K(o, r, `object expected, ${Ei(r[0])} found`)]; if (void 0 === r[0].zoom) return [new K(o, r, "object stop key must have zoom")]; if (void 0 === r[0].value) return [new K(o, r, "object stop key must have value")]; if (s && s > Y(r[0].zoom)) return [new K(o, r[0].zoom, "stop zoom values must appear in ascending order")]; Y(r[0].zoom) !== s && (s = Y(r[0].zoom), n = void 0, a = {}), i = i.concat(Xi({ key: `${o}[0]`, value: r[0], valueSpec: { zoom: {} }, style: t.style, styleSpec: t.styleSpec, objectElementValidators: { zoom: Hi, value: p } })); } else i = i.concat(p({ key: `${o}[0]`, value: r[0], valueSpec: {}, style: t.style, styleSpec: t.styleSpec }, r)); return Ui(J(r[1])) ? i.concat([new K(`${o}[1]`, r[1], "expressions are not allowed in function stops.")]) : i.concat(wr({ key: `${o}[1]`, value: r[1], valueSpec: e, style: t.style, styleSpec: t.styleSpec })) } function p(t, s) { const o = Ei(t.value), l = Y(t.value), h = null !== t.value ? t.value : s; if (r) { if (o !== r) return [new K(t.key, h, `${o} stop domain type must match previous stop domain type ${r}`)] } else r = o; if ("number" !== o && "string" !== o && "boolean" !== o) return [new K(t.key, h, "stop domain value must be a number, string, or boolean")]; if ("number" !== o && "categorical" !== i) { let r = `number expected, ${o} found`; return Ii(e) && void 0 === i && (r += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), [new K(t.key, h, r)] } return "categorical" !== i || "number" !== o || isFinite(l) && Math.floor(l) === l ? "categorical" !== i && "number" === o && void 0 !== n && l < n ? [new K(t.key, h, "stop domain values must appear in ascending order")] : (n = l, "categorical" === i && l in a ? [new K(t.key, h, "stop domain values must be unique")] : (a[l] = !0, [])) : [new K(t.key, h, `integer expected, found ${l}`)] } } function Yi(t) { const e = ("property" === t.expressionContext ? Ni : $i)(J(t.value), t.valueSpec); if ("error" === e.result) return e.value.map((e => new K(`${t.key}${e.key}`, t.value, e.message))); const i = e.value.expression || e.value._styleExpression.expression; if ("property" === t.expressionContext && "text-font" === t.propertyKey && !i.outputDefined()) return [new K(t.key, t.value, `Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)]; if ("property" === t.expressionContext && "layout" === t.propertyType && !pe(i)) return [new K(t.key, t.value, '"feature-state" data expressions are not supported with layout properties.')]; if ("filter" === t.expressionContext && !pe(i)) return [new K(t.key, t.value, '"feature-state" data expressions are not supported with filters.')]; if (t.expressionContext && 0 === t.expressionContext.indexOf("cluster")) { if (!de(i, ["zoom", "feature-state"])) return [new K(t.key, t.value, '"zoom" and "feature-state" expressions are not supported with cluster properties.')]; if ("cluster-initial" === t.expressionContext && !ce(i)) return [new K(t.key, t.value, "Feature data expressions are not supported with initial expression part of cluster properties.")] } return [] } function Ji(t) { const e = t.key, i = t.value, r = t.valueSpec, n = []; return Array.isArray(r.values) ? -1 === r.values.indexOf(Y(i)) && n.push(new K(e, i, `expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)) : -1 === Object.keys(r.values).indexOf(Y(i)) && n.push(new K(e, i, `expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)), n } function Qi(t) { if (!0 === t || !1 === t) return !0; if (!Array.isArray(t) || 0 === t.length) return !1; switch (t[0]) { case "has": return t.length >= 2 && "$id" !== t[1] && "$type" !== t[1]; case "in": return t.length >= 3 && ("string" != typeof t[1] || Array.isArray(t[2])); case "!in": case "!has": case "none": return !1; case "==": case "!=": case ">": case ">=": case "<": case "<=": return 3 !== t.length || Array.isArray(t[1]) || Array.isArray(t[2]); case "any": case "all": for (const e of t.slice(1)) if (!Qi(e) && "boolean" != typeof e) return !1; return !0; default: return !0 } } const tr = { type: "boolean", default: !1, transition: !1, "property-type": "data-driven", expression: { interpolated: !1, parameters: ["zoom", "feature"] } }; function er(t) { if (null == t) return { filter: () => !0, needGeometry: !1 }; Qi(t) || (t = nr(t)); const e = $i(t, tr); if ("error" === e.result) throw new Error(e.value.map((t => `${t.key}: ${t.message}`)).join(", ")); return { filter: (t, i, r) => e.value.evaluate(t, i, {}, r), needGeometry: rr(t) } } function ir(t, e) { return t < e ? -1 : t > e ? 1 : 0 } function rr(t) { if (!Array.isArray(t)) return !1; if ("within" === t[0]) return !0; for (let e = 1; e < t.length; e++)if (rr(t[e])) return !0; return !1 } function nr(t) { if (!t) return !0; const e = t[0]; return t.length <= 1 ? "any" !== e : "==" === e ? sr(t[1], t[2], "==") : "!=" === e ? lr(sr(t[1], t[2], "==")) : "<" === e || ">" === e || "<=" === e || ">=" === e ? sr(t[1], t[2], e) : "any" === e ? (i = t.slice(1), ["any"].concat(i.map(nr))) : "all" === e ? ["all"].concat(t.slice(1).map(nr)) : "none" === e ? ["all"].concat(t.slice(1).map(nr).map(lr)) : "in" === e ? ar(t[1], t.slice(2)) : "!in" === e ? lr(ar(t[1], t.slice(2))) : "has" === e ? or(t[1]) : "!has" === e ? lr(or(t[1])) : "within" !== e || t; var i; } function sr(t, e, i) { switch (t) { case "$type": return [`filter-type-${i}`, e]; case "$id": return [`filter-id-${i}`, e]; default: return [`filter-${i}`, t, e] } } function ar(t, e) { if (0 === e.length) return !1; switch (t) { case "$type": return ["filter-type-in", ["literal", e]]; case "$id": return ["filter-id-in", ["literal", e]]; default: return e.length > 200 && !e.some((t => typeof t != typeof e[0])) ? ["filter-in-large", t, ["literal", e.sort(ir)]] : ["filter-in-small", t, ["literal", e]] } } function or(t) { switch (t) { case "$type": return !0; case "$id": return ["filter-has-id"]; default: return ["filter-has", t] } } function lr(t) { return ["!", t] } function hr(t) { return Qi(J(t.value)) ? Yi(W({}, t, { expressionContext: "filter", valueSpec: { value: "boolean" } })) : ur(t) } function ur(t) { const e = t.value, i = t.key; if ("array" !== Ei(e)) return [new K(i, e, `array expected, ${Ei(e)} found`)]; const r = t.styleSpec; let n, s = []; if (e.length < 1) return [new K(i, e, "filter array must have at least 1 element")]; switch (s = s.concat(Ji({ key: `${i}[0]`, value: e[0], valueSpec: r.filter_operator, style: t.style, styleSpec: t.styleSpec })), Y(e[0])) { case "<": case "<=": case ">": case ">=": e.length >= 2 && "$type" === Y(e[1]) && s.push(new K(i, e, `"$type" cannot be use with operator "${e[0]}"`)); case "==": case "!=": 3 !== e.length && s.push(new K(i, e, `filter array for operator "${e[0]}" must have 3 elements`)); case "in": case "!in": e.length >= 2 && (n = Ei(e[1]), "string" !== n && s.push(new K(`${i}[1]`, e[1], `string expected, ${n} found`))); for (let a = 2; a < e.length; a++)n = Ei(e[a]), "$type" === Y(e[1]) ? s = s.concat(Ji({ key: `${i}[${a}]`, value: e[a], valueSpec: r.geometry_type, style: t.style, styleSpec: t.styleSpec })) : "string" !== n && "number" !== n && "boolean" !== n && s.push(new K(`${i}[${a}]`, e[a], `string, number, or boolean expected, ${n} found`)); break; case "any": case "all": case "none": for (let r = 1; r < e.length; r++)s = s.concat(ur({ key: `${i}[${r}]`, value: e[r], style: t.style, styleSpec: t.styleSpec })); break; case "has": case "!has": n = Ei(e[1]), 2 !== e.length ? s.push(new K(i, e, `filter array for "${e[0]}" operator must have 2 elements`)) : "string" !== n && s.push(new K(`${i}[1]`, e[1], `string expected, ${n} found`)); break; case "within": n = Ei(e[1]), 2 !== e.length ? s.push(new K(i, e, `filter array for "${e[0]}" operator must have 2 elements`)) : "object" !== n && s.push(new K(`${i}[1]`, e[1], `object expected, ${n} found`)); }return s } function cr(t, e) { const i = t.key, r = t.style, n = t.styleSpec, s = t.value, a = t.objectKey, o = n[`${e}_${t.layerType}`]; if (!o) return []; const l = a.match(/^(.*)-transition$/); if ("paint" === e && l && o[l[1]] && o[l[1]].transition) return wr({ key: i, value: s, valueSpec: n.transition, style: r, styleSpec: n }); const h = t.valueSpec || o[a]; if (!h) return [new K(i, s, `unknown property "${a}"`)]; let u; if ("string" === Ei(s) && Ii(h) && !h.tokens && (u = /^{([^}]+)}$/.exec(s))) return [new K(i, s, `"${a}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(u[1])} }\`.`)]; const c = []; return "symbol" === t.layerType && ("text-field" === a && r && !r.glyphs && c.push(new K(i, s, 'use of "text-field" requires a style "glyphs" property')), "text-font" === a && Ci(J(s)) && "identity" === Y(s.type) && c.push(new K(i, s, '"text-font" does not support identity functions'))), c.concat(wr({ key: t.key, value: s, valueSpec: h, style: r, styleSpec: n, expressionContext: "property", propertyType: e, propertyKey: a })) } function pr(t) { return cr(t, "paint") } function dr(t) { return cr(t, "layout") } function fr(t) { let e = []; const i = t.value, r = t.key, n = t.style, s = t.styleSpec; i.type || i.ref || e.push(new K(r, i, 'either "type" or "ref" is required')); let a = Y(i.type); const o = Y(i.ref); if (i.id) { const s = Y(i.id); for (let a = 0; a < t.arrayIndex; a++) { const t = n.layers[a]; Y(t.id) === s && e.push(new K(r, i.id, `duplicate layer id "${i.id}", previously used at line ${t.id.__line__}`)); } } if ("ref" in i) { let t;["type", "source", "source-layer", "filter", "layout"].forEach((t => { t in i && e.push(new K(r, i[t], `"${t}" is prohibited for ref layers`)); })), n.layers.forEach((e => { Y(e.id) === o && (t = e); })), t ? t.ref ? e.push(new K(r, i.ref, "ref cannot reference another ref layer")) : a = Y(t.type) : e.push(new K(r, i.ref, `ref layer "${o}" not found`)); } else if ("background" !== a && "sky" !== a) if (i.source) { const t = n.sources && n.sources[i.source], s = t && Y(t.type); t ? "vector" === s && "raster" === a ? e.push(new K(r, i.source, `layer "${i.id}" requires a raster source`)) : "raster" === s && "raster" !== a ? e.push(new K(r, i.source, `layer "${i.id}" requires a vector source`)) : "vector" !== s || i["source-layer"] ? "raster-dem" === s && "hillshade" !== a ? e.push(new K(r, i.source, "raster-dem source can only be used with layer type 'hillshade'.")) : "line" !== a || !i.paint || !i.paint["line-gradient"] || "geojson" === s && t.lineMetrics || e.push(new K(r, i, `layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)) : e.push(new K(r, i, `layer "${i.id}" must specify a "source-layer"`)) : e.push(new K(r, i.source, `source "${i.source}" not found`)); } else e.push(new K(r, i, 'missing required property "source"')); return e = e.concat(Xi({ key: r, value: i, valueSpec: s.layer, style: t.style, styleSpec: t.styleSpec, objectElementValidators: { "*": () => [], type: () => wr({ key: `${r}.type`, value: i.type, valueSpec: s.layer.type, style: t.style, styleSpec: t.styleSpec, object: i, objectKey: "type" }), filter: hr, layout: t => Xi({ layer: i, key: t.key, value: t.value, style: t.style, styleSpec: t.styleSpec, objectElementValidators: { "*": t => dr(W({ layerType: a }, t)) } }), paint: t => Xi({ layer: i, key: t.key, value: t.value, style: t.style, styleSpec: t.styleSpec, objectElementValidators: { "*": t => pr(W({ layerType: a }, t)) } }) } })), e } function yr(t) { const e = t.value, i = t.key, r = Ei(e); return "string" !== r ? [new K(i, e, `string expected, ${r} found`)] : [] } const mr = { promoteId: function ({ key: t, value: e }) { if ("string" === Ei(e)) return yr({ key: t, value: e }); { const i = []; for (const r in e) i.push(...yr({ key: `${t}.${r}`, value: e[r] })); return i } } }; function gr(t) { const e = t.value, i = t.key, r = t.styleSpec, n = t.style; if (!e.type) return [new K(i, e, '"type" is required')]; const s = Y(e.type); let a; switch (s) { case "vector": case "raster": case "raster-dem": return a = Xi({ key: i, value: e, valueSpec: r[`source_${s.replace("-", "_")}`], style: t.style, styleSpec: r, objectElementValidators: mr }), a; case "geojson": if (a = Xi({ key: i, value: e, valueSpec: r.source_geojson, style: n, styleSpec: r, objectElementValidators: mr }), e.cluster) for (const t in e.clusterProperties) { const [r, n] = e.clusterProperties[t], s = "string" == typeof r ? [r, ["accumulated"], ["get", t]] : r; a.push(...Yi({ key: `${i}.${t}.map`, value: n, expressionContext: "cluster-map" })), a.push(...Yi({ key: `${i}.${t}.reduce`, value: s, expressionContext: "cluster-reduce" })); } return a; case "video": return Xi({ key: i, value: e, valueSpec: r.source_video, style: n, styleSpec: r }); case "image": return Xi({ key: i, value: e, valueSpec: r.source_image, style: n, styleSpec: r }); case "canvas": return [new K(i, null, "Please use runtime APIs to add canvas sources, rather than including them in stylesheets.", "source.canvas")]; default: return Ji({ key: `${i}.type`, value: e.type, valueSpec: { values: ["vector", "raster", "raster-dem", "geojson", "video", "image"] }, style: n, styleSpec: r }) } } function xr(t) { const e = t.value, i = t.styleSpec, r = i.light, n = t.style; let s = []; const a = Ei(e); if (void 0 === e) return s; if ("object" !== a) return s = s.concat([new K("light", e, `object expected, ${a} found`)]), s; for (const t in e) { const a = t.match(/^(.*)-transition$/); s = s.concat(a && r[a[1]] && r[a[1]].transition ? wr({ key: t, value: e[t], valueSpec: i.transition, style: n, styleSpec: i }) : r[t] ? wr({ key: t, value: e[t], valueSpec: r[t], style: n, styleSpec: i }) : [new K(t, e[t], `unknown property "${t}"`)]); } return s } function _r(t) { const e = t.value, i = t.key, r = t.style, n = t.styleSpec, s = n.terrain; let a = []; const o = Ei(e); if (void 0 === e) return a; if ("object" !== o) return a = a.concat([new K("terrain", e, `object expected, ${o} found`)]), a; for (const t in e) { const i = t.match(/^(.*)-transition$/); a = a.concat(i && s[i[1]] && s[i[1]].transition ? wr({ key: t, value: e[t], valueSpec: n.transition, style: r, styleSpec: n }) : s[t] ? wr({ key: t, value: e[t], valueSpec: s[t], style: r, styleSpec: n }) : [new K(t, e[t], `unknown property "${t}"`)]); } if (e.source) { const t = r.sources && r.sources[e.source], n = t && Y(t.type); t ? "raster-dem" !== n && a.push(new K(i, e.source, `terrain cannot be used with a source of type ${n}, it only be used with a "raster-dem" source type`)) : a.push(new K(i, e.source, `source "${e.source}" not found`)); } else a.push(new K(i, e, 'terrain is missing required property "source"')); return a } function vr(t) { const e = t.value, i = t.style, r = t.styleSpec, n = r.fog; let s = []; const a = Ei(e); if (void 0 === e) return s; if ("object" !== a) return s = s.concat([new K("fog", e, `object expected, ${a} found`)]), s; e.range && !Ui(J(e.range)) && e.range[0] >= e.range[1] && (s = s.concat([new K("fog", e, "fog.range[0] can't be greater than or equal to fog.range[1]")])); for (const t in e) { const a = t.match(/^(.*)-transition$/); s = s.concat(a && n[a[1]] && n[a[1]].transition ? wr({ key: t, value: e[t], valueSpec: r.transition, style: i, styleSpec: r }) : n[t] ? wr({ key: t, value: e[t], valueSpec: n[t], style: i, styleSpec: r }) : [new K(t, e[t], `unknown property "${t}"`)]); } return s } const br = { "*": () => [], array: Ki, boolean: function (t) { const e = t.value, i = t.key, r = Ei(e); return "boolean" !== r ? [new K(i, e, `boolean expected, ${r} found`)] : [] }, number: Hi, color: function (t) { const e = t.key, i = t.value, r = Ei(i); return "string" !== r ? [new K(e, i, `color expected, ${r} found`)] : null === vt.parseCSSColor(i) ? [new K(e, i, `color expected, "${i}" found`)] : [] }, constants: H, enum: Ji, filter: hr, function: Wi, layer: fr, object: Xi, source: gr, light: xr, terrain: _r, fog: vr, string: yr, formatted: function (t) { return 0 === yr(t).length ? [] : Yi(t) }, resolvedImage: function (t) { return 0 === yr(t).length ? [] : Yi(t) } }; function wr(t) { const e = t.value, i = t.valueSpec, r = t.styleSpec; return i.expression && Ci(Y(e)) ? Wi(t) : i.expression && Ui(J(e)) ? Yi(t) : i.type && br[i.type] ? br[i.type](t) : Xi(W({}, t, { valueSpec: i.type ? r[i.type] : i })) } function kr(t) { const e = t.value, i = t.key, r = yr(t); return r.length || (-1 === e.indexOf("{fontstack}") && r.push(new K(i, e, '"glyphs" url must include a "{fontstack}" token')), -1 === e.indexOf("{range}") && r.push(new K(i, e, '"glyphs" url must include a "{range}" token'))), r } function Ar(t, e = X) { let i = []; return i = i.concat(wr({ key: "", value: t, valueSpec: e.$root, styleSpec: e, style: t, objectElementValidators: { glyphs: kr, "*": () => [] } })), t.constants && (i = i.concat(H({ key: "constants", value: t.constants, style: t, styleSpec: e }))), Sr(i) } function Sr(t) { return [].concat(t).sort(((t, e) => t.line - e.line)) } function zr(t) { return function (...e) { return Sr(t.apply(this, e)) } } Ar.source = zr(gr), Ar.light = zr(xr), Ar.terrain = zr(_r), Ar.fog = zr(vr), Ar.layer = zr(fr), Ar.filter = zr(hr), Ar.paintProperty = zr(pr), Ar.layoutProperty = zr(dr); const Ir = Ar, Mr = Ir.light, Tr = Ir.fog, Er = Ir.paintProperty, Cr = Ir.layoutProperty; function Pr(t, e) { let i = !1; if (e && e.length) for (const r of e) t.fire(new Z(new Error(r.message))), i = !0; return i } var Dr = Br; function Br(t, e, i) { var r = this.cells = []; if (t instanceof ArrayBuffer) { this.arrayBuffer = t; var n = new Int32Array(this.arrayBuffer); t = n[0], this.d = (e = n[1]) + 2 * (i = n[2]); for (var s = 0; s < this.d * this.d; s++) { var a = n[3 + s], o = n[3 + s + 1]; r.push(a === o ? null : n.subarray(a, o)); } var l = n[3 + r.length + 1]; this.keys = n.subarray(n[3 + r.length], l), this.bboxes = n.subarray(l), this.insert = this._insertReadonly; } else { this.d = e + 2 * i; for (var h = 0; h < this.d * this.d; h++)r.push([]); this.keys = [], this.bboxes = []; } this.n = e, this.extent = t, this.padding = i, this.scale = e / t, this.uid = 0; var u = i / e * t; this.min = -u, this.max = t + u; } Br.prototype.insert = function (t, e, i, r, n) { this._forEachCell(e, i, r, n, this._insertCell, this.uid++), this.keys.push(t), this.bboxes.push(e), this.bboxes.push(i), this.bboxes.push(r), this.bboxes.push(n); }, Br.prototype._insertReadonly = function () { throw "Cannot insert into a GridIndex created from an ArrayBuffer." }, Br.prototype._insertCell = function (t, e, i, r, n, s) { this.cells[n].push(s); }, Br.prototype.query = function (t, e, i, r, n) { var s = this.min, a = this.max; if (t <= s && e <= s && a <= i && a <= r && !n) return Array.prototype.slice.call(this.keys); var o = []; return this._forEachCell(t, e, i, r, this._queryCell, o, {}, n), o }, Br.prototype._queryCell = function (t, e, i, r, n, s, a, o) { var l = this.cells[n]; if (null !== l) for (var h = this.keys, u = this.bboxes, c = 0; c < l.length; c++) { var p = l[c]; if (void 0 === a[p]) { var d = 4 * p; (o ? o(u[d + 0], u[d + 1], u[d + 2], u[d + 3]) : t <= u[d + 2] && e <= u[d + 3] && i >= u[d + 0] && r >= u[d + 1]) ? (a[p] = !0, s.push(h[p])) : a[p] = !1; } } }, Br.prototype._forEachCell = function (t, e, i, r, n, s, a, o) { for (var l = this._convertToCellCoord(t), h = this._convertToCellCoord(e), u = this._convertToCellCoord(i), c = this._convertToCellCoord(r), p = l; p <= u; p++)for (var d = h; d <= c; d++) { var f = this.d * d + p; if ((!o || o(this._convertFromCellCoord(p), this._convertFromCellCoord(d), this._convertFromCellCoord(p + 1), this._convertFromCellCoord(d + 1))) && n.call(this, t, e, i, r, f, s, a, o)) return } }, Br.prototype._convertFromCellCoord = function (t) { return (t - this.padding) / this.scale }, Br.prototype._convertToCellCoord = function (t) { return Math.max(0, Math.min(this.d - 1, Math.floor(t * this.scale) + this.padding)) }, Br.prototype.toArrayBuffer = function () { if (this.arrayBuffer) return this.arrayBuffer; for (var t = this.cells, e = 3 + this.cells.length + 1 + 1, i = 0, r = 0; r < this.cells.length; r++)i += this.cells[r].length; var n = new Int32Array(e + i + this.keys.length + this.bboxes.length); n[0] = this.extent, n[1] = this.n, n[2] = this.padding; for (var s = e, a = 0; a < t.length; a++) { var o = t[a]; n[3 + a] = s, n.set(o, s), s += o.length; } return n[3 + t.length] = s, n.set(this.keys, s), n[3 + t.length + 1] = s += this.keys.length, n.set(this.bboxes, s), s += this.bboxes.length, n.buffer }; const { ImageData: Vr, ImageBitmap: Lr } = n, Fr = {}; function Rr(t, e, i = {}) { Object.defineProperty(e, "_classRegistryKey", { value: t, writeable: !1 }), Fr[t] = { klass: e, omit: i.omit || [], shallow: i.shallow || [] }; } Rr("Object", Object), Dr.serialize = function (t, e) { const i = t.toArrayBuffer(); return e && e.push(i), { buffer: i } }, Dr.deserialize = function (t) { return new Dr(t.buffer) }, Rr("Grid", Dr), Rr("Color", wt), Rr("Error", Error), Rr("ResolvedImage", zt), Rr("StylePropertyFunction", ji), Rr("StyleExpression", Oi, { omit: ["_evaluator"] }), Rr("ZoomDependentExpression", qi), Rr("ZoomConstantExpression", Zi), Rr("CompoundExpression", jt, { omit: ["_evaluate"] }); for (const t in Ai) Ai[t]._classRegistryKey || Rr(`Expression_${t}`, Ai[t]); function Or(t) { return t && "undefined" != typeof ArrayBuffer && (t instanceof ArrayBuffer || t.constructor && "ArrayBuffer" === t.constructor.name) } function Ur(t) { return Lr && t instanceof Lr } function $r(t, e) { if (null == t || "boolean" == typeof t || "number" == typeof t || "string" == typeof t || t instanceof Boolean || t instanceof Number || t instanceof String || t instanceof Date || t instanceof RegExp) return t; if (Or(t) || Ur(t)) return e && e.push(t), t; if (ArrayBuffer.isView(t)) { const i = t; return e && e.push(i.buffer), i } if (t instanceof Vr) return e && e.push(t.data.buffer), t; if (Array.isArray(t)) { const i = []; for (const r of t) i.push($r(r, e)); return i } if ("object" == typeof t) { const i = t.constructor, r = i._classRegistryKey; if (!r) throw new Error("can't serialize object of unregistered class"); const n = i.serialize ? i.serialize(t, e) : {}; if (!i.serialize) { for (const i in t) { if (!t.hasOwnProperty(i)) continue; if (Fr[r].omit.indexOf(i) >= 0) continue; const s = t[i]; n[i] = Fr[r].shallow.indexOf(i) >= 0 ? s : $r(s, e); } t instanceof Error && (n.message = t.message); } if (n.$name) throw new Error("$name property is reserved for worker serialization logic."); return "Object" !== r && (n.$name = r), n } throw new Error("can't serialize object of type " + typeof t) } function Zr(t) { if (null == t || "boolean" == typeof t || "number" == typeof t || "string" == typeof t || t instanceof Boolean || t instanceof Number || t instanceof String || t instanceof Date || t instanceof RegExp || Or(t) || Ur(t) || ArrayBuffer.isView(t) || t instanceof Vr) return t; if (Array.isArray(t)) return t.map(Zr); if ("object" == typeof t) { const e = t.$name || "Object", { klass: i } = Fr[e]; if (!i) throw new Error(`can't deserialize unregistered class ${e}`); if (i.deserialize) return i.deserialize(t); const r = Object.create(i.prototype); for (const i of Object.keys(t)) { if ("$name" === i) continue; const n = t[i]; r[i] = Fr[e].shallow.indexOf(i) >= 0 ? n : Zr(n); } return r } throw new Error("can't deserialize object of type " + typeof t) } class qr { constructor() { this.first = !0; } update(t, e) { const i = Math.floor(t); return this.first ? (this.first = !1, this.lastIntegerZoom = i, this.lastIntegerZoomTime = 0, this.lastZoom = t, this.lastFloorZoom = i, !0) : (this.lastFloorZoom > i ? (this.lastIntegerZoom = i + 1, this.lastIntegerZoomTime = e) : this.lastFloorZoom < i && (this.lastIntegerZoom = i, this.lastIntegerZoomTime = e), t !== this.lastZoom && (this.lastZoom = t, this.lastFloorZoom = i, !0)) } } const Nr = t => t >= 128 && t <= 255, jr = t => t >= 1536 && t <= 1791, Gr = t => t >= 1872 && t <= 1919, Xr = t => t >= 2208 && t <= 2303, Kr = t => t >= 11904 && t <= 12031, Hr = t => t >= 12032 && t <= 12255, Wr = t => t >= 12272 && t <= 12287, Yr = t => t >= 12288 && t <= 12351, Jr = t => t >= 12352 && t <= 12447, Qr = t => t >= 12448 && t <= 12543, tn = t => t >= 12544 && t <= 12591, en = t => t >= 12704 && t <= 12735, rn = t => t >= 12736 && t <= 12783, nn = t => t >= 12784 && t <= 12799, sn = t => t >= 12800 && t <= 13055, an = t => t >= 13056 && t <= 13311, on = t => t >= 13312 && t <= 19903, ln = t => t >= 19968 && t <= 40959, hn = t => t >= 40960 && t <= 42127, un = t => t >= 42128 && t <= 42191, cn = t => t >= 44032 && t <= 55215, pn = t => t >= 63744 && t <= 64255, dn = t => t >= 64336 && t <= 65023, fn = t => t >= 65040 && t <= 65055, yn = t => t >= 65072 && t <= 65103, mn = t => t >= 65104 && t <= 65135, gn = t => t >= 65136 && t <= 65279, xn = t => t >= 65280 && t <= 65519; function _n(t) { for (const e of t) if (wn(e.charCodeAt(0))) return !0; return !1 } function vn(t) { for (const e of t) if (!bn(e.charCodeAt(0))) return !1; return !0 } function bn(t) { return !(jr(t) || Gr(t) || Xr(t) || dn(t) || gn(t)) } function wn(t) { return !(746 !== t && 747 !== t && (t < 4352 || !(en(t) || tn(t) || yn(t) && !(t >= 65097 && t <= 65103) || pn(t) || an(t) || Kr(t) || rn(t) || !(!Yr(t) || t >= 12296 && t <= 12305 || t >= 12308 && t <= 12319 || 12336 === t) || on(t) || ln(t) || sn(t) || (t => t >= 12592 && t <= 12687)(t) || (t => t >= 43360 && t <= 43391)(t) || (t => t >= 55216 && t <= 55295)(t) || (t => t >= 4352 && t <= 4607)(t) || cn(t) || Jr(t) || Wr(t) || (t => t >= 12688 && t <= 12703)(t) || Hr(t) || nn(t) || Qr(t) && 12540 !== t || !(!xn(t) || 65288 === t || 65289 === t || 65293 === t || t >= 65306 && t <= 65310 || 65339 === t || 65341 === t || 65343 === t || t >= 65371 && t <= 65503 || 65507 === t || t >= 65512 && t <= 65519) || !(!mn(t) || t >= 65112 && t <= 65118 || t >= 65123 && t <= 65126) || (t => t >= 5120 && t <= 5759)(t) || (t => t >= 6320 && t <= 6399)(t) || fn(t) || (t => t >= 19904 && t <= 19967)(t) || hn(t) || un(t)))) } function kn(t) { return !(wn(t) || function (t) { return !!(Nr(t) && (167 === t || 169 === t || 174 === t || 177 === t || 188 === t || 189 === t || 190 === t || 215 === t || 247 === t) || (t => t >= 8192 && t <= 8303)(t) && (8214 === t || 8224 === t || 8225 === t || 8240 === t || 8241 === t || 8251 === t || 8252 === t || 8258 === t || 8263 === t || 8264 === t || 8265 === t || 8273 === t) || (t => t >= 8448 && t <= 8527)(t) || (t => t >= 8528 && t <= 8591)(t) || (t => t >= 8960 && t <= 9215)(t) && (t >= 8960 && t <= 8967 || t >= 8972 && t <= 8991 || t >= 8996 && t <= 9e3 || 9003 === t || t >= 9085 && t <= 9114 || t >= 9150 && t <= 9165 || 9167 === t || t >= 9169 && t <= 9179 || t >= 9186 && t <= 9215) || (t => t >= 9216 && t <= 9279)(t) && 9251 !== t || (t => t >= 9280 && t <= 9311)(t) || (t => t >= 9312 && t <= 9471)(t) || (t => t >= 9632 && t <= 9727)(t) || (t => t >= 9728 && t <= 9983)(t) && !(t >= 9754 && t <= 9759) || (t => t >= 11008 && t <= 11263)(t) && (t >= 11026 && t <= 11055 || t >= 11088 && t <= 11097 || t >= 11192 && t <= 11243) || Yr(t) || Qr(t) || (t => t >= 57344 && t <= 63743)(t) || yn(t) || mn(t) || xn(t) || 8734 === t || 8756 === t || 8757 === t || t >= 9984 && t <= 10087 || t >= 10102 && t <= 10131 || 65532 === t || 65533 === t) }(t)) } function An(t) { return t >= 1424 && t <= 2303 || dn(t) || gn(t) } function Sn(t, e) { return !(!e && An(t) || t >= 2304 && t <= 3583 || t >= 3840 && t <= 4255 || (t => t >= 6016 && t <= 6143)(t)) } function zn(t) { for (const e of t) if (An(e.charCodeAt(0))) return !0; return !1 } let In; const Mn = { API_URL: "https://api.mapbox.com", get API_URL_REGEX() { if (null == In) { const t = /^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i; try { In = null != process.env.API_URL_REGEX ? new RegExp(process.env.API_URL_REGEX) : t; } catch (e) { In = t; } } return In }, get EVENTS_URL() { return this.API_URL ? 0 === this.API_URL.indexOf("https://api.mapbox.cn") ? "https://events.mapbox.cn/events/v2" : 0 === this.API_URL.indexOf("https://api.mapbox.com") ? "https://events.mapbox.com/events/v2" : null : null }, SESSION_PATH: "/map-sessions/v1", FEEDBACK_URL: "https://apps.mapbox.com/feedback", TILE_URL_VERSION: "v4", RASTER_URL_PREFIX: "raster/v1", REQUIRE_ACCESS_TOKEN: !0, ACCESS_TOKEN: null, MAX_PARALLEL_IMAGE_REQUESTS: 16 }, Tn = { supported: !1, testSupport: function (t) { !Pn && Cn && (Dn ? Bn(t) : En = t); } }; let En, Cn, Pn = !1, Dn = !1; function Bn(t) { const e = t.createTexture(); t.bindTexture(t.TEXTURE_2D, e); try { if (t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, Cn), t.isContextLost()) return; Tn.supported = !0; } catch (t) { } t.deleteTexture(e), Pn = !0; } n.document && (Cn = n.document.createElement("img"), Cn.onload = function () { En && Bn(En), En = null, Dn = !0; }, Cn.onerror = function () { Pn = !0, En = null; }, Cn.src = "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="); const Vn = "01", Ln = "NO_ACCESS_TOKEN"; function Fn(t) { return 0 === t.indexOf("mapbox:") } function Rn(t) { return Mn.API_URL_REGEX.test(t) } const On = /^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/; function Un(t) { const e = t.match(On); if (!e) throw new Error("Unable to parse URL object"); return { protocol: e[1], authority: e[2], path: e[3] || "/", params: e[4] ? e[4].split("&") : [] } } function $n(t) { const e = t.params.length ? `?${t.params.join("&")}` : ""; return `${t.protocol}://${t.authority}${t.path}${e}` } function Zn(t) { if (!t) return null; const e = t.split("."); if (!e || 3 !== e.length) return null; try { return JSON.parse(decodeURIComponent(n.atob(e[1]).split("").map((t => "%" + ("00" + t.charCodeAt(0).toString(16)).slice(-2))).join(""))) } catch (t) { return null } } class qn { constructor(t) { this.type = t, this.anonId = null, this.eventData = {}, this.queue = [], this.pendingRequest = null; } getStorageKey(t) { const e = Zn(Mn.ACCESS_TOKEN); let i = ""; return i = e && e.u ? n.btoa(encodeURIComponent(e.u).replace(/%([0-9A-F]{2})/g, ((t, e) => String.fromCharCode(Number("0x" + e))))) : Mn.ACCESS_TOKEN || "", t ? `mapbox.eventData.${t}:${i}` : `mapbox.eventData:${i}` } fetchEventData() { console.error(121212); const t = R("localStorage"), e = this.getStorageKey(), i = this.getStorageKey("uuid"); if (t) try { const t = n.localStorage.getItem(e); t && (this.eventData = JSON.parse(t)); const r = n.localStorage.getItem(i); r && (this.anonId = r); } catch (t) { C("Unable to read from LocalStorage"); } } saveEventData() { const t = R("localStorage"), e = this.getStorageKey(), i = this.getStorageKey("uuid"); if (t) try { n.localStorage.setItem(i, this.anonId), Object.keys(this.eventData).length >= 1 && n.localStorage.setItem(e, JSON.stringify(this.eventData)); } catch (t) { C("Unable to write to LocalStorage"); } } processRequests(t) { } postEvent(t, i, r, n) { if (!Mn.EVENTS_URL) return; const s = Un(Mn.EVENTS_URL); s.params.push(`access_token=${n || Mn.ACCESS_TOKEN || ""}`); const a = { event: this.type, created: new Date(t).toISOString(), sdkIdentifier: "mapbox-gl-js", sdkVersion: e, skuId: Vn, userId: this.anonId }, o = i ? _(a, i) : a, l = { url: $n(s), headers: { "Content-Type": "text/plain" }, body: JSON.stringify([o]) }; this.pendingRequest = us(l, (t => { this.pendingRequest = null, r(t), this.saveEventData(), this.processRequests(n); })); } queueRequest(t, e) { this.queue.push(t), this.processRequests(e); } } const Nn = new class extends qn { constructor(t) { super("appUserTurnstile"), this._customAccessToken = t; } postTurnstileEvent(t, e) { Mn.EVENTS_URL && Mn.ACCESS_TOKEN && Array.isArray(t) && t.some((t => Fn(t) || Rn(t))) && this.queueRequest(Date.now(), e); } processRequests(t) { if (this.pendingRequest || 0 === this.queue.length) return; this.anonId && this.eventData.lastSuccess && this.eventData.tokenU || this.fetchEventData(); const e = Zn(Mn.ACCESS_TOKEN), i = e ? e.u : Mn.ACCESS_TOKEN; let r = i !== this.eventData.tokenU; A(this.anonId) || (this.anonId = w(), r = !0); const n = this.queue.shift(); if (this.eventData.lastSuccess) { const t = new Date(this.eventData.lastSuccess), e = new Date(n), i = (n - this.eventData.lastSuccess) / 864e5; r = r || i >= 1 || i < -1 || t.getDate() !== e.getDate(); } else r = !0; if (!r) return this.processRequests(); this.postEvent(n, { "enabled.telemetry": !1 }, (t => { t || (this.eventData.lastSuccess = n, this.eventData.tokenU = i); }), t); } }, jn = Nn.postTurnstileEvent.bind(Nn), Gn = new class extends qn { constructor() { super("map.load"), this.success = {}, this.skuToken = ""; } postMapLoadEvent(t, e, i, r) { this.skuToken = e, this.errorCb = r, Mn.EVENTS_URL && (i || Mn.ACCESS_TOKEN ? this.queueRequest({ id: t, timestamp: Date.now() }, i) : this.errorCb(new Error(Ln))); } processRequests(t) { if (this.pendingRequest || 0 === this.queue.length) return; const { id: e, timestamp: i } = this.queue.shift(); e && this.success[e] || (this.anonId || this.fetchEventData(), A(this.anonId) || (this.anonId = w()), this.postEvent(i, { skuToken: this.skuToken }, (t => { t ? this.errorCb(t) : e && (this.success[e] = !0); }), t)); } }, Xn = Gn.postMapLoadEvent.bind(Gn), Kn = new class extends qn { constructor() { super("map.auth"), this.success = {}, this.skuToken = ""; } getSession(t, e, i, r) { if (!Mn.API_URL || !Mn.SESSION_PATH) return; const n = Un(Mn.API_URL + Mn.SESSION_PATH); n.params.push(`sku=${e || ""}`), n.params.push(`access_token=${r || Mn.ACCESS_TOKEN || ""}`); const s = { url: $n(n), headers: { "Content-Type": "text/plain" } }; this.pendingRequest = cs(s, (t => { this.pendingRequest = null, i(t), this.saveEventData(), this.processRequests(r); })); } getSessionAPI(t, e, i, r) { this.skuToken = e, this.errorCb = r, Mn.SESSION_PATH && Mn.API_URL && (i || Mn.ACCESS_TOKEN) && this.queueRequest({ id: t, timestamp: Date.now() }, i); } processRequests(t) { if (this.pendingRequest || 0 === this.queue.length) return; const { id: e, timestamp: i } = this.queue.shift(); e && this.success[e] || this.getSession(i, this.skuToken, (t => { t ? this.errorCb(t) : e && (this.success[e] = !0); }), t); } }, Hn = Kn.getSessionAPI.bind(Kn), Wn = new Set, Yn = "mapbox-tiles"; let Jn, Qn, ts = 500, es = 50; function is() { n.caches && !Jn && (Jn = n.caches.open(Yn)); } function rs(t) { const e = t.indexOf("?"); return e < 0 ? t : t.slice(0, e) } let ns = 1 / 0; const ss = { Unknown: "Unknown", Style: "Style", Source: "Source", Tile: "Tile", Glyphs: "Glyphs", SpriteImage: "SpriteImage", SpriteJSON: "SpriteJSON", Image: "Image" }; "function" == typeof Object.freeze && Object.freeze(ss); class as extends Error { constructor(t, e, i) { 401 === e && Rn(i) && (t += ": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"), super(t), this.status = e, this.url = i; } toString() { return `${this.name}: ${this.message} (${this.status}): ${this.url}` } } const os = B() ? () => self.worker && self.worker.referrer : () => ("blob:" === n.location.protocol ? n.parent : n).location.href; const ls = function (t, e) { if (!(/^file:/.test(i = t.url) || /^file:/.test(os()) && !/^\w+:/.test(i))) { if (n.fetch && n.Request && n.AbortController && n.Request.prototype.hasOwnProperty("signal")) return function (t, e) { const i = new n.AbortController, r = new n.Request(t.url, { method: t.method || "GET", body: t.body, credentials: t.credentials, headers: t.headers, referrer: os(), signal: i.signal }); let s = !1, a = !1; const o = (l = r.url).indexOf("sku=") > 0 && Rn(l); var l; "json" === t.type && r.headers.set("Accept", "application/json"); const h = (i, s, l) => { if (a) return; if (i && "SecurityError" !== i.message && C(i), s && l) return u(s); const h = Date.now(); n.fetch(r).then((i => { if (i.ok) { const t = o ? i.clone() : null; return u(i, t, h) } return e(new as(i.statusText, i.status, t.url)) })).catch((t => { 20 !== t.code && e(new Error(t.message)); })); }, u = (i, o, l) => { ("arrayBuffer" === t.type ? i.arrayBuffer() : "json" === t.type ? i.json() : i.text()).then((t => { a || (o && l && function (t, e, i) { if (is(), !Jn) return; const r = { status: e.status, statusText: e.statusText, headers: new n.Headers }; e.headers.forEach(((t, e) => r.headers.set(e, t))); const s = V(e.headers.get("Cache-Control") || ""); s["no-store"] || (s["max-age"] && r.headers.set("Expires", new Date(i + 1e3 * s["max-age"]).toUTCString()), new Date(r.headers.get("Expires")).getTime() - i < 42e4 || function (t, e) { if (void 0 === Qn) try { new Response(new ReadableStream), Qn = !0; } catch (t) { Qn = !1; } Qn ? e(t.body) : t.blob().then(e); }(e, (e => { const i = new n.Response(e, r); is(), Jn && Jn.then((e => e.put(rs(t.url), i))).catch((t => C(t.message))); }))); }(r, o, l), s = !0, e(null, t, i.headers.get("Cache-Control"), i.headers.get("Expires"))); })).catch((t => { a || e(new Error(t.message)); })); }; return o ? function (t, e) { if (is(), !Jn) return e(null); const i = rs(t.url); Jn.then((t => { t.match(i).then((r => { const n = function (t) { if (!t) return !1; const e = new Date(t.headers.get("Expires") || 0), i = V(t.headers.get("Cache-Control") || ""); return e > Date.now() && !i["no-cache"] }(r); t.delete(i), n && t.put(i, r.clone()), e(null, r, n); })).catch(e); })).catch(e); }(r, h) : h(null, null), { cancel: () => { a = !0, s || i.abort(); } } }(t, e); if (B() && self.worker && self.worker.actor) return self.worker.actor.send("getResource", t, e, void 0, !0) } var i; return function (t, e) { const i = new n.XMLHttpRequest; i.open(t.method || "GET", t.url, !0), "arrayBuffer" === t.type && (i.responseType = "arraybuffer"); for (const e in t.headers) i.setRequestHeader(e, t.headers[e]); return "json" === t.type && (i.responseType = "text", i.setRequestHeader("Accept", "application/json")), i.withCredentials = "include" === t.credentials, i.onerror = () => { e(new Error(i.statusText)); }, i.onload = () => { if ((i.status >= 200 && i.status < 300 || 0 === i.status) && null !== i.response) { let r = i.response; if ("json" === t.type) try { r = JSON.parse(i.response); } catch (t) { return e(t) } e(null, r, i.getResponseHeader("Cache-Control"), i.getResponseHeader("Expires")); } else e(new as(i.statusText, i.status, t.url)); }, i.send(t.body), { cancel: () => i.abort() } }(t, e) }, hs = function (t, e) { return ls(_(t, { type: "arrayBuffer" }), e) }, us = function (t, e) { return ls(_(t, { method: "POST" }), e) }, cs = function (t, e) { return ls(_(t, { method: "GET" }), e) }; function ps(t) { const e = n.document.createElement("a"); return e.href = t, e.protocol === n.document.location.protocol && e.host === n.document.location.host } const ds = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="; let fs, ys; fs = [], ys = 0; const ms = function (t, e) { if (Tn.supported && (t.headers || (t.headers = {}), t.headers.accept = "image/webp,*/*"), ys >= Mn.MAX_PARALLEL_IMAGE_REQUESTS) { const i = { requestParameters: t, callback: e, cancelled: !1, cancel() { this.cancelled = !0; } }; return fs.push(i), i } ys++; let i = !1; const r = () => { if (!i) for (i = !0, ys--; fs.length && ys < Mn.MAX_PARALLEL_IMAGE_REQUESTS;) { const t = fs.shift(), { requestParameters: e, callback: i, cancelled: r } = t; r || (t.cancel = ms(e, i).cancel); } }, s = hs(t, ((t, i, s, a) => { r(), t ? e(t) : i && (n.createImageBitmap ? function (t, e) { const i = new n.Blob([new Uint8Array(t)], { type: "image/png" }); n.createImageBitmap(i).then((t => { e(null, t); })).catch((t => { e(new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)); })); }(i, ((t, i) => e(t, i, s, a))) : function (t, e) { const i = new n.Image, r = n.URL; i.onload = () => { e(null, i), r.revokeObjectURL(i.src), i.onload = null, n.requestAnimationFrame((() => { i.src = ds; })); }, i.onerror = () => e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")); const s = new n.Blob([new Uint8Array(t)], { type: "image/png" }); i.src = t.byteLength ? r.createObjectURL(s) : ds; }(i, ((t, i) => e(t, i, s, a)))); })); return { cancel: () => { s.cancel(), r(); } } }; let gs, xs, _s; const vs = { now: () => void 0 !== _s ? _s : n.performance.now(), setNow(t) { _s = t; }, restoreNow() { _s = void 0; }, frame(t) { const e = n.requestAnimationFrame(t); return { cancel: () => n.cancelAnimationFrame(e) } }, getImageData(t, e = 0) { const i = n.document.createElement("canvas"), r = i.getContext("2d"); if (!r) throw new Error("failed to create canvas 2d context"); return i.width = t.width, i.height = t.height, r.drawImage(t, 0, 0, t.width, t.height), r.getImageData(-e, -e, t.width + 2 * e, t.height + 2 * e) }, resolveURL: t => (gs || (gs = n.document.createElement("a")), gs.href = t, gs.href), hardwareConcurrency: n.navigator.hardwareConcurrency || 4, get devicePixelRatio() { return n.devicePixelRatio }, get prefersReducedMotion() { return !!n.matchMedia && (null == xs && (xs = n.matchMedia("(prefers-reduced-motion: reduce)")), xs.matches) } }, bs = "loading", ws = "loaded"; let ks = "unavailable", As = null; const Ss = function (t) { t && "string" == typeof t && t.indexOf("NetworkError") > -1 && (ks = "error"); }; function zs() { Is.fire(new $("pluginStateChange", { pluginStatus: ks, pluginURL: As })); } const Is = new q, Ms = function () { return ks }, Ts = { applyArabicShaping: null, processBidirectionalText: null, processStyledBidirectionalText: null, isLoaded: () => ks === ws || null != Ts.applyArabicShaping, isLoading: () => ks === bs, setState(t) { ks = t.pluginStatus, As = t.pluginURL; }, isParsed: () => null != Ts.applyArabicShaping && null != Ts.processBidirectionalText && null != Ts.processStyledBidirectionalText, getPluginURL: () => As }; class Es { constructor(t, e) { this.zoom = t, e ? (this.now = e.now, this.fadeDuration = e.fadeDuration, this.zoomHistory = e.zoomHistory, this.transition = e.transition) : (this.now = 0, this.fadeDuration = 0, this.zoomHistory = new qr, this.transition = {}); } isSupportedScript(t) { return function (t, e) { for (const i of t) if (!Sn(i.charCodeAt(0), e)) return !1; return !0 }(t, Ts.isLoaded()) } crossFadingFactor() { return 0 === this.fadeDuration ? 1 : Math.min((this.now - this.zoomHistory.lastIntegerZoomTime) / this.fadeDuration, 1) } getCrossfadeParameters() { const t = this.zoom, e = t - Math.floor(t), i = this.crossFadingFactor(); return t > this.zoomHistory.lastIntegerZoom ? { fromScale: 2, toScale: 1, t: e + (1 - e) * i } : { fromScale: .5, toScale: 1, t: 1 - (1 - i) * e } } } class Cs { constructor(t, e) { this.property = t, this.value = e, this.expression = function (t, e) { if (Ci(t)) return new ji(t, e); if (Ui(t)) { const i = Ni(t, e); if ("error" === i.result) throw new Error(i.value.map((t => `${t.key}: ${t.message}`)).join(", ")); return i.value } { let i = t; return "string" == typeof t && e && "color" === e.type && (i = wt.parse(t)), { kind: "constant", evaluate: () => i } } }(void 0 === e && t.specification ? t.specification.default : e, t.specification); } isDataDriven() { return "source" === this.expression.kind || "composite" === this.expression.kind } possiblyEvaluate(t, e, i) { return this.property.possiblyEvaluate(this, t, e, i) } } class Ps { constructor(t) { this.property = t, this.value = new Cs(t, void 0); } transitioned(t, e) { return new Bs(this.property, this.value, e, _({}, t.transition, this.transition), t.now) } untransitioned() { return new Bs(this.property, this.value, null, {}, 0) } } class Ds { constructor(t) { this._properties = t, this._values = Object.create(t.defaultTransitionablePropertyValues); } getValue(t) { return T(this._values[t].value.value) } setValue(t, e) { this._values.hasOwnProperty(t) || (this._values[t] = new Ps(this._values[t].property)), this._values[t].value = new Cs(this._values[t].property, null === e ? void 0 : T(e)); } getTransition(t) { return T(this._values[t].transition) } setTransition(t, e) { this._values.hasOwnProperty(t) || (this._values[t] = new Ps(this._values[t].property)), this._values[t].transition = T(e) || void 0; } serialize() { const t = {}; for (const e of Object.keys(this._values)) { const i = this.getValue(e); void 0 !== i && (t[e] = i); const r = this.getTransition(e); void 0 !== r && (t[`${e}-transition`] = r); } return t } transitioned(t, e) { const i = new Vs(this._properties); for (const r of Object.keys(this._values)) i._values[r] = this._values[r].transitioned(t, e._values[r]); return i } untransitioned() { const t = new Vs(this._properties); for (const e of Object.keys(this._values)) t._values[e] = this._values[e].untransitioned(); return t } } class Bs { constructor(t, e, i, r, n) { const s = r.delay || 0, a = r.duration || 0; n = n || 0, this.property = t, this.value = e, this.begin = n + s, this.end = this.begin + a, t.specification && t.specification.transition && (r.delay || r.duration) && (this.prior = i); } possiblyEvaluate(t, e, i) { const r = t.now || 0, n = this.value.possiblyEvaluate(t, e, i), s = this.prior; if (s) { if (r > this.end) return this.prior = null, n; if (this.value.isDataDriven()) return this.prior = null, n; if (r < this.begin) return s.possiblyEvaluate(t, e, i); { const a = (r - this.begin) / (this.end - this.begin); return this.property.interpolate(s.possiblyEvaluate(t, e, i), n, p(a)) } } return n } } class Vs { constructor(t) { this._properties = t, this._values = Object.create(t.defaultTransitioningPropertyValues); } possiblyEvaluate(t, e, i) { const r = new Rs(this._properties); for (const n of Object.keys(this._values)) r._values[n] = this._values[n].possiblyEvaluate(t, e, i); return r } hasTransition() { for (const t of Object.keys(this._values)) if (this._values[t].prior) return !0; return !1 } } class Ls { constructor(t) { this._properties = t, this._values = Object.create(t.defaultPropertyValues); } getValue(t) { return T(this._values[t].value) } setValue(t, e) { this._values[t] = new Cs(this._values[t].property, null === e ? void 0 : T(e)); } serialize() { const t = {}; for (const e of Object.keys(this._values)) { const i = this.getValue(e); void 0 !== i && (t[e] = i); } return t } possiblyEvaluate(t, e, i) { const r = new Rs(this._properties); for (const n of Object.keys(this._values)) r._values[n] = this._values[n].possiblyEvaluate(t, e, i); return r } } class Fs { constructor(t, e, i) { this.property = t, this.value = e, this.parameters = i; } isConstant() { return "constant" === this.value.kind } constantOr(t) { return "constant" === this.value.kind ? this.value.value : t } evaluate(t, e, i, r) { return this.property.evaluate(this.value, this.parameters, t, e, i, r) } } class Rs { constructor(t) { this._properties = t, this._values = Object.create(t.defaultPossiblyEvaluatedValues); } get(t) { return this._values[t] } } class Os { constructor(t) { this.specification = t; } possiblyEvaluate(t, e) { return t.expression.evaluate(e) } interpolate(t, e, i) { const r = Se[this.specification.type]; return r ? r(t, e, i) : t } } class Us { constructor(t, e) { this.specification = t, this.overrides = e; } possiblyEvaluate(t, e, i, r) { return new Fs(this, "constant" === t.expression.kind || "camera" === t.expression.kind ? { kind: "constant", value: t.expression.evaluate(e, null, {}, i, r) } : t.expression, e) } interpolate(t, e, i) { if ("constant" !== t.value.kind || "constant" !== e.value.kind) return t; if (void 0 === t.value.value || void 0 === e.value.value) return new Fs(this, { kind: "constant", value: void 0 }, t.parameters); const r = Se[this.specification.type]; return r ? new Fs(this, { kind: "constant", value: r(t.value.value, e.value.value, i) }, t.parameters) : t } evaluate(t, e, i, r, n, s) { return "constant" === t.kind ? t.value : t.evaluate(e, i, r, n, s) } } class $s extends Us { possiblyEvaluate(t, e, i, r) { if (void 0 === t.value) return new Fs(this, { kind: "constant", value: void 0 }, e); if ("constant" === t.expression.kind) { const n = t.expression.evaluate(e, null, {}, i, r), s = "resolvedImage" === t.property.specification.type && "string" != typeof n ? n.name : n, a = this._calculate(s, s, s, e); return new Fs(this, { kind: "constant", value: a }, e) } if ("camera" === t.expression.kind) { const i = this._calculate(t.expression.evaluate({ zoom: e.zoom - 1 }), t.expression.evaluate({ zoom: e.zoom }), t.expression.evaluate({ zoom: e.zoom + 1 }), e); return new Fs(this, { kind: "constant", value: i }, e) } return new Fs(this, t.expression, e) } evaluate(t, e, i, r, n, s) { if ("source" === t.kind) { const a = t.evaluate(e, i, r, n, s); return this._calculate(a, a, a, e) } return "composite" === t.kind ? this._calculate(t.evaluate({ zoom: Math.floor(e.zoom) - 1 }, i, r), t.evaluate({ zoom: Math.floor(e.zoom) }, i, r), t.evaluate({ zoom: Math.floor(e.zoom) + 1 }, i, r), e) : t.value } _calculate(t, e, i, r) { return r.zoom > r.zoomHistory.lastIntegerZoom ? { from: t, to: e, other: i } : { from: i, to: e, other: t } } interpolate(t) { return t } } class Zs { constructor(t) { this.specification = t; } possiblyEvaluate(t, e, i, r) { if (void 0 !== t.value) { if ("constant" === t.expression.kind) { const n = t.expression.evaluate(e, null, {}, i, r); return this._calculate(n, n, n, e) } return this._calculate(t.expression.evaluate(new Es(Math.floor(e.zoom - 1), e)), t.expression.evaluate(new Es(Math.floor(e.zoom), e)), t.expression.evaluate(new Es(Math.floor(e.zoom + 1), e)), e) } } _calculate(t, e, i, r) { return r.zoom > r.zoomHistory.lastIntegerZoom ? { from: t, to: e } : { from: i, to: e } } interpolate(t) { return t } } class qs { constructor(t) { this.specification = t; } possiblyEvaluate(t, e, i, r) { return !!t.expression.evaluate(e, null, {}, i, r) } interpolate() { return !1 } } class Ns { constructor(t) { this.properties = t, this.defaultPropertyValues = {}, this.defaultTransitionablePropertyValues = {}, this.defaultTransitioningPropertyValues = {}, this.defaultPossiblyEvaluatedValues = {}, this.overridableProperties = []; for (const e in t) { const i = t[e]; i.specification && i.specification.overridable && this.overridableProperties.push(e); const r = this.defaultPropertyValues[e] = new Cs(i, void 0), n = this.defaultTransitionablePropertyValues[e] = new Ps(i); this.defaultTransitioningPropertyValues[e] = n.untransitioned(), this.defaultPossiblyEvaluatedValues[e] = r.possiblyEvaluate({}); } } } function js(t, e) { return 256 * (t = y(Math.floor(t), 0, 255)) + y(Math.floor(e), 0, 255) } Rr("DataDrivenProperty", Us), Rr("DataConstantProperty", Os), Rr("CrossFadedDataDrivenProperty", $s), Rr("CrossFadedProperty", Zs), Rr("ColorRampProperty", qs); const Gs = { Int8: Int8Array, Uint8: Uint8Array, Int16: Int16Array, Uint16: Uint16Array, Int32: Int32Array, Uint32: Uint32Array, Float32: Float32Array }; class Xs { constructor(t, e) { this._structArray = t, this._pos1 = e * this.size, this._pos2 = this._pos1 / 2, this._pos4 = this._pos1 / 4, this._pos8 = this._pos1 / 8; } } class Ks { constructor() { this.isTransferred = !1, this.capacity = -1, this.resize(0); } static serialize(t, e) { return t._trim(), e && (t.isTransferred = !0, e.push(t.arrayBuffer)), { length: t.length, arrayBuffer: t.arrayBuffer } } static deserialize(t) { const e = Object.create(this.prototype); return e.arrayBuffer = t.arrayBuffer, e.length = t.length, e.capacity = t.arrayBuffer.byteLength / e.bytesPerElement, e._refreshViews(), e } _trim() { this.length !== this.capacity && (this.capacity = this.length, this.arrayBuffer = this.arrayBuffer.slice(0, this.length * this.bytesPerElement), this._refreshViews()); } clear() { this.length = 0; } resize(t) { this.reserve(t), this.length = t; } reserve(t) { if (t > this.capacity) { this.capacity = Math.max(t, Math.floor(5 * this.capacity), 128), this.arrayBuffer = new ArrayBuffer(this.capacity * this.bytesPerElement); const e = this.uint8; this._refreshViews(), e && this.uint8.set(e); } } _refreshViews() { throw new Error("_refreshViews() must be implemented by each concrete StructArray layout") } } function Hs(t, e = 1) { let i = 0, r = 0; return { members: t.map((t => { const n = Gs[t.type].BYTES_PER_ELEMENT, s = i = Ws(i, Math.max(e, n)), a = t.components || 1; return r = Math.max(r, n), i += n * a, { name: t.name, type: t.type, components: a, offset: s } })), size: Ws(i, Math.max(r, e)), alignment: e } } function Ws(t, e) { return Math.ceil(t / e) * e } class Ys extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer); } emplaceBack(t, e) { const i = this.length; return this.resize(i + 1), this.emplace(i, t, e) } emplace(t, e, i) { const r = 2 * t; return this.int16[r + 0] = e, this.int16[r + 1] = i, t } } Ys.prototype.bytesPerElement = 4, Rr("StructArrayLayout2i4", Ys); class Js extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer); } emplaceBack(t, e, i, r) { const n = this.length; return this.resize(n + 1), this.emplace(n, t, e, i, r) } emplace(t, e, i, r, n) { const s = 4 * t; return this.int16[s + 0] = e, this.int16[s + 1] = i, this.int16[s + 2] = r, this.int16[s + 3] = n, t } } Js.prototype.bytesPerElement = 8, Rr("StructArrayLayout4i8", Js); class Qs extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer); } emplaceBack(t, e, i, r, n, s, a) { const o = this.length; return this.resize(o + 1), this.emplace(o, t, e, i, r, n, s, a) } emplace(t, e, i, r, n, s, a, o) { const l = 6 * t, h = 12 * t, u = 3 * t; return this.int16[l + 0] = e, this.int16[l + 1] = i, this.uint8[h + 4] = r, this.uint8[h + 5] = n, this.uint8[h + 6] = s, this.uint8[h + 7] = a, this.float32[u + 2] = o, t } } Qs.prototype.bytesPerElement = 12, Rr("StructArrayLayout2i4ub1f12", Qs); class ta extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer); } emplaceBack(t, e) { const i = this.length; return this.resize(i + 1), this.emplace(i, t, e) } emplace(t, e, i) { const r = 2 * t; return this.float32[r + 0] = e, this.float32[r + 1] = i, t } } ta.prototype.bytesPerElement = 8, Rr("StructArrayLayout2f8", ta); class ea extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer); } emplaceBack(t, e, i, r, n, s, a, o, l, h) { const u = this.length; return this.resize(u + 1), this.emplace(u, t, e, i, r, n, s, a, o, l, h) } emplace(t, e, i, r, n, s, a, o, l, h, u) { const c = 10 * t; return this.uint16[c + 0] = e, this.uint16[c + 1] = i, this.uint16[c + 2] = r, this.uint16[c + 3] = n, this.uint16[c + 4] = s, this.uint16[c + 5] = a, this.uint16[c + 6] = o, this.uint16[c + 7] = l, this.uint16[c + 8] = h, this.uint16[c + 9] = u, t } } ea.prototype.bytesPerElement = 20, Rr("StructArrayLayout10ui20", ea); class ia extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer); } emplaceBack(t, e, i, r, n, s, a, o) { const l = this.length; return this.resize(l + 1), this.emplace(l, t, e, i, r, n, s, a, o) } emplace(t, e, i, r, n, s, a, o, l) { const h = 8 * t; return this.uint16[h + 0] = e, this.uint16[h + 1] = i, this.uint16[h + 2] = r, this.uint16[h + 3] = n, this.uint16[h + 4] = s, this.uint16[h + 5] = a, this.uint16[h + 6] = o, this.uint16[h + 7] = l, t } } ia.prototype.bytesPerElement = 16, Rr("StructArrayLayout8ui16", ia); class ra extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer); } emplaceBack(t, e, i, r, n, s, a, o, l, h, u, c) { const p = this.length; return this.resize(p + 1), this.emplace(p, t, e, i, r, n, s, a, o, l, h, u, c) } emplace(t, e, i, r, n, s, a, o, l, h, u, c, p) { const d = 12 * t; return this.int16[d + 0] = e, this.int16[d + 1] = i, this.int16[d + 2] = r, this.int16[d + 3] = n, this.uint16[d + 4] = s, this.uint16[d + 5] = a, this.uint16[d + 6] = o, this.uint16[d + 7] = l, this.int16[d + 8] = h, this.int16[d + 9] = u, this.int16[d + 10] = c, this.int16[d + 11] = p, t } } ra.prototype.bytesPerElement = 24, Rr("StructArrayLayout4i4ui4i24", ra); class na extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer); } emplaceBack(t, e, i) { const r = this.length; return this.resize(r + 1), this.emplace(r, t, e, i) } emplace(t, e, i, r) { const n = 3 * t; return this.float32[n + 0] = e, this.float32[n + 1] = i, this.float32[n + 2] = r, t } } na.prototype.bytesPerElement = 12, Rr("StructArrayLayout3f12", na); class sa extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer); } emplaceBack(t) { const e = this.length; return this.resize(e + 1), this.emplace(e, t) } emplace(t, e) { return this.uint32[1 * t + 0] = e, t } } sa.prototype.bytesPerElement = 4, Rr("StructArrayLayout1ul4", sa); class aa extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer); } emplaceBack(t, e, i, r, n, s, a, o, l, h) { const u = this.length; return this.resize(u + 1), this.emplace(u, t, e, i, r, n, s, a, o, l, h) } emplace(t, e, i, r, n, s, a, o, l, h, u) { const c = 16 * t, p = 8 * t; return this.int16[c + 0] = e, this.int16[c + 1] = i, this.float32[p + 1] = r, this.float32[p + 2] = n, this.float32[p + 3] = s, this.float32[p + 4] = a, this.int16[c + 10] = o, this.uint32[p + 6] = l, this.uint16[c + 14] = h, this.uint16[c + 15] = u, t } } aa.prototype.bytesPerElement = 32, Rr("StructArrayLayout2i4f1i1ul2ui32", aa); class oa extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer); } emplaceBack(t, e, i, r, n, s) { const a = this.length; return this.resize(a + 1), this.emplace(a, t, e, i, r, n, s) } emplace(t, e, i, r, n, s, a) { const o = 6 * t; return this.int16[o + 0] = e, this.int16[o + 1] = i, this.int16[o + 2] = r, this.int16[o + 3] = n, this.int16[o + 4] = s, this.int16[o + 5] = a, t } } oa.prototype.bytesPerElement = 12, Rr("StructArrayLayout2i2i2i12", oa); class la extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer); } emplaceBack(t, e, i, r, n) { const s = this.length; return this.resize(s + 1), this.emplace(s, t, e, i, r, n) } emplace(t, e, i, r, n, s) { const a = 4 * t, o = 8 * t; return this.float32[a + 0] = e, this.float32[a + 1] = i, this.float32[a + 2] = r, this.int16[o + 6] = n, this.int16[o + 7] = s, t } } la.prototype.bytesPerElement = 16, Rr("StructArrayLayout2f1f2i16", la); class ha extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer); } emplaceBack(t, e, i, r) { const n = this.length; return this.resize(n + 1), this.emplace(n, t, e, i, r) } emplace(t, e, i, r, n) { const s = 12 * t, a = 3 * t; return this.uint8[s + 0] = e, this.uint8[s + 1] = i, this.float32[a + 1] = r, this.float32[a + 2] = n, t } } ha.prototype.bytesPerElement = 12, Rr("StructArrayLayout2ub2f12", ha); class ua extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer); } emplaceBack(t, e, i) { const r = this.length; return this.resize(r + 1), this.emplace(r, t, e, i) } emplace(t, e, i, r) { const n = 3 * t; return this.uint16[n + 0] = e, this.uint16[n + 1] = i, this.uint16[n + 2] = r, t } } ua.prototype.bytesPerElement = 6, Rr("StructArrayLayout3ui6", ua); class ca extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer); } emplaceBack(t, e, i, r, n, s, a, o, l, h, u, c, p, d, f, y, m, g) { const x = this.length; return this.resize(x + 1), this.emplace(x, t, e, i, r, n, s, a, o, l, h, u, c, p, d, f, y, m, g) } emplace(t, e, i, r, n, s, a, o, l, h, u, c, p, d, f, y, m, g, x) { const _ = 24 * t, v = 12 * t, b = 48 * t; return this.int16[_ + 0] = e, this.int16[_ + 1] = i, this.uint16[_ + 2] = r, this.uint16[_ + 3] = n, this.uint32[v + 2] = s, this.uint32[v + 3] = a, this.uint32[v + 4] = o, this.uint16[_ + 10] = l, this.uint16[_ + 11] = h, this.uint16[_ + 12] = u, this.float32[v + 7] = c, this.float32[v + 8] = p, this.uint8[b + 36] = d, this.uint8[b + 37] = f, this.uint8[b + 38] = y, this.uint32[v + 10] = m, this.int16[_ + 22] = g, this.uint8[b + 46] = x, t } } ca.prototype.bytesPerElement = 48, Rr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1ub48", ca); class pa extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer); } emplaceBack(t, e, i, r, n, s, a, o, l, h, u, c, p, d, f, y, m, g, x, _, v, b, w, k, A, S, z) { const I = this.length; return this.resize(I + 1), this.emplace(I, t, e, i, r, n, s, a, o, l, h, u, c, p, d, f, y, m, g, x, _, v, b, w, k, A, S, z) } emplace(t, e, i, r, n, s, a, o, l, h, u, c, p, d, f, y, m, g, x, _, v, b, w, k, A, S, z, I) { const M = 32 * t, T = 16 * t; return this.int16[M + 0] = e, this.int16[M + 1] = i, this.int16[M + 2] = r, this.int16[M + 3] = n, this.int16[M + 4] = s, this.int16[M + 5] = a, this.int16[M + 6] = o, this.int16[M + 7] = l, this.uint16[M + 8] = h, this.uint16[M + 9] = u, this.uint16[M + 10] = c, this.uint16[M + 11] = p, this.uint16[M + 12] = d, this.uint16[M + 13] = f, this.uint16[M + 14] = y, this.uint16[M + 15] = m, this.uint16[M + 16] = g, this.uint16[M + 17] = x, this.uint16[M + 18] = _, this.uint16[M + 19] = v, this.uint16[M + 20] = b, this.uint16[M + 21] = w, this.uint16[M + 22] = k, this.uint32[T + 12] = A, this.float32[T + 13] = S, this.float32[T + 14] = z, this.float32[T + 15] = I, t } } pa.prototype.bytesPerElement = 64, Rr("StructArrayLayout8i15ui1ul3f64", pa); class da extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer); } emplaceBack(t) { const e = this.length; return this.resize(e + 1), this.emplace(e, t) } emplace(t, e) { return this.float32[1 * t + 0] = e, t } } da.prototype.bytesPerElement = 4, Rr("StructArrayLayout1f4", da); class fa extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer); } emplaceBack(t, e, i) { const r = this.length; return this.resize(r + 1), this.emplace(r, t, e, i) } emplace(t, e, i, r) { const n = 3 * t; return this.int16[n + 0] = e, this.int16[n + 1] = i, this.int16[n + 2] = r, t } } fa.prototype.bytesPerElement = 6, Rr("StructArrayLayout3i6", fa); class ya extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer); } emplaceBack(t, e, i, r) { const n = this.length; return this.resize(n + 1), this.emplace(n, t, e, i, r) } emplace(t, e, i, r, n) { const s = 6 * t; return this.uint32[3 * t + 0] = e, this.uint16[s + 2] = i, this.uint16[s + 3] = r, this.uint16[s + 4] = n, t } } ya.prototype.bytesPerElement = 12, Rr("StructArrayLayout1ul3ui12", ya); class ma extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer); } emplaceBack(t, e) { const i = this.length; return this.resize(i + 1), this.emplace(i, t, e) } emplace(t, e, i) { const r = 2 * t; return this.uint16[r + 0] = e, this.uint16[r + 1] = i, t } } ma.prototype.bytesPerElement = 4, Rr("StructArrayLayout2ui4", ma); class ga extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer); } emplaceBack(t) { const e = this.length; return this.resize(e + 1), this.emplace(e, t) } emplace(t, e) { return this.uint16[1 * t + 0] = e, t } } ga.prototype.bytesPerElement = 2, Rr("StructArrayLayout1ui2", ga); class xa extends Ks { _refreshViews() { this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer); } emplaceBack(t, e, i, r) { const n = this.length; return this.resize(n + 1), this.emplace(n, t, e, i, r) } emplace(t, e, i, r, n) { const s = 4 * t; return this.float32[s + 0] = e, this.float32[s + 1] = i, this.float32[s + 2] = r, this.float32[s + 3] = n, t } } xa.prototype.bytesPerElement = 16, Rr("StructArrayLayout4f16", xa); class _a extends Xs { get anchorPointX() { return this._structArray.int16[this._pos2 + 0] } get anchorPointY() { return this._structArray.int16[this._pos2 + 1] } get x1() { return this._structArray.float32[this._pos4 + 1] } get y1() { return this._structArray.float32[this._pos4 + 2] } get x2() { return this._structArray.float32[this._pos4 + 3] } get y2() { return this._structArray.float32[this._pos4 + 4] } get padding() { return this._structArray.int16[this._pos2 + 10] } get featureIndex() { return this._structArray.uint32[this._pos4 + 6] } get sourceLayerIndex() { return this._structArray.uint16[this._pos2 + 14] } get bucketIndex() { return this._structArray.uint16[this._pos2 + 15] } get anchorPoint() { return new i(this.anchorPointX, this.anchorPointY) } } _a.prototype.size = 32; class va extends aa { get(t) { return new _a(this, t) } } Rr("CollisionBoxArray", va); class ba extends Xs { get anchorX() { return this._structArray.int16[this._pos2 + 0] } get anchorY() { return this._structArray.int16[this._pos2 + 1] } get glyphStartIndex() { return this._structArray.uint16[this._pos2 + 2] } get numGlyphs() { return this._structArray.uint16[this._pos2 + 3] } get vertexStartIndex() { return this._structArray.uint32[this._pos4 + 2] } get lineStartIndex() { return this._structArray.uint32[this._pos4 + 3] } get lineLength() { return this._structArray.uint32[this._pos4 + 4] } get segment() { return this._structArray.uint16[this._pos2 + 10] } get lowerSize() { return this._structArray.uint16[this._pos2 + 11] } get upperSize() { return this._structArray.uint16[this._pos2 + 12] } get lineOffsetX() { return this._structArray.float32[this._pos4 + 7] } get lineOffsetY() { return this._structArray.float32[this._pos4 + 8] } get writingMode() { return this._structArray.uint8[this._pos1 + 36] } get placedOrientation() { return this._structArray.uint8[this._pos1 + 37] } set placedOrientation(t) { this._structArray.uint8[this._pos1 + 37] = t; } get hidden() { return this._structArray.uint8[this._pos1 + 38] } set hidden(t) { this._structArray.uint8[this._pos1 + 38] = t; } get crossTileID() { return this._structArray.uint32[this._pos4 + 10] } set crossTileID(t) { this._structArray.uint32[this._pos4 + 10] = t; } get associatedIconIndex() { return this._structArray.int16[this._pos2 + 22] } get flipState() { return this._structArray.uint8[this._pos1 + 46] } set flipState(t) { this._structArray.uint8[this._pos1 + 46] = t; } } ba.prototype.size = 48; class wa extends ca { get(t) { return new ba(this, t) } } Rr("PlacedSymbolArray", wa); class ka extends Xs { get anchorX() { return this._structArray.int16[this._pos2 + 0] } get anchorY() { return this._structArray.int16[this._pos2 + 1] } get rightJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 2] } get centerJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 3] } get leftJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 4] } get verticalPlacedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 5] } get placedIconSymbolIndex() { return this._structArray.int16[this._pos2 + 6] } get verticalPlacedIconSymbolIndex() { return this._structArray.int16[this._pos2 + 7] } get key() { return this._structArray.uint16[this._pos2 + 8] } get textBoxStartIndex() { return this._structArray.uint16[this._pos2 + 9] } get textBoxEndIndex() { return this._structArray.uint16[this._pos2 + 10] } get verticalTextBoxStartIndex() { return this._structArray.uint16[this._pos2 + 11] } get verticalTextBoxEndIndex() { return this._structArray.uint16[this._pos2 + 12] } get iconBoxStartIndex() { return this._structArray.uint16[this._pos2 + 13] } get iconBoxEndIndex() { return this._structArray.uint16[this._pos2 + 14] } get verticalIconBoxStartIndex() { return this._structArray.uint16[this._pos2 + 15] } get verticalIconBoxEndIndex() { return this._structArray.uint16[this._pos2 + 16] } get featureIndex() { return this._structArray.uint16[this._pos2 + 17] } get numHorizontalGlyphVertices() { return this._structArray.uint16[this._pos2 + 18] } get numVerticalGlyphVertices() { return this._structArray.uint16[this._pos2 + 19] } get numIconVertices() { return this._structArray.uint16[this._pos2 + 20] } get numVerticalIconVertices() { return this._structArray.uint16[this._pos2 + 21] } get useRuntimeCollisionCircles() { return this._structArray.uint16[this._pos2 + 22] } get crossTileID() { return this._structArray.uint32[this._pos4 + 12] } set crossTileID(t) { this._structArray.uint32[this._pos4 + 12] = t; } get textOffset0() { return this._structArray.float32[this._pos4 + 13] } get textOffset1() { return this._structArray.float32[this._pos4 + 14] } get collisionCircleDiameter() { return this._structArray.float32[this._pos4 + 15] } } ka.prototype.size = 64; class Aa extends pa { get(t) { return new ka(this, t) } } Rr("SymbolInstanceArray", Aa); class Sa extends da { getoffsetX(t) { return this.float32[1 * t + 0] } } Rr("GlyphOffsetArray", Sa); class za extends fa { getx(t) { return this.int16[3 * t + 0] } gety(t) { return this.int16[3 * t + 1] } gettileUnitDistanceFromAnchor(t) { return this.int16[3 * t + 2] } } Rr("SymbolLineVertexArray", za); class Ia extends Xs { get featureIndex() { return this._structArray.uint32[this._pos4 + 0] } get sourceLayerIndex() { return this._structArray.uint16[this._pos2 + 2] } get bucketIndex() { return this._structArray.uint16[this._pos2 + 3] } get layoutVertexArrayOffset() { return this._structArray.uint16[this._pos2 + 4] } } Ia.prototype.size = 12; class Ma extends ya { get(t) { return new Ia(this, t) } } Rr("FeatureIndexArray", Ma); class Ta extends Xs { get a_centroid_pos0() { return this._structArray.uint16[this._pos2 + 0] } get a_centroid_pos1() { return this._structArray.uint16[this._pos2 + 1] } } Ta.prototype.size = 4; class Ea extends ma { get(t) { return new Ta(this, t) } } Rr("FillExtrusionCentroidArray", Ea); const Ca = Hs([{ name: "a_pattern_to", components: 4, type: "Uint16" }, { name: "a_pattern_from", components: 4, type: "Uint16" }, { name: "a_pixel_ratio_to", components: 1, type: "Uint16" }, { name: "a_pixel_ratio_from", components: 1, type: "Uint16" }]), Pa = Hs([{ name: "a_dash_to", components: 4, type: "Uint16" }, { name: "a_dash_from", components: 4, type: "Uint16" }]); var Da = _t((function (t) { t.exports = function (t, e) { var i, r, n, s, a, o, l, h; for (r = t.length - (i = 3 & t.length), n = e, a = 3432918353, o = 461845907, h = 0; h < r;)l = 255 & t.charCodeAt(h) | (255 & t.charCodeAt(++h)) << 8 | (255 & t.charCodeAt(++h)) << 16 | (255 & t.charCodeAt(++h)) << 24, ++h, n = 27492 + (65535 & (s = 5 * (65535 & (n = (n ^= l = (65535 & (l = (l = (65535 & l) * a + (((l >>> 16) * a & 65535) << 16) & 4294967295) << 15 | l >>> 17)) * o + (((l >>> 16) * o & 65535) << 16) & 4294967295) << 13 | n >>> 19)) + ((5 * (n >>> 16) & 65535) << 16) & 4294967295)) + ((58964 + (s >>> 16) & 65535) << 16); switch (l = 0, i) { case 3: l ^= (255 & t.charCodeAt(h + 2)) << 16; case 2: l ^= (255 & t.charCodeAt(h + 1)) << 8; case 1: n ^= l = (65535 & (l = (l = (65535 & (l ^= 255 & t.charCodeAt(h))) * a + (((l >>> 16) * a & 65535) << 16) & 4294967295) << 15 | l >>> 17)) * o + (((l >>> 16) * o & 65535) << 16) & 4294967295; }return n ^= t.length, n = 2246822507 * (65535 & (n ^= n >>> 16)) + ((2246822507 * (n >>> 16) & 65535) << 16) & 4294967295, n = 3266489909 * (65535 & (n ^= n >>> 13)) + ((3266489909 * (n >>> 16) & 65535) << 16) & 4294967295, (n ^= n >>> 16) >>> 0 }; })), Ba = _t((function (t) { t.exports = function (t, e) { for (var i, r = t.length, n = e ^ r, s = 0; r >= 4;)i = 1540483477 * (65535 & (i = 255 & t.charCodeAt(s) | (255 & t.charCodeAt(++s)) << 8 | (255 & t.charCodeAt(++s)) << 16 | (255 & t.charCodeAt(++s)) << 24)) + ((1540483477 * (i >>> 16) & 65535) << 16), n = 1540483477 * (65535 & n) + ((1540483477 * (n >>> 16) & 65535) << 16) ^ (i = 1540483477 * (65535 & (i ^= i >>> 24)) + ((1540483477 * (i >>> 16) & 65535) << 16)), r -= 4, ++s; switch (r) { case 3: n ^= (255 & t.charCodeAt(s + 2)) << 16; case 2: n ^= (255 & t.charCodeAt(s + 1)) << 8; case 1: n = 1540483477 * (65535 & (n ^= 255 & t.charCodeAt(s))) + ((1540483477 * (n >>> 16) & 65535) << 16); }return n = 1540483477 * (65535 & (n ^= n >>> 13)) + ((1540483477 * (n >>> 16) & 65535) << 16), (n ^= n >>> 15) >>> 0 }; })), Va = Da, La = Ba; Va.murmur3 = Da, Va.murmur2 = La; class Fa { constructor() { this.ids = [], this.positions = [], this.indexed = !1; } add(t, e, i, r) { this.ids.push(Ra(t)), this.positions.push(e, i, r); } getPositions(t) { const e = Ra(t); let i = 0, r = this.ids.length - 1; for (; i < r;) { const t = i + r >> 1; this.ids[t] >= e ? r = t : i = t + 1; } const n = []; for (; this.ids[i] === e;)n.push({ index: this.positions[3 * i], start: this.positions[3 * i + 1], end: this.positions[3 * i + 2] }), i++; return n } static serialize(t, e) { const i = new Float64Array(t.ids), r = new Uint32Array(t.positions); return Oa(i, r, 0, i.length - 1), e && e.push(i.buffer, r.buffer), { ids: i, positions: r } } static deserialize(t) { const e = new Fa; return e.ids = t.ids, e.positions = t.positions, e.indexed = !0, e } } function Ra(t) { const e = +t; return !isNaN(e) && e <= o ? e : Va(String(t)) } function Oa(t, e, i, r) { for (; i < r;) { const n = t[i + r >> 1]; let s = i - 1, a = r + 1; for (; ;) { do { s++; } while (t[s] < n); do { a--; } while (t[a] > n); if (s >= a) break; Ua(t, s, a), Ua(e, 3 * s, 3 * a), Ua(e, 3 * s + 1, 3 * a + 1), Ua(e, 3 * s + 2, 3 * a + 2); } a - i < r - a ? (Oa(t, e, i, a), i = a + 1) : (Oa(t, e, a + 1, r), r = a); } } function Ua(t, e, i) { const r = t[e]; t[e] = t[i], t[i] = r; } Rr("FeaturePositionMap", Fa); class $a { constructor(t, e) { this.gl = t.gl, this.location = e; } } class Za extends $a { constructor(t, e) { super(t, e), this.current = 0; } set(t) { this.current !== t && (this.current = t, this.gl.uniform1f(this.location, t)); } } class qa extends $a { constructor(t, e) { super(t, e), this.current = [0, 0, 0, 0]; } set(t) { t[0] === this.current[0] && t[1] === this.current[1] && t[2] === this.current[2] && t[3] === this.current[3] || (this.current = t, this.gl.uniform4f(this.location, t[0], t[1], t[2], t[3])); } } class Na extends $a { constructor(t, e) { super(t, e), this.current = wt.transparent; } set(t) { t.r === this.current.r && t.g === this.current.g && t.b === this.current.b && t.a === this.current.a || (this.current = t, this.gl.uniform4f(this.location, t.r, t.g, t.b, t.a)); } } const ja = new Float32Array(16), Ga = new Float32Array(9); function Xa(t) { return [js(255 * t.r, 255 * t.g), js(255 * t.b, 255 * t.a)] } class Ka { constructor(t, e, i) { this.value = t, this.uniformNames = e.map((t => `u_${t}`)), this.type = i; } setUniform(t, e, i) { t.set(i.constantOr(this.value)); } getBinding(t, e, i) { return "color" === this.type ? new Na(t, e) : new Za(t, e) } } class Ha { constructor(t, e) { this.uniformNames = e.map((t => `u_${t}`)), this.patternFrom = null, this.patternTo = null, this.pixelRatioFrom = 1, this.pixelRatioTo = 1; } setConstantPatternPositions(t, e) { this.pixelRatioFrom = e.pixelRatio, this.pixelRatioTo = t.pixelRatio, this.patternFrom = e.tl.concat(e.br), this.patternTo = t.tl.concat(t.br); } setUniform(t, e, i, r) { const n = "u_pattern_to" === r || "u_dash_to" === r ? this.patternTo : "u_pattern_from" === r || "u_dash_from" === r ? this.patternFrom : "u_pixel_ratio_to" === r ? this.pixelRatioTo : "u_pixel_ratio_from" === r ? this.pixelRatioFrom : null; n && t.set(n); } getBinding(t, e, i) { return "u_pattern_from" === i || "u_pattern_to" === i || "u_dash_from" === i || "u_dash_to" === i ? new qa(t, e) : new Za(t, e) } } class Wa { constructor(t, e, i, r) { this.expression = t, this.type = i, this.maxValue = 0, this.paintVertexAttributes = e.map((t => ({ name: `a_${t}`, type: "Float32", components: "color" === i ? 2 : 1, offset: 0 }))), this.paintVertexArray = new r; } populatePaintArray(t, e, i, r, n) { const s = this.paintVertexArray.length, a = this.expression.evaluate(new Es(0), e, {}, r, [], n); this.paintVertexArray.resize(t), this._setPaintValue(s, t, a); } updatePaintArray(t, e, i, r) { const n = this.expression.evaluate({ zoom: 0 }, i, r); this._setPaintValue(t, e, n); } _setPaintValue(t, e, i) { if ("color" === this.type) { const r = Xa(i); for (let i = t; i < e; i++)this.paintVertexArray.emplace(i, r[0], r[1]); } else { for (let r = t; r < e; r++)this.paintVertexArray.emplace(r, i); this.maxValue = Math.max(this.maxValue, Math.abs(i)); } } upload(t) { this.paintVertexArray && this.paintVertexArray.arrayBuffer && (this.paintVertexBuffer && this.paintVertexBuffer.buffer ? this.paintVertexBuffer.updateData(this.paintVertexArray) : this.paintVertexBuffer = t.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent)); } destroy() { this.paintVertexBuffer && this.paintVertexBuffer.destroy(); } } class Ya { constructor(t, e, i, r, n, s) { this.expression = t, this.uniformNames = e.map((t => `u_${t}_t`)), this.type = i, this.useIntegerZoom = r, this.zoom = n, this.maxValue = 0, this.paintVertexAttributes = e.map((t => ({ name: `a_${t}`, type: "Float32", components: "color" === i ? 4 : 2, offset: 0 }))), this.paintVertexArray = new s; } populatePaintArray(t, e, i, r, n) { const s = this.expression.evaluate(new Es(this.zoom), e, {}, r, [], n), a = this.expression.evaluate(new Es(this.zoom + 1), e, {}, r, [], n), o = this.paintVertexArray.length; this.paintVertexArray.resize(t), this._setPaintValue(o, t, s, a); } updatePaintArray(t, e, i, r) { const n = this.expression.evaluate({ zoom: this.zoom }, i, r), s = this.expression.evaluate({ zoom: this.zoom + 1 }, i, r); this._setPaintValue(t, e, n, s); } _setPaintValue(t, e, i, r) { if ("color" === this.type) { const n = Xa(i), s = Xa(r); for (let i = t; i < e; i++)this.paintVertexArray.emplace(i, n[0], n[1], s[0], s[1]); } else { for (let n = t; n < e; n++)this.paintVertexArray.emplace(n, i, r); this.maxValue = Math.max(this.maxValue, Math.abs(i), Math.abs(r)); } } upload(t) { this.paintVertexArray && this.paintVertexArray.arrayBuffer && (this.paintVertexBuffer && this.paintVertexBuffer.buffer ? this.paintVertexBuffer.updateData(this.paintVertexArray) : this.paintVertexBuffer = t.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent)); } destroy() { this.paintVertexBuffer && this.paintVertexBuffer.destroy(); } setUniform(t, e) { const i = this.useIntegerZoom ? Math.floor(e.zoom) : e.zoom, r = y(this.expression.interpolationFactor(i, this.zoom, this.zoom + 1), 0, 1); t.set(r); } getBinding(t, e, i) { return new Za(t, e) } } class Ja { constructor(t, e, i, r, n, s, a) { this.expression = t, this.type = i, this.useIntegerZoom = r, this.zoom = n, this.layerId = a, this.paintVertexAttributes = ("array" === i ? Pa : Ca).members; for (let t = 0; t < e.length; ++t); this.zoomInPaintVertexArray = new s, this.zoomOutPaintVertexArray = new s; } populatePaintArray(t, e, i) { const r = this.zoomInPaintVertexArray.length; this.zoomInPaintVertexArray.resize(t), this.zoomOutPaintVertexArray.resize(t), this._setPaintValues(r, t, e.patterns && e.patterns[this.layerId], i); } updatePaintArray(t, e, i, r, n) { this._setPaintValues(t, e, i.patterns && i.patterns[this.layerId], n); } _setPaintValues(t, e, i, r) { if (!r || !i) return; const { min: n, mid: s, max: a } = i, o = r[n], l = r[s], h = r[a]; if (o && l && h) for (let i = t; i < e; i++)this._setPaintValue(this.zoomInPaintVertexArray, i, l, o), this._setPaintValue(this.zoomOutPaintVertexArray, i, l, h); } _setPaintValue(t, e, i, r) { t.emplace(e, i.tl[0], i.tl[1], i.br[0], i.br[1], r.tl[0], r.tl[1], r.br[0], r.br[1], i.pixelRatio, r.pixelRatio); } upload(t) { this.zoomInPaintVertexArray && this.zoomInPaintVertexArray.arrayBuffer && this.zoomOutPaintVertexArray && this.zoomOutPaintVertexArray.arrayBuffer && (this.zoomInPaintVertexBuffer = t.createVertexBuffer(this.zoomInPaintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent), this.zoomOutPaintVertexBuffer = t.createVertexBuffer(this.zoomOutPaintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent)); } destroy() { this.zoomOutPaintVertexBuffer && this.zoomOutPaintVertexBuffer.destroy(), this.zoomInPaintVertexBuffer && this.zoomInPaintVertexBuffer.destroy(); } } class Qa { constructor(t, e, i = (() => !0)) { this.binders = {}, this._buffers = []; const r = []; for (const n in t.paint._values) { if (!i(n)) continue; const s = t.paint.get(n); if (!(s instanceof Fs && Ii(s.property.specification))) continue; const a = io(n, t.type), o = s.value, l = s.property.specification.type, h = s.property.useIntegerZoom, u = s.property.specification["property-type"], c = "cross-faded" === u || "cross-faded-data-driven" === u, p = "line-dasharray" === String(n) && "constant" !== t.layout.get("line-cap").value.kind; if ("constant" !== o.kind || p) if ("source" === o.kind || p || c) { const i = so(n, l, "source"); this.binders[n] = c ? new Ja(o, a, l, h, e, i, t.id) : new Wa(o, a, l, i), r.push(`/a_${n}`); } else { const t = so(n, l, "composite"); this.binders[n] = new Ya(o, a, l, h, e, t), r.push(`/z_${n}`); } else this.binders[n] = c ? new Ha(o.value, a) : new Ka(o.value, a, l), r.push(`/u_${n}`); } this.cacheKey = r.sort().join(""); } getMaxValue(t) { const e = this.binders[t]; return e instanceof Wa || e instanceof Ya ? e.maxValue : 0 } populatePaintArrays(t, e, i, r, n) { for (const s in this.binders) { const a = this.binders[s]; (a instanceof Wa || a instanceof Ya || a instanceof Ja) && a.populatePaintArray(t, e, i, r, n); } } setConstantPatternPositions(t, e) { for (const i in this.binders) { const r = this.binders[i]; r instanceof Ha && r.setConstantPatternPositions(t, e); } } updatePaintArrays(t, e, i, r, n) { let s = !1; for (const a in t) { const o = e.getPositions(a); for (const e of o) { const o = i.feature(e.index); for (const i in this.binders) { const l = this.binders[i]; if ((l instanceof Wa || l instanceof Ya || l instanceof Ja) && !0 === l.expression.isStateDependent) { const h = r.paint.get(i); l.expression = h.value, l.updatePaintArray(e.start, e.end, o, t[a], n), s = !0; } } } } return s } defines() { const t = []; for (const e in this.binders) { const i = this.binders[e]; (i instanceof Ka || i instanceof Ha) && t.push(...i.uniformNames.map((t => `#define HAS_UNIFORM_${t}`))); } return t } getBinderAttributes() { const t = []; for (const e in this.binders) { const i = this.binders[e]; if (i instanceof Wa || i instanceof Ya || i instanceof Ja) for (let e = 0; e < i.paintVertexAttributes.length; e++)t.push(i.paintVertexAttributes[e].name); } return t } getBinderUniforms() { const t = []; for (const e in this.binders) { const i = this.binders[e]; if (i instanceof Ka || i instanceof Ha || i instanceof Ya) for (const e of i.uniformNames) t.push(e); } return t } getPaintVertexBuffers() { return this._buffers } getUniforms(t, e) { const i = []; for (const r in this.binders) { const n = this.binders[r]; if (n instanceof Ka || n instanceof Ha || n instanceof Ya) for (const s of n.uniformNames) if (e[s]) { const a = n.getBinding(t, e[s], s); i.push({ name: s, property: r, binding: a }); } } return i } setUniforms(t, e, i, r) { for (const { name: t, property: n, binding: s } of e) this.binders[n].setUniform(s, r, i.get(n), t); } updatePaintBuffers(t) { this._buffers = []; for (const e in this.binders) { const i = this.binders[e]; if (t && i instanceof Ja) { const e = 2 === t.fromScale ? i.zoomInPaintVertexBuffer : i.zoomOutPaintVertexBuffer; e && this._buffers.push(e); } else (i instanceof Wa || i instanceof Ya) && i.paintVertexBuffer && this._buffers.push(i.paintVertexBuffer); } } upload(t) { for (const e in this.binders) { const i = this.binders[e]; (i instanceof Wa || i instanceof Ya || i instanceof Ja) && i.upload(t); } this.updatePaintBuffers(); } destroy() { for (const t in this.binders) { const e = this.binders[t]; (e instanceof Wa || e instanceof Ya || e instanceof Ja) && e.destroy(); } } } class to { constructor(t, e, i = (() => !0)) { this.programConfigurations = {}; for (const r of t) this.programConfigurations[r.id] = new Qa(r, e, i); this.needsUpload = !1, this._featureMap = new Fa, this._bufferOffset = 0; } populatePaintArrays(t, e, i, r, n, s) { for (const i in this.programConfigurations) this.programConfigurations[i].populatePaintArrays(t, e, r, n, s); void 0 !== e.id && this._featureMap.add(e.id, i, this._bufferOffset, t), this._bufferOffset = t, this.needsUpload = !0; } updatePaintArrays(t, e, i, r) { for (const n of i) this.needsUpload = this.programConfigurations[n.id].updatePaintArrays(t, this._featureMap, e, n, r) || this.needsUpload; } get(t) { return this.programConfigurations[t] } upload(t) { if (this.needsUpload) { for (const e in this.programConfigurations) this.programConfigurations[e].upload(t); this.needsUpload = !1; } } destroy() { for (const t in this.programConfigurations) this.programConfigurations[t].destroy(); } } const eo = { "text-opacity": ["opacity"], "icon-opacity": ["opacity"], "text-color": ["fill_color"], "icon-color": ["fill_color"], "text-halo-color": ["halo_color"], "icon-halo-color": ["halo_color"], "text-halo-blur": ["halo_blur"], "icon-halo-blur": ["halo_blur"], "text-halo-width": ["halo_width"], "icon-halo-width": ["halo_width"], "line-gap-width": ["gapwidth"], "line-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"], "fill-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"], "fill-extrusion-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"], "line-dasharray": ["dash_to", "dash_from"] }; function io(t, e) { return eo[t] || [t.replace(`${e}-`, "").replace(/-/g, "_")] } const ro = { "line-pattern": { source: ea, composite: ea }, "fill-pattern": { source: ea, composite: ea }, "fill-extrusion-pattern": { source: ea, composite: ea }, "line-dasharray": { source: ia, composite: ia } }, no = { color: { source: ta, composite: xa }, number: { source: da, composite: ta } }; function so(t, e, i) { const r = ro[t]; return r && r[i] || no[e][i] } Rr("ConstantBinder", Ka), Rr("CrossFadedConstantBinder", Ha), Rr("SourceExpressionBinder", Wa), Rr("CrossFadedCompositeBinder", Ja), Rr("CompositeExpressionBinder", Ya), Rr("ProgramConfiguration", Qa, { omit: ["_buffers"] }), Rr("ProgramConfigurationSet", to); const ao = "-transition"; class oo extends q { constructor(t, e) { if (super(), this.id = t.id, this.type = t.type, this._featureFilter = { filter: () => !0, needGeometry: !1 }, "custom" !== t.type && (this.metadata = (t = t).metadata, this.minzoom = t.minzoom, this.maxzoom = t.maxzoom, "background" !== t.type && "sky" !== t.type && (this.source = t.source, this.sourceLayer = t["source-layer"], this.filter = t.filter), e.layout && (this._unevaluatedLayout = new Ls(e.layout)), e.paint)) { this._transitionablePaint = new Ds(e.paint); for (const e in t.paint) this.setPaintProperty(e, t.paint[e], { validate: !1 }); for (const e in t.layout) this.setLayoutProperty(e, t.layout[e], { validate: !1 }); this._transitioningPaint = this._transitionablePaint.untransitioned(), this.paint = new Rs(e.paint); } } getCrossfadeParameters() { return this._crossfadeParameters } getLayoutProperty(t) { return "visibility" === t ? this.visibility : this._unevaluatedLayout.getValue(t) } setLayoutProperty(t, e, i = {}) { null != e && this._validate(Cr, `layers.${this.id}.layout.${t}`, t, e, i) || ("visibility" !== t ? this._unevaluatedLayout.setValue(t, e) : this.visibility = e); } getPaintProperty(t) { return z(t, ao) ? this._transitionablePaint.getTransition(t.slice(0, -ao.length)) : this._transitionablePaint.getValue(t) } setPaintProperty(t, e, i = {}) { if (null != e && this._validate(Er, `layers.${this.id}.paint.${t}`, t, e, i)) return !1; if (z(t, ao)) return this._transitionablePaint.setTransition(t.slice(0, -ao.length), e || void 0), !1; { const i = this._transitionablePaint._values[t], r = i.property && i.property.specification && "cross-faded-data-driven" === i.property.specification["property-type"], n = i.value.isDataDriven(), s = i.value; this._transitionablePaint.setValue(t, e), this._handleSpecialPaintPropertyUpdate(t); const a = this._transitionablePaint._values[t].value; return a.isDataDriven() || n || r || this._handleOverridablePaintPropertyUpdate(t, s, a) } } _handleSpecialPaintPropertyUpdate(t) { } getProgramIds() { return null } getProgramConfiguration(t) { return null } _handleOverridablePaintPropertyUpdate(t, e, i) { return !1 } isHidden(t) { return !!(this.minzoom && t < this.minzoom) || !!(this.maxzoom && t >= this.maxzoom) || "none" === this.visibility } updateTransitions(t) { this._transitioningPaint = this._transitionablePaint.transitioned(t, this._transitioningPaint); } hasTransition() { return this._transitioningPaint.hasTransition() } recalculate(t, e) { t.getCrossfadeParameters && (this._crossfadeParameters = t.getCrossfadeParameters()), this._unevaluatedLayout && (this.layout = this._unevaluatedLayout.possiblyEvaluate(t, void 0, e)), this.paint = this._transitioningPaint.possiblyEvaluate(t, void 0, e); } serialize() { const t = { id: this.id, type: this.type, source: this.source, "source-layer": this.sourceLayer, metadata: this.metadata, minzoom: this.minzoom, maxzoom: this.maxzoom, filter: this.filter, layout: this._unevaluatedLayout && this._unevaluatedLayout.serialize(), paint: this._transitionablePaint && this._transitionablePaint.serialize() }; return this.visibility && (t.layout = t.layout || {}, t.layout.visibility = this.visibility), M(t, ((t, e) => !(void 0 === t || "layout" === e && !Object.keys(t).length || "paint" === e && !Object.keys(t).length))) } _validate(t, e, i, r, n = {}) { return (!n || !1 !== n.validate) && Pr(this, t.call(Ir, { key: e, layerType: this.type, objectKey: i, value: r, styleSpec: X, style: { glyphs: !0, sprite: !0 } })) } is3D() { return !1 } isSky() { return !1 } isTileClipped() { return !1 } hasOffscreenPass() { return !1 } resize() { } isStateDependent() { for (const t in this.paint._values) { const e = this.paint.get(t); if (e instanceof Fs && Ii(e.property.specification) && ("source" === e.value.kind || "composite" === e.value.kind) && e.value.isStateDependent) return !0 } return !1 } } const lo = Hs([{ name: "a_pos", components: 2, type: "Int16" }], 4), { members: ho } = lo; class uo { constructor(t = []) { this.segments = t; } prepareSegment(t, e, i, r) { let n = this.segments[this.segments.length - 1]; return t > uo.MAX_VERTEX_ARRAY_LENGTH && C(`Max vertices per segment is ${uo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`), (!n || n.vertexLength + t > uo.MAX_VERTEX_ARRAY_LENGTH || n.sortKey !== r) && (n = { vertexOffset: e.length, primitiveOffset: i.length, vertexLength: 0, primitiveLength: 0 }, void 0 !== r && (n.sortKey = r), this.segments.push(n)), n } get() { return this.segments } destroy() { for (const t of this.segments) for (const e in t.vaos) t.vaos[e].destroy(); } static simpleSegment(t, e, i, r) { return new uo([{ vertexOffset: t, primitiveOffset: e, vertexLength: i, primitiveLength: r, vaos: {}, sortKey: 0 }]) } } uo.MAX_VERTEX_ARRAY_LENGTH = Math.pow(2, 16) - 1, Rr("SegmentVector", uo); var co = 8192; const po = Math.pow(2, 14) - 1, fo = -po - 1; function yo(t) { const e = co / t.extent, i = t.loadGeometry(); for (let t = 0; t < i.length; t++) { const r = i[t]; for (let t = 0; t < r.length; t++) { const i = r[t], n = Math.round(i.x * e), s = Math.round(i.y * e); i.x = y(n, fo, po), i.y = y(s, fo, po), (n < i.x || n > i.x + 1 || s < i.y || s > i.y + 1) && C("Geometry exceeds allowed extent, reduce your vector tile buffer size"); } } return i } function mo(t, e) { return { type: t.type, id: t.id, properties: t.properties, geometry: e ? yo(t) : [] } } function go(t, e, i, r, n) { t.emplaceBack(2 * e + (r + 1) / 2, 2 * i + (n + 1) / 2); } class xo { constructor(t) { this.zoom = t.zoom, this.overscaling = t.overscaling, this.layers = t.layers, this.layerIds = this.layers.map((t => t.id)), this.index = t.index, this.hasPattern = !1, this.layoutVertexArray = new Ys, this.indexArray = new ua, this.segments = new uo, this.programConfigurations = new to(t.layers, t.zoom), this.stateDependentLayerIds = this.layers.filter((t => t.isStateDependent())).map((t => t.id)); } populate(t, e, i) { const r = this.layers[0], n = []; let s = null; "circle" === r.type && (s = r.layout.get("circle-sort-key")); for (const { feature: e, id: r, index: a, sourceLayerIndex: o } of t) { const t = this.layers[0]._featureFilter.needGeometry, l = mo(e, t); if (!this.layers[0]._featureFilter.filter(new Es(this.zoom), l, i)) continue; const h = s ? s.evaluate(l, {}, i) : void 0, u = { id: r, properties: e.properties, type: e.type, sourceLayerIndex: o, index: a, geometry: t ? l.geometry : yo(e), patterns: {}, sortKey: h }; n.push(u); } s && n.sort(((t, e) => t.sortKey - e.sortKey)); for (const r of n) { const { geometry: n, index: s, sourceLayerIndex: a } = r, o = t[s].feature; this.addFeature(r, n, s, i), e.featureIndex.insert(o, n, s, a, this.index); } } update(t, e, i) { this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t, e, this.stateDependentLayers, i); } isEmpty() { return 0 === this.layoutVertexArray.length } uploadPending() { return !this.uploaded || this.programConfigurations.needsUpload } upload(t) { this.uploaded || (this.layoutVertexBuffer = t.createVertexBuffer(this.layoutVertexArray, ho), this.indexBuffer = t.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(t), this.uploaded = !0; } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy()); } addFeature(t, e, i, r) { for (const i of e) for (const e of i) { const i = e.x, r = e.y; if (i < 0 || i >= co || r < 0 || r >= co) continue; const n = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray, t.sortKey), s = n.vertexLength; go(this.layoutVertexArray, i, r, -1, -1), go(this.layoutVertexArray, i, r, 1, -1), go(this.layoutVertexArray, i, r, 1, 1), go(this.layoutVertexArray, i, r, -1, 1), this.indexArray.emplaceBack(s, s + 1, s + 2), this.indexArray.emplaceBack(s, s + 3, s + 2), n.vertexLength += 4, n.primitiveLength += 2; } this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t, i, {}, r); } } function _o(t, e) { for (let i = 0; i < t.length; i++)if (Mo(e, t[i])) return !0; for (let i = 0; i < e.length; i++)if (Mo(t, e[i])) return !0; return !!ko(t, e) } function vo(t, e, i) { return !!Mo(t, e) || !!So(e, t, i) } function bo(t, e) { if (1 === t.length) return Io(e, t[0]); for (let i = 0; i < e.length; i++) { const r = e[i]; for (let e = 0; e < r.length; e++)if (Mo(t, r[e])) return !0 } for (let i = 0; i < t.length; i++)if (Io(e, t[i])) return !0; for (let i = 0; i < e.length; i++)if (ko(t, e[i])) return !0; return !1 } function wo(t, e, i) { if (t.length > 1) { if (ko(t, e)) return !0; for (let r = 0; r < e.length; r++)if (So(e[r], t, i)) return !0 } for (let r = 0; r < t.length; r++)if (So(t[r], e, i)) return !0; return !1 } function ko(t, e) { if (0 === t.length || 0 === e.length) return !1; for (let i = 0; i < t.length - 1; i++) { const r = t[i], n = t[i + 1]; for (let t = 0; t < e.length - 1; t++)if (Ao(r, n, e[t], e[t + 1])) return !0 } return !1 } function Ao(t, e, i, r) { return P(t, i, r) !== P(e, i, r) && P(t, e, i) !== P(t, e, r) } function So(t, e, i) { const r = i * i; if (1 === e.length) return t.distSqr(e[0]) < r; for (let i = 1; i < e.length; i++)if (zo(t, e[i - 1], e[i]) < r) return !0; return !1 } function zo(t, e, i) { const r = e.distSqr(i); if (0 === r) return t.distSqr(e); const n = ((t.x - e.x) * (i.x - e.x) + (t.y - e.y) * (i.y - e.y)) / r; return t.distSqr(n < 0 ? e : n > 1 ? i : i.sub(e)._mult(n)._add(e)) } function Io(t, e) { let i, r, n, s = !1; for (let a = 0; a < t.length; a++) { i = t[a]; for (let t = 0, a = i.length - 1; t < i.length; a = t++)r = i[t], n = i[a], r.y > e.y != n.y > e.y && e.x < (n.x - r.x) * (e.y - r.y) / (n.y - r.y) + r.x && (s = !s); } return s } function Mo(t, e) { let i = !1; for (let r = 0, n = t.length - 1; r < t.length; n = r++) { const s = t[r], a = t[n]; s.y > e.y != a.y > e.y && e.x < (a.x - s.x) * (e.y - s.y) / (a.y - s.y) + s.x && (i = !i); } return i } function To(t, e, r, n, s) { for (const i of t) if (e <= i.x && r <= i.y && n >= i.x && s >= i.y) return !0; const a = [new i(e, r), new i(e, s), new i(n, s), new i(n, r)]; if (t.length > 2) for (const e of a) if (Mo(t, e)) return !0; for (let e = 0; e < t.length - 1; e++)if (Eo(t[e], t[e + 1], a)) return !0; return !1 } function Eo(t, e, i) { const r = i[0], n = i[2]; if (t.x < r.x && e.x < r.x || t.x > n.x && e.x > n.x || t.y < r.y && e.y < r.y || t.y > n.y && e.y > n.y) return !1; const s = P(t, e, i[0]); return s !== P(t, e, i[1]) || s !== P(t, e, i[2]) || s !== P(t, e, i[3]) } function Co(t, e, i) { const r = e.paint.get(t).value; return "constant" === r.kind ? r.value : i.programConfigurations.get(e.id).getMaxValue(t) } function Po(t) { return Math.sqrt(t[0] * t[0] + t[1] * t[1]) } function Do(t, e, r, n, s) { if (!e[0] && !e[1]) return t; const a = i.convert(e)._mult(s); "viewport" === r && a._rotate(-n); const o = []; for (let e = 0; e < t.length; e++)o.push(t[e].sub(a)); return o } function Bo(t, e, r, n) { const s = i.convert(t)._mult(n); return "viewport" === e && s._rotate(-r), s } Rr("CircleBucket", xo, { omit: ["layers"] }); const Vo = new Ns({ "circle-sort-key": new Us(X.layout_circle["circle-sort-key"]) }); var Lo = { paint: new Ns({ "circle-radius": new Us(X.paint_circle["circle-radius"]), "circle-color": new Us(X.paint_circle["circle-color"]), "circle-blur": new Us(X.paint_circle["circle-blur"]), "circle-opacity": new Us(X.paint_circle["circle-opacity"]), "circle-translate": new Os(X.paint_circle["circle-translate"]), "circle-translate-anchor": new Os(X.paint_circle["circle-translate-anchor"]), "circle-pitch-scale": new Os(X.paint_circle["circle-pitch-scale"]), "circle-pitch-alignment": new Os(X.paint_circle["circle-pitch-alignment"]), "circle-stroke-width": new Us(X.paint_circle["circle-stroke-width"]), "circle-stroke-color": new Us(X.paint_circle["circle-stroke-color"]), "circle-stroke-opacity": new Us(X.paint_circle["circle-stroke-opacity"]) }), layout: Vo }, Fo = "undefined" != typeof Float32Array ? Float32Array : Array; function Ro() { var t = new Fo(9); return Fo != Float32Array && (t[1] = 0, t[2] = 0, t[3] = 0, t[5] = 0, t[6] = 0, t[7] = 0), t[0] = 1, t[4] = 1, t[8] = 1, t } function Oo() { var t = new Fo(16); return Fo != Float32Array && (t[1] = 0, t[2] = 0, t[3] = 0, t[4] = 0, t[6] = 0, t[7] = 0, t[8] = 0, t[9] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0), t[0] = 1, t[5] = 1, t[10] = 1, t[15] = 1, t } function Uo(t) { return t[0] = 1, t[1] = 0, t[2] = 0, t[3] = 0, t[4] = 0, t[5] = 1, t[6] = 0, t[7] = 0, t[8] = 0, t[9] = 0, t[10] = 1, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, t } function $o(t, e) { var i = e[0], r = e[1], n = e[2], s = e[3], a = e[4], o = e[5], l = e[6], h = e[7], u = e[8], c = e[9], p = e[10], d = e[11], f = e[12], y = e[13], m = e[14], g = e[15], x = i * o - r * a, _ = i * l - n * a, v = i * h - s * a, b = r * l - n * o, w = r * h - s * o, k = n * h - s * l, A = u * y - c * f, S = u * m - p * f, z = u * g - d * f, I = c * m - p * y, M = c * g - d * y, T = p * g - d * m, E = x * T - _ * M + v * I + b * z - w * S + k * A; return E ? (t[0] = (o * T - l * M + h * I) * (E = 1 / E), t[1] = (n * M - r * T - s * I) * E, t[2] = (y * k - m * w + g * b) * E, t[3] = (p * w - c * k - d * b) * E, t[4] = (l * z - a * T - h * S) * E, t[5] = (i * T - n * z + s * S) * E, t[6] = (m * v - f * k - g * _) * E, t[7] = (u * k - p * v + d * _) * E, t[8] = (a * M - o * z + h * A) * E, t[9] = (r * z - i * M - s * A) * E, t[10] = (f * w - y * v + g * x) * E, t[11] = (c * v - u * w - d * x) * E, t[12] = (o * S - a * I - l * A) * E, t[13] = (i * I - r * S + n * A) * E, t[14] = (y * _ - f * b - m * x) * E, t[15] = (u * b - c * _ + p * x) * E, t) : null } function Zo(t, e, i) { var r = e[0], n = e[1], s = e[2], a = e[3], o = e[4], l = e[5], h = e[6], u = e[7], c = e[8], p = e[9], d = e[10], f = e[11], y = e[12], m = e[13], g = e[14], x = e[15], _ = i[0], v = i[1], b = i[2], w = i[3]; return t[0] = _ * r + v * o + b * c + w * y, t[1] = _ * n + v * l + b * p + w * m, t[2] = _ * s + v * h + b * d + w * g, t[3] = _ * a + v * u + b * f + w * x, t[4] = (_ = i[4]) * r + (v = i[5]) * o + (b = i[6]) * c + (w = i[7]) * y, t[5] = _ * n + v * l + b * p + w * m, t[6] = _ * s + v * h + b * d + w * g, t[7] = _ * a + v * u + b * f + w * x, t[8] = (_ = i[8]) * r + (v = i[9]) * o + (b = i[10]) * c + (w = i[11]) * y, t[9] = _ * n + v * l + b * p + w * m, t[10] = _ * s + v * h + b * d + w * g, t[11] = _ * a + v * u + b * f + w * x, t[12] = (_ = i[12]) * r + (v = i[13]) * o + (b = i[14]) * c + (w = i[15]) * y, t[13] = _ * n + v * l + b * p + w * m, t[14] = _ * s + v * h + b * d + w * g, t[15] = _ * a + v * u + b * f + w * x, t } function qo(t, e, i) { var r, n, s, a, o, l, h, u, c, p, d, f, y = i[0], m = i[1], g = i[2]; return e === t ? (t[12] = e[0] * y + e[4] * m + e[8] * g + e[12], t[13] = e[1] * y + e[5] * m + e[9] * g + e[13], t[14] = e[2] * y + e[6] * m + e[10] * g + e[14], t[15] = e[3] * y + e[7] * m + e[11] * g + e[15]) : (n = e[1], s = e[2], a = e[3], o = e[4], l = e[5], h = e[6], u = e[7], c = e[8], p = e[9], d = e[10], f = e[11], t[0] = r = e[0], t[1] = n, t[2] = s, t[3] = a, t[4] = o, t[5] = l, t[6] = h, t[7] = u, t[8] = c, t[9] = p, t[10] = d, t[11] = f, t[12] = r * y + o * m + c * g + e[12], t[13] = n * y + l * m + p * g + e[13], t[14] = s * y + h * m + d * g + e[14], t[15] = a * y + u * m + f * g + e[15]), t } function No(t, e, i) { var r = i[0], n = i[1], s = i[2]; return t[0] = e[0] * r, t[1] = e[1] * r, t[2] = e[2] * r, t[3] = e[3] * r, t[4] = e[4] * n, t[5] = e[5] * n, t[6] = e[6] * n, t[7] = e[7] * n, t[8] = e[8] * s, t[9] = e[9] * s, t[10] = e[10] * s, t[11] = e[11] * s, t[12] = e[12], t[13] = e[13], t[14] = e[14], t[15] = e[15], t } function jo(t, e, i) { var r = Math.sin(i), n = Math.cos(i), s = e[4], a = e[5], o = e[6], l = e[7], h = e[8], u = e[9], c = e[10], p = e[11]; return e !== t && (t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[12] = e[12], t[13] = e[13], t[14] = e[14], t[15] = e[15]), t[4] = s * n + h * r, t[5] = a * n + u * r, t[6] = o * n + c * r, t[7] = l * n + p * r, t[8] = h * n - s * r, t[9] = u * n - a * r, t[10] = c * n - o * r, t[11] = p * n - l * r, t } function Go(t, e, i) { var r = Math.sin(i), n = Math.cos(i), s = e[0], a = e[1], o = e[2], l = e[3], h = e[4], u = e[5], c = e[6], p = e[7]; return e !== t && (t[8] = e[8], t[9] = e[9], t[10] = e[10], t[11] = e[11], t[12] = e[12], t[13] = e[13], t[14] = e[14], t[15] = e[15]), t[0] = s * n + h * r, t[1] = a * n + u * r, t[2] = o * n + c * r, t[3] = l * n + p * r, t[4] = h * n - s * r, t[5] = u * n - a * r, t[6] = c * n - o * r, t[7] = p * n - l * r, t } function Xo(t, e) { var i = e[0], r = e[1], n = e[2], s = e[3], a = i + i, o = r + r, l = n + n, h = i * a, u = r * a, c = r * o, p = n * a, d = n * o, f = n * l, y = s * a, m = s * o, g = s * l; return t[0] = 1 - c - f, t[1] = u + g, t[2] = p - m, t[3] = 0, t[4] = u - g, t[5] = 1 - h - f, t[6] = d + y, t[7] = 0, t[8] = p + m, t[9] = d - y, t[10] = 1 - h - c, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, t } Math.hypot || (Math.hypot = function () { for (var t = 0, e = arguments.length; e--;)t += arguments[e] * arguments[e]; return Math.sqrt(t) }); var Ko = function (t, e, i, r, n) { var s, a = 1 / Math.tan(e / 2); return t[0] = a / i, t[1] = 0, t[2] = 0, t[3] = 0, t[4] = 0, t[5] = a, t[6] = 0, t[7] = 0, t[8] = 0, t[9] = 0, t[11] = -1, t[12] = 0, t[13] = 0, t[15] = 0, null != n && n !== 1 / 0 ? (t[10] = (n + r) * (s = 1 / (r - n)), t[14] = 2 * n * r * s) : (t[10] = -1, t[14] = -2 * r), t }, Ho = Zo; function Wo() { var t = new Fo(3); return Fo != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0), t } function Yo(t) { var e = new Fo(3); return e[0] = t[0], e[1] = t[1], e[2] = t[2], e } function Jo(t) { return Math.hypot(t[0], t[1], t[2]) } function Qo(t, e, i) { var r = new Fo(3); return r[0] = t, r[1] = e, r[2] = i, r } function tl(t, e, i) { return t[0] = e[0] + i[0], t[1] = e[1] + i[1], t[2] = e[2] + i[2], t } function el(t, e, i) { return t[0] = e[0] - i[0], t[1] = e[1] - i[1], t[2] = e[2] - i[2], t } function il(t, e, i) { return t[0] = e[0] * i[0], t[1] = e[1] * i[1], t[2] = e[2] * i[2], t } function rl(t, e, i) { return t[0] = e[0] * i, t[1] = e[1] * i, t[2] = e[2] * i, t } function nl(t, e, i, r) { return t[0] = e[0] + i[0] * r, t[1] = e[1] + i[1] * r, t[2] = e[2] + i[2] * r, t } function sl(t, e) { var i = e[0], r = e[1], n = e[2], s = i * i + r * r + n * n; return s > 0 && (s = 1 / Math.sqrt(s)), t[0] = e[0] * s, t[1] = e[1] * s, t[2] = e[2] * s, t } function al(t, e) { return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] } function ol(t, e, i) { var r = e[0], n = e[1], s = e[2], a = i[0], o = i[1], l = i[2]; return t[0] = n * l - s * o, t[1] = s * a - r * l, t[2] = r * o - n * a, t } function ll(t, e, i) { var r = e[0], n = e[1], s = e[2], a = i[3] * r + i[7] * n + i[11] * s + i[15]; return t[0] = (i[0] * r + i[4] * n + i[8] * s + i[12]) / (a = a || 1), t[1] = (i[1] * r + i[5] * n + i[9] * s + i[13]) / a, t[2] = (i[2] * r + i[6] * n + i[10] * s + i[14]) / a, t } function hl(t, e, i) { var r = i[0], n = i[1], s = i[2], a = e[0], o = e[1], l = e[2], h = n * l - s * o, u = s * a - r * l, c = r * o - n * a, p = n * c - s * u, d = s * h - r * c, f = r * u - n * h, y = 2 * i[3]; return u *= y, c *= y, d *= 2, f *= 2, t[0] = a + (h *= y) + (p *= 2), t[1] = o + u + d, t[2] = l + c + f, t } var ul, cl = el, pl = il, dl = Jo; function fl(t, e, i) { return t[0] = e[0] * i, t[1] = e[1] * i, t[2] = e[2] * i, t[3] = e[3] * i, t } function yl(t, e, i) { var r = e[0], n = e[1], s = e[2], a = e[3]; return t[0] = i[0] * r + i[4] * n + i[8] * s + i[12] * a, t[1] = i[1] * r + i[5] * n + i[9] * s + i[13] * a, t[2] = i[2] * r + i[6] * n + i[10] * s + i[14] * a, t[3] = i[3] * r + i[7] * n + i[11] * s + i[15] * a, t } function ml() { var t = new Fo(4); return Fo != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0), t[3] = 1, t } function gl(t) { return t[0] = 0, t[1] = 0, t[2] = 0, t[3] = 1, t } function xl(t, e, i) { i *= .5; var r = e[0], n = e[1], s = e[2], a = e[3], o = Math.sin(i), l = Math.cos(i); return t[0] = r * l + a * o, t[1] = n * l + s * o, t[2] = s * l - n * o, t[3] = a * l - r * o, t } Wo(), ul = new Fo(4), Fo != Float32Array && (ul[0] = 0, ul[1] = 0, ul[2] = 0, ul[3] = 0), Wo(), Qo(1, 0, 0), Qo(0, 1, 0), ml(), ml(), Ro(); class _l { constructor(t, e) { this.pos = t, this.dir = e; } intersectsPlane(t, e, i) { const r = al(e, this.dir); if (Math.abs(r) < 1e-6) return !1; const n = al(cl(Wo(), t, this.pos), e) / r; return function (t, e) { t[0] = e[0], t[1] = e[1], t[2] = e[2]; }(i, nl(Wo(), this.pos, this.dir, n)), !0 } } class vl { constructor(t, e) { this.points = t, this.planes = e; } static fromInvProjectionMatrix(t, e, i) { const r = Math.pow(2, i), n = [[-1, 1, -1, 1], [1, 1, -1, 1], [1, -1, -1, 1], [-1, -1, -1, 1], [-1, 1, 1, 1], [1, 1, 1, 1], [1, -1, 1, 1], [-1, -1, 1, 1]].map((i => { const n = yl([], i, t), s = 1 / n[3] / e * r; return function (t, e, i) { return t[0] = e[0] * i[0], t[1] = e[1] * i[1], t[2] = e[2] * i[2], t[3] = e[3] * i[3], t }(n, n, [s, s, 1 / n[3], s]) })), s = [[0, 1, 2], [6, 5, 4], [0, 3, 7], [2, 1, 5], [3, 2, 6], [0, 4, 5]].map((t => { const e = sl([], ol([], cl([], n[t[0]], n[t[1]]), cl([], n[t[2]], n[t[1]]))), i = -al(e, n[t[1]]); return e.concat(i) })); return new vl(n, s) } } class bl { constructor(t, e) { this.min = t, this.max = e, this.center = rl([], tl([], this.min, this.max), .5); } quadrant(t) { const e = [t % 2 == 0, t < 2], i = Yo(this.min), r = Yo(this.max); for (let t = 0; t < e.length; t++)i[t] = e[t] ? this.min[t] : this.center[t], r[t] = e[t] ? this.center[t] : this.max[t]; return r[2] = this.max[2], new bl(i, r) } distanceX(t) { return Math.max(Math.min(this.max[0], t[0]), this.min[0]) - t[0] } distanceY(t) { return Math.max(Math.min(this.max[1], t[1]), this.min[1]) - t[1] } distanceZ(t) { return Math.max(Math.min(this.max[2], t[2]), this.min[2]) - t[2] } intersects(t) { const e = [[this.min[0], this.min[1], this.min[2], 1], [this.max[0], this.min[1], this.min[2], 1], [this.max[0], this.max[1], this.min[2], 1], [this.min[0], this.max[1], this.min[2], 1], [this.min[0], this.min[1], this.max[2], 1], [this.max[0], this.min[1], this.max[2], 1], [this.max[0], this.max[1], this.max[2], 1], [this.min[0], this.max[1], this.max[2], 1]]; let i = !0; for (let s = 0; s < t.planes.length; s++) { const a = t.planes[s]; let o = 0; for (let t = 0; t < e.length; t++)o += (r = a)[0] * (n = e[t])[0] + r[1] * n[1] + r[2] * n[2] + r[3] * n[3] >= 0; if (0 === o) return 0; o !== e.length && (i = !1); } var r, n; if (i) return 2; for (let e = 0; e < 3; e++) { let i = Number.MAX_VALUE, r = -Number.MAX_VALUE; for (let n = 0; n < t.points.length; n++) { const s = t.points[n][e] - this.min[e]; i = Math.min(i, s), r = Math.max(r, s); } if (r < 0 || i > this.max[e] - this.min[e]) return 0 } return 1 } } function wl(t, e, r) { const n = yl([], [t.x, t.y, e, 1], r); return new i(n[0] / n[3], n[1] / n[3]) } const kl = Qo(0, 0, 0), Al = Qo(0, 0, 1); function Sl(t, e) { const r = Wo(); return kl[2] = e, t.intersectsPlane(kl, Al, r), new i(r[0], r[1]) } class zl extends xo { } function Il(t, { width: e, height: i }, r, n) { if (n) { if (n instanceof Uint8ClampedArray) n = new Uint8Array(n.buffer); else if (n.length !== e * i * r) throw new RangeError("mismatched image size") } else n = new Uint8Array(e * i * r); return t.width = e, t.height = i, t.data = n, t } function Ml(t, { width: e, height: i }, r) { if (e === t.width && i === t.height) return; const n = Il({}, { width: e, height: i }, r); Tl(t, n, { x: 0, y: 0 }, { x: 0, y: 0 }, { width: Math.min(t.width, e), height: Math.min(t.height, i) }, r), t.width = e, t.height = i, t.data = n.data; } function Tl(t, e, i, r, n, s) { if (0 === n.width || 0 === n.height) return e; if (n.width > t.width || n.height > t.height || i.x > t.width - n.width || i.y > t.height - n.height) throw new RangeError("out of range source coordinates for image copy"); if (n.width > e.width || n.height > e.height || r.x > e.width - n.width || r.y > e.height - n.height) throw new RangeError("out of range destination coordinates for image copy"); const a = t.data, o = e.data; for (let l = 0; l < n.height; l++) { const h = ((i.y + l) * t.width + i.x) * s, u = ((r.y + l) * e.width + r.x) * s; for (let t = 0; t < n.width * s; t++)o[u + t] = a[h + t]; } return e } Rr("HeatmapBucket", zl, { omit: ["layers"] }); class El { constructor(t, e) { Il(this, t, 1, e); } resize(t) { Ml(this, t, 1); } clone() { return new El({ width: this.width, height: this.height }, new Uint8Array(this.data)) } static copy(t, e, i, r, n) { Tl(t, e, i, r, n, 1); } } class Cl { constructor(t, e) { Il(this, t, 4, e); } resize(t) { Ml(this, t, 4); } replace(t, e) { e ? this.data.set(t) : this.data = t instanceof Uint8ClampedArray ? new Uint8Array(t.buffer) : t; } clone() { return new Cl({ width: this.width, height: this.height }, new Uint8Array(this.data)) } static copy(t, e, i, r, n) { Tl(t, e, i, r, n, 4); } } Rr("AlphaImage", El), Rr("RGBAImage", Cl); var Pl = { paint: new Ns({ "heatmap-radius": new Us(X.paint_heatmap["heatmap-radius"]), "heatmap-weight": new Us(X.paint_heatmap["heatmap-weight"]), "heatmap-intensity": new Os(X.paint_heatmap["heatmap-intensity"]), "heatmap-color": new qs(X.paint_heatmap["heatmap-color"]), "heatmap-opacity": new Os(X.paint_heatmap["heatmap-opacity"]) }) }; function Dl(t) { const e = {}, i = t.resolution || 256, r = t.clips ? t.clips.length : 1, n = t.image || new Cl({ width: i, height: r }), s = (i, r, s) => { e[t.evaluationKey] = s; const a = t.expression.evaluate(e); n.data[i + r + 0] = Math.floor(255 * a.r / a.a), n.data[i + r + 1] = Math.floor(255 * a.g / a.a), n.data[i + r + 2] = Math.floor(255 * a.b / a.a), n.data[i + r + 3] = Math.floor(255 * a.a); }; if (t.clips) for (let e = 0, n = 0; e < r; ++e, n += 4 * i)for (let r = 0, a = 0; r < i; r++, a += 4) { const o = r / (i - 1), { start: l, end: h } = t.clips[e]; s(n, a, l * (1 - o) + h * o); } else for (let t = 0, e = 0; t < i; t++, e += 4)s(0, e, t / (i - 1)); return n } var Bl = { paint: new Ns({ "hillshade-illumination-direction": new Os(X.paint_hillshade["hillshade-illumination-direction"]), "hillshade-illumination-anchor": new Os(X.paint_hillshade["hillshade-illumination-anchor"]), "hillshade-exaggeration": new Os(X.paint_hillshade["hillshade-exaggeration"]), "hillshade-shadow-color": new Os(X.paint_hillshade["hillshade-shadow-color"]), "hillshade-highlight-color": new Os(X.paint_hillshade["hillshade-highlight-color"]), "hillshade-accent-color": new Os(X.paint_hillshade["hillshade-accent-color"]) }) }; const Vl = Hs([{ name: "a_pos", components: 2, type: "Int16" }], 4), { members: Ll } = Vl; var Fl = Ol, Rl = Ol; function Ol(t, e, i) { i = i || 2; var r, n, s, a, o, l, h, u = e && e.length, c = u ? e[0] * i : t.length, p = Ul(t, 0, c, i, !0), d = []; if (!p || p.next === p.prev) return d; if (u && (p = function (t, e, i, r) { var n, s, a, o = []; for (n = 0, s = e.length; n < s; n++)(a = Ul(t, e[n] * r, n < s - 1 ? e[n + 1] * r : t.length, r, !1)) === a.next && (a.steiner = !0), o.push(Yl(a)); for (o.sort(Xl), n = 0; n < o.length; n++)i = $l(i = Kl(o[n], i), i.next); return i }(t, e, p, i)), t.length > 80 * i) { r = s = t[0], n = a = t[1]; for (var f = i; f < c; f += i)(o = t[f]) < r && (r = o), (l = t[f + 1]) < n && (n = l), o > s && (s = o), l > a && (a = l); h = 0 !== (h = Math.max(s - r, a - n)) ? 1 / h : 0; } return Zl(p, d, i, r, n, h), d } function Ul(t, e, i, r, n) { var s, a; if (n === uh(t, e, i, r) > 0) for (s = e; s < i; s += r)a = oh(s, t[s], t[s + 1], a); else for (s = i - r; s >= e; s -= r)a = oh(s, t[s], t[s + 1], a); return a && eh(a, a.next) && (lh(a), a = a.next), a } function $l(t, e) { if (!t) return t; e || (e = t); var i, r = t; do { if (i = !1, r.steiner || !eh(r, r.next) && 0 !== th(r.prev, r, r.next)) r = r.next; else { if (lh(r), (r = e = r.prev) === r.next) break; i = !0; } } while (i || r !== e); return e } function Zl(t, e, i, r, n, s, a) { if (t) { !a && s && function (t, e, i, r) { var n = t; do { null === n.z && (n.z = Wl(n.x, n.y, e, i, r)), n.prevZ = n.prev, n.nextZ = n.next, n = n.next; } while (n !== t); n.prevZ.nextZ = null, n.prevZ = null, function (t) { var e, i, r, n, s, a, o, l, h = 1; do { for (i = t, t = null, s = null, a = 0; i;) { for (a++, r = i, o = 0, e = 0; e < h && (o++, r = r.nextZ); e++); for (l = h; o > 0 || l > 0 && r;)0 !== o && (0 === l || !r || i.z <= r.z) ? (n = i, i = i.nextZ, o--) : (n = r, r = r.nextZ, l--), s ? s.nextZ = n : t = n, n.prevZ = s, s = n; i = r; } s.nextZ = null, h *= 2; } while (a > 1) }(n); }(t, r, n, s); for (var o, l, h = t; t.prev !== t.next;)if (o = t.prev, l = t.next, s ? Nl(t, r, n, s) : ql(t)) e.push(o.i / i), e.push(t.i / i), e.push(l.i / i), lh(t), t = l.next, h = l.next; else if ((t = l) === h) { a ? 1 === a ? Zl(t = jl($l(t), e, i), e, i, r, n, s, 2) : 2 === a && Gl(t, e, i, r, n, s) : Zl($l(t), e, i, r, n, s, 1); break } } } function ql(t) { var e = t.prev, i = t, r = t.next; if (th(e, i, r) >= 0) return !1; for (var n = t.next.next; n !== t.prev;) { if (Jl(e.x, e.y, i.x, i.y, r.x, r.y, n.x, n.y) && th(n.prev, n, n.next) >= 0) return !1; n = n.next; } return !0 } function Nl(t, e, i, r) { var n = t.prev, s = t, a = t.next; if (th(n, s, a) >= 0) return !1; for (var o = n.x > s.x ? n.x > a.x ? n.x : a.x : s.x > a.x ? s.x : a.x, l = n.y > s.y ? n.y > a.y ? n.y : a.y : s.y > a.y ? s.y : a.y, h = Wl(n.x < s.x ? n.x < a.x ? n.x : a.x : s.x < a.x ? s.x : a.x, n.y < s.y ? n.y < a.y ? n.y : a.y : s.y < a.y ? s.y : a.y, e, i, r), u = Wl(o, l, e, i, r), c = t.prevZ, p = t.nextZ; c && c.z >= h && p && p.z <= u;) { if (c !== t.prev && c !== t.next && Jl(n.x, n.y, s.x, s.y, a.x, a.y, c.x, c.y) && th(c.prev, c, c.next) >= 0) return !1; if (c = c.prevZ, p !== t.prev && p !== t.next && Jl(n.x, n.y, s.x, s.y, a.x, a.y, p.x, p.y) && th(p.prev, p, p.next) >= 0) return !1; p = p.nextZ; } for (; c && c.z >= h;) { if (c !== t.prev && c !== t.next && Jl(n.x, n.y, s.x, s.y, a.x, a.y, c.x, c.y) && th(c.prev, c, c.next) >= 0) return !1; c = c.prevZ; } for (; p && p.z <= u;) { if (p !== t.prev && p !== t.next && Jl(n.x, n.y, s.x, s.y, a.x, a.y, p.x, p.y) && th(p.prev, p, p.next) >= 0) return !1; p = p.nextZ; } return !0 } function jl(t, e, i) { var r = t; do { var n = r.prev, s = r.next.next; !eh(n, s) && ih(n, r, r.next, s) && sh(n, s) && sh(s, n) && (e.push(n.i / i), e.push(r.i / i), e.push(s.i / i), lh(r), lh(r.next), r = t = s), r = r.next; } while (r !== t); return $l(r) } function Gl(t, e, i, r, n, s) { var a = t; do { for (var o = a.next.next; o !== a.prev;) { if (a.i !== o.i && Ql(a, o)) { var l = ah(a, o); return a = $l(a, a.next), l = $l(l, l.next), Zl(a, e, i, r, n, s), void Zl(l, e, i, r, n, s) } o = o.next; } a = a.next; } while (a !== t) } function Xl(t, e) { return t.x - e.x } function Kl(t, e) { var i = function (t, e) { var i, r = e, n = t.x, s = t.y, a = -1 / 0; do { if (s <= r.y && s >= r.next.y && r.next.y !== r.y) { var o = r.x + (s - r.y) * (r.next.x - r.x) / (r.next.y - r.y); if (o <= n && o > a) { if (a = o, o === n) { if (s === r.y) return r; if (s === r.next.y) return r.next } i = r.x < r.next.x ? r : r.next; } } r = r.next; } while (r !== e); if (!i) return null; if (n === a) return i; var l, h = i, u = i.x, c = i.y, p = 1 / 0; r = i; do { n >= r.x && r.x >= u && n !== r.x && Jl(s < c ? n : a, s, u, c, s < c ? a : n, s, r.x, r.y) && (l = Math.abs(s - r.y) / (n - r.x), sh(r, t) && (l < p || l === p && (r.x > i.x || r.x === i.x && Hl(i, r))) && (i = r, p = l)), r = r.next; } while (r !== h); return i }(t, e); if (!i) return e; var r = ah(i, t), n = $l(i, i.next); return $l(r, r.next), e === i ? n : e } function Hl(t, e) { return th(t.prev, t, e.prev) < 0 && th(e.next, t, t.next) < 0 } function Wl(t, e, i, r, n) { return (t = 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = 32767 * (t - i) * n) | t << 8)) | t << 4)) | t << 2)) | t << 1)) | (e = 1431655765 & ((e = 858993459 & ((e = 252645135 & ((e = 16711935 & ((e = 32767 * (e - r) * n) | e << 8)) | e << 4)) | e << 2)) | e << 1)) << 1 } function Yl(t) { var e = t, i = t; do { (e.x < i.x || e.x === i.x && e.y < i.y) && (i = e), e = e.next; } while (e !== t); return i } function Jl(t, e, i, r, n, s, a, o) { return (n - a) * (e - o) - (t - a) * (s - o) >= 0 && (t - a) * (r - o) - (i - a) * (e - o) >= 0 && (i - a) * (s - o) - (n - a) * (r - o) >= 0 } function Ql(t, e) { return t.next.i !== e.i && t.prev.i !== e.i && !function (t, e) { var i = t; do { if (i.i !== t.i && i.next.i !== t.i && i.i !== e.i && i.next.i !== e.i && ih(i, i.next, t, e)) return !0; i = i.next; } while (i !== t); return !1 }(t, e) && (sh(t, e) && sh(e, t) && function (t, e) { var i = t, r = !1, n = (t.x + e.x) / 2, s = (t.y + e.y) / 2; do { i.y > s != i.next.y > s && i.next.y !== i.y && n < (i.next.x - i.x) * (s - i.y) / (i.next.y - i.y) + i.x && (r = !r), i = i.next; } while (i !== t); return r }(t, e) && (th(t.prev, t, e.prev) || th(t, e.prev, e)) || eh(t, e) && th(t.prev, t, t.next) > 0 && th(e.prev, e, e.next) > 0) } function th(t, e, i) { return (e.y - t.y) * (i.x - e.x) - (e.x - t.x) * (i.y - e.y) } function eh(t, e) { return t.x === e.x && t.y === e.y } function ih(t, e, i, r) { var n = nh(th(t, e, i)), s = nh(th(t, e, r)), a = nh(th(i, r, t)), o = nh(th(i, r, e)); return n !== s && a !== o || !(0 !== n || !rh(t, i, e)) || !(0 !== s || !rh(t, r, e)) || !(0 !== a || !rh(i, t, r)) || !(0 !== o || !rh(i, e, r)) } function rh(t, e, i) { return e.x <= Math.max(t.x, i.x) && e.x >= Math.min(t.x, i.x) && e.y <= Math.max(t.y, i.y) && e.y >= Math.min(t.y, i.y) } function nh(t) { return t > 0 ? 1 : t < 0 ? -1 : 0 } function sh(t, e) { return th(t.prev, t, t.next) < 0 ? th(t, e, t.next) >= 0 && th(t, t.prev, e) >= 0 : th(t, e, t.prev) < 0 || th(t, t.next, e) < 0 } function ah(t, e) { var i = new hh(t.i, t.x, t.y), r = new hh(e.i, e.x, e.y), n = t.next, s = e.prev; return t.next = e, e.prev = t, i.next = n, n.prev = i, r.next = i, i.prev = r, s.next = r, r.prev = s, r } function oh(t, e, i, r) { var n = new hh(t, e, i); return r ? (n.next = r.next, n.prev = r, r.next.prev = n, r.next = n) : (n.prev = n, n.next = n), n } function lh(t) { t.next.prev = t.prev, t.prev.next = t.next, t.prevZ && (t.prevZ.nextZ = t.nextZ), t.nextZ && (t.nextZ.prevZ = t.prevZ); } function hh(t, e, i) { this.i = t, this.x = e, this.y = i, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = !1; } function uh(t, e, i, r) { for (var n = 0, s = e, a = i - r; s < i; s += r)n += (t[a] - t[s]) * (t[s + 1] + t[a + 1]), a = s; return n } function ch(t, e, i, r, n) { ph(t, e, i || 0, r || t.length - 1, n || fh); } function ph(t, e, i, r, n) { for (; r > i;) { if (r - i > 600) { var s = r - i + 1, a = e - i + 1, o = Math.log(s), l = .5 * Math.exp(2 * o / 3), h = .5 * Math.sqrt(o * l * (s - l) / s) * (a - s / 2 < 0 ? -1 : 1); ph(t, e, Math.max(i, Math.floor(e - a * l / s + h)), Math.min(r, Math.floor(e + (s - a) * l / s + h)), n); } var u = t[e], c = i, p = r; for (dh(t, i, e), n(t[r], u) > 0 && dh(t, i, r); c < p;) { for (dh(t, c, p), c++, p--; n(t[c], u) < 0;)c++; for (; n(t[p], u) > 0;)p--; } 0 === n(t[i], u) ? dh(t, i, p) : dh(t, ++p, r), p <= e && (i = p + 1), e <= p && (r = p - 1); } } function dh(t, e, i) { var r = t[e]; t[e] = t[i], t[i] = r; } function fh(t, e) { return t < e ? -1 : t > e ? 1 : 0 } function yh(t, e) { const i = t.length; if (i <= 1) return [t]; const r = []; let n, s; for (let e = 0; e < i; e++) { const i = D(t[e]); 0 !== i && (t[e].area = Math.abs(i), void 0 === s && (s = i < 0), s === i < 0 ? (n && r.push(n), n = [t[e]]) : n.push(t[e])); } if (n && r.push(n), e > 1) for (let t = 0; t < r.length; t++)r[t].length <= e || (ch(r[t], e, 1, r[t].length - 1, mh), r[t] = r[t].slice(0, e)); return r } function mh(t, e) { return e.area - t.area } function gh(t, e, i) { const r = i.patternDependencies; let n = !1; for (const i of e) { const e = i.paint.get(`${t}-pattern`); e.isConstant() || (n = !0); const s = e.constantOr(null); s && (n = !0, r[s.to] = !0, r[s.from] = !0); } return n } function xh(t, e, i, r, n) { const s = n.patternDependencies; for (const a of e) { const e = a.paint.get(`${t}-pattern`).value; if ("constant" !== e.kind) { let t = e.evaluate({ zoom: r - 1 }, i, {}, n.availableImages), o = e.evaluate({ zoom: r }, i, {}, n.availableImages), l = e.evaluate({ zoom: r + 1 }, i, {}, n.availableImages); t = t && t.name ? t.name : t, o = o && o.name ? o.name : o, l = l && l.name ? l.name : l, s[t] = !0, s[o] = !0, s[l] = !0, i.patterns[a.id] = { min: t, mid: o, max: l }; } } return i } Ol.deviation = function (t, e, i, r) { var n = e && e.length, s = Math.abs(uh(t, 0, n ? e[0] * i : t.length, i)); if (n) for (var a = 0, o = e.length; a < o; a++)s -= Math.abs(uh(t, e[a] * i, a < o - 1 ? e[a + 1] * i : t.length, i)); var l = 0; for (a = 0; a < r.length; a += 3) { var h = r[a] * i, u = r[a + 1] * i, c = r[a + 2] * i; l += Math.abs((t[h] - t[c]) * (t[u + 1] - t[h + 1]) - (t[h] - t[u]) * (t[c + 1] - t[h + 1])); } return 0 === s && 0 === l ? 0 : Math.abs((l - s) / s) }, Ol.flatten = function (t) { for (var e = t[0][0].length, i = { vertices: [], holes: [], dimensions: e }, r = 0, n = 0; n < t.length; n++) { for (var s = 0; s < t[n].length; s++)for (var a = 0; a < e; a++)i.vertices.push(t[n][s][a]); n > 0 && i.holes.push(r += t[n - 1].length); } return i }, Fl.default = Rl; class _h { constructor(t) { this.zoom = t.zoom, this.overscaling = t.overscaling, this.layers = t.layers, this.layerIds = this.layers.map((t => t.id)), this.index = t.index, this.hasPattern = !1, this.patternFeatures = [], this.layoutVertexArray = new Ys, this.indexArray = new ua, this.indexArray2 = new ma, this.programConfigurations = new to(t.layers, t.zoom), this.segments = new uo, this.segments2 = new uo, this.stateDependentLayerIds = this.layers.filter((t => t.isStateDependent())).map((t => t.id)); } populate(t, e, i) { this.hasPattern = gh("fill", this.layers, e); const r = this.layers[0].layout.get("fill-sort-key"), n = []; for (const { feature: s, id: a, index: o, sourceLayerIndex: l } of t) { const t = this.layers[0]._featureFilter.needGeometry, h = mo(s, t); if (!this.layers[0]._featureFilter.filter(new Es(this.zoom), h, i)) continue; const u = r ? r.evaluate(h, {}, i, e.availableImages) : void 0, c = { id: a, properties: s.properties, type: s.type, sourceLayerIndex: l, index: o, geometry: t ? h.geometry : yo(s), patterns: {}, sortKey: u }; n.push(c); } r && n.sort(((t, e) => t.sortKey - e.sortKey)); for (const r of n) { const { geometry: n, index: s, sourceLayerIndex: a } = r; if (this.hasPattern) { const t = xh("fill", this.layers, r, this.zoom, e); this.patternFeatures.push(t); } else this.addFeature(r, n, s, i, {}); e.featureIndex.insert(t[s].feature, n, s, a, this.index); } } update(t, e, i) { this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t, e, this.stateDependentLayers, i); } addFeatures(t, e, i) { for (const t of this.patternFeatures) this.addFeature(t, t.geometry, t.index, e, i); } isEmpty() { return 0 === this.layoutVertexArray.length } uploadPending() { return !this.uploaded || this.programConfigurations.needsUpload } upload(t) { this.uploaded || (this.layoutVertexBuffer = t.createVertexBuffer(this.layoutVertexArray, Ll), this.indexBuffer = t.createIndexBuffer(this.indexArray), this.indexBuffer2 = t.createIndexBuffer(this.indexArray2)), this.programConfigurations.upload(t), this.uploaded = !0; } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.indexBuffer2.destroy(), this.programConfigurations.destroy(), this.segments.destroy(), this.segments2.destroy()); } addFeature(t, e, i, r, n) { for (const t of yh(e, 500)) { let e = 0; for (const i of t) e += i.length; const i = this.segments.prepareSegment(e, this.layoutVertexArray, this.indexArray), r = i.vertexLength, n = [], s = []; for (const e of t) { if (0 === e.length) continue; e !== t[0] && s.push(n.length / 2); const i = this.segments2.prepareSegment(e.length, this.layoutVertexArray, this.indexArray2), r = i.vertexLength; this.layoutVertexArray.emplaceBack(e[0].x, e[0].y), this.indexArray2.emplaceBack(r + e.length - 1, r), n.push(e[0].x), n.push(e[0].y); for (let t = 1; t < e.length; t++)this.layoutVertexArray.emplaceBack(e[t].x, e[t].y), this.indexArray2.emplaceBack(r + t - 1, r + t), n.push(e[t].x), n.push(e[t].y); i.vertexLength += e.length, i.primitiveLength += e.length; } const a = Fl(n, s); for (let t = 0; t < a.length; t += 3)this.indexArray.emplaceBack(r + a[t], r + a[t + 1], r + a[t + 2]); i.vertexLength += e, i.primitiveLength += a.length / 3; } this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t, i, n, r); } } Rr("FillBucket", _h, { omit: ["layers", "patternFeatures"] }); const vh = new Ns({ "fill-sort-key": new Us(X.layout_fill["fill-sort-key"]) }); var bh = { paint: new Ns({ "fill-antialias": new Os(X.paint_fill["fill-antialias"]), "fill-opacity": new Us(X.paint_fill["fill-opacity"]), "fill-color": new Us(X.paint_fill["fill-color"]), "fill-outline-color": new Us(X.paint_fill["fill-outline-color"]), "fill-translate": new Os(X.paint_fill["fill-translate"]), "fill-translate-anchor": new Os(X.paint_fill["fill-translate-anchor"]), "fill-pattern": new $s(X.paint_fill["fill-pattern"]) }), layout: vh }; const wh = Hs([{ name: "a_pos_normal_ed", components: 4, type: "Int16" }]), kh = Hs([{ name: "a_centroid_pos", components: 2, type: "Uint16" }]), { members: Ah } = wh, Sh = {}; function zh(t) { if (void 0 === t || null == t || "[object Object]" != Object.prototype.toString.call(t)) return !1; for (let e in Sh) if (Sh[e].CODE === t.CODE) return !0; return !1 } function Ih(t) { return function (t, e) { switch (e) { case Sh.EPSG4326.CODE: case Sh.EPSG4490.CODE: return y((90 - t) / 360, 0, .5); case Sh.EPSG3857.CODE: case Sh.EPSG900913.CODE: return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + t * Math.PI / 360))) / 360 } }(t, Qh()) } function Mh(t) { return function (t, e) { switch (e) { case Sh.EPSG4326.CODE: case Sh.EPSG4490.CODE: return y(90 - 360 * t, -90, 90); case Sh.EPSG3857.CODE: case Sh.EPSG900913.CODE: return 360 / Math.PI * Math.atan(Math.exp((180 - 360 * t) * Math.PI / 180)) - 90 } }(t, Qh()) } Sh.EPSG4326 = { CODE: 4326, EPSG: "EPSG:4326" }, Sh.EPSG4490 = { CODE: 4490, EPSG: "EPSG:4490" }, Sh.EPSG3857 = { CODE: 3857, EPSG: "EPSG:3857" }, Sh.EPSG900913 = { CODE: 900913, EPSG: "EPSG:900913" }; const Th = 2 * Math.PI * j; function Eh(t) { return Th * Math.cos(t * Math.PI / 180) } function Ch(t) { return (180 + t) / 360 } function Ph(t, e) { return t / Eh(e) } function Dh(t, e) { return t * Eh(Mh(e)) } class Bh { constructor(t, e, i = 0) { this.x = +t, this.y = +e, this.z = +i; } static fromLngLat(t, e = 0) { const i = G.convert(t); return new Bh(Ch(i.lng), Ih(i.lat), Ph(e, i.lat)) } toLngLat() { return new G(360 * this.x - 180, Mh(this.y)) } toAltitude() { return Dh(this.z, this.y) } meterInMercatorCoordinateUnits() { return 1 / Th * (t = Mh(this.y), 1 / Math.cos(t * Math.PI / 180)); var t; } } class Vh { constructor(t = 0, e = 0, i = 0, r = 0) { if (isNaN(t) || t < 0 || isNaN(e) || e < 0 || isNaN(i) || i < 0 || isNaN(r) || r < 0) throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers"); this.top = t, this.bottom = e, this.left = i, this.right = r; } interpolate(t, e, i) { return null != e.top && null != t.top && (this.top = Ae(t.top, e.top, i)), null != e.bottom && null != t.bottom && (this.bottom = Ae(t.bottom, e.bottom, i)), null != e.left && null != t.left && (this.left = Ae(t.left, e.left, i)), null != e.right && null != t.right && (this.right = Ae(t.right, e.right, i)), this } getCenter(t, e) { const r = y((this.left + t - this.right) / 2, 0, t), n = y((this.top + e - this.bottom) / 2, 0, e); return new i(r, n) } equals(t) { return this.top === t.top && this.bottom === t.bottom && this.left === t.left && this.right === t.right } clone() { return new Vh(this.top, this.bottom, this.left, this.right) } toJSON() { return { top: this.top, bottom: this.bottom, left: this.left, right: this.right } } } function Lh(t, e) { return [t[4 * e], t[4 * e + 1], t[4 * e + 2], t[4 * e + 3]] } function Fh(t, e, i) { t[4 * e + 0] = i[0], t[4 * e + 1] = i[1], t[4 * e + 2] = i[2], t[4 * e + 3] = i[3]; } function Rh(t, e) { const i = Lh(t, 3); Xo(t, e), Fh(t, 3, i); } function Oh(t, e) { Fh(t, 3, [e[0], e[1], e[2], 1]); } function Uh(t, e) { const i = gl([]); return function (t, e, i) { i *= .5; var r = e[0], n = e[1], s = e[2], a = e[3], o = Math.sin(i), l = Math.cos(i); t[0] = r * l + n * o, t[1] = n * l - r * o, t[2] = s * l + a * o, t[3] = a * l - s * o; }(i, i, -e), xl(i, i, -t), i } function $h(t, e) { const i = [t[0], t[1], 0], r = [e[0], e[1], 0]; if (Jo(i) >= 1e-15) { const t = sl([], i); rl(r, t, al(r, t)), e[0] = r[0], e[1] = r[1]; } const n = ol([], e, t); if (dl(n) < 1e-15) return null; const s = Math.atan2(-n[1], n[0]); return Uh(Math.atan2(Math.sqrt(t[0] * t[0] + t[1] * t[1]), -t[2]), s) } class Zh { constructor(t, e) { this.position = t, this.orientation = e; } get position() { return this._position } set position(t) { this._position = this._renderWorldCopies ? function (t) { if (!t) return; const e = Array.isArray(t) ? new Bh(t[0], t[1], t[2]) : t; return e.x = m(e.x, 0, 1), e }(t) : t; } lookAtPoint(t, e) { if (this.orientation = null, !this.position) return; const i = this._elevation ? this._elevation.getAtPointOrZero(Bh.fromLngLat(t)) : 0, r = this.position, n = Bh.fromLngLat(t, i), s = [n.x - r.x, n.y - r.y, n.z - r.z]; e || (e = [0, 0, 1]), e[2] = Math.abs(e[2]), this.orientation = $h(s, e); } setPitchBearing(t, e) { this.orientation = Uh(u(t), u(-e)); } } class qh { constructor(t, e) { this._transform = Uo([]), this._orientation = gl([]), e && (this._orientation = e, Rh(this._transform, this._orientation)), t && Oh(this._transform, t); } get mercatorPosition() { const t = this.position; return new Bh(t[0], t[1], t[2]) } get position() { const t = Lh(this._transform, 3); return [t[0], t[1], t[2]] } set position(t) { Oh(this._transform, t); } get orientation() { return this._orientation } set orientation(t) { this._orientation = t, Rh(this._transform, this._orientation); } getPitchBearing() { const t = this.forward(), e = this.right(); return { bearing: Math.atan2(-e[1], e[0]), pitch: Math.atan2(Math.sqrt(t[0] * t[0] + t[1] * t[1]), -t[2]) } } setPitchBearing(t, e) { this._orientation = Uh(t, e), Rh(this._transform, this._orientation); } forward() { const t = Lh(this._transform, 2); return [-t[0], -t[1], -t[2]] } up() { const t = Lh(this._transform, 1); return [-t[0], -t[1], -t[2]] } right() { const t = Lh(this._transform, 0); return [t[0], t[1], t[2]] } getCameraToWorld(t, e) { const i = new Float64Array(16); return $o(i, this.getWorldToCamera(t, e)), i } getWorldToCameraPosition(t, e, i) { const r = this.position; rl(r, r, -t); const n = new Float64Array(16); var s, a; return (s = n)[0] = (a = [i, i, i])[0], s[1] = 0, s[2] = 0, s[3] = 0, s[4] = 0, s[5] = a[1], s[6] = 0, s[7] = 0, s[8] = 0, s[9] = 0, s[10] = a[2], s[11] = 0, s[12] = 0, s[13] = 0, s[14] = 0, s[15] = 1, qo(n, n, r), n[10] *= e, n } getWorldToCamera(t, e) { const i = new Float64Array(16), r = new Float64Array(4), n = this.position; var s, a; return (s = r)[0] = -(a = this._orientation)[0], s[1] = -a[1], s[2] = -a[2], s[3] = a[3], rl(n, n, -t), Xo(i, r), qo(i, i, n), i[1] *= -1, i[5] *= -1, i[9] *= -1, i[13] *= -1, i[8] *= e, i[9] *= e, i[10] *= e, i[11] *= e, i } getCameraToClipPerspective(t, e, i, r) { const n = new Float64Array(16); return Ko(n, t, e, i, r), n } getDistanceToElevation(t) { const e = 0 === t ? 0 : Ph(t, this.position[1]), i = this.forward(); return (e - this.position[2]) / i[2] } clone() { return new qh([...this.position], [...this.orientation]) } } function Nh(t, e, i) { var r = 2 * Math.PI * 6378137 / 256 / Math.pow(2, i); return [t * r - 2 * Math.PI * 6378137 / 2, e * r - 2 * Math.PI * 6378137 / 2] } class jh { constructor(t, e, i) { this.z = t, this.x = e, this.y = i, this.key = Kh(0, t, t, e, i); } equals(t) { return this.z === t.z && this.x === t.x && this.y === t.y } url(t, e, i, r) { const n = function (t, e, i) { switch (Qh()) { case Sh.EPSG4326.CODE: case Sh.EPSG4490.CODE: return function (t, e, i) { const r = 360 / Math.pow(2, i); return [t * r - 180, 90 - (e + 1) * r, (t + 1) * r - 180, 90 - e * r].join(",") }(t, e, i); case Sh.EPSG3857.CODE: case Sh.EPSG900913.CODE: return function (t, e, i) { var r = Nh(256 * t, 256 * (e = Math.pow(2, i) - e - 1), i), n = Nh(256 * (t + 1), 256 * (e + 1), i); return r[0] + "," + r[1] + "," + n[0] + "," + n[1] }(t, e, i) } }(this.x, this.y, this.z), s = function (t, e, i) { let r, n = ""; for (let s = t; s > 0; s--)r = 1 << s - 1, n += (e & r ? 1 : 0) + (i & r ? 2 : 0); return n }(this.z, this.x, this.y); return r = r || (t => t), i = i || 0, t[(this.x + this.y) % t.length].replace("{prefix}", (this.x % 16).toString(16) + (this.y % 16).toString(16)).replace("{z}", String(this.z + i)).replace("{x}", String(this.x)).replace("{y}", String("tms" === e ? 0 === this.z ? 0 : Math.pow(2, this.z + i) - 1 - this.y : this.y)).replace("{quadkey}", s).replace("{bbox-epsg-3857}", n).replace("{bbox-epsg-4326}", n).replace("{bbox-epsg-4490}", n).replace("{bbox-transform}", r(n, { ...this })) } getTilePoint(t) { const e = Math.pow(2, this.z); return new i((t.x * e - this.x) * co, (t.y * e - this.y) * co) } getTileVec3(t) { const e = Math.pow(2, this.z); return Qo((t.x * e - this.x) * co, (t.y * e - this.y) * co, Dh(t.z, t.y)) } toString() { return `${this.z}/${this.x}/${this.y}` } } class Gh { constructor(t, e) { this.wrap = t, this.canonical = e, this.key = Kh(t, e.z, e.z, e.x, e.y); } } class Xh { constructor(t, e, i, r, n) { this.overscaledZ = t, this.wrap = e, this.canonical = new jh(i, +r, +n), this.key = 0 === e && t === i ? this.canonical.key : Kh(e, t, i, r, n); } equals(t) { return this.overscaledZ === t.overscaledZ && this.wrap === t.wrap && this.canonical.equals(t.canonical) } scaledTo(t) { const e = this.canonical.z - t; return t > this.canonical.z ? new Xh(t, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y) : new Xh(t, this.wrap, t, this.canonical.x >> e, this.canonical.y >> e) } calculateScaledKey(t, e = !0) { if (this.overscaledZ === t && e) return this.key; if (t > this.canonical.z) return Kh(this.wrap * +e, t, this.canonical.z, this.canonical.x, this.canonical.y); { const i = this.canonical.z - t; return Kh(this.wrap * +e, t, t, this.canonical.x >> i, this.canonical.y >> i) } } isChildOf(t) { if (t.wrap !== this.wrap) return !1; const e = this.canonical.z - t.canonical.z; return 0 === t.overscaledZ || t.overscaledZ < this.overscaledZ && t.canonical.x === this.canonical.x >> e && t.canonical.y === this.canonical.y >> e } children(t) { if (this.overscaledZ >= t) return [new Xh(this.overscaledZ + 1, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y)]; const e = this.canonical.z + 1, i = 2 * this.canonical.x, r = 2 * this.canonical.y; return [new Xh(e, this.wrap, e, i, r), new Xh(e, this.wrap, e, i + 1, r), new Xh(e, this.wrap, e, i, r + 1), new Xh(e, this.wrap, e, i + 1, r + 1)] } isLessThan(t) { return this.wrap < t.wrap || !(this.wrap > t.wrap) && (this.overscaledZ < t.overscaledZ || !(this.overscaledZ > t.overscaledZ) && (this.canonical.x < t.canonical.x || !(this.canonical.x > t.canonical.x) && this.canonical.y < t.canonical.y)) } wrapped() { return new Xh(this.overscaledZ, 0, this.canonical.z, this.canonical.x, this.canonical.y) } unwrapTo(t) { return new Xh(this.overscaledZ, t, this.canonical.z, this.canonical.x, this.canonical.y) } overscaleFactor() { return Math.pow(2, this.overscaledZ - this.canonical.z) } toUnwrapped() { return new Gh(this.wrap, this.canonical) } toString() { return `${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}` } getTilePoint(t) { return this.canonical.getTilePoint(new Bh(t.x - this.wrap, t.y)) } getTileVec3(t) { return this.canonical.getTileVec3(new Bh(t.x - this.wrap, t.y, t.z)) } } function Kh(t, e, i, r, n) { const s = 1 << Math.min(i, 22); let a = s * (n % s) + r % s; return t && i < 22 && (a += s * s * ((t < 0 ? -2 * t - 1 : 2 * t) % (1 << 2 * (22 - i)))), 16 * (32 * a + i) + (e - i) } Rr("CanonicalTileID", jh), Rr("OverscaledTileID", Xh, { omit: ["projMatrix"] }); class Hh { constructor(t, e, i, r, n) { this.tileSize = 512, this.maxValidLatitude = 85.051129, this._renderWorldCopies = void 0 === n || n, this._minZoom = t || 0, this._maxZoom = e || 22, this._minPitch = null == i ? 0 : i, this._maxPitch = null == r ? 60 : r, this.setMaxBounds(), this.width = 0, this.height = 0, this._center = new G(0, 0), this.zoom = 0, this.angle = 0, this._fov = .6435011087932844, this._pitch = 0, this._unmodified = !0, this._edgeInsets = new Vh, this._projMatrixCache = {}, this._alignedProjMatrixCache = {}, this._fogTileMatrixCache = {}, this._camera = new qh, this._centerAltitude = 0, this._averageElevation = 0, this.cameraElevationReference = "ground", this._horizonShift = .1; } clone() { const t = new Hh(this._minZoom, this._maxZoom, this._minPitch, this.maxPitch, this._renderWorldCopies); return t._elevation = this._elevation, t._centerAltitude = this._centerAltitude, t.tileSize = this.tileSize, t.latRange = this.latRange, t.width = this.width, t.height = this.height, t.cameraElevationReference = this.cameraElevationReference, t._center = this._center, t._setZoom(this.zoom), t._cameraZoom = this._cameraZoom, t.angle = this.angle, t._fov = this._fov, t._pitch = this._pitch, t._averageElevation = this._averageElevation, t._unmodified = this._unmodified, t._edgeInsets = this._edgeInsets.clone(), t._camera = this._camera.clone(), t._calcMatrices(), t.freezeTileCoverage = this.freezeTileCoverage, t } get elevation() { return this._elevation } set elevation(t) { this._elevation !== t && (this._elevation = t, t ? this._updateCenterElevation() && this._updateCameraOnTerrain() : (this._cameraZoom = null, this._centerAltitude = 0), this._calcMatrices()); } updateElevation(t) { this._terrainEnabled() && null == this._cameraZoom && this._updateCenterElevation() && this._updateCameraOnTerrain(), t && this._constrainCameraAltitude(), this._calcMatrices(); } get minZoom() { return this._minZoom } set minZoom(t) { this._minZoom !== t && (this._minZoom = t, this.zoom = Math.max(this.zoom, t)); } get maxZoom() { return this._maxZoom } set maxZoom(t) { this._maxZoom !== t && (this._maxZoom = t, this.zoom = Math.min(this.zoom, t)); } get minPitch() { return this._minPitch } set minPitch(t) { this._minPitch !== t && (this._minPitch = t, this.pitch = Math.max(this.pitch, t)); } get maxPitch() { return this._maxPitch } set maxPitch(t) { this._maxPitch !== t && (this._maxPitch = t, this.pitch = Math.min(this.pitch, t)); } get renderWorldCopies() { return this._renderWorldCopies } set renderWorldCopies(t) { void 0 === t ? t = !0 : null === t && (t = !1), this._renderWorldCopies = t; } get worldSize() { return this.tileSize * this.scale } get cameraWorldSize() { const t = Math.max(this._camera.getDistanceToElevation(this._averageElevation), Number.EPSILON); return this._worldSizeFromZoom(this._zoomFromMercatorZ(t)) } get pixelsPerMeter() { return Ph(1, this.center.lat) * this.worldSize } get cameraPixelsPerMeter() { return Ph(1, this.center.lat) * this.cameraWorldSize } get centerOffset() { return this.centerPoint._sub(this.size._div(2)) } get size() { return new i(this.width, this.height) } get bearing() { return -this.angle / Math.PI * 180 } set bearing(t) { const e = -m(t, -180, 180) * Math.PI / 180; var i; this.angle !== e && (this._unmodified = !1, this.angle = e, this._calcMatrices(), this.rotationMatrix = (i = new Fo(4), Fo != Float32Array && (i[1] = 0, i[2] = 0), i[0] = 1, i[3] = 1, i), function (t, e, i) { var r = e[0], n = e[1], s = e[2], a = e[3], o = Math.sin(i), l = Math.cos(i); t[0] = r * l + s * o, t[1] = n * l + a * o, t[2] = r * -o + s * l, t[3] = n * -o + a * l; }(this.rotationMatrix, this.rotationMatrix, this.angle)); } get pitch() { return this._pitch / Math.PI * 180 } set pitch(t) { const e = y(t, this.minPitch, this.maxPitch) / 180 * Math.PI; this._pitch !== e && (this._unmodified = !1, this._pitch = e, this._calcMatrices()); } get fov() { return this._fov / Math.PI * 180 } set fov(t) { t = Math.max(.01, Math.min(60, t)), this._fov !== t && (this._unmodified = !1, this._fov = t / 180 * Math.PI, this._calcMatrices()); } get averageElevation() { return this._averageElevation } set averageElevation(t) { this._averageElevation = t, this._calcFogMatrices(); } get zoom() { return this._zoom } set zoom(t) { const e = Math.min(Math.max(t, this.minZoom), this.maxZoom); this._zoom !== e && (this._unmodified = !1, this._setZoom(e), this._terrainEnabled() && this._updateCameraOnTerrain(), this._constrain(), this._calcMatrices()); } _setZoom(t) { this._zoom = t, this.scale = this.zoomScale(t), this.tileZoom = Math.floor(t), this.zoomFraction = t - this.tileZoom; } _updateCenterElevation() { if (!this._elevation) return !1; const t = this._elevation.getAtPointOrZero(Bh.fromLngLat(this.center), -1); return -1 === t ? (this._cameraZoom = null, !1) : (this._centerAltitude = t, !0) } _updateCameraOnTerrain() { const t = this.cameraToCenterDistance / this.worldSize, e = Ph(this._centerAltitude, this.center.lat); this._cameraZoom = this._zoomFromMercatorZ(e + t); } sampleAverageElevation() { if (!this._elevation) return 0; const t = this._elevation, e = [[.5, .2], [.3, .5], [.5, .5], [.7, .5], [.5, .8]], r = this.horizonLineFromTop(); let n = 0, s = 0; for (let a = 0; a < e.length; a++) { const o = new i(e[a][0] * this.width, r + e[a][1] * (this.height - r)), l = t.pointCoordinate(o); if (!l) continue; const h = 1 / Math.hypot(l[0] - this._camera.position[0], l[1] - this._camera.position[1]); n += l[3] * h, s += h; } return 0 === s ? NaN : n / s } get center() { return this._center } set center(t) { t.lat === this._center.lat && t.lng === this._center.lng || (this._unmodified = !1, this._center = t, this._terrainEnabled() && ("ground" === this.cameraElevationReference ? this._updateCenterElevation() ? this._updateCameraOnTerrain() : this._cameraZoom = null : this._updateZoomFromElevation()), this._constrain(), this._calcMatrices()); } _updateZoomFromElevation() { if (null == this._cameraZoom || !this._elevation) return; const t = this._cameraZoom, e = Ph(this._elevation.getAtPointOrZero(Bh.fromLngLat(this.center)), this.center.lat), i = this._mercatorZfromZoom(t), r = this._mercatorZfromZoom(this._maxZoom), n = Math.max(i - e, r); this._setZoom(this._zoomFromMercatorZ(n)); } get padding() { return this._edgeInsets.toJSON() } set padding(t) { this._edgeInsets.equals(t) || (this._unmodified = !1, this._edgeInsets.interpolate(this._edgeInsets, t, 1), this._calcMatrices()); } computeZoomRelativeTo(t) { const e = this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint, t.toAltitude())); let i; i = t.z < this._camera.position[2] ? [e.x, e.y, e.z] : [t.x, t.y, t.z]; const r = Jo(cl([], this._camera.position, i)); return y(this._zoomFromMercatorZ(r), this._minZoom, this._maxZoom) } setFreeCameraOptions(t) { if (!this.height) return; if (!t.position && !t.orientation) return; this._updateCameraState(); let e = !1; if (t.orientation && !function (t, e) { return t[0] === e[0] && t[1] === e[1] && t[2] === e[2] && t[3] === e[3] }(t.orientation, this._camera.orientation) && (e = this._setCameraOrientation(t.orientation)), t.position) { const n = [t.position.x, t.position.y, t.position.z]; ((i = n)[0] !== (r = this._camera.position)[0] || i[1] !== r[1] || i[2] !== r[2]) && (this._setCameraPosition(n), e = !0); } var i, r; e && (this._updateStateFromCamera(), this.recenterOnTerrain()); } getFreeCameraOptions() { this._updateCameraState(); const t = this._camera.position, e = new Zh; return e.position = new Bh(t[0], t[1], t[2]), e.orientation = this._camera.orientation, e._elevation = this.elevation, e._renderWorldCopies = this._renderWorldCopies, e } _setCameraOrientation(t) { if (e = t, !Math.hypot(e[0], e[1], e[2], e[3])) return !1; var e; !function (t, e) { var i = e[0], r = e[1], n = e[2], s = e[3], a = i * i + r * r + n * n + s * s; a > 0 && (a = 1 / Math.sqrt(a)), t[0] = i * a, t[1] = r * a, t[2] = n * a, t[3] = s * a; }(t, t); const i = hl([], [0, 0, -1], t), r = hl([], [0, -1, 0], t); if (r[2] < 0) return !1; const n = $h(i, r); return !!n && (this._camera.orientation = n, !0) } _setCameraPosition(t) { const e = this.zoomScale(this.minZoom) * this.tileSize, i = this.zoomScale(this.maxZoom) * this.tileSize, r = this.cameraToCenterDistance; t[2] = y(t[2], r / i, r / e), this._camera.position = t; } get centerPoint() { return this._edgeInsets.getCenter(this.width, this.height) } get fovAboveCenter() { return this._fov * (.5 + this.centerOffset.y / this.height) } isPaddingEqual(t) { return this._edgeInsets.equals(t) } interpolatePadding(t, e, i) { this._unmodified = !1, this._edgeInsets.interpolate(t, e, i), this._constrain(), this._calcMatrices(); } coveringZoomLevel(t) { const e = (t.roundZoom ? Math.round : Math.floor)(this.zoom + this.scaleZoom(this.tileSize / t.tileSize)); return Math.max(0, e) } getVisibleUnwrappedCoordinates(t) { const e = [new Gh(0, t)]; if (this._renderWorldCopies) { const r = this.pointCoordinate(new i(0, 0)), n = this.pointCoordinate(new i(this.width, 0)), s = this.pointCoordinate(new i(this.width, this.height)), a = this.pointCoordinate(new i(0, this.height)), o = Math.floor(Math.min(r.x, n.x, s.x, a.x)), l = Math.floor(Math.max(r.x, n.x, s.x, a.x)), h = 1; for (let i = o - h; i <= l + h; i++)0 !== i && e.push(new Gh(i, t)); } return e } coveringTiles(t) { let e = this.coveringZoomLevel(t); const i = e, r = this.elevation && !t.isTerrainDEM; if (void 0 !== t.minzoom && e < t.minzoom) return []; void 0 !== t.maxzoom && e > t.maxzoom && (e = t.maxzoom); const n = Bh.fromLngLat(this.center), s = 1 << e, a = [s * n.x, s * n.y, 0], o = vl.fromInvProjectionMatrix(this.invProjMatrix, this.worldSize, e), l = this.pointCoordinate(this.getCameraPoint()), h = s * Ph(1, this.center.lat), u = this._camera.position[2] / Ph(1, this.center.lat), p = [s * l.x, s * l.y, u], d = this.cameraToCenterDistance / t.tileSize * (t.roundZoom ? 1 : .502), f = this.pitch <= 60 && this._edgeInsets.top <= this._edgeInsets.bottom && !this._elevation ? e : 0, y = t.isTerrainDEM && this._elevation ? 1e4 * this._elevation.exaggeration() : this._centerAltitude, m = t.isTerrainDEM ? -y : this._elevation ? this._elevation.getMinElevationBelowMSL() : 0, g = t => ({ aabb: new bl([t * s, 0, m], [(t + 1) * s, s, y]), zoom: 0, x: 0, y: 0, wrap: t, fullyVisible: !1 }), x = [], _ = [], v = e, b = t.reparseOverscaled ? i : e, w = t => { if (!this._elevation || !t.tileID) return; const e = this._elevation.getMinMaxForTile(t.tileID), i = t.aabb; e ? (i.min[2] = e.min, i.max[2] = e.max, i.center[2] = (i.min[2] + i.max[2]) / 2) : (t.shouldSplit = S(t), t.shouldSplit || (i.min[2] = i.max[2] = i.center[2] = this._centerAltitude)); }, k = t => t * t, A = k((u - this._centerAltitude) * h), S = t => { if (t.zoom < f) return !0; if (t.zoom === v) return !1; if (null != t.shouldSplit) return t.shouldSplit; const e = t.aabb.distanceX(p), i = t.aabb.distanceY(p); let n = A; r && (n = k(t.aabb.distanceZ(p) * h)); const s = e * e + i * i + n, a = k((1 << v - t.zoom) * d * ((t, e) => { if (e * k(.707) < t) return 1; const i = Math.sqrt(e / t); return i / (1.4144271570014144 + (Math.pow(1.1, i - 1.4144271570014144 + 1) - 1) / (1.1 - 1) - 1) })(Math.max(n, A), s)); return s < a }; if (this._renderWorldCopies) for (let t = 1; t <= 3; t++)x.push(g(-t)), x.push(g(t)); for (x.push(g(0)); x.length > 0;) { const i = x.pop(), n = i.x, s = i.y; let l = i.fullyVisible; if (!l) { const t = i.aabb.intersects(o); if (0 === t) continue; l = 2 === t; } if (i.zoom !== v && S(i)) for (let t = 0; t < 4; t++) { const e = (n << 1) + t % 2, a = (s << 1) + (t >> 1), o = { aabb: i.aabb.quadrant(t), zoom: i.zoom + 1, x: e, y: a, wrap: i.wrap, fullyVisible: l, tileID: void 0, shouldSplit: void 0 }; r && (o.tileID = new Xh(i.zoom + 1 === v ? b : i.zoom + 1, i.wrap, i.zoom + 1, e, a), w(o)), x.push(o); } else { const r = i.zoom === v ? b : i.zoom; if (t.minzoom && t.minzoom > r) continue; const o = a[0] - (.5 + n + (i.wrap << i.zoom)) * (1 << e - i.zoom), l = a[1] - .5 - s, h = i.tileID ? i.tileID : new Xh(r, i.wrap, i.zoom, n, s); _.push({ tileID: h, distanceSq: o * o + l * l }); } } if (this.fogCullDistSq) { const t = this.fogCullDistSq; _.splice(0, _.length, ..._.filter((e => { const i = [0, 0, 0, 1], n = [co, co, 0, 1], s = this.calculateFogTileMatrix(e.tileID.toUnwrapped()); yl(i, i, s), yl(n, n, s); const a = function (t, e, i) { let r = 0; for (let i = 0; i < 2; ++i) { const n = 0; t[i] > n && (r += (t[i] - n) * (t[i] - n)), e[i] < n && (r += (n - e[i]) * (n - e[i])); } return r }(i, n); if (0 === a) return !0; let o = !1; const l = this.horizonLineFromTop(); if (a > t && 0 !== l) { const t = this.calculateProjMatrix(e.tileID.toUnwrapped()); let i; r && this._elevation && (i = this._elevation.getMinMaxForTile(e.tileID)), i || (i = { min: m, max: y }); const n = function (t) { const e = Math.round((t + 45 + 360) % 360 / 90) % 4; return c[e] }(this.bearing), s = [n[0] * co, n[1] * co, i.max]; ll(s, s, t), o = (1 - s[1]) * this.height * .5 < l; } return a < t || o }))); } return _.sort(((t, e) => t.distanceSq - e.distanceSq)).map((t => t.tileID)) } resize(t, e) { this.width = t, this.height = e, this.pixelsToGLUnits = [2 / t, -2 / e], this._constrain(), this._calcMatrices(); } get unmodified() { return this._unmodified } zoomScale(t) { return Math.pow(2, t) } scaleZoom(t) { return Math.log(t) / Math.LN2 } project(t) { const e = y(t.lat, -this.maxValidLatitude, this.maxValidLatitude); return new i(Ch(t.lng) * this.worldSize, Ih(e) * this.worldSize) } unproject(t) { return new Bh(t.x / this.worldSize, t.y / this.worldSize).toLngLat() } get point() { return this.project(this.center) } setLocationAtPoint(t, e) { const i = this.pointCoordinate(e), r = this.pointCoordinate(this.centerPoint), n = this.locationCoordinate(t), s = new Bh(n.x - (i.x - r.x), n.y - (i.y - r.y)); this.center = this.coordinateLocation(s), this._renderWorldCopies && (this.center = this.center.wrap()); } setLocation(t) { this.center = this.coordinateLocation(t), this._renderWorldCopies && (this.center = this.center.wrap()); } locationPoint(t) { return this._coordinatePoint(this.locationCoordinate(t), !1) } locationPoint3D(t) { return this._coordinatePoint(this.locationCoordinate(t), !0) } pointLocation(t) { return this.coordinateLocation(this.pointCoordinate(t)) } pointLocation3D(t) { return this.coordinateLocation(this.pointCoordinate3D(t)) } locationCoordinate(t) { return Bh.fromLngLat(t) } coordinateLocation(t) { return t.toLngLat() } pointRayIntersection(t, e) { const i = null != e ? e : this._centerAltitude, r = [t.x, t.y, 0, 1], n = [t.x, t.y, 1, 1]; yl(r, r, this.pixelMatrixInverse), yl(n, n, this.pixelMatrixInverse); const s = n[3]; fl(r, r, 1 / r[3]), fl(n, n, 1 / s); const a = r[2], o = n[2]; return { p0: r, p1: n, t: a === o ? 0 : (i - a) / (o - a) } } screenPointToMercatorRay(t) { const e = [t.x, t.y, 0, 1], i = [t.x, t.y, 1, 1]; return yl(e, e, this.pixelMatrixInverse), yl(i, i, this.pixelMatrixInverse), fl(e, e, 1 / e[3]), fl(i, i, 1 / i[3]), e[2] = Ph(e[2], this._center.lat) * this.worldSize, i[2] = Ph(i[2], this._center.lat) * this.worldSize, fl(e, e, 1 / this.worldSize), fl(i, i, 1 / this.worldSize), new _l([e[0], e[1], e[2]], sl([], cl([], i, e))) } rayIntersectionCoordinate(t) { const { p0: e, p1: i, t: r } = t, n = Ph(e[2], this._center.lat), s = Ph(i[2], this._center.lat); return new Bh(Ae(e[0], i[0], r) / this.worldSize, Ae(e[1], i[1], r) / this.worldSize, Ae(n, s, r)) } pointCoordinate(t) { const e = this.horizonLineFromTop(!1), r = new i(t.x, Math.max(e, t.y)); return this.rayIntersectionCoordinate(this.pointRayIntersection(r)) } pointCoordinate3D(t) { if (!this.elevation) return this.pointCoordinate(t); const e = this.elevation; let i = this.elevation.pointCoordinate(t); if (i) return new Bh(i[0], i[1], i[2]); let r = 0, n = this.horizonLineFromTop(); if (t.y > n) return this.pointCoordinate(t); const s = .02 * n, a = t.clone(); for (let t = 0; t < 10 && n - r > s; t++) { a.y = Ae(r, n, .66); const t = e.pointCoordinate(a); t ? (n = a.y, i = t) : r = a.y; } return i ? new Bh(i[0], i[1], i[2]) : this.pointCoordinate(t) } isPointAboveHorizon(t) { if (this.elevation) return !this.elevation.pointCoordinate(t); { const e = this.horizonLineFromTop(); return t.y < e } } _coordinatePoint(t, e) { const r = e && this.elevation ? this.elevation.getAtPointOrZero(t, this._centerAltitude) : this._centerAltitude, n = [t.x * this.worldSize, t.y * this.worldSize, r + t.toAltitude(), 1]; return yl(n, n, this.pixelMatrix), n[3] > 0 ? new i(n[0] / n[3], n[1] / n[3]) : new i(Number.MAX_VALUE, Number.MAX_VALUE) } getBounds() { return this._terrainEnabled() ? this._getBounds3D() : (new N).extend(this.pointLocation(new i(this._edgeInsets.left, this._edgeInsets.top))).extend(this.pointLocation(new i(this.width - this._edgeInsets.right, this._edgeInsets.top))).extend(this.pointLocation(new i(this.width - this._edgeInsets.right, this.height - this._edgeInsets.bottom))).extend(this.pointLocation(new i(this._edgeInsets.left, this.height - this._edgeInsets.bottom))) } _getBounds3D() { const t = this.elevation, e = t.visibleDemTiles.reduce(((t, e) => { if (e.dem) { const i = e.dem.tree; t.min = Math.min(t.min, i.minimums[0]), t.max = Math.max(t.max, i.maximums[0]); } return t }), { min: Number.MAX_VALUE, max: 0 }); e.min *= t.exaggeration(), e.max *= t.exaggeration(); const r = this.horizonLineFromTop(); return [new i(0, r), new i(this.width, r), new i(this.width, this.height), new i(0, this.height)].reduce(((t, i) => t.extend(this.coordinateLocation(this.rayIntersectionCoordinate(this.pointRayIntersection(i, e.min)))).extend(this.coordinateLocation(this.rayIntersectionCoordinate(this.pointRayIntersection(i, e.max))))), new N) } horizonLineFromTop(t = !0) { const e = this.height / 2 / Math.tan(this._fov / 2) / Math.tan(Math.max(this._pitch, .1)) + this.centerOffset.y, i = this.height / 2 - .97 * e; return t ? Math.max(0, i) : i } getMaxBounds() { return this.latRange && 2 === this.latRange.length && this.lngRange && 2 === this.lngRange.length ? new N([this.lngRange[0], this.latRange[0]], [this.lngRange[1], this.latRange[1]]) : null } setMaxBounds(t) { t ? (this.lngRange = [t.getWest(), t.getEast()], this.latRange = [t.getSouth(), t.getNorth()], this._constrain()) : (this.lngRange = null, this.latRange = [-this.maxValidLatitude, this.maxValidLatitude]); } calculatePosMatrix(t, e) { const i = t.canonical, r = e / this.zoomScale(i.z), n = i.x + Math.pow(2, i.z) * t.wrap, s = Uo(new Float64Array(16)); return qo(s, s, [n * r, i.y * r, 0]), No(s, s, [r / co, r / co, 1]), s } calculateFogTileMatrix(t) { const e = t.key, i = this._fogTileMatrixCache; if (i[e]) return i[e]; const r = this.calculatePosMatrix(t, this.cameraWorldSize); return Zo(r, this.worldToFogMatrix, r), i[e] = new Float32Array(r), i[e] } calculateProjMatrix(t, e = !1) { const i = t.key, r = e ? this._alignedProjMatrixCache : this._projMatrixCache; if (r[i]) return r[i]; const n = this.calculatePosMatrix(t, this.worldSize); return Zo(n, e ? this.alignedProjMatrix : this.projMatrix, n), r[i] = new Float32Array(n), r[i] } customLayerMatrix() { return this.mercatorMatrix.slice() } recenterOnTerrain() { if (!this._elevation) return; const t = this._elevation; this._updateCameraState(); const e = this._camera.position, i = this._camera.forward(); if (e[2] <= 0 || i[2] >= 0) return; const r = Ph(1, this._center.lat); e[2] /= r, i[2] /= r, sl(i, i); const n = t.raycast(e, i, t.exaggeration()); if (n) { const t = nl([], e, i, n), r = new Bh(t[0], t[1], Ph(t[2], Mh(t[1]))), s = this._camera.position, a = r.z + Jo([r.x - s[0], r.y - s[1], r.z - s[2]]); this._cameraZoom = this._zoomFromMercatorZ(a), this._centerAltitude = r.toAltitude(), this._center = r.toLngLat(), this._updateZoomFromElevation(), this._constrain(), this._calcMatrices(); } } _constrainCameraAltitude() { if (!this._elevation) return; const t = this._elevation; this._updateCameraState(); const e = t.getAtPointOrZero(this._camera.mercatorPosition), i = this._minimumHeightOverTerrain() * Math.cos(u(this._maxPitch)), r = Ph(e, this._center.lat), n = this._camera.position[2] - r; if (n < i) { const t = Bh.fromLngLat(this._center, this._centerAltitude), e = this._camera.mercatorPosition, r = [t.x - e.x, t.y - e.y, t.z - e.z], s = Jo(r); r[2] -= i - n; const a = Jo(r); if (0 === a) return; rl(r, r, s / a), this._camera.position = [t.x - r[0], t.y - r[1], t.z - r[2]], this._camera.orientation = $h(r, this._camera.up()), this._updateStateFromCamera(); } } _constrain() { if (!this.center || !this.width || !this.height || this._constraining) return; this._constraining = !0; let t, e, r, n, s = -90, a = 90, o = -180, l = 180; const h = this.size, u = this._unmodified; if (this.latRange) { const e = this.latRange; s = Ih(e[1]) * this.worldSize, a = Ih(e[0]) * this.worldSize, t = a - s < h.y ? h.y / (a - s) : 0; } if (this.lngRange) { const t = this.lngRange; o = Ch(t[0]) * this.worldSize, l = Ch(t[1]) * this.worldSize, e = l - o < h.x ? h.x / (l - o) : 0; } const c = this.point, p = Math.max(e || 0, t || 0); if (p) return this.center = this.unproject(new i(e ? (l + o) / 2 : c.x, t ? (a + s) / 2 : c.y)), this.zoom += this.scaleZoom(p), this._unmodified = u, void (this._constraining = !1); if (this.latRange) { const t = c.y, e = h.y / 2; t - e < s && (n = s + e), t + e > a && (n = a - e); } if (this.lngRange) { const t = c.x, e = h.x / 2; t - e < o && (r = o + e), t + e > l && (r = l - e); } void 0 === r && void 0 === n || (this.center = this.unproject(new i(void 0 !== r ? r : c.x, void 0 !== n ? n : c.y))), this._constrainCameraAltitude(), this._unmodified = u, this._constraining = !1; } _minZoomForBounds() { const t = (t, e) => Math.log2(t / (this.tileSize * Math.abs(e[1] - e[0]))); let e = 0; if (this.latRange) { const i = this.latRange; e = t(this.height, [Ih(i[0]), Ih(i[1])]); } let i = 0; if (this.lngRange) { const e = this.lngRange; i = t(this.width, [Ch(e[0]), Ch(e[1])]); } return Math.max(e, i) } _maxCameraBoundsDistance() { return this._mercatorZfromZoom(this._minZoomForBounds()) } _calcMatrices() { if (!this.height) return; const t = this.centerOffset; this.cameraToCenterDistance = .5 / Math.tan(this._fov / 2) * this.height; const e = this.pixelsPerMeter; this._updateCameraState(); const i = Math.PI / 2 + this._pitch, r = this.fovAboveCenter, n = this.elevation ? this.elevation.getMinElevationBelowMSL() * e : 0, s = (this._camera.position[2] * this.worldSize - n) / Math.cos(this._pitch), a = Math.sin(r) * s / Math.sin(y(Math.PI - i - r, .01, Math.PI - .01)), o = this.point, l = o.x, h = o.y, u = Math.cos(Math.PI / 2 - this._pitch) * a + s, c = Math.min(1.01 * u, s * (1 / this._horizonShift)), p = this.height / 50, d = this._camera.getWorldToCamera(this.worldSize, e), f = this._camera.getCameraToClipPerspective(this._fov, this.width / this.height, p, c); f[8] = 2 * -t.x / this.width, f[9] = 2 * t.y / this.height; let m = Ho([], f, d); this.mercatorMatrix = No([], m, [this.worldSize, this.worldSize, this.worldSize / e]), this.projMatrix = m, this.invProjMatrix = $o(new Float64Array(16), this.projMatrix); const g = new Float32Array(16); Uo(g), No(g, g, [1, -1, 1]), jo(g, g, this._pitch), Go(g, g, this.angle); const x = Ko(new Float32Array(16), this._fov, this.width / this.height, p, c), _ = (Math.PI / 2 - this._pitch) * (this.height / this._fov) * this._horizonShift; x[8] = 2 * -t.x / this.width, x[9] = 2 * (t.y + _) / this.height, this.skyboxMatrix = Zo(g, x, g); const v = this.width % 2 / 2, b = this.height % 2 / 2, w = Math.cos(this.angle), k = Math.sin(this.angle), A = l - Math.round(l) + w * v + k * b, S = h - Math.round(h) + w * b + k * v, z = new Float64Array(m); if (qo(z, z, [A > .5 ? A - 1 : A, S > .5 ? S - 1 : S, 0]), this.alignedProjMatrix = z, m = Oo(), No(m, m, [this.width / 2, -this.height / 2, 1]), qo(m, m, [1, -1, 0]), this.labelPlaneMatrix = m, m = Oo(), No(m, m, [1, -1, 1]), qo(m, m, [-1, -1, 0]), No(m, m, [2 / this.width, 2 / this.height, 1]), this.glCoordMatrix = m, this.pixelMatrix = Zo(new Float64Array(16), this.labelPlaneMatrix, this.projMatrix), this._calcFogMatrices(), m = $o(new Float64Array(16), this.pixelMatrix), !m) throw new Error("failed to invert matrix"); this.pixelMatrixInverse = m, this._projMatrixCache = {}, this._alignedProjMatrixCache = {}; } _calcFogMatrices() { this._fogTileMatrixCache = {}; const t = this.cameraWorldSize, e = this.cameraPixelsPerMeter, i = this._camera.position, r = 1 / this.height, n = [t, t, e]; rl(n, n, r), rl(i, i, -1), il(i, i, n); const s = Oo(); qo(s, s, i), No(s, s, n), this.mercatorFogMatrix = s, this.worldToFogMatrix = this._camera.getWorldToCameraPosition(t, e, r); } _updateCameraState() { if (!this.height) return; this._camera.setPitchBearing(this._pitch, this.angle); const t = this._camera.forward(), e = this.cameraToCenterDistance, i = this.point, r = this._mercatorZfromZoom(this._cameraZoom ? this._cameraZoom : this._zoom) - Ph(this._centerAltitude, this.center.lat), n = this.cameraToCenterDistance / r; this._camera.position = [i.x / this.worldSize - t[0] * e / n, i.y / this.worldSize - t[1] * e / n, Ph(this._centerAltitude, this._center.lat) + -t[2] * e / n]; } _translateCameraConstrained(t) { const e = this._maxCameraBoundsDistance() * Math.cos(this._pitch), i = t[2]; let r = 1; i > 0 && (r = Math.min((e - this._camera.position[2]) / i, 1)), this._camera.position = nl([], this._camera.position, t, r), this._updateStateFromCamera(); } _updateStateFromCamera() { const t = this._camera.position, e = this._camera.forward(), { pitch: i, bearing: r } = this._camera.getPitchBearing(), n = Ph(this._centerAltitude, this.center.lat), s = this._mercatorZfromZoom(this._maxZoom) * Math.cos(u(this._maxPitch)), a = Math.max((t[2] - n) / Math.cos(i), s), o = this._zoomFromMercatorZ(a); nl(t, t, e, a), this._pitch = y(i, u(this.minPitch), u(this.maxPitch)), this.angle = m(r, -Math.PI, Math.PI), this._setZoom(y(o, this._minZoom, this._maxZoom)), this._terrainEnabled() && this._updateCameraOnTerrain(), this._center = new Bh(t[0], t[1], t[2]).toLngLat(), this._unmodified = !1, this._constrain(), this._calcMatrices(); } _worldSizeFromZoom(t) { return Math.pow(2, t) * this.tileSize } _mercatorZfromZoom(t) { return this.cameraToCenterDistance / this._worldSizeFromZoom(t) } _minimumHeightOverTerrain() { const t = Math.min((null != this._cameraZoom ? this._cameraZoom : this._zoom) + 2, this._maxZoom); return this._mercatorZfromZoom(t) } _zoomFromMercatorZ(t) { return this.scaleZoom(this.cameraToCenterDistance / (t * this.tileSize)) } _terrainEnabled() { return !!this._elevation } isHorizonVisibleForPoints(t, e) { const r = Math.min(t.x, e.x), n = Math.max(t.x, e.x), s = Math.min(t.y, e.y), a = Math.max(t.y, e.y), o = [new i(r, s), new i(n, a), new i(r, a), new i(n, s)], l = this._renderWorldCopies ? -3 : 0, h = this._renderWorldCopies ? 4 : 1; for (const t of o) { const e = this.pointRayIntersection(t); if (e.t < 0) return !0; const i = this.rayIntersectionCoordinate(e); if (i.x < l || i.y < 0 || i.x > h || i.y > 1) return !0 } return !1 } isHorizonVisible() { return this.pitch + this.fovAboveCenter * h > 88 || this.isHorizonVisibleForPoints(new i(0, 0), new i(this.width, this.height)) } zoomDeltaToMovement(t, e) { const i = Jo(cl([], this._camera.position, t)), r = this._zoomFromMercatorZ(i) + e; return i - this._mercatorZfromZoom(r) } getCameraPoint() { const t = Math.tan(this._pitch) * (this.cameraToCenterDistance || 1); return this.centerPoint.add(new i(0, t)) } } class Wh extends Hh { update(t) { t.hasOwnProperty("maxValidLatitude") && (this.maxValidLatitude = t.maxValidLatitude), t.size && this.resize(...t.size); } } const Yh = {}; function Jh(t) { const e = t.transform || Yh.transform, i = function (t) { switch (t.CODE) { case Sh.EPSG4326.CODE: case Sh.EPSG4490.CODE: return { maxValidLatitude: 90 }; case Sh.EPSG3857.CODE: case Sh.EPSG900913.CODE: return { maxValidLatitude: 85.051129 } } }(Yh.crs); e.update({ ...t, ...i }); } function Qh() { return Yh.crs.CODE } function tu(t, e, i, r, n) { this.properties = {}, this.extent = i, this.type = 0, this._pbf = t, this._geometry = -1, this._keys = r, this._values = n, t.readFields(eu, this, e); } function eu(t, e, i) { 1 == t ? e.id = i.readVarint() : 2 == t ? function (t, e) { for (var i = t.readVarint() + t.pos; t.pos < i;) { var r = e._keys[t.readVarint()], n = e._values[t.readVarint()]; e.properties[r] = n; } }(i, e) : 3 == t ? e.type = i.readVarint() : 4 == t && (e._geometry = i.pos); } function iu(t) { for (var e, i, r = 0, n = 0, s = t.length, a = s - 1; n < s; a = n++)r += ((i = t[a]).x - (e = t[n]).x) * (e.y + i.y); return r } function ru(t, e) { this.version = 1, this.name = null, this.extent = 4096, this.length = 0, this._pbf = t, this._keys = [], this._values = [], this._features = [], t.readFields(nu, this, e), this.length = this._features.length; } function nu(t, e, i) { 15 === t ? e.version = i.readVarint() : 1 === t ? e.name = i.readString() : 5 === t ? e.extent = i.readVarint() : 2 === t ? e._features.push(i.pos) : 3 === t ? e._keys.push(i.readString()) : 4 === t && e._values.push(function (t) { for (var e = null, i = t.readVarint() + t.pos; t.pos < i;) { var r = t.readVarint() >> 3; e = 1 === r ? t.readString() : 2 === r ? t.readFloat() : 3 === r ? t.readDouble() : 4 === r ? t.readVarint64() : 5 === r ? t.readVarint() : 6 === r ? t.readSVarint() : 7 === r ? t.readBoolean() : null; } return e }(i)); } function su(t, e, i) { if (3 === t) { var r = new ru(i, i.readVarint() + i.pos); r.length && (e[r.name] = r); } } Yh.crs = Sh.EPSG3857, Yh.transform = void 0, tu.types = ["Unknown", "Point", "LineString", "Polygon"], tu.prototype.loadGeometry = function () { var t = this._pbf; t.pos = this._geometry; for (var e, r = t.readVarint() + t.pos, n = 1, s = 0, a = 0, o = 0, l = []; t.pos < r;) { if (s <= 0) { var h = t.readVarint(); n = 7 & h, s = h >> 3; } if (s--, 1 === n || 2 === n) a += t.readSVarint(), o += t.readSVarint(), 1 === n && (e && l.push(e), e = []), e.push(new i(a, o)); else { if (7 !== n) throw new Error("unknown command " + n); e && e.push(e[0].clone()); } } return e && l.push(e), l }, tu.prototype.bbox = function () { var t = this._pbf; t.pos = this._geometry; for (var e = t.readVarint() + t.pos, i = 1, r = 0, n = 0, s = 0, a = 1 / 0, o = -1 / 0, l = 1 / 0, h = -1 / 0; t.pos < e;) { if (r <= 0) { var u = t.readVarint(); i = 7 & u, r = u >> 3; } if (r--, 1 === i || 2 === i) (n += t.readSVarint()) < a && (a = n), n > o && (o = n), (s += t.readSVarint()) < l && (l = s), s > h && (h = s); else if (7 !== i) throw new Error("unknown command " + i) } return [a, l, o, h] }, tu.prototype.toGeoJSON = function (t, e, i) { var r, n, s, a = this.extent * Math.pow(2, i), o = this.extent * t, l = this.extent * e, h = this.loadGeometry(), u = tu.types[this.type]; switch (Qh()) { case Sh.EPSG4326.CODE: case Sh.EPSG4490.CODE: s = function (t) { for (var e = 0; e < t.length; e++) { var i = t[e]; t[e] = [360 * (i.x + o) / a - 180, 90 - 360 * (i.y + l) / a]; } }; break; case Sh.EPSG3857.CODE: case Sh.EPSG900913.CODE: s = function (t) { for (var e = 0; e < t.length; e++) { var i = t[e]; t[e] = [360 * (i.x + o) / a - 180, 360 / Math.PI * Math.atan(Math.exp((180 - 360 * (i.y + l) / a) * Math.PI / 180)) - 90]; } }; }switch (this.type) { case 1: var c = []; for (r = 0; r < h.length; r++)c[r] = h[r][0]; s(h = c); break; case 2: for (r = 0; r < h.length; r++)s(h[r]); break; case 3: for (h = function (t) { var e = t.length; if (e <= 1) return [t]; for (var i, r, n = [], s = 0; s < e; s++) { var a = iu(t[s]); 0 !== a && (void 0 === r && (r = a < 0), r === a < 0 ? (i && n.push(i), i = [t[s]]) : i.push(t[s])); } return i && n.push(i), n }(h), r = 0; r < h.length; r++)for (n = 0; n < h[r].length; n++)s(h[r][n]); }1 === h.length ? h = h[0] : u = "Multi" + u; var p = { type: "Feature", geometry: { type: u, coordinates: h }, properties: this.properties }; return "id" in this && (p.id = this.id), p }, ru.prototype.feature = function (t) { if (t < 0 || t >= this._features.length) throw new Error("feature index out of bounds"); this._pbf.pos = this._features[t]; var e = this._pbf.readVarint() + this._pbf.pos; return new tu(this._pbf, e, this.extent, this._keys, this._values) }; var au = { VectorTile: function (t, e) { this.layers = t.readFields(su, {}, e); }, VectorTileLayer: ru, VectorTileFeature: tu }; const ou = au.VectorTileFeature.types, lu = Math.pow(2, 13); function hu(t, e, i, r, n, s, a, o) { t.emplaceBack((e << 1) + a, (i << 1) + s, (Math.floor(r * lu) << 1) + n, Math.round(o)); } class uu { constructor() { this.acc = new i(0, 0), this.polyCount = []; } startRing(t) { this.currentPolyCount = { edges: 0, top: 0 }, this.polyCount.push(this.currentPolyCount), this.min || (this.min = new i(t.x, t.y), this.max = new i(t.x, t.y)); } append(t, e) { this.currentPolyCount.edges++, this.acc._add(t); let i = !!this.borders; const r = this.min, n = this.max; t.x < r.x ? (r.x = t.x, i = !0) : t.x > n.x && (n.x = t.x, i = !0), t.y < r.y ? (r.y = t.y, i = !0) : t.y > n.y && (n.y = t.y, i = !0), ((0 === t.x || t.x === co) && t.x === e.x) != ((0 === t.y || t.y === co) && t.y === e.y) && this.processBorderOverlap(t, e), i && this.checkBorderIntersection(t, e); } checkBorderIntersection(t, e) { e.x < 0 != t.x < 0 && this.addBorderIntersection(0, Ae(e.y, t.y, (0 - e.x) / (t.x - e.x))), e.x > co != t.x > co && this.addBorderIntersection(1, Ae(e.y, t.y, (co - e.x) / (t.x - e.x))), e.y < 0 != t.y < 0 && this.addBorderIntersection(2, Ae(e.x, t.x, (0 - e.y) / (t.y - e.y))), e.y > co != t.y > co && this.addBorderIntersection(3, Ae(e.x, t.x, (co - e.y) / (t.y - e.y))); } addBorderIntersection(t, e) { this.borders || (this.borders = [[Number.MAX_VALUE, -Number.MAX_VALUE], [Number.MAX_VALUE, -Number.MAX_VALUE], [Number.MAX_VALUE, -Number.MAX_VALUE], [Number.MAX_VALUE, -Number.MAX_VALUE]]); const i = this.borders[t]; e < i[0] && (i[0] = e), e > i[1] && (i[1] = e); } processBorderOverlap(t, e) { if (t.x === e.x) { if (t.y === e.y) return; const i = 0 === t.x ? 0 : 1; this.addBorderIntersection(i, e.y), this.addBorderIntersection(i, t.y); } else { const i = 0 === t.y ? 2 : 3; this.addBorderIntersection(i, e.x), this.addBorderIntersection(i, t.x); } } centroid() { const t = this.polyCount.reduce(((t, e) => t + e.edges), 0); return 0 !== t ? this.acc.div(t)._round() : new i(0, 0) } span() { return new i(this.max.x - this.min.x, this.max.y - this.min.y) } intersectsCount() { return this.borders.reduce(((t, e) => t + +(e[0] !== Number.MAX_VALUE)), 0) } } class cu { constructor(t) { this.zoom = t.zoom, this.overscaling = t.overscaling, this.layers = t.layers, this.layerIds = this.layers.map((t => t.id)), this.index = t.index, this.hasPattern = !1, this.layoutVertexArray = new Js, this.centroidVertexArray = new Ea, this.indexArray = new ua, this.programConfigurations = new to(t.layers, t.zoom), this.segments = new uo, this.stateDependentLayerIds = this.layers.filter((t => t.isStateDependent())).map((t => t.id)), this.enableTerrain = t.enableTerrain; } populate(t, e, i) { this.features = [], this.hasPattern = gh("fill-extrusion", this.layers, e), this.featuresOnBorder = [], this.borders = [[], [], [], []], this.borderDone = [!1, !1, !1, !1], this.tileToMeter = function (t) { const e = Math.exp(Math.PI * (1 - t.y / (1 << t.z) * 2)); return 80150034 * e / (e * e + 1) / co / (1 << t.z) }(i); for (const { feature: r, id: n, index: s, sourceLayerIndex: a } of t) { const t = this.layers[0]._featureFilter.needGeometry, o = mo(r, t); if (!this.layers[0]._featureFilter.filter(new Es(this.zoom), o, i)) continue; const l = { id: n, sourceLayerIndex: a, index: s, geometry: t ? o.geometry : yo(r), properties: r.properties, type: r.type, patterns: {} }, h = this.layoutVertexArray.length; this.hasPattern ? this.features.push(xh("fill-extrusion", this.layers, l, this.zoom, e)) : this.addFeature(l, l.geometry, s, i, {}), e.featureIndex.insert(r, l.geometry, s, a, this.index, h); } this.sortBorders(); } addFeatures(t, e, i) { for (const t of this.features) { const { geometry: r } = t; this.addFeature(t, r, t.index, e, i); } this.sortBorders(); } update(t, e, i) { this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t, e, this.stateDependentLayers, i); } isEmpty() { return 0 === this.layoutVertexArray.length } uploadPending() { return !this.uploaded || this.programConfigurations.needsUpload } upload(t) { this.uploaded || (this.layoutVertexBuffer = t.createVertexBuffer(this.layoutVertexArray, Ah), this.indexBuffer = t.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(t), this.uploaded = !0; } uploadCentroid(t) { 0 !== this.centroidVertexArray.length && (this.centroidVertexBuffer ? this.needsCentroidUpdate && this.centroidVertexBuffer.updateData(this.centroidVertexArray) : this.centroidVertexBuffer = t.createVertexBuffer(this.centroidVertexArray, kh.members, !0), this.needsCentroidUpdate = !1); } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.centroidVertexBuffer && this.centroidVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy()); } addFeature(t, e, i, r, n) { const s = this.enableTerrain && t.properties && "Polygon" === ou[t.type] ? new uu : null; for (const i of yh(e, 500)) { let e = 0, r = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray); if (0 === i.length || (a = i[0]).every((t => t.x <= 0)) || a.every((t => t.x >= co)) || a.every((t => t.y <= 0)) || a.every((t => t.y >= co))) continue; for (let t = 0; t < i.length; t++) { const n = i[t]; if (0 === n.length) continue; e += n.length; let a = 0; s && s.startRing(n[0]); for (let t = 0; t < n.length; t++) { const e = n[t]; if (t >= 1) { const i = n[t - 1]; if (!pu(e, i)) { s && s.append(e, i), r.vertexLength + 4 > uo.MAX_VERTEX_ARRAY_LENGTH && (r = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray)); const t = e.sub(i)._perp(), n = t.x / (Math.abs(t.x) + Math.abs(t.y)), o = t.y > 0 ? 1 : 0, l = i.dist(e); a + l > 32768 && (a = 0), hu(this.layoutVertexArray, e.x, e.y, n, o, 0, 0, a), hu(this.layoutVertexArray, e.x, e.y, n, o, 0, 1, a), a += l, hu(this.layoutVertexArray, i.x, i.y, n, o, 0, 0, a), hu(this.layoutVertexArray, i.x, i.y, n, o, 0, 1, a); const h = r.vertexLength; this.indexArray.emplaceBack(h, h + 2, h + 1), this.indexArray.emplaceBack(h + 1, h + 2, h + 3), r.vertexLength += 4, r.primitiveLength += 2; } } } } if (r.vertexLength + e > uo.MAX_VERTEX_ARRAY_LENGTH && (r = this.segments.prepareSegment(e, this.layoutVertexArray, this.indexArray)), "Polygon" !== ou[t.type]) continue; const n = [], o = [], l = r.vertexLength; for (let t = 0; t < i.length; t++) { const e = i[t]; if (0 !== e.length) { e !== i[0] && o.push(n.length / 2); for (let t = 0; t < e.length; t++) { const i = e[t]; hu(this.layoutVertexArray, i.x, i.y, 0, 0, 1, 1, 0), n.push(i.x), n.push(i.y), s && s.currentPolyCount.top++; } } } const h = Fl(n, o); for (let t = 0; t < h.length; t += 3)this.indexArray.emplaceBack(l + h[t], l + h[t + 2], l + h[t + 1]); r.primitiveLength += h.length / 3, r.vertexLength += e; } var a; if (s && s.polyCount.length > 0) { if (s.borders) { s.vertexArrayOffset = this.centroidVertexArray.length; const t = s.borders, e = this.featuresOnBorder.push(s) - 1; for (let i = 0; i < 4; i++)t[i][0] !== Number.MAX_VALUE && this.borders[i].push(e); } this.encodeCentroid(s.borders ? void 0 : s.centroid(), s); } this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t, i, n, r); } sortBorders() { for (let t = 0; t < 4; t++)this.borders[t].sort(((e, i) => this.featuresOnBorder[e].borders[t][0] - this.featuresOnBorder[i].borders[t][0])); } encodeCentroid(t, e, i = !0) { let r, n; if (t) if (0 !== t.y) { const i = e.span()._mult(this.tileToMeter); r = (Math.max(t.x, 1) << 3) + Math.min(7, Math.round(i.x / 10)), n = (Math.max(t.y, 1) << 3) + Math.min(7, Math.round(i.y / 10)); } else r = Math.ceil(7 * (t.x + 450)), n = 0; else r = 0, n = +i; let s = i ? this.centroidVertexArray.length : e.vertexArrayOffset; for (const t of e.polyCount) { i && this.centroidVertexArray.resize(this.centroidVertexArray.length + 4 * t.edges + t.top); for (let e = 0; e < 2 * t.edges; e++)this.centroidVertexArray.emplace(s++, 0, n), this.centroidVertexArray.emplace(s++, r, n); for (let e = 0; e < t.top; e++)this.centroidVertexArray.emplace(s++, r, n); } } } function pu(t, e) { return t.x === e.x && (t.x < 0 || t.x > co) || t.y === e.y && (t.y < 0 || t.y > co) } Rr("FillExtrusionBucket", cu, { omit: ["layers", "features"] }), Rr("PartMetadata", uu); var du = { paint: new Ns({ "fill-extrusion-opacity": new Os(X["paint_fill-extrusion"]["fill-extrusion-opacity"]), "fill-extrusion-color": new Us(X["paint_fill-extrusion"]["fill-extrusion-color"]), "fill-extrusion-pattern-topColor": new Us(X["paint_fill-extrusion"]["fill-extrusion-pattern-topColor"]), "fill-extrusion-translate": new Os(X["paint_fill-extrusion"]["fill-extrusion-translate"]), "fill-extrusion-translate-anchor": new Os(X["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]), "fill-extrusion-pattern": new $s(X["paint_fill-extrusion"]["fill-extrusion-pattern"]), "fill-extrusion-height": new Us(X["paint_fill-extrusion"]["fill-extrusion-height"]), "fill-extrusion-base": new Us(X["paint_fill-extrusion"]["fill-extrusion-base"]), "fill-extrusion-vertical-gradient": new Os(X["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]) }) }; function fu(t, e) { return t.x * e.x + t.y * e.y } function yu(t, e) { if (1 === t.length) { let i = 0; const r = e[i++]; let n; for (; !n || r.equals(n);)if (n = e[i++], !n) return 1 / 0; for (; i < e.length; i++) { const s = e[i], a = t[0], o = n.sub(r), l = s.sub(r), h = a.sub(r), u = fu(o, o), c = fu(o, l), p = fu(l, l), d = fu(h, o), f = fu(h, l), y = u * p - c * c, m = (p * d - c * f) / y, g = (u * f - c * d) / y, x = r.z * (1 - m - g) + n.z * m + s.z * g; if (isFinite(x)) return x } return 1 / 0 } { let t = 1 / 0; for (const i of e) t = Math.min(t, i.z); return t } } function mu(t) { const e = new i(t[0], t[1]); return e.z = t[2], e } function gu(t, e, i, r, n, s, a, o) { const l = a * n.getElevationAt(t, e, !0, !0), h = 0 !== s[0], u = h ? 0 === s[1] ? a * (s[0] / 7 - 450) : a * function (t, e, i) { const r = Math.floor(e[0] / 8), n = Math.floor(e[1] / 8), s = 10 * (e[0] - 8 * r), a = 10 * (e[1] - 8 * n), o = t.getElevationAt(r, n, !0, !0), l = t.getMeterToDEM(i), h = Math.floor(.5 * (s * l - 1)), u = Math.floor(.5 * (a * l - 1)), c = t.tileCoordToPixel(r, n), p = 2 * h + 1, d = 2 * u + 1, f = function (t, e, i, r, n) { return [t.getElevationAtPixel(e, i, !0), t.getElevationAtPixel(e + n, i, !0), t.getElevationAtPixel(e, i + n, !0), t.getElevationAtPixel(e + r, i + n, !0)] }(t, c.x - h, c.y - u, p, d), y = Math.abs(f[0] - f[1]), m = Math.abs(f[2] - f[3]), g = Math.abs(f[0] - f[2]) + Math.abs(f[1] - f[3]), x = Math.min(.25, .5 * l * (y + m) / p), _ = Math.min(.25, .5 * l * g / d); return o + Math.max(x * s, _ * a) }(n, s, o) : l; return { base: l + (0 === i) ? -1 : i, top: h ? Math.max(u + r, l + i + 2) : l + r } } const xu = Hs([{ name: "a_pos_normal", components: 2, type: "Int16" }, { name: "a_data", components: 4, type: "Uint8" }, { name: "a_linesofar", components: 1, type: "Float32" }], 4), { members: _u } = xu, vu = Hs([{ name: "a_uv_x", components: 1, type: "Float32" }, { name: "a_split_index", components: 1, type: "Float32" }]), { members: bu } = vu, wu = au.VectorTileFeature.types, ku = Math.cos(Math.PI / 180 * 37.5); class Au { constructor(t) { this.zoom = t.zoom, this.overscaling = t.overscaling, this.layers = t.layers, this.layerIds = this.layers.map((t => t.id)), this.index = t.index, this.hasPattern = !1, this.patternFeatures = [], this.lineClipsArray = [], this.gradients = {}, this.layers.forEach((t => { this.gradients[t.id] = {}; })), this.layoutVertexArray = new Qs, this.layoutVertexArray2 = new ta, this.indexArray = new ua, this.programConfigurations = new to(t.layers, t.zoom), this.segments = new uo, this.maxLineLength = 0, this.stateDependentLayerIds = this.layers.filter((t => t.isStateDependent())).map((t => t.id)); } populate(t, e, i) { this.hasPattern = gh("line", this.layers, e); const r = this.layers[0].layout.get("line-sort-key"), n = []; for (const { feature: e, id: s, index: a, sourceLayerIndex: o } of t) { const t = this.layers[0]._featureFilter.needGeometry, l = mo(e, t); if (!this.layers[0]._featureFilter.filter(new Es(this.zoom), l, i)) continue; const h = r ? r.evaluate(l, {}, i) : void 0, u = { id: s, properties: e.properties, type: e.type, sourceLayerIndex: o, index: a, geometry: t ? l.geometry : yo(e), patterns: {}, sortKey: h }; n.push(u); } r && n.sort(((t, e) => t.sortKey - e.sortKey)); const { lineAtlas: s, featureIndex: a } = e, o = this.addConstantDashes(s); for (const r of n) { const { geometry: n, index: l, sourceLayerIndex: h } = r; if (o && this.addFeatureDashes(r, s), this.hasPattern) { const t = xh("line", this.layers, r, this.zoom, e); this.patternFeatures.push(t); } else this.addFeature(r, n, l, i, s.positions); a.insert(t[l].feature, n, l, h, this.index); } } addConstantDashes(t) { let e = !1; for (const i of this.layers) { const r = i.paint.get("line-dasharray").value, n = i.layout.get("line-cap").value; if ("constant" !== r.kind || "constant" !== n.kind) e = !0; else { const e = n.value, i = r.value; if (!i) continue; t.addDash(i.from, e), t.addDash(i.to, e), i.other && t.addDash(i.other, e); } } return e } addFeatureDashes(t, e) { const i = this.zoom; for (const r of this.layers) { const n = r.paint.get("line-dasharray").value, s = r.layout.get("line-cap").value; if ("constant" === n.kind && "constant" === s.kind) continue; let a, o, l, h, u, c; if ("constant" === n.kind) { const t = n.value; if (!t) continue; a = t.other || t.to, o = t.to, l = t.from; } else a = n.evaluate({ zoom: i - 1 }, t), o = n.evaluate({ zoom: i }, t), l = n.evaluate({ zoom: i + 1 }, t); "constant" === s.kind ? h = u = c = s.value : (h = s.evaluate({ zoom: i - 1 }, t), u = s.evaluate({ zoom: i }, t), c = s.evaluate({ zoom: i + 1 }, t)), e.addDash(a, h), e.addDash(o, u), e.addDash(l, c); const p = e.getKey(a, h), d = e.getKey(o, u), f = e.getKey(l, c); t.patterns[r.id] = { min: p, mid: d, max: f }; } } update(t, e, i) { this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t, e, this.stateDependentLayers, i); } addFeatures(t, e, i) { for (const t of this.patternFeatures) this.addFeature(t, t.geometry, t.index, e, i); } isEmpty() { return 0 === this.layoutVertexArray.length } uploadPending() { return !this.uploaded || this.programConfigurations.needsUpload } upload(t) { this.uploaded || (0 !== this.layoutVertexArray2.length && (this.layoutVertexBuffer2 = t.createVertexBuffer(this.layoutVertexArray2, bu)), this.layoutVertexBuffer = t.createVertexBuffer(this.layoutVertexArray, _u), this.indexBuffer = t.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(t), this.uploaded = !0; } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy()); } lineFeatureClips(t) { if (t.properties && t.properties.hasOwnProperty("mapbox_clip_start") && t.properties.hasOwnProperty("mapbox_clip_end")) return { start: +t.properties.mapbox_clip_start, end: +t.properties.mapbox_clip_end } } addFeature(t, e, i, r, n) { const s = this.layers[0].layout, a = s.get("line-join").evaluate(t, {}), o = s.get("line-cap").evaluate(t, {}), l = s.get("line-miter-limit"), h = s.get("line-round-limit"); this.lineClips = this.lineFeatureClips(t); for (const i of e) this.addLine(i, t, a, o, l, h); this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t, i, n, r); } addLine(t, e, i, r, n, s) { if (this.distance = 0, this.scaledDistance = 0, this.totalDistance = 0, this.lineSoFar = 0, this.lineClips) { this.lineClipsArray.push(this.lineClips); for (let e = 0; e < t.length - 1; e++)this.totalDistance += t[e].dist(t[e + 1]); this.updateScaledDistance(), this.maxLineLength = Math.max(this.maxLineLength, this.totalDistance); } const a = "Polygon" === wu[e.type]; let o = t.length; for (; o >= 2 && t[o - 1].equals(t[o - 2]);)o--; let l = 0; for (; l < o - 1 && t[l].equals(t[l + 1]);)l++; if (o < (a ? 3 : 2)) return; "bevel" === i && (n = 1.05); const h = this.overscaling <= 16 ? 122880 / (512 * this.overscaling) : 0, u = this.segments.prepareSegment(10 * o, this.layoutVertexArray, this.indexArray); let c, p, d, f, y; this.e1 = this.e2 = -1, a && (c = t[o - 2], y = t[l].sub(c)._unit()._perp()); for (let e = l; e < o; e++) { if (d = e === o - 1 ? a ? t[l + 1] : void 0 : t[e + 1], d && t[e].equals(d)) continue; y && (f = y), c && (p = c), c = t[e], y = d ? d.sub(c)._unit()._perp() : f, f = f || y; let m = f.add(y); 0 === m.x && 0 === m.y || m._unit(); const g = f.x * y.x + f.y * y.y, x = m.x * y.x + m.y * y.y, _ = 0 !== x ? 1 / x : 1 / 0, v = 2 * Math.sqrt(2 - 2 * x), b = x < ku && p && d, w = f.x * y.y - f.y * y.x > 0; if (b && e > l) { const t = c.dist(p); if (t > 2 * h) { const e = c.sub(c.sub(p)._mult(h / t)._round()); this.updateDistance(p, e), this.addCurrentVertex(e, f, 0, 0, u), p = e; } } const k = p && d; let A = k ? i : a ? "butt" : r; if (k && "round" === A && (_ < s ? A = "miter" : _ <= 2 && (A = "fakeround")), "miter" === A && _ > n && (A = "bevel"), "bevel" === A && (_ > 2 && (A = "flipbevel"), _ < n && (A = "miter")), p && this.updateDistance(p, c), "miter" === A) m._mult(_), this.addCurrentVertex(c, m, 0, 0, u); else if ("flipbevel" === A) { if (_ > 100) m = y.mult(-1); else { const t = _ * f.add(y).mag() / f.sub(y).mag(); m._perp()._mult(t * (w ? -1 : 1)); } this.addCurrentVertex(c, m, 0, 0, u), this.addCurrentVertex(c, m.mult(-1), 0, 0, u); } else if ("bevel" === A || "fakeround" === A) { const t = -Math.sqrt(_ * _ - 1), e = w ? t : 0, i = w ? 0 : t; if (p && this.addCurrentVertex(c, f, e, i, u), "fakeround" === A) { const t = Math.round(180 * v / Math.PI / 20); for (let e = 1; e < t; e++) { let i = e / t; if (.5 !== i) { const t = i - .5; i += i * t * (i - 1) * ((1.0904 + g * (g * (3.55645 - 1.43519 * g) - 3.2452)) * t * t + (.848013 + g * (.215638 * g - 1.06021))); } const r = y.sub(f)._mult(i)._add(f)._unit()._mult(w ? -1 : 1); this.addHalfVertex(c, r.x, r.y, !1, w, 0, u); } } d && this.addCurrentVertex(c, y, -e, -i, u); } else if ("butt" === A) this.addCurrentVertex(c, m, 0, 0, u); else if ("square" === A) { const t = p ? 1 : -1; p || this.addCurrentVertex(c, m, t, t, u), this.addCurrentVertex(c, m, 0, 0, u), p && this.addCurrentVertex(c, m, t, t, u); } else "round" === A && (p && (this.addCurrentVertex(c, f, 0, 0, u), this.addCurrentVertex(c, f, 1, 1, u, !0)), d && (this.addCurrentVertex(c, y, -1, -1, u, !0), this.addCurrentVertex(c, y, 0, 0, u))); if (b && e < o - 1) { const t = c.dist(d); if (t > 2 * h) { const e = c.add(d.sub(c)._mult(h / t)._round()); this.updateDistance(c, e), this.addCurrentVertex(e, y, 0, 0, u), c = e; } } } } addCurrentVertex(t, e, i, r, n, s = !1) { const a = e.y * r - e.x, o = -e.y - e.x * r; this.addHalfVertex(t, e.x + e.y * i, e.y - e.x * i, s, !1, i, n), this.addHalfVertex(t, a, o, s, !0, -r, n); } addHalfVertex({ x: t, y: e }, i, r, n, s, a, o) { this.layoutVertexArray.emplaceBack((t << 1) + (n ? 1 : 0), (e << 1) + (s ? 1 : 0), Math.round(63 * i) + 128, Math.round(63 * r) + 128, 1 + (0 === a ? 0 : a < 0 ? -1 : 1), 0, this.lineSoFar), this.lineClips && this.layoutVertexArray2.emplaceBack(this.scaledDistance, this.lineClipsArray.length); const l = o.vertexLength++; this.e1 >= 0 && this.e2 >= 0 && (this.indexArray.emplaceBack(this.e1, this.e2, l), o.primitiveLength++), s ? this.e2 = l : this.e1 = l; } updateScaledDistance() { if (this.lineClips) { const t = this.totalDistance / (this.lineClips.end - this.lineClips.start); this.scaledDistance = this.distance / this.totalDistance, this.lineSoFar = t * this.lineClips.start + this.distance; } else this.lineSoFar = this.distance; } updateDistance(t, e) { this.distance += t.dist(e), this.updateScaledDistance(); } } Rr("LineBucket", Au, { omit: ["layers", "patternFeatures"] }); const Su = new Ns({ "line-cap": new Us(X.layout_line["line-cap"]), "line-join": new Us(X.layout_line["line-join"]), "line-miter-limit": new Os(X.layout_line["line-miter-limit"]), "line-round-limit": new Os(X.layout_line["line-round-limit"]), "line-sort-key": new Us(X.layout_line["line-sort-key"]) }); var zu = { paint: new Ns({ "line-opacity": new Us(X.paint_line["line-opacity"]), "line-color": new Us(X.paint_line["line-color"]), "line-translate": new Os(X.paint_line["line-translate"]), "line-translate-anchor": new Os(X.paint_line["line-translate-anchor"]), "line-width": new Us(X.paint_line["line-width"]), "line-gap-width": new Us(X.paint_line["line-gap-width"]), "line-offset": new Us(X.paint_line["line-offset"]), "line-blur": new Us(X.paint_line["line-blur"]), "line-dasharray": new $s(X.paint_line["line-dasharray"]), "line-pattern": new $s(X.paint_line["line-pattern"]), "line-gradient": new qs(X.paint_line["line-gradient"]) }), layout: Su }; const Iu = new class extends Us { possiblyEvaluate(t, e) { return e = new Es(Math.floor(e.zoom), { now: e.now, fadeDuration: e.fadeDuration, zoomHistory: e.zoomHistory, transition: e.transition }), super.possiblyEvaluate(t, e) } evaluate(t, e, i, r) { return e = _({}, e, { zoom: Math.floor(e.zoom) }), super.evaluate(t, e, i, r) } }(zu.paint.properties["line-width"].specification); function Mu(t, e) { return e > 0 ? e + 2 * t : t } Iu.useIntegerZoom = !0; const Tu = Hs([{ name: "a_pos_offset", components: 4, type: "Int16" }, { name: "a_data", components: 4, type: "Uint16" }, { name: "a_pixeloffset", components: 4, type: "Int16" }], 4), Eu = Hs([{ name: "a_projected_pos", components: 3, type: "Float32" }], 4); Hs([{ name: "a_fade_opacity", components: 1, type: "Uint32" }], 4); const Cu = Hs([{ name: "a_placed", components: 2, type: "Uint8" }, { name: "a_shift", components: 2, type: "Float32" }]), Pu = Hs([{ name: "a_size_scale", components: 1, type: "Float32" }, { name: "a_padding", components: 2, type: "Float32" }]); Hs([{ type: "Int16", name: "anchorPointX" }, { type: "Int16", name: "anchorPointY" }, { type: "Float32", name: "x1" }, { type: "Float32", name: "y1" }, { type: "Float32", name: "x2" }, { type: "Float32", name: "y2" }, { type: "Int16", name: "padding" }, { type: "Uint32", name: "featureIndex" }, { type: "Uint16", name: "sourceLayerIndex" }, { type: "Uint16", name: "bucketIndex" }]); const Du = Hs([{ name: "a_pos", components: 2, type: "Int16" }, { name: "a_anchor_pos", components: 2, type: "Int16" }, { name: "a_extrude", components: 2, type: "Int16" }], 4), Bu = Hs([{ name: "a_pos_2f", components: 2, type: "Float32" }, { name: "a_radius", components: 1, type: "Float32" }, { name: "a_flags", components: 2, type: "Int16" }], 4); Hs([{ name: "triangle", components: 3, type: "Uint16" }]), Hs([{ type: "Int16", name: "anchorX" }, { type: "Int16", name: "anchorY" }, { type: "Uint16", name: "glyphStartIndex" }, { type: "Uint16", name: "numGlyphs" }, { type: "Uint32", name: "vertexStartIndex" }, { type: "Uint32", name: "lineStartIndex" }, { type: "Uint32", name: "lineLength" }, { type: "Uint16", name: "segment" }, { type: "Uint16", name: "lowerSize" }, { type: "Uint16", name: "upperSize" }, { type: "Float32", name: "lineOffsetX" }, { type: "Float32", name: "lineOffsetY" }, { type: "Uint8", name: "writingMode" }, { type: "Uint8", name: "placedOrientation" }, { type: "Uint8", name: "hidden" }, { type: "Uint32", name: "crossTileID" }, { type: "Int16", name: "associatedIconIndex" }, { type: "Uint8", name: "flipState" }]), Hs([{ type: "Int16", name: "anchorX" }, { type: "Int16", name: "anchorY" }, { type: "Int16", name: "rightJustifiedTextSymbolIndex" }, { type: "Int16", name: "centerJustifiedTextSymbolIndex" }, { type: "Int16", name: "leftJustifiedTextSymbolIndex" }, { type: "Int16", name: "verticalPlacedTextSymbolIndex" }, { type: "Int16", name: "placedIconSymbolIndex" }, { type: "Int16", name: "verticalPlacedIconSymbolIndex" }, { type: "Uint16", name: "key" }, { type: "Uint16", name: "textBoxStartIndex" }, { type: "Uint16", name: "textBoxEndIndex" }, { type: "Uint16", name: "verticalTextBoxStartIndex" }, { type: "Uint16", name: "verticalTextBoxEndIndex" }, { type: "Uint16", name: "iconBoxStartIndex" }, { type: "Uint16", name: "iconBoxEndIndex" }, { type: "Uint16", name: "verticalIconBoxStartIndex" }, { type: "Uint16", name: "verticalIconBoxEndIndex" }, { type: "Uint16", name: "featureIndex" }, { type: "Uint16", name: "numHorizontalGlyphVertices" }, { type: "Uint16", name: "numVerticalGlyphVertices" }, { type: "Uint16", name: "numIconVertices" }, { type: "Uint16", name: "numVerticalIconVertices" }, { type: "Uint16", name: "useRuntimeCollisionCircles" }, { type: "Uint32", name: "crossTileID" }, { type: "Float32", components: 2, name: "textOffset" }, { type: "Float32", name: "collisionCircleDiameter" }]), Hs([{ type: "Float32", name: "offsetX" }]), Hs([{ type: "Int16", name: "x" }, { type: "Int16", name: "y" }, { type: "Int16", name: "tileUnitDistanceFromAnchor" }]); var Vu = 24; const Lu = 128; function Fu(t, e) { const { expression: i } = e; if ("constant" === i.kind) return { kind: "constant", layoutSize: i.evaluate(new Es(t + 1)) }; if ("source" === i.kind) return { kind: "source" }; { const { zoomStops: e, interpolationType: r } = i; let n = 0; for (; n < e.length && e[n] <= t;)n++; n = Math.max(0, n - 1); let s = n; for (; s < e.length && e[s] < t + 1;)s++; s = Math.min(e.length - 1, s); const a = e[n], o = e[s]; return "composite" === i.kind ? { kind: "composite", minZoom: a, maxZoom: o, interpolationType: r } : { kind: "camera", minZoom: a, maxZoom: o, minSize: i.evaluate(new Es(a)), maxSize: i.evaluate(new Es(o)), interpolationType: r } } } function Ru(t, { uSize: e, uSizeT: i }, { lowerSize: r, upperSize: n }) { return "source" === t.kind ? r / Lu : "composite" === t.kind ? Ae(r / Lu, n / Lu, i) : e } function Ou(t, e) { let i = 0, r = 0; if ("constant" === t.kind) r = t.layoutSize; else if ("source" !== t.kind) { const { interpolationType: n, minZoom: s, maxZoom: a } = t, o = n ? y(je.interpolationFactor(n, e, s, a), 0, 1) : 0; "camera" === t.kind ? r = Ae(t.minSize, t.maxSize, o) : i = o; } return { uSizeT: i, uSize: r } } var Uu = Object.freeze({ __proto__: null, getSizeData: Fu, evaluateSizeForFeature: Ru, evaluateSizeForZoom: Ou, SIZE_PACK_FACTOR: Lu }); function $u(t, e, i) { return t.sections.forEach((t => { t.text = function (t, e, i) { const r = e.layout.get("text-transform").evaluate(i, {}); return "uppercase" === r ? t = t.toLocaleUpperCase() : "lowercase" === r && (t = t.toLocaleLowerCase()), Ts.applyArabicShaping && (t = Ts.applyArabicShaping(t)), t }(t.text, e, i); })), t } const Zu = { "!": "锔�", "#": "锛�", $: "锛�", "%": "锛�", "&": "锛�", "(": "锔�", ")": "锔�", "*": "锛�", "+": "锛�", ",": "锔�", "-": "锔�", ".": "銉�", "/": "锛�", ":": "锔�", ";": "锔�", "<": "锔�", "=": "锛�", ">": "锕€", "?": "锔�", "@": "锛�", "[": "锕�", "\\": "锛�", "]": "锕�", "^": "锛�", _: "锔�", "`": "锝€", "{": "锔�", "|": "鈥�", "}": "锔�", "~": "锝�", "垄": "锟�", "拢": "锟�", "楼": "锟�", "娄": "锟�", "卢": "锟�", "炉": "锟�", "鈥�": "锔�", "鈥�": "锔�", "鈥�": "锕�", "鈥�": "锕�", "鈥�": "锕�", "鈥�": "锕�", "鈥�": "锔�", "鈥�": "銉�", "鈧�": "锟�", "銆�": "锔�", "銆�": "锔�", "銆�": "锔�", "銆�": "锕€", "銆�": "锔�", "銆�": "锔�", "銆�": "锕�", "銆�": "锕�", "銆�": "锕�", "銆�": "锕�", "銆�": "锔�", "銆�": "锔�", "銆�": "锔�", "銆�": "锔�", "銆�": "锔�", "銆�": "锔�", "锛�": "锔�", "锛�": "锔�", "锛�": "锔�", "锛�": "锔�", "锛�": "锔�", "锛�": "銉�", "锛�": "锔�", "锛�": "锔�", "锛�": "锔�", "锛�": "锕€", "锛�": "锔�", "锛�": "锕�", "锛�": "锕�", "锛�": "锔�", "锝�": "锔�", "锝�": "鈥�", "锝�": "锔�", "锝�": "锔�", "锝�": "锔�", "锝�": "锔�", "锝�": "锕�", "锝�": "锕�" }; var qu = function (t, e, i, r, n) { var s, a, o = 8 * n - r - 1, l = (1 << o) - 1, h = l >> 1, u = -7, c = i ? n - 1 : 0, p = i ? -1 : 1, d = t[e + c]; for (c += p, s = d & (1 << -u) - 1, d >>= -u, u += o; u > 0; s = 256 * s + t[e + c], c += p, u -= 8); for (a = s & (1 << -u) - 1, s >>= -u, u += r; u > 0; a = 256 * a + t[e + c], c += p, u -= 8); if (0 === s) s = 1 - h; else { if (s === l) return a ? NaN : 1 / 0 * (d ? -1 : 1); a += Math.pow(2, r), s -= h; } return (d ? -1 : 1) * a * Math.pow(2, s - r) }, Nu = function (t, e, i, r, n, s) { var a, o, l, h = 8 * s - n - 1, u = (1 << h) - 1, c = u >> 1, p = 23 === n ? Math.pow(2, -24) - Math.pow(2, -77) : 0, d = r ? 0 : s - 1, f = r ? 1 : -1, y = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0; for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (o = isNaN(e) ? 1 : 0, a = u) : (a = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -a)) < 1 && (a--, l *= 2), (e += a + c >= 1 ? p / l : p * Math.pow(2, 1 - c)) * l >= 2 && (a++, l /= 2), a + c >= u ? (o = 0, a = u) : a + c >= 1 ? (o = (e * l - 1) * Math.pow(2, n), a += c) : (o = e * Math.pow(2, c - 1) * Math.pow(2, n), a = 0)); n >= 8; t[i + d] = 255 & o, d += f, o /= 256, n -= 8); for (a = a << n | o, h += n; h > 0; t[i + d] = 255 & a, d += f, a /= 256, h -= 8); t[i + d - f] |= 128 * y; }, ju = Gu; function Gu(t) { this.buf = ArrayBuffer.isView && ArrayBuffer.isView(t) ? t : new Uint8Array(t || 0), this.pos = 0, this.type = 0, this.length = this.buf.length; } Gu.Varint = 0, Gu.Fixed64 = 1, Gu.Bytes = 2, Gu.Fixed32 = 5; var Xu = 4294967296, Ku = 1 / Xu, Hu = "undefined" == typeof TextDecoder ? null : new TextDecoder("utf8"); function Wu(t) { return t.type === Gu.Bytes ? t.readVarint() + t.pos : t.pos + 1 } function Yu(t, e, i) { return i ? 4294967296 * e + (t >>> 0) : 4294967296 * (e >>> 0) + (t >>> 0) } function Ju(t, e, i) { var r = e <= 16383 ? 1 : e <= 2097151 ? 2 : e <= 268435455 ? 3 : Math.floor(Math.log(e) / (7 * Math.LN2)); i.realloc(r); for (var n = i.pos - 1; n >= t; n--)i.buf[n + r] = i.buf[n]; } function Qu(t, e) { for (var i = 0; i < t.length; i++)e.writeVarint(t[i]); } function tc(t, e) { for (var i = 0; i < t.length; i++)e.writeSVarint(t[i]); } function ec(t, e) { for (var i = 0; i < t.length; i++)e.writeFloat(t[i]); } function ic(t, e) { for (var i = 0; i < t.length; i++)e.writeDouble(t[i]); } function rc(t, e) { for (var i = 0; i < t.length; i++)e.writeBoolean(t[i]); } function nc(t, e) { for (var i = 0; i < t.length; i++)e.writeFixed32(t[i]); } function sc(t, e) { for (var i = 0; i < t.length; i++)e.writeSFixed32(t[i]); } function ac(t, e) { for (var i = 0; i < t.length; i++)e.writeFixed64(t[i]); } function oc(t, e) { for (var i = 0; i < t.length; i++)e.writeSFixed64(t[i]); } function lc(t, e) { return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + 16777216 * t[e + 3] } function hc(t, e, i) { t[i] = e, t[i + 1] = e >>> 8, t[i + 2] = e >>> 16, t[i + 3] = e >>> 24; } function uc(t, e) { return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + (t[e + 3] << 24) } function cc(t, e, i) { 1 === t && i.readMessage(pc, e); } function pc(t, e, i) { if (3 === t) { const { id: t, bitmap: r, width: n, height: s, left: a, top: o, advance: l } = i.readMessage(dc, {}); e.push({ id: t, bitmap: new El({ width: n + 6, height: s + 6 }, r), metrics: { width: n, height: s, left: a, top: o, advance: l } }); } } function dc(t, e, i) { 1 === t ? e.id = i.readVarint() : 2 === t ? e.bitmap = i.readBytes() : 3 === t ? e.width = i.readVarint() : 4 === t ? e.height = i.readVarint() : 5 === t ? e.left = i.readSVarint() : 6 === t ? e.top = i.readSVarint() : 7 === t && (e.advance = i.readVarint()); } function fc(t) { let e = 0, i = 0; for (const r of t) e += r.w * r.h, i = Math.max(i, r.w); t.sort(((t, e) => e.h - t.h)); const r = [{ x: 0, y: 0, w: Math.max(Math.ceil(Math.sqrt(e / .95)), i), h: 1 / 0 }]; let n = 0, s = 0; for (const e of t) for (let t = r.length - 1; t >= 0; t--) { const i = r[t]; if (!(e.w > i.w || e.h > i.h)) { if (e.x = i.x, e.y = i.y, s = Math.max(s, e.y + e.h), n = Math.max(n, e.x + e.w), e.w === i.w && e.h === i.h) { const e = r.pop(); t < r.length && (r[t] = e); } else e.h === i.h ? (i.x += e.w, i.w -= e.w) : e.w === i.w ? (i.y += e.h, i.h -= e.h) : (r.push({ x: i.x + e.w, y: i.y, w: i.w - e.w, h: e.h }), i.y += e.h, i.h -= e.h); break } } return { w: n, h: s, fill: e / (n * s) || 0 } } Gu.prototype = { destroy: function () { this.buf = null; }, readFields: function (t, e, i) { for (i = i || this.length; this.pos < i;) { var r = this.readVarint(), n = r >> 3, s = this.pos; this.type = 7 & r, t(n, e, this), this.pos === s && this.skip(r); } return e }, readMessage: function (t, e) { return this.readFields(t, e, this.readVarint() + this.pos) }, readFixed32: function () { var t = lc(this.buf, this.pos); return this.pos += 4, t }, readSFixed32: function () { var t = uc(this.buf, this.pos); return this.pos += 4, t }, readFixed64: function () { var t = lc(this.buf, this.pos) + lc(this.buf, this.pos + 4) * Xu; return this.pos += 8, t }, readSFixed64: function () { var t = lc(this.buf, this.pos) + uc(this.buf, this.pos + 4) * Xu; return this.pos += 8, t }, readFloat: function () { var t = qu(this.buf, this.pos, !0, 23, 4); return this.pos += 4, t }, readDouble: function () { var t = qu(this.buf, this.pos, !0, 52, 8); return this.pos += 8, t }, readVarint: function (t) { var e, i, r = this.buf; return e = 127 & (i = r[this.pos++]), i < 128 ? e : (e |= (127 & (i = r[this.pos++])) << 7, i < 128 ? e : (e |= (127 & (i = r[this.pos++])) << 14, i < 128 ? e : (e |= (127 & (i = r[this.pos++])) << 21, i < 128 ? e : function (t, e, i) { var r, n, s = i.buf; if (r = (112 & (n = s[i.pos++])) >> 4, n < 128) return Yu(t, r, e); if (r |= (127 & (n = s[i.pos++])) << 3, n < 128) return Yu(t, r, e); if (r |= (127 & (n = s[i.pos++])) << 10, n < 128) return Yu(t, r, e); if (r |= (127 & (n = s[i.pos++])) << 17, n < 128) return Yu(t, r, e); if (r |= (127 & (n = s[i.pos++])) << 24, n < 128) return Yu(t, r, e); if (r |= (1 & (n = s[i.pos++])) << 31, n < 128) return Yu(t, r, e); throw new Error("Expected varint not more than 10 bytes") }(e |= (15 & (i = r[this.pos])) << 28, t, this)))) }, readVarint64: function () { return this.readVarint(!0) }, readSVarint: function () { var t = this.readVarint(); return t % 2 == 1 ? (t + 1) / -2 : t / 2 }, readBoolean: function () { return Boolean(this.readVarint()) }, readString: function () { var t = this.readVarint() + this.pos, e = this.pos; return this.pos = t, t - e >= 12 && Hu ? function (t, e, i) { return Hu.decode(t.subarray(e, i)) }(this.buf, e, t) : function (t, e, i) { for (var r = "", n = e; n < i;) { var s, a, o, l = t[n], h = null, u = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1; if (n + u > i) break; 1 === u ? l < 128 && (h = l) : 2 === u ? 128 == (192 & (s = t[n + 1])) && (h = (31 & l) << 6 | 63 & s) <= 127 && (h = null) : 3 === u ? (a = t[n + 2], 128 == (192 & (s = t[n + 1])) && 128 == (192 & a) && ((h = (15 & l) << 12 | (63 & s) << 6 | 63 & a) <= 2047 || h >= 55296 && h <= 57343) && (h = null)) : 4 === u && (a = t[n + 2], o = t[n + 3], 128 == (192 & (s = t[n + 1])) && 128 == (192 & a) && 128 == (192 & o) && ((h = (15 & l) << 18 | (63 & s) << 12 | (63 & a) << 6 | 63 & o) <= 65535 || h >= 1114112) && (h = null)), null === h ? (h = 65533, u = 1) : h > 65535 && (h -= 65536, r += String.fromCharCode(h >>> 10 & 1023 | 55296), h = 56320 | 1023 & h), r += String.fromCharCode(h), n += u; } return r }(this.buf, e, t) }, readBytes: function () { var t = this.readVarint() + this.pos, e = this.buf.subarray(this.pos, t); return this.pos = t, e }, readPackedVarint: function (t, e) { if (this.type !== Gu.Bytes) return t.push(this.readVarint(e)); var i = Wu(this); for (t = t || []; this.pos < i;)t.push(this.readVarint(e)); return t }, readPackedSVarint: function (t) { if (this.type !== Gu.Bytes) return t.push(this.readSVarint()); var e = Wu(this); for (t = t || []; this.pos < e;)t.push(this.readSVarint()); return t }, readPackedBoolean: function (t) { if (this.type !== Gu.Bytes) return t.push(this.readBoolean()); var e = Wu(this); for (t = t || []; this.pos < e;)t.push(this.readBoolean()); return t }, readPackedFloat: function (t) { if (this.type !== Gu.Bytes) return t.push(this.readFloat()); var e = Wu(this); for (t = t || []; this.pos < e;)t.push(this.readFloat()); return t }, readPackedDouble: function (t) { if (this.type !== Gu.Bytes) return t.push(this.readDouble()); var e = Wu(this); for (t = t || []; this.pos < e;)t.push(this.readDouble()); return t }, readPackedFixed32: function (t) { if (this.type !== Gu.Bytes) return t.push(this.readFixed32()); var e = Wu(this); for (t = t || []; this.pos < e;)t.push(this.readFixed32()); return t }, readPackedSFixed32: function (t) { if (this.type !== Gu.Bytes) return t.push(this.readSFixed32()); var e = Wu(this); for (t = t || []; this.pos < e;)t.push(this.readSFixed32()); return t }, readPackedFixed64: function (t) { if (this.type !== Gu.Bytes) return t.push(this.readFixed64()); var e = Wu(this); for (t = t || []; this.pos < e;)t.push(this.readFixed64()); return t }, readPackedSFixed64: function (t) { if (this.type !== Gu.Bytes) return t.push(this.readSFixed64()); var e = Wu(this); for (t = t || []; this.pos < e;)t.push(this.readSFixed64()); return t }, skip: function (t) { var e = 7 & t; if (e === Gu.Varint) for (; this.buf[this.pos++] > 127;); else if (e === Gu.Bytes) this.pos = this.readVarint() + this.pos; else if (e === Gu.Fixed32) this.pos += 4; else { if (e !== Gu.Fixed64) throw new Error("Unimplemented type: " + e); this.pos += 8; } }, writeTag: function (t, e) { this.writeVarint(t << 3 | e); }, realloc: function (t) { for (var e = this.length || 16; e < this.pos + t;)e *= 2; if (e !== this.length) { var i = new Uint8Array(e); i.set(this.buf), this.buf = i, this.length = e; } }, finish: function () { return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length) }, writeFixed32: function (t) { this.realloc(4), hc(this.buf, t, this.pos), this.pos += 4; }, writeSFixed32: function (t) { this.realloc(4), hc(this.buf, t, this.pos), this.pos += 4; }, writeFixed64: function (t) { this.realloc(8), hc(this.buf, -1 & t, this.pos), hc(this.buf, Math.floor(t * Ku), this.pos + 4), this.pos += 8; }, writeSFixed64: function (t) { this.realloc(8), hc(this.buf, -1 & t, this.pos), hc(this.buf, Math.floor(t * Ku), this.pos + 4), this.pos += 8; }, writeVarint: function (t) { (t = +t || 0) > 268435455 || t < 0 ? function (t, e) { var i, r; if (t >= 0 ? (i = t % 4294967296 | 0, r = t / 4294967296 | 0) : (r = ~(-t / 4294967296), 4294967295 ^ (i = ~(-t % 4294967296)) ? i = i + 1 | 0 : (i = 0, r = r + 1 | 0)), t >= 0x10000000000000000 || t < -0x10000000000000000) throw new Error("Given varint doesn't fit into 10 bytes"); e.realloc(10), function (t, e, i) { i.buf[i.pos++] = 127 & t | 128, t >>>= 7, i.buf[i.pos++] = 127 & t | 128, t >>>= 7, i.buf[i.pos++] = 127 & t | 128, t >>>= 7, i.buf[i.pos++] = 127 & t | 128, i.buf[i.pos] = 127 & (t >>>= 7); }(i, 0, e), function (t, e) { var i = (7 & t) << 4; e.buf[e.pos++] |= i | ((t >>>= 3) ? 128 : 0), t && (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = 127 & t))))); }(r, e); }(t, this) : (this.realloc(4), this.buf[this.pos++] = 127 & t | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = t >>> 7 & 127)))); }, writeSVarint: function (t) { this.writeVarint(t < 0 ? 2 * -t - 1 : 2 * t); }, writeBoolean: function (t) { this.writeVarint(Boolean(t)); }, writeString: function (t) { t = String(t), this.realloc(4 * t.length), this.pos++; var e = this.pos; this.pos = function (t, e, i) { for (var r, n, s = 0; s < e.length; s++) { if ((r = e.charCodeAt(s)) > 55295 && r < 57344) { if (!n) { r > 56319 || s + 1 === e.length ? (t[i++] = 239, t[i++] = 191, t[i++] = 189) : n = r; continue } if (r < 56320) { t[i++] = 239, t[i++] = 191, t[i++] = 189, n = r; continue } r = n - 55296 << 10 | r - 56320 | 65536, n = null; } else n && (t[i++] = 239, t[i++] = 191, t[i++] = 189, n = null); r < 128 ? t[i++] = r : (r < 2048 ? t[i++] = r >> 6 | 192 : (r < 65536 ? t[i++] = r >> 12 | 224 : (t[i++] = r >> 18 | 240, t[i++] = r >> 12 & 63 | 128), t[i++] = r >> 6 & 63 | 128), t[i++] = 63 & r | 128); } return i }(this.buf, t, this.pos); var i = this.pos - e; i >= 128 && Ju(e, i, this), this.pos = e - 1, this.writeVarint(i), this.pos += i; }, writeFloat: function (t) { this.realloc(4), Nu(this.buf, t, this.pos, !0, 23, 4), this.pos += 4; }, writeDouble: function (t) { this.realloc(8), Nu(this.buf, t, this.pos, !0, 52, 8), this.pos += 8; }, writeBytes: function (t) { var e = t.length; this.writeVarint(e), this.realloc(e); for (var i = 0; i < e; i++)this.buf[this.pos++] = t[i]; }, writeRawMessage: function (t, e) { this.pos++; var i = this.pos; t(e, this); var r = this.pos - i; r >= 128 && Ju(i, r, this), this.pos = i - 1, this.writeVarint(r), this.pos += r; }, writeMessage: function (t, e, i) { this.writeTag(t, Gu.Bytes), this.writeRawMessage(e, i); }, writePackedVarint: function (t, e) { e.length && this.writeMessage(t, Qu, e); }, writePackedSVarint: function (t, e) { e.length && this.writeMessage(t, tc, e); }, writePackedBoolean: function (t, e) { e.length && this.writeMessage(t, rc, e); }, writePackedFloat: function (t, e) { e.length && this.writeMessage(t, ec, e); }, writePackedDouble: function (t, e) { e.length && this.writeMessage(t, ic, e); }, writePackedFixed32: function (t, e) { e.length && this.writeMessage(t, nc, e); }, writePackedSFixed32: function (t, e) { e.length && this.writeMessage(t, sc, e); }, writePackedFixed64: function (t, e) { e.length && this.writeMessage(t, ac, e); }, writePackedSFixed64: function (t, e) { e.length && this.writeMessage(t, oc, e); }, writeBytesField: function (t, e) { this.writeTag(t, Gu.Bytes), this.writeBytes(e); }, writeFixed32Field: function (t, e) { this.writeTag(t, Gu.Fixed32), this.writeFixed32(e); }, writeSFixed32Field: function (t, e) { this.writeTag(t, Gu.Fixed32), this.writeSFixed32(e); }, writeFixed64Field: function (t, e) { this.writeTag(t, Gu.Fixed64), this.writeFixed64(e); }, writeSFixed64Field: function (t, e) { this.writeTag(t, Gu.Fixed64), this.writeSFixed64(e); }, writeVarintField: function (t, e) { this.writeTag(t, Gu.Varint), this.writeVarint(e); }, writeSVarintField: function (t, e) { this.writeTag(t, Gu.Varint), this.writeSVarint(e); }, writeStringField: function (t, e) { this.writeTag(t, Gu.Bytes), this.writeString(e); }, writeFloatField: function (t, e) { this.writeTag(t, Gu.Fixed32), this.writeFloat(e); }, writeDoubleField: function (t, e) { this.writeTag(t, Gu.Fixed64), this.writeDouble(e); }, writeBooleanField: function (t, e) { this.writeVarintField(t, Boolean(e)); } }; class yc { constructor(t, { pixelRatio: e, version: i, stretchX: r, stretchY: n, content: s }) { this.paddedRect = t, this.pixelRatio = e, this.stretchX = r, this.stretchY = n, this.content = s, this.version = i; } get tl() { return [this.paddedRect.x + 1, this.paddedRect.y + 1] } get br() { return [this.paddedRect.x + this.paddedRect.w - 1, this.paddedRect.y + this.paddedRect.h - 1] } get displaySize() { return [(this.paddedRect.w - 2) / this.pixelRatio, (this.paddedRect.h - 2) / this.pixelRatio] } } class mc { constructor(t, e) { const i = {}, r = {}; this.haveRenderCallbacks = []; const n = []; this.addImages(t, i, n), this.addImages(e, r, n); const { w: s, h: a } = fc(n), o = new Cl({ width: s || 1, height: a || 1 }); for (const e in t) { const r = t[e], n = i[e].paddedRect; Cl.copy(r.data, o, { x: 0, y: 0 }, { x: n.x + 1, y: n.y + 1 }, r.data); } for (const t in e) { const i = e[t], n = r[t].paddedRect, s = n.x + 1, a = n.y + 1, l = i.data.width, h = i.data.height; Cl.copy(i.data, o, { x: 0, y: 0 }, { x: s, y: a }, i.data), Cl.copy(i.data, o, { x: 0, y: h - 1 }, { x: s, y: a - 1 }, { width: l, height: 1 }), Cl.copy(i.data, o, { x: 0, y: 0 }, { x: s, y: a + h }, { width: l, height: 1 }), Cl.copy(i.data, o, { x: l - 1, y: 0 }, { x: s - 1, y: a }, { width: 1, height: h }), Cl.copy(i.data, o, { x: 0, y: 0 }, { x: s + l, y: a }, { width: 1, height: h }); } this.image = o, this.iconPositions = i, this.patternPositions = r; } addImages(t, e, i) { for (const r in t) { const n = t[r], s = { x: 0, y: 0, w: n.data.width + 2, h: n.data.height + 2 }; i.push(s), e[r] = new yc(s, n), n.hasRenderCallback && this.haveRenderCallbacks.push(r); } } patchUpdatedImages(t, e) { t.dispatchRenderCallbacks(this.haveRenderCallbacks); for (const i in t.updatedImages) this.patchUpdatedImage(this.iconPositions[i], t.getImage(i), e), this.patchUpdatedImage(this.patternPositions[i], t.getImage(i), e); } patchUpdatedImage(t, e, i) { if (!t || !e) return; if (t.version === e.version) return; t.version = e.version; const [r, n] = t.tl; i.update(e.data, void 0, { x: r, y: n }); } } Rr("ImagePosition", yc), Rr("ImageAtlas", mc); const gc = { horizontal: 1, vertical: 2, horizontalOnly: 3 }, xc = -17; class _c { constructor() { this.scale = 1, this.fontStack = "", this.imageName = null; } static forText(t, e) { const i = new _c; return i.scale = t || 1, i.fontStack = e, i } static forImage(t) { const e = new _c; return e.imageName = t, e } } class vc { constructor() { this.text = "", this.sectionIndex = [], this.sections = [], this.imageSectionID = null; } static fromFeature(t, e) { const i = new vc; for (let r = 0; r < t.sections.length; r++) { const n = t.sections[r]; n.image ? i.addImageSection(n) : i.addTextSection(n, e); } return i } length() { return this.text.length } getSection(t) { return this.sections[this.sectionIndex[t]] } getSectionIndex(t) { return this.sectionIndex[t] } getCharCode(t) { return this.text.charCodeAt(t) } verticalizePunctuation() { this.text = function (t) { let e = ""; for (let i = 0; i < t.length; i++) { const r = t.charCodeAt(i + 1) || null, n = t.charCodeAt(i - 1) || null; e += r && kn(r) && !Zu[t[i + 1]] || n && kn(n) && !Zu[t[i - 1]] || !Zu[t[i]] ? t[i] : Zu[t[i]]; } return e }(this.text); } trim() { let t = 0; for (let e = 0; e < this.text.length && wc[this.text.charCodeAt(e)]; e++)t++; let e = this.text.length; for (let i = this.text.length - 1; i >= 0 && i >= t && wc[this.text.charCodeAt(i)]; i--)e--; this.text = this.text.substring(t, e), this.sectionIndex = this.sectionIndex.slice(t, e); } substring(t, e) { const i = new vc; return i.text = this.text.substring(t, e), i.sectionIndex = this.sectionIndex.slice(t, e), i.sections = this.sections, i } toString() { return this.text } getMaxScale() { return this.sectionIndex.reduce(((t, e) => Math.max(t, this.sections[e].scale)), 0) } addTextSection(t, e) { this.text += t.text, this.sections.push(_c.forText(t.scale, t.fontStack || e)); const i = this.sections.length - 1; for (let e = 0; e < t.text.length; ++e)this.sectionIndex.push(i); } addImageSection(t) { const e = t.image ? t.image.name : ""; if (0 === e.length) return void C("Can't add FormattedSection with an empty image."); const i = this.getNextImageSectionCharCode(); i ? (this.text += String.fromCharCode(i), this.sections.push(_c.forImage(e)), this.sectionIndex.push(this.sections.length - 1)) : C("Reached maximum number of images 6401"); } getNextImageSectionCharCode() { return this.imageSectionID ? this.imageSectionID >= 63743 ? null : ++this.imageSectionID : (this.imageSectionID = 57344, this.imageSectionID) } } function bc(t, e, i, r, n, s, a, o, l, h, u, c, p, d, f, y) { const m = vc.fromFeature(t, n); let g; c === gc.vertical && m.verticalizePunctuation(); const { processBidirectionalText: x, processStyledBidirectionalText: _ } = Ts; if (x && 1 === m.sections.length) { g = []; const t = x(m.toString(), Tc(m, h, s, e, r, d, f)); for (const e of t) { const t = new vc; t.text = e, t.sections = m.sections; for (let i = 0; i < e.length; i++)t.sectionIndex.push(0); g.push(t); } } else if (_) { g = []; const t = _(m.text, m.sectionIndex, Tc(m, h, s, e, r, d, f)); for (const e of t) { const t = new vc; t.text = e[0], t.sectionIndex = e[1], t.sections = m.sections, g.push(t); } } else g = function (t, e) { const i = [], r = t.text; let n = 0; for (const r of e) i.push(t.substring(n, r)), n = r; return n < r.length && i.push(t.substring(n, r.length)), i }(m, Tc(m, h, s, e, r, d, f)); const v = [], b = { positionedLines: v, text: m.toString(), top: u[1], bottom: u[1], left: u[0], right: u[0], writingMode: c, iconsInText: !1, verticalizable: !1 }; return function (t, e, i, r, n, s, a, o, l, h, u, c) { let p = 0, d = xc, f = 0, y = 0; const m = "right" === o ? 1 : "left" === o ? 0 : .5; let g = 0; for (const a of n) { a.trim(); const n = a.getMaxScale(), o = (n - 1) * Vu, _ = { positionedGlyphs: [], lineOffset: 0 }; t.positionedLines[g] = _; const v = _.positionedGlyphs; let b = 0; if (!a.length()) { d += s, ++g; continue } for (let s = 0; s < a.length(); s++) { const f = a.getSection(s), y = a.getSectionIndex(s), m = a.getCharCode(s); let g = 0, _ = null, w = null, k = null, A = Vu; const S = !(l === gc.horizontal || !u && !wn(m) || u && (wc[m] || (x = m, jr(x) || Gr(x) || Xr(x) || dn(x) || gn(x)))); if (f.imageName) { const e = r[f.imageName]; if (!e) continue; k = f.imageName, t.iconsInText = t.iconsInText || !0, w = e.paddedRect; const i = e.displaySize; f.scale = f.scale * Vu / c, _ = { width: i[0], height: i[1], left: 1, top: -3, advance: S ? i[1] : i[0], localGlyph: !1 }, g = o + (Vu - i[1] * f.scale), A = _.advance; const s = S ? i[0] * f.scale - Vu * n : i[1] * f.scale - Vu * n; s > 0 && s > b && (b = s); } else { const t = i[f.fontStack], r = t && t[m]; if (r && r.rect) w = r.rect, _ = r.metrics; else { const t = e[f.fontStack], i = t && t[m]; if (!i) continue; _ = i.metrics; } g = (n - f.scale) * Vu; } S ? (t.verticalizable = !0, v.push({ glyph: m, imageName: k, x: p, y: d + g, vertical: S, scale: f.scale, localGlyph: _.localGlyph, fontStack: f.fontStack, sectionIndex: y, metrics: _, rect: w }), p += A * f.scale + h) : (v.push({ glyph: m, imageName: k, x: p, y: d + g, vertical: S, scale: f.scale, localGlyph: _.localGlyph, fontStack: f.fontStack, sectionIndex: y, metrics: _, rect: w }), p += _.advance * f.scale + h); } 0 !== v.length && (f = Math.max(p - h, f), Cc(v, 0, v.length - 1, m, b)), p = 0; const w = s * n + b; _.lineOffset = Math.max(b, o), d += w, y = Math.max(w, y), ++g; } var x; const _ = d - xc, { horizontalAlign: v, verticalAlign: b } = Ec(a); ((function (t, e, i, r, n, s, a, o, l) { const h = (e - i) * n; let u = 0; u = s !== a ? -o * r - xc : (-r * l + .5) * a; for (const e of t) for (const t of e.positionedGlyphs) t.x += h, t.y += u; }))(t.positionedLines, m, v, b, f, y, s, _, n.length), t.top += -b * _, t.bottom = t.top + _, t.left += -v * f, t.right = t.left + f; }(b, e, i, r, g, a, o, l, c, h, p, y), !function (t) { for (const e of t) if (0 !== e.positionedGlyphs.length) return !1; return !0 }(v) && b } const wc = { 9: !0, 10: !0, 11: !0, 12: !0, 13: !0, 32: !0 }, kc = { 10: !0, 32: !0, 38: !0, 40: !0, 41: !0, 43: !0, 45: !0, 47: !0, 173: !0, 183: !0, 8203: !0, 8208: !0, 8211: !0, 8231: !0 }; function Ac(t, e, i, r, n, s) { if (e.imageName) { const t = r[e.imageName]; return t ? t.displaySize[0] * e.scale * Vu / s + n : 0 } { const r = i[e.fontStack], s = r && r[t]; return s ? s.metrics.advance * e.scale + n : 0 } } function Sc(t, e, i, r) { const n = Math.pow(t - e, 2); return r ? t < e ? n / 2 : 2 * n : n + Math.abs(i) * i } function zc(t, e, i) { let r = 0; return 10 === t && (r -= 1e4), i && (r += 150), 40 !== t && 65288 !== t || (r += 50), 41 !== e && 65289 !== e || (r += 50), r } function Ic(t, e, i, r, n, s) { let a = null, o = Sc(e, i, n, s); for (const t of r) { const r = Sc(e - t.x, i, n, s) + t.badness; r <= o && (a = t, o = r); } return { index: t, x: e, priorBreak: a, badness: o } } function Mc(t) { return t ? Mc(t.priorBreak).concat(t.index) : [] } function Tc(t, e, i, r, n, s, a) { if ("point" !== s) return []; if (!t) return []; const o = [], l = function (t, e, i, r, n, s) { let a = 0; for (let i = 0; i < t.length(); i++) { const o = t.getSection(i); a += Ac(t.getCharCode(i), o, r, n, e, s); } return a / Math.max(1, Math.ceil(a / i)) }(t, e, i, r, n, a), h = t.text.indexOf("鈥�") >= 0; let u = 0; for (let i = 0; i < t.length(); i++) { const s = t.getSection(i), p = t.getCharCode(i); if (wc[p] || (u += Ac(p, s, r, n, e, a)), i < t.length() - 1) { const e = !((c = p) < 11904 || !(en(c) || tn(c) || yn(c) || pn(c) || an(c) || Kr(c) || rn(c) || Yr(c) || on(c) || ln(c) || sn(c) || xn(c) || Jr(c) || Wr(c) || Hr(c) || nn(c) || Qr(c) || fn(c) || un(c) || hn(c))); (kc[p] || e || s.imageName) && o.push(Ic(i + 1, u, l, o, zc(p, t.getCharCode(i + 1), e && h), !1)); } } var c; return Mc(Ic(t.length(), u, l, o, 0, !0)) } function Ec(t) { let e = .5, i = .5; switch (t) { case "right": case "top-right": case "bottom-right": e = 1; break; case "left": case "top-left": case "bottom-left": e = 0; }switch (t) { case "bottom": case "bottom-right": case "bottom-left": i = 1; break; case "top": case "top-right": case "top-left": i = 0; }return { horizontalAlign: e, verticalAlign: i } } function Cc(t, e, i, r, n) { if (!r && !n) return; const s = t[i], a = (t[i].x + s.metrics.advance * s.scale) * r; for (let r = e; r <= i; r++)t[r].x -= a, t[r].y += n; } function Pc(t, e, i) { const { horizontalAlign: r, verticalAlign: n } = Ec(i), s = e[0] - t.displaySize[0] * r, a = e[1] - t.displaySize[1] * n; return { image: t, top: a, bottom: a + t.displaySize[1], left: s, right: s + t.displaySize[0] } } function Dc(t, e, i, r, n, s) { const a = t.image; let o; if (a.content) { const t = a.content, e = a.pixelRatio || 1; o = [t[0] / e, t[1] / e, a.displaySize[0] - t[2] / e, a.displaySize[1] - t[3] / e]; } const l = e.left * s, h = e.right * s; let u, c, p, d; "width" === i || "both" === i ? (d = n[0] + l - r[3], c = n[0] + h + r[1]) : (d = n[0] + (l + h - a.displaySize[0]) / 2, c = d + a.displaySize[0]); const f = e.top * s, y = e.bottom * s; return "height" === i || "both" === i ? (u = n[1] + f - r[0], p = n[1] + y + r[2]) : (u = n[1] + (f + y - a.displaySize[1]) / 2, p = u + a.displaySize[1]), { image: a, top: u, right: c, bottom: p, left: d, collisionPadding: o } } class Bc extends i { constructor(t, e, i, r) { super(t, e), this.angle = i, void 0 !== r && (this.segment = r); } clone() { return new Bc(this.x, this.y, this.angle, this.segment) } } function Vc(t, e, i, r, n) { if (void 0 === e.segment) return !0; let s = e, a = e.segment + 1, o = 0; for (; o > -i / 2;) { if (a--, a < 0) return !1; o -= t[a].dist(s), s = t[a]; } o += t[a].dist(t[a + 1]), a++; const l = []; let h = 0; for (; o < i / 2;) { const e = t[a], i = t[a + 1]; if (!i) return !1; let s = t[a - 1].angleTo(e) - e.angleTo(i); for (s = Math.abs((s + 3 * Math.PI) % (2 * Math.PI) - Math.PI), l.push({ distance: o, angleDelta: s }), h += s; o - l[0].distance > r;)h -= l.shift().angleDelta; if (h > n) return !1; a++, o += e.dist(i); } return !0 } function Lc(t) { let e = 0; for (let i = 0; i < t.length - 1; i++)e += t[i].dist(t[i + 1]); return e } function Fc(t, e, i) { return t ? .6 * e * i : 0 } function Rc(t, e) { return Math.max(t ? t.right - t.left : 0, e ? e.right - e.left : 0) } function Oc(t, e, i, r, n, s) { const a = Fc(i, n, s), o = Rc(i, r) * s; let l = 0; const h = Lc(t) / 2; for (let i = 0; i < t.length - 1; i++) { const r = t[i], n = t[i + 1], s = r.dist(n); if (l + s > h) { const u = (h - l) / s, c = Ae(r.x, n.x, u), p = Ae(r.y, n.y, u), d = new Bc(c, p, n.angleTo(r), i); return d._round(), !a || Vc(t, d, o, a, e) ? d : void 0 } l += s; } } function Uc(t, e, i, r, n, s, a, o, l) { const h = Fc(r, s, a), u = Rc(r, n), c = u * a, p = 0 === t[0].x || t[0].x === l || 0 === t[0].y || t[0].y === l; return e - c < e / 4 && (e = c + e / 4), $c(t, p ? e / 2 * o % e : (u / 2 + 2 * s) * a * o % e, e, h, i, c, p, !1, l) } function $c(t, e, i, r, n, s, a, o, l) { const h = s / 2, u = Lc(t); let c = 0, p = e - i, d = []; for (let e = 0; e < t.length - 1; e++) { const a = t[e], o = t[e + 1], f = a.dist(o), y = o.angleTo(a); for (; p + i < c + f;) { p += i; const m = (p - c) / f, g = Ae(a.x, o.x, m), x = Ae(a.y, o.y, m); if (g >= 0 && g < l && x >= 0 && x < l && p - h >= 0 && p + h <= u) { const i = new Bc(g, x, y, e); i._round(), r && !Vc(t, i, s, r, n) || d.push(i); } } c += f; } return o || d.length || a || (d = $c(t, c / 2, i, r, n, s, a, !0, l)), d } function Zc(t, e, r, n, s) { const a = []; for (let o = 0; o < t.length; o++) { const l = t[o]; let h; for (let t = 0; t < l.length - 1; t++) { let o = l[t], u = l[t + 1]; o.x < e && u.x < e || (o.x < e ? o = new i(e, o.y + (e - o.x) / (u.x - o.x) * (u.y - o.y))._round() : u.x < e && (u = new i(e, o.y + (e - o.x) / (u.x - o.x) * (u.y - o.y))._round()), o.y < r && u.y < r || (o.y < r ? o = new i(o.x + (r - o.y) / (u.y - o.y) * (u.x - o.x), r)._round() : u.y < r && (u = new i(o.x + (r - o.y) / (u.y - o.y) * (u.x - o.x), r)._round()), o.x >= n && u.x >= n || (o.x >= n ? o = new i(n, o.y + (n - o.x) / (u.x - o.x) * (u.y - o.y))._round() : u.x >= n && (u = new i(n, o.y + (n - o.x) / (u.x - o.x) * (u.y - o.y))._round()), o.y >= s && u.y >= s || (o.y >= s ? o = new i(o.x + (s - o.y) / (u.y - o.y) * (u.x - o.x), s)._round() : u.y >= s && (u = new i(o.x + (s - o.y) / (u.y - o.y) * (u.x - o.x), s)._round()), h && o.equals(h[h.length - 1]) || (h = [o], a.push(h)), h.push(u))))); } } return a } Rr("Anchor", Bc); var qc = Gc, Nc = Gc, jc = 1e20; function Gc(t, e, i, r, n, s) { this.fontSize = t || 24, this.buffer = void 0 === e ? 3 : e, this.cutoff = r || .25, this.fontFamily = n || "sans-serif", this.fontWeight = s || "normal", this.radius = i || 8; var a = this.size = this.fontSize + 2 * this.buffer, o = a + 2 * this.buffer; this.canvas = document.createElement("canvas"), this.canvas.width = this.canvas.height = a, this.ctx = this.canvas.getContext("2d"), this.ctx.font = this.fontWeight + " " + this.fontSize + "px " + this.fontFamily, this.ctx.textAlign = "left", this.ctx.fillStyle = "black", this.gridOuter = new Float64Array(o * o), this.gridInner = new Float64Array(o * o), this.f = new Float64Array(o), this.z = new Float64Array(o + 1), this.v = new Uint16Array(o), this.useMetrics = void 0 !== this.ctx.measureText("A").actualBoundingBoxLeft, this.middle = Math.round(a / 2 * (navigator.userAgent.indexOf("Gecko/") >= 0 ? 1.2 : 1)); } function Xc(t, e, i, r, n, s) { for (var a = 0; a < e; a++)Kc(t, a, e, i, r, n, s); for (var o = 0; o < i; o++)Kc(t, o * e, 1, e, r, n, s); } function Kc(t, e, i, r, n, s, a) { var o, l, h, u; for (s[0] = 0, a[0] = -jc, a[1] = jc, o = 0; o < r; o++)n[o] = t[e + o * i]; for (o = 1, l = 0, h = 0; o < r; o++) { do { h = (n[o] - n[u = s[l]] + o * o - u * u) / (o - u) / 2; } while (h <= a[l] && --l > -1); s[++l] = o, a[l] = h, a[l + 1] = jc; } for (o = 0, l = 0; o < r; o++) { for (; a[l + 1] < o;)l++; t[e + o * i] = n[u = s[l]] + (o - u) * (o - u); } } Gc.prototype._draw = function (t, e) { var i, r, n, s, a, o, l, h, u, c = this.ctx.measureText(t), p = c.width, d = 2 * this.buffer; e && this.useMetrics ? (a = Math.floor(c.actualBoundingBoxAscent), h = this.buffer + Math.ceil(c.actualBoundingBoxAscent), o = this.buffer, l = this.buffer, i = (r = Math.min(this.size, Math.ceil(c.actualBoundingBoxRight - c.actualBoundingBoxLeft))) + d, n = (s = Math.min(this.size - o, Math.ceil(c.actualBoundingBoxAscent + c.actualBoundingBoxDescent))) + d, this.ctx.textBaseline = "alphabetic") : (i = r = this.size, n = s = this.size, a = 19 * this.fontSize / 24, o = l = 0, h = this.middle, this.ctx.textBaseline = "middle"), r && s && (this.ctx.clearRect(l, o, r, s), this.ctx.fillText(t, this.buffer, h), u = this.ctx.getImageData(l, o, r, s)); var f = new Uint8ClampedArray(i * n); return function (t, e, i, r, n, s, a) { s.fill(jc, 0, e * i), a.fill(0, 0, e * i); for (var o = (e - r) / 2, l = 0; l < n; l++)for (var h = 0; h < r; h++) { var u = (l + o) * e + h + o, c = t.data[4 * (l * r + h) + 3] / 255; if (1 === c) s[u] = 0, a[u] = jc; else if (0 === c) s[u] = jc, a[u] = 0; else { var p = Math.max(0, .5 - c), d = Math.max(0, c - .5); s[u] = p * p, a[u] = d * d; } } }(u, i, n, r, s, this.gridOuter, this.gridInner), Xc(this.gridOuter, i, n, this.f, this.v, this.z), Xc(this.gridInner, i, n, this.f, this.v, this.z), function (t, e, i, r, n, s, a) { for (var o = 0; o < e * i; o++) { var l = Math.sqrt(r[o]) - Math.sqrt(n[o]); t[o] = Math.round(255 - 255 * (l / s + a)); } }(f, i, n, this.gridOuter, this.gridInner, this.radius, this.cutoff), { data: f, metrics: { width: r, height: s, sdfWidth: i, sdfHeight: n, top: a, left: 0, advance: p } } }, Gc.prototype.draw = function (t) { return this._draw(t, !1).data }, Gc.prototype.drawWithMetrics = function (t) { return this._draw(t, !0) }, qc.default = Nc; const Hc = { none: 0, ideographs: 1, all: 2 }; class Wc { constructor(t, e, i, r) { this.requestManager = t, this.localGlyphMode = e, this.localFontFamily = i, this.localIdeographFontWeight = r, this.entries = {}, this.localGlyphs = { 200: {}, 400: {}, 500: {}, 900: {} }; } setURL(t) { this.url = t; } getGlyphs(t, e) { const i = []; for (const e in t) for (const r of t[e]) i.push({ stack: e, id: r }); g(i, (({ stack: t, id: e }, i) => { let r = this.entries[t]; r || (r = this.entries[t] = { glyphs: {}, requests: {}, ranges: {} }); let n = r.glyphs[e]; if (void 0 !== n) return void i(null, { stack: t, id: e, glyph: n }); if (n = this._tinySDF(r, t, e), n) return r.glyphs[e] = n, void i(null, { stack: t, id: e, glyph: n }); const s = Math.floor(e / 256); if (256 * s > 65535) return void i(new Error("glyphs > 65535 not supported")); if (r.ranges[s]) return void i(null, { stack: t, id: e, glyph: n }); let a = r.requests[s]; a || (a = r.requests[s] = [], Wc.loadGlyphRange(t, s, this.url, this.requestManager, ((t, e) => { if (e) { for (const t in e) this._doesCharSupportLocalGlyph(+t) || (r.glyphs[+t] = e[+t]); r.ranges[s] = !0; } for (const i of a) i(t, e); delete r.requests[s]; }))), a.push(((r, n) => { r ? i(r) : n && i(null, { stack: t, id: e, glyph: n[e] || null }); })); }), ((t, i) => { if (t) e(t); else if (i) { const t = {}; for (const { stack: e, id: r, glyph: n } of i) (t[e] || (t[e] = {}))[r] = n && { id: n.id, bitmap: n.bitmap.clone(), metrics: n.metrics }; e(null, t); } })); } _doesCharSupportLocalGlyph(t) { return this.localGlyphMode !== Hc.none && (this.localGlyphMode === Hc.all ? !!this.localFontFamily : !!this.localFontFamily && (ln(t) || cn(t) || xn(t) || yn(t) || Yr(t) || Nr(t) || Jr(t) || Qr(t))) } _tinySDF(t, e, i) { const r = this.localFontFamily; if (!r) return; if (!this._doesCharSupportLocalGlyph(i)) return; let n = t.tinySDF; if (!n) { let i = this.localIdeographFontWeight || "500"; /bold/i.test(e) ? i = "900" : /medium/i.test(e) ? i = "500" : /light/i.test(e) && (i = "200"), n = t.tinySDF = new Wc.TinySDF(48, 6, 16, .25, r, i); } if (this.localGlyphs[n.fontWeight][i]) return this.localGlyphs[n.fontWeight][i]; const { data: s, metrics: a } = n.drawWithMetrics(String.fromCharCode(i)), { sdfWidth: o, sdfHeight: l, width: h, height: u, left: c, top: p, advance: d } = a; return this.localGlyphs[n.fontWeight][i] = { id: i, bitmap: new El({ width: o, height: l }, s), metrics: { width: h / 2, height: u / 2, left: c / 2, top: p / 2 - 23, advance: d / 2, localGlyph: !0 } } } } function Yc(t, e, r, n) { const s = [], a = t.image, o = a.pixelRatio, l = a.paddedRect.w - 2, h = a.paddedRect.h - 2, u = t.right - t.left, c = t.bottom - t.top, p = a.stretchX || [[0, l]], d = a.stretchY || [[0, h]], f = (t, e) => t + e[1] - e[0], y = p.reduce(f, 0), m = d.reduce(f, 0), g = l - y, x = h - m; let _ = 0, v = y, b = 0, w = m, k = 0, A = g, S = 0, z = x; if (a.content && n) { const t = a.content; _ = Jc(p, 0, t[0]), b = Jc(d, 0, t[1]), v = Jc(p, t[0], t[2]), w = Jc(d, t[1], t[3]), k = t[0] - _, S = t[1] - b, A = t[2] - t[0] - v, z = t[3] - t[1] - w; } const I = (n, s, l, h) => { const p = tp(n.stretch - _, v, u, t.left), d = ep(n.fixed - k, A, n.stretch, y), f = tp(s.stretch - b, w, c, t.top), g = ep(s.fixed - S, z, s.stretch, m), x = tp(l.stretch - _, v, u, t.left), I = ep(l.fixed - k, A, l.stretch, y), M = tp(h.stretch - b, w, c, t.top), T = ep(h.fixed - S, z, h.stretch, m), E = new i(p, f), C = new i(x, f), P = new i(x, M), D = new i(p, M), B = new i(d / o, g / o), V = new i(I / o, T / o), L = e * Math.PI / 180; if (L) { const t = Math.sin(L), e = Math.cos(L), i = [e, -t, t, e]; E._matMult(i), C._matMult(i), D._matMult(i), P._matMult(i); } const F = n.stretch + n.fixed, R = s.stretch + s.fixed; return { tl: E, tr: C, bl: D, br: P, tex: { x: a.paddedRect.x + 1 + F, y: a.paddedRect.y + 1 + R, w: l.stretch + l.fixed - F, h: h.stretch + h.fixed - R }, writingMode: void 0, glyphOffset: [0, 0], sectionIndex: 0, pixelOffsetTL: B, pixelOffsetBR: V, minFontScaleX: A / o / u, minFontScaleY: z / o / c, isSDF: r } }; if (n && (a.stretchX || a.stretchY)) { const t = Qc(p, g, y), e = Qc(d, x, m); for (let i = 0; i < t.length - 1; i++) { const r = t[i], n = t[i + 1]; for (let t = 0; t < e.length - 1; t++)s.push(I(r, e[t], n, e[t + 1])); } } else s.push(I({ fixed: 0, stretch: -1 }, { fixed: 0, stretch: -1 }, { fixed: 0, stretch: l + 1 }, { fixed: 0, stretch: h + 1 })); return s } function Jc(t, e, i) { let r = 0; for (const n of t) r += Math.max(e, Math.min(i, n[1])) - Math.max(e, Math.min(i, n[0])); return r } function Qc(t, e, i) { const r = [{ fixed: -1, stretch: 0 }]; for (const [e, i] of t) { const t = r[r.length - 1]; r.push({ fixed: e - t.stretch, stretch: t.stretch }), r.push({ fixed: e - t.stretch, stretch: t.stretch + (i - e) }); } return r.push({ fixed: e + 1, stretch: i }), r } function tp(t, e, i, r) { return t / e * i + r } function ep(t, e, i, r) { return t - e * i / r } Wc.loadGlyphRange = function (t, e, i, r, n) { const s = 256 * e, a = s + 255, o = r.transformRequest(r.normalizeGlyphsURL(i).replace("{glyphs_address}", "webmap-vs.sf-express.com/MapVTService").replace("{fontstack}", t).replace("{range}", `${s}-${a}`), ss.Glyphs); hs(o, ((t, e) => { if (t) n(t); else if (e) { const t = {}; for (const i of function (t) { return new ju(t).readFields(cc, []) }(e)) t[i.id] = i; n(null, t); } })); }, Wc.TinySDF = qc; class ip { constructor(t = [], e = rp) { if (this.data = t, this.length = this.data.length, this.compare = e, this.length > 0) for (let t = (this.length >> 1) - 1; t >= 0; t--)this._down(t); } push(t) { this.data.push(t), this.length++, this._up(this.length - 1); } pop() { if (0 === this.length) return; const t = this.data[0], e = this.data.pop(); return this.length--, this.length > 0 && (this.data[0] = e, this._down(0)), t } peek() { return this.data[0] } _up(t) { const { data: e, compare: i } = this, r = e[t]; for (; t > 0;) { const n = t - 1 >> 1, s = e[n]; if (i(r, s) >= 0) break; e[t] = s, t = n; } e[t] = r; } _down(t) { const { data: e, compare: i } = this, r = this.length >> 1, n = e[t]; for (; t < r;) { let r = 1 + (t << 1), s = e[r]; const a = r + 1; if (a < this.length && i(e[a], s) < 0 && (r = a, s = e[a]), i(s, n) >= 0) break; e[t] = s, t = r; } e[t] = n; } } function rp(t, e) { return t < e ? -1 : t > e ? 1 : 0 } function np(t, e = 1, r = !1) { let n = 1 / 0, s = 1 / 0, a = -1 / 0, o = -1 / 0; const l = t[0]; for (let t = 0; t < l.length; t++) { const e = l[t]; (!t || e.x < n) && (n = e.x), (!t || e.y < s) && (s = e.y), (!t || e.x > a) && (a = e.x), (!t || e.y > o) && (o = e.y); } const h = Math.min(a - n, o - s); let u = h / 2; const c = new ip([], sp); if (0 === h) return new i(n, s); for (let e = n; e < a; e += h)for (let i = s; i < o; i += h)c.push(new ap(e + u, i + u, u, t)); let p = function (t) { let e = 0, i = 0, r = 0; const n = t[0]; for (let t = 0, s = n.length, a = s - 1; t < s; a = t++) { const s = n[t], o = n[a], l = s.x * o.y - o.x * s.y; i += (s.x + o.x) * l, r += (s.y + o.y) * l, e += 3 * l; } return new ap(i / e, r / e, 0, t) }(t), d = c.length; for (; c.length;) { const i = c.pop(); (i.d > p.d || !p.d) && (p = i, r && console.log("found best %d after %d probes", Math.round(1e4 * i.d) / 1e4, d)), i.max - p.d <= e || (u = i.h / 2, c.push(new ap(i.p.x - u, i.p.y - u, u, t)), c.push(new ap(i.p.x + u, i.p.y - u, u, t)), c.push(new ap(i.p.x - u, i.p.y + u, u, t)), c.push(new ap(i.p.x + u, i.p.y + u, u, t)), d += 4); } return r && (console.log(`num probes: ${d}`), console.log(`best distance: ${p.d}`)), p.p } function sp(t, e) { return e.max - t.max } function ap(t, e, r, n) { this.p = new i(t, e), this.h = r, this.d = function (t, e) { let i = !1, r = 1 / 0; for (let n = 0; n < e.length; n++) { const s = e[n]; for (let e = 0, n = s.length, a = n - 1; e < n; a = e++) { const n = s[e], o = s[a]; n.y > t.y != o.y > t.y && t.x < (o.x - n.x) * (t.y - n.y) / (o.y - n.y) + n.x && (i = !i), r = Math.min(r, zo(t, n, o)); } } return (i ? 1 : -1) * Math.sqrt(r) }(this.p, n), this.max = this.d + this.h * Math.SQRT2; } const op = Number.POSITIVE_INFINITY; function lp(t, e) { return e[1] !== op ? function (t, e, i) { let r = 0, n = 0; switch (e = Math.abs(e), i = Math.abs(i), t) { case "top-right": case "top-left": case "top": n = i - 7; break; case "bottom-right": case "bottom-left": case "bottom": n = 7 - i; }switch (t) { case "top-right": case "bottom-right": case "right": r = -e; break; case "top-left": case "bottom-left": case "left": r = e; }return [r, n] }(t, e[0], e[1]) : function (t, e) { let i = 0, r = 0; e < 0 && (e = 0); const n = e / Math.sqrt(2); switch (t) { case "top-right": case "top-left": r = n - 7; break; case "bottom-right": case "bottom-left": r = 7 - n; break; case "bottom": r = 7 - e; break; case "top": r = e - 7; }switch (t) { case "top-right": case "bottom-right": i = -n; break; case "top-left": case "bottom-left": i = n; break; case "left": i = e; break; case "right": i = -e; }return [i, r] }(t, e[0]) } function hp(t, e, i, r, n, s, a, o) { t.createArrays(), t.tilePixelRatio = co / (512 * t.overscaling), t.compareText = {}, t.iconsNeedLinear = !1; const l = t.layers[0].layout, h = t.layers[0]._unevaluatedLayout._values, u = {}; if ("composite" === t.textSizeData.kind) { const { minZoom: e, maxZoom: i } = t.textSizeData; u.compositeTextSizes = [h["text-size"].possiblyEvaluate(new Es(e), a), h["text-size"].possiblyEvaluate(new Es(i), a)]; } if ("composite" === t.iconSizeData.kind) { const { minZoom: e, maxZoom: i } = t.iconSizeData; u.compositeIconSizes = [h["icon-size"].possiblyEvaluate(new Es(e), a), h["icon-size"].possiblyEvaluate(new Es(i), a)]; } u.layoutTextSize = h["text-size"].possiblyEvaluate(new Es(o + 1), a), u.layoutIconSize = h["icon-size"].possiblyEvaluate(new Es(o + 1), a), u.textMaxSize = h["text-size"].possiblyEvaluate(new Es(18), a); const c = "map" === l.get("text-rotation-alignment") && "point" !== l.get("symbol-placement"), p = l.get("text-keep-upright"), d = l.get("text-size"); for (const s of t.features) { const o = l.get("text-font").evaluate(s, {}, a).join(","), h = d.evaluate(s, {}, a), f = u.layoutTextSize.evaluate(s, {}, a), y = (u.layoutIconSize.evaluate(s, {}, a), { horizontal: {}, vertical: void 0 }), m = s.text; let g, x = [0, 0]; if (m) { const r = m.toString(), u = l.get("text-letter-spacing").evaluate(s, {}, a) * Vu, d = l.get("text-line-height").evaluate(s, {}, a) * Vu, g = vn(r) ? u : 0, _ = l.get("text-anchor").evaluate(s, {}, a), v = l.get("text-variable-anchor"); if (!v) { const t = l.get("text-radial-offset").evaluate(s, {}, a); x = t ? lp(_, [t * Vu, op]) : l.get("text-offset").evaluate(s, {}, a).map((t => t * Vu)); } let b = c ? "center" : l.get("text-justify").evaluate(s, {}, a); const w = l.get("symbol-placement"), k = "point" === w ? l.get("text-max-width").evaluate(s, {}, a) * Vu : 0, A = () => { t.allowVerticalPlacement && _n(r) && (y.vertical = bc(m, e, i, n, o, k, d, _, "left", g, x, gc.vertical, !0, w, f, h)); }; if (!c && v) { const t = "auto" === b ? v.map((t => up(t))) : [b]; let r = !1; for (let s = 0; s < t.length; s++) { const a = t[s]; if (!y.horizontal[a]) if (r) y.horizontal[a] = y.horizontal[0]; else { const t = bc(m, e, i, n, o, k, d, "center", a, g, x, gc.horizontal, !1, w, f, h); t && (y.horizontal[a] = t, r = 1 === t.positionedLines.length); } } A(); } else { "auto" === b && (b = up(_)); const t = bc(m, e, i, n, o, k, d, _, b, g, x, gc.horizontal, !1, w, f, h); t && (y.horizontal[b] = t), A(), _n(r) && c && p && (y.vertical = bc(m, e, i, n, o, k, d, _, b, g, x, gc.vertical, !1, w, f, h)); } } let _ = !1; if (s.icon && s.icon.name) { const e = r[s.icon.name]; e && (g = Pc(n[s.icon.name], l.get("icon-offset").evaluate(s, {}, a), l.get("icon-anchor").evaluate(s, {}, a)), _ = e.sdf, void 0 === t.sdfIcons ? t.sdfIcons = e.sdf : t.sdfIcons !== e.sdf && C("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"), (e.pixelRatio !== t.pixelRatio || 0 !== l.get("icon-rotate").constantOr(1)) && (t.iconsNeedLinear = !0)); } const v = fp(y.horizontal) || y.vertical; t.iconsInText || (t.iconsInText = !!v && v.iconsInText), (v || g) && cp(t, s, y, g, r, u, f, 0, x, _, a); } s && t.generateCollisionDebugBuffers(o, t.collisionBoxArray); } function up(t) { switch (t) { case "right": case "top-right": case "bottom-right": return "right"; case "left": case "top-left": case "bottom-left": return "left" }return "center" } function cp(t, e, i, r, n, s, a, o, l, h, c) { let p = s.textMaxSize.evaluate(e, {}, c); void 0 === p && (p = a); const d = t.layers[0].layout, f = d.get("icon-offset").evaluate(e, {}, c), y = fp(i.horizontal), m = a / 24, g = t.tilePixelRatio * p / 24, x = t.tilePixelRatio * d.get("symbol-spacing"), _ = d.get("text-padding") * t.tilePixelRatio, v = d.get("icon-padding") * t.tilePixelRatio, b = u(d.get("text-max-angle")), w = "map" === d.get("text-rotation-alignment") && "point" !== d.get("symbol-placement"), k = "map" === d.get("icon-rotation-alignment") && "point" !== d.get("symbol-placement"), A = d.get("symbol-placement"), S = x / 2, z = d.get("icon-text-fit"); let I; r && "none" !== z && (t.allowVerticalPlacement && i.vertical && (I = Dc(r, i.vertical, z, d.get("icon-text-fit-padding"), f, m)), y && (r = Dc(r, y, z, d.get("icon-text-fit-padding"), f, m))); const M = (o, u) => { u.x < 0 || u.x >= co || u.y < 0 || u.y >= co || function (t, e, i, r, n, s, a, o, l, h, u, c, p, d, f, y, m, g, x, _, v, b, w, k) { const A = t.addToLineVertexArray(e, i); let S, z, I, M, T, E, P, D = 0, B = 0, V = 0, L = 0, F = -1, R = -1; const O = {}; let U = Va(""), $ = 0, Z = 0; if (void 0 === o._unevaluatedLayout.getValue("text-radial-offset") ? [$, Z] = o.layout.get("text-offset").evaluate(_, {}, w).map((t => t * Vu)) : ($ = o.layout.get("text-radial-offset").evaluate(_, {}, w) * Vu, Z = op), t.allowVerticalPlacement && r.vertical) { const t = r.vertical; if (d) E = mp(t), a && (P = mp(a)); else { const i = o.layout.get("text-rotate").evaluate(_, {}, w) + 90; I = yp(l, e, h, u, c, t, p, i), a && (M = yp(l, e, h, u, c, a, m, i)); } } if (n) { const i = o.layout.get("icon-rotate").evaluate(_, {}, w), r = "none" !== o.layout.get("icon-text-fit"), s = Yc(n, i, b, r), p = a ? Yc(a, i, b, r) : void 0; z = yp(l, e, h, u, c, n, m, i), D = 4 * s.length; const d = t.iconSizeData; let f = null; "source" === d.kind ? (f = [Lu * o.layout.get("icon-size").evaluate(_, {}, w)], f[0] > pp && C(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)) : "composite" === d.kind && (f = [Lu * v.compositeIconSizes[0].evaluate(_, {}, w), Lu * v.compositeIconSizes[1].evaluate(_, {}, w)], (f[0] > pp || f[1] > pp) && C(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)), t.addSymbols(t.icon, s, f, x, g, _, !1, e, A.lineStartIndex, A.lineLength, -1, w), F = t.icon.placedSymbolArray.length - 1, p && (B = 4 * p.length, t.addSymbols(t.icon, p, f, x, g, _, gc.vertical, e, A.lineStartIndex, A.lineLength, -1, w), R = t.icon.placedSymbolArray.length - 1); } for (const i in r.horizontal) { const n = r.horizontal[i]; S || (U = Va(n.text), d ? T = mp(n) : S = yp(l, e, h, u, c, n, p, o.layout.get("text-rotate").evaluate(_, {}, w))); const a = 1 === n.positionedLines.length; if (V += dp(t, e, n, s, o, d, _, f, A, r.vertical ? gc.horizontal : gc.horizontalOnly, a ? Object.keys(r.horizontal) : [i], O, F, v, w), a) break } r.vertical && (L += dp(t, e, r.vertical, s, o, d, _, f, A, gc.vertical, ["vertical"], O, R, v, w)); let q = -1; const N = (t, e) => t ? Math.max(t, e) : e; q = N(T, q), q = N(E, q), q = N(P, q); const j = q > -1 ? 1 : 0; j && (q *= k / Vu), t.glyphOffsetArray.length >= Sp.MAX_GLYPHS && C("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"), void 0 !== _.sortKey && t.addToSortKeyRanges(t.symbolInstances.length, _.sortKey), t.symbolInstances.emplaceBack(e.x, e.y, O.right >= 0 ? O.right : -1, O.center >= 0 ? O.center : -1, O.left >= 0 ? O.left : -1, O.vertical || -1, F, R, U, void 0 !== S ? S : t.collisionBoxArray.length, void 0 !== S ? S + 1 : t.collisionBoxArray.length, void 0 !== I ? I : t.collisionBoxArray.length, void 0 !== I ? I + 1 : t.collisionBoxArray.length, void 0 !== z ? z : t.collisionBoxArray.length, void 0 !== z ? z + 1 : t.collisionBoxArray.length, M || t.collisionBoxArray.length, M ? M + 1 : t.collisionBoxArray.length, h, V, L, D, B, j, 0, $, Z, q); }(t, u, o, i, r, n, I, t.layers[0], t.collisionBoxArray, e.index, e.sourceLayerIndex, t.index, _, w, l, 0, v, k, f, e, s, h, c, a); }; if ("line" === A) for (const n of Zc(e.geometry, 0, 0, co, co)) { const e = Uc(n, x, b, i.vertical || y, r, 24, g, t.overscaling, co); for (const i of e) { const e = y; e && gp(t, e.text, S, i) || M(n, i); } } else if ("line-center" === A) { for (const t of e.geometry) if (t.length > 1) { const e = Oc(t, b, i.vertical || y, r, 24, g); e && M(t, e); } } else if ("Polygon" === e.type) for (const t of yh(e.geometry, 0)) { const e = np(t, 16); M(t[0], new Bc(e.x, e.y, 0)); } else if ("LineString" === e.type) for (const t of e.geometry) M(t, new Bc(t[0].x, t[0].y, 0)); else if ("Point" === e.type) for (const t of e.geometry) for (const e of t) M([e], new Bc(e.x, e.y, 0)); } const pp = 32640; function dp(t, e, r, n, s, a, o, l, h, u, c, p, d, f, y) { const m = function (t, e, r, n, s, a, o, l) { const h = n.layout.get("text-rotate").evaluate(a, {}) * Math.PI / 180, u = []; for (const t of e.positionedLines) for (const n of t.positionedGlyphs) { if (!n.rect) continue; const a = n.rect || {}; let c = 4, p = !0, d = 1, f = 0; const y = (s || l) && n.vertical, m = n.metrics.advance * n.scale / 2; if (l && e.verticalizable) { const e = (n.scale - 1) * Vu, i = (Vu - n.metrics.width * n.scale) / 2; f = t.lineOffset / 2 - (n.imageName ? -i : e); } if (n.imageName) { const t = o[n.imageName]; p = t.sdf, d = t.pixelRatio, c = 1 / d; } const g = s ? [n.x + m, n.y] : [0, 0]; let x = s ? [0, 0] : [n.x + m + r[0], n.y + r[1] - f], _ = [0, 0]; y && (_ = x, x = [0, 0]); const v = (n.metrics.left - c) * n.scale - m + x[0], b = (-n.metrics.top - c) * n.scale + x[1], w = v + a.w * n.scale / (d * (n.localGlyph ? 2 : 1)), k = b + a.h * n.scale / (d * (n.localGlyph ? 2 : 1)), A = new i(v, b), S = new i(w, b), z = new i(v, k), I = new i(w, k); if (y) { const t = new i(-m, m - xc), e = -Math.PI / 2, r = 12 - m, s = new i(22 - r, -(n.imageName ? r : 0)), a = new i(..._); A._rotateAround(e, t)._add(s)._add(a), S._rotateAround(e, t)._add(s)._add(a), z._rotateAround(e, t)._add(s)._add(a), I._rotateAround(e, t)._add(s)._add(a); } if (h) { const t = Math.sin(h), e = Math.cos(h), i = [e, -t, t, e]; A._matMult(i), S._matMult(i), z._matMult(i), I._matMult(i); } const M = new i(0, 0), T = new i(0, 0); u.push({ tl: A, tr: S, bl: z, br: I, tex: a, writingMode: e.writingMode, glyphOffset: g, sectionIndex: n.sectionIndex, isSDF: p, pixelOffsetTL: M, pixelOffsetBR: T, minFontScaleX: 0, minFontScaleY: 0 }); } return u }(0, r, l, s, a, o, n, t.allowVerticalPlacement), g = t.textSizeData; let x = null; "source" === g.kind ? (x = [Lu * s.layout.get("text-size").evaluate(o, {}, y)], x[0] > pp && C(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)) : "composite" === g.kind && (x = [Lu * f.compositeTextSizes[0].evaluate(o, {}, y), Lu * f.compositeTextSizes[1].evaluate(o, {}, y)], (x[0] > pp || x[1] > pp) && C(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)), t.addSymbols(t.text, m, x, l, a, o, u, e, h.lineStartIndex, h.lineLength, d, y); for (const e of c) p[e] = t.text.placedSymbolArray.length - 1; return 4 * m.length } function fp(t) { for (const e in t) return t[e]; return null } function yp(t, e, r, n, s, a, o, l) { let h = a.top, c = a.bottom, p = a.left, d = a.right; const f = a.collisionPadding; if (f && (p -= f[0], h -= f[1], d += f[2], c += f[3]), l) { const t = new i(p, h), e = new i(d, h), r = new i(p, c), n = new i(d, c), s = u(l); t._rotate(s), e._rotate(s), r._rotate(s), n._rotate(s), p = Math.min(t.x, e.x, r.x, n.x), d = Math.max(t.x, e.x, r.x, n.x), h = Math.min(t.y, e.y, r.y, n.y), c = Math.max(t.y, e.y, r.y, n.y); } return t.emplaceBack(e.x, e.y, p, h, d, c, o, r, n, s), t.length - 1 } function mp(t) { t.collisionPadding && (t.top -= t.collisionPadding[1], t.bottom += t.collisionPadding[3]); const e = t.bottom - t.top; return e > 0 ? Math.max(10, e) : null } function gp(t, e, i, r) { const n = t.compareText; if (e in n) { const t = n[e]; for (let e = t.length - 1; e >= 0; e--)if (r.dist(t[e]) < i) return !0 } else n[e] = []; return n[e].push(r), !1 } const xp = au.VectorTileFeature.types, _p = [{ name: "a_fade_opacity", components: 1, type: "Uint8", offset: 0 }]; function vp(t, e, i, r, n, s, a, o, l, h, u, c, p) { const d = o ? Math.min(pp, Math.round(o[0])) : 0, f = o ? Math.min(pp, Math.round(o[1])) : 0; t.emplaceBack(e, i, Math.round(32 * r), Math.round(32 * n), s, a, (d << 1) + (l ? 1 : 0), f, 16 * h, 16 * u, 256 * c, 256 * p); } function bp(t, e, i) { t.emplaceBack(e.x, e.y, i), t.emplaceBack(e.x, e.y, i), t.emplaceBack(e.x, e.y, i), t.emplaceBack(e.x, e.y, i); } function wp(t) { for (const e of t.sections) if (zn(e.text)) return !0; return !1 } class kp { constructor(t) { this.layoutVertexArray = new ra, this.indexArray = new ua, this.programConfigurations = t, this.segments = new uo, this.dynamicLayoutVertexArray = new na, this.opacityVertexArray = new sa, this.placedSymbolArray = new wa; } isEmpty() { return 0 === this.layoutVertexArray.length && 0 === this.indexArray.length && 0 === this.dynamicLayoutVertexArray.length && 0 === this.opacityVertexArray.length } upload(t, e, i, r) { this.isEmpty() || (i && (this.layoutVertexBuffer = t.createVertexBuffer(this.layoutVertexArray, Tu.members), this.indexBuffer = t.createIndexBuffer(this.indexArray, e), this.dynamicLayoutVertexBuffer = t.createVertexBuffer(this.dynamicLayoutVertexArray, Eu.members, !0), this.opacityVertexBuffer = t.createVertexBuffer(this.opacityVertexArray, _p, !0), this.opacityVertexBuffer.itemSize = 1), (i || r) && this.programConfigurations.upload(t)); } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy(), this.dynamicLayoutVertexBuffer.destroy(), this.opacityVertexBuffer.destroy()); } } Rr("SymbolBuffers", kp); class Ap { constructor(t, e, i) { this.layoutVertexArray = new t, this.layoutAttributes = e, this.indexArray = new i, this.segments = new uo, this.collisionVertexArray = new ha, this.collisionVertexArrayExt = new na; } upload(t) { this.layoutVertexBuffer = t.createVertexBuffer(this.layoutVertexArray, this.layoutAttributes), this.indexBuffer = t.createIndexBuffer(this.indexArray), this.collisionVertexBuffer = t.createVertexBuffer(this.collisionVertexArray, Cu.members, !0), this.collisionVertexBufferExt = t.createVertexBuffer(this.collisionVertexArrayExt, Pu.members, !0); } destroy() { this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.segments.destroy(), this.collisionVertexBuffer.destroy(), this.collisionVertexBufferExt.destroy()); } } Rr("CollisionBuffers", Ap); class Sp { constructor(t) { this.collisionBoxArray = t.collisionBoxArray, this.zoom = t.zoom, this.overscaling = t.overscaling, this.layers = t.layers, this.layerIds = this.layers.map((t => t.id)), this.index = t.index, this.pixelRatio = t.pixelRatio, this.sourceLayerIndex = t.sourceLayerIndex, this.hasPattern = !1, this.hasRTLText = !1, this.sortKeyRanges = [], this.collisionCircleArray = [], this.placementInvProjMatrix = Uo([]), this.placementViewportMatrix = Uo([]); const e = this.layers[0]._unevaluatedLayout._values; this.textSizeData = Fu(this.zoom, e["text-size"]), this.iconSizeData = Fu(this.zoom, e["icon-size"]); const i = this.layers[0].layout, r = i.get("symbol-sort-key"), n = i.get("symbol-z-order"); this.canOverlap = i.get("text-allow-overlap") || i.get("icon-allow-overlap") || i.get("text-ignore-placement") || i.get("icon-ignore-placement"), this.sortFeaturesByKey = "viewport-y" !== n && void 0 !== r.constantOr(1), this.sortFeaturesByY = ("viewport-y" === n || "auto" === n && !this.sortFeaturesByKey) && this.canOverlap, "point" === i.get("symbol-placement") && (this.writingModes = i.get("text-writing-mode").map((t => gc[t]))), this.stateDependentLayerIds = this.layers.filter((t => t.isStateDependent())).map((t => t.id)), this.sourceID = t.sourceID; } createArrays() { this.text = new kp(new to(this.layers, this.zoom, (t => /^text/.test(t)))), this.icon = new kp(new to(this.layers, this.zoom, (t => /^icon/.test(t)))), this.glyphOffsetArray = new Sa, this.lineVertexArray = new za, this.symbolInstances = new Aa; } calculateGlyphDependencies(t, e, i, r, n) { for (let s = 0; s < t.length; s++)if (e[t.charCodeAt(s)] = !0, (i || r) && n) { const i = Zu[t.charAt(s)]; i && (e[i.charCodeAt(0)] = !0); } } populate(t, e, i) { const r = this.layers[0], n = r.layout, s = n.get("text-font"), a = n.get("text-field"), o = n.get("icon-image"), l = ("constant" !== a.value.kind || a.value.value instanceof St && !a.value.value.isEmpty() || a.value.value.toString().length > 0) && ("constant" !== s.value.kind || s.value.value.length > 0), h = "constant" !== o.value.kind || !!o.value.value || Object.keys(o.parameters).length > 0, u = n.get("symbol-sort-key"); if (this.features = [], !l && !h) return; const c = e.iconDependencies, p = e.glyphDependencies, d = e.availableImages, f = new Es(this.zoom); for (const { feature: e, id: a, index: o, sourceLayerIndex: y } of t) { const t = r._featureFilter.needGeometry, m = mo(e, t); if (!r._featureFilter.filter(f, m, i)) continue; let g, x; if (t || (m.geometry = yo(e)), l) { const t = r.getValueAndResolveTokens("text-field", m, i, d), e = St.factory(t); wp(e) && (this.hasRTLText = !0), (!this.hasRTLText || "unavailable" === Ms() || this.hasRTLText && Ts.isParsed()) && (g = $u(e, r, m)); } if (h) { const t = r.getValueAndResolveTokens("icon-image", m, i, d); x = t instanceof zt ? t : zt.fromString(t); } if (!g && !x) continue; const _ = this.sortFeaturesByKey ? u.evaluate(m, {}, i) : void 0, v = { id: a, text: g, icon: x, index: o, sourceLayerIndex: y, geometry: m.geometry, properties: e.properties, type: xp[e.type], sortKey: _ }; if (!((v.properties ? v.properties.mzr : 0) > this.zoom) && (this.features.push(v), x && (c[x.name] = !0), g)) { const t = s.evaluate(m, {}, i).join(","), e = "map" === n.get("text-rotation-alignment") && "point" !== n.get("symbol-placement"); this.allowVerticalPlacement = this.writingModes && this.writingModes.indexOf(gc.vertical) >= 0; for (const i of g.sections) if (i.image) c[i.image.name] = !0; else { const r = _n(g.toString()), n = i.fontStack || t, s = p[n] = p[n] || {}; this.calculateGlyphDependencies(i.text, s, e, this.allowVerticalPlacement, r); } } } "line" === n.get("symbol-placement") && (this.features = function (t) { const e = {}, i = {}, r = []; let n = 0; function s(e) { r.push(t[e]), n++; } function a(t, e, n) { const s = i[t]; return delete i[t], i[e] = s, r[s].geometry[0].pop(), r[s].geometry[0] = r[s].geometry[0].concat(n[0]), s } function o(t, i, n) { const s = e[i]; return delete e[i], e[t] = s, r[s].geometry[0].shift(), r[s].geometry[0] = n[0].concat(r[s].geometry[0]), s } function l(t, e, i) { const r = i ? e[0][e[0].length - 1] : e[0][0]; return `${t}:${r.x}:${r.y}` } for (let h = 0; h < t.length; h++) { const u = t[h], c = u.geometry, p = u.text ? u.text.toString() : null; if (!p) { s(h); continue } const d = l(p, c), f = l(p, c, !0); if (d in i && f in e && i[d] !== e[f]) { const t = o(d, f, c), n = a(d, f, r[t].geometry); delete e[d], delete i[f], i[l(p, r[n].geometry, !0)] = n, r[t].geometry = null; } else d in i ? a(d, f, c) : f in e ? o(d, f, c) : (s(h), e[d] = n - 1, i[f] = n - 1); } return r.filter((t => t.geometry)) }(this.features)), this.sortFeaturesByKey && this.features.sort(((t, e) => t.sortKey - e.sortKey)); } update(t, e, i) { this.stateDependentLayers.length && (this.text.programConfigurations.updatePaintArrays(t, e, this.layers, i), this.icon.programConfigurations.updatePaintArrays(t, e, this.layers, i)); } isEmpty() { return 0 === this.symbolInstances.length && !this.hasRTLText } uploadPending() { return !this.uploaded || this.text.programConfigurations.needsUpload || this.icon.programConfigurations.needsUpload } upload(t) { !this.uploaded && this.hasDebugData() && (this.textCollisionBox.upload(t), this.iconCollisionBox.upload(t)), this.text.upload(t, this.sortFeaturesByY, !this.uploaded, this.text.programConfigurations.needsUpload), this.icon.upload(t, this.sortFeaturesByY, !this.uploaded, this.icon.programConfigurations.needsUpload), this.uploaded = !0; } destroyDebugData() { this.textCollisionBox.destroy(), this.iconCollisionBox.destroy(); } destroy() { this.text.destroy(), this.icon.destroy(), this.hasDebugData() && this.destroyDebugData(); } addToLineVertexArray(t, e) { const i = this.lineVertexArray.length; if (void 0 !== t.segment) { let i = t.dist(e[t.segment + 1]), r = t.dist(e[t.segment]); const n = {}; for (let r = t.segment + 1; r < e.length; r++)n[r] = { x: e[r].x, y: e[r].y, tileUnitDistanceFromAnchor: i }, r < e.length - 1 && (i += e[r + 1].dist(e[r])); for (let i = t.segment || 0; i >= 0; i--)n[i] = { x: e[i].x, y: e[i].y, tileUnitDistanceFromAnchor: r }, i > 0 && (r += e[i - 1].dist(e[i])); for (let t = 0; t < e.length; t++) { const e = n[t]; this.lineVertexArray.emplaceBack(e.x, e.y, e.tileUnitDistanceFromAnchor); } } return { lineStartIndex: i, lineLength: this.lineVertexArray.length - i } } addSymbols(t, e, i, r, n, s, a, o, l, h, u, c) { const p = t.indexArray, d = t.layoutVertexArray, f = t.segments.prepareSegment(4 * e.length, d, p, this.canOverlap ? s.sortKey : void 0), y = this.glyphOffsetArray.length, m = f.vertexLength, g = this.allowVerticalPlacement && a === gc.vertical ? Math.PI / 2 : 0, x = s.text && s.text.sections; for (let r = 0; r < e.length; r++) { const { tl: n, tr: a, bl: l, br: h, tex: u, pixelOffsetTL: y, pixelOffsetBR: m, minFontScaleX: _, minFontScaleY: v, glyphOffset: b, isSDF: w, sectionIndex: k } = e[r], A = f.vertexLength, S = b[1]; vp(d, o.x, o.y, n.x, S + n.y, u.x, u.y, i, w, y.x, y.y, _, v), vp(d, o.x, o.y, a.x, S + a.y, u.x + u.w, u.y, i, w, m.x, y.y, _, v), vp(d, o.x, o.y, l.x, S + l.y, u.x, u.y + u.h, i, w, y.x, m.y, _, v), vp(d, o.x, o.y, h.x, S + h.y, u.x + u.w, u.y + u.h, i, w, m.x, m.y, _, v), bp(t.dynamicLayoutVertexArray, o, g), p.emplaceBack(A, A + 1, A + 2), p.emplaceBack(A + 1, A + 2, A + 3), f.vertexLength += 4, f.primitiveLength += 2, this.glyphOffsetArray.emplaceBack(b[0]), r !== e.length - 1 && k === e[r + 1].sectionIndex || t.programConfigurations.populatePaintArrays(d.length, s, s.index, {}, c, x && x[k]); } t.placedSymbolArray.emplaceBack(o.x, o.y, y, this.glyphOffsetArray.length - y, m, l, h, o.segment, i ? i[0] : 0, i ? i[1] : 0, r[0], r[1], a, 0, !1, 0, u, 0); } _commitLayoutVertex(t, e, i, r, n) { t.emplaceBack(e.x, e.y, i, r, Math.round(n.x), Math.round(n.y)); } _addCollisionDebugVertices(t, e, r, n, s) { const a = r.segments.prepareSegment(4, r.layoutVertexArray, r.indexArray), o = a.vertexLength, l = s.anchorX, h = s.anchorY; for (let t = 0; t < 4; t++)r.collisionVertexArray.emplaceBack(0, 0, 0, 0); r.collisionVertexArrayExt.emplaceBack(e, -t.padding, -t.padding), r.collisionVertexArrayExt.emplaceBack(e, t.padding, -t.padding), r.collisionVertexArrayExt.emplaceBack(e, t.padding, t.padding), r.collisionVertexArrayExt.emplaceBack(e, -t.padding, t.padding), this._commitLayoutVertex(r.layoutVertexArray, n, l, h, new i(t.x1, t.y1)), this._commitLayoutVertex(r.layoutVertexArray, n, l, h, new i(t.x2, t.y1)), this._commitLayoutVertex(r.layoutVertexArray, n, l, h, new i(t.x2, t.y2)), this._commitLayoutVertex(r.layoutVertexArray, n, l, h, new i(t.x1, t.y2)), a.vertexLength += 4; const u = r.indexArray; u.emplaceBack(o, o + 1), u.emplaceBack(o + 1, o + 2), u.emplaceBack(o + 2, o + 3), u.emplaceBack(o + 3, o), a.primitiveLength += 4; } _addTextDebugCollisionBoxes(t, e, i, r, n, s) { for (let a = r; a < n; a++) { const r = i.get(a), n = this.getSymbolInstanceTextSize(t, s, e, a); this._addCollisionDebugVertices(r, n, this.textCollisionBox, r.anchorPoint, s); } } _addIconDebugCollisionBoxes(t, e, i, r, n, s) { for (let a = r; a < n; a++) { const r = i.get(a), n = this.getSymbolInstanceIconSize(t, e, a); this._addCollisionDebugVertices(r, n, this.iconCollisionBox, r.anchorPoint, s); } } generateCollisionDebugBuffers(t, e) { this.hasDebugData() && this.destroyDebugData(), this.textCollisionBox = new Ap(oa, Du.members, ma), this.iconCollisionBox = new Ap(oa, Du.members, ma); const i = Ou(this.iconSizeData, t), r = Ou(this.textSizeData, t); for (let n = 0; n < this.symbolInstances.length; n++) { const s = this.symbolInstances.get(n); this._addTextDebugCollisionBoxes(r, t, e, s.textBoxStartIndex, s.textBoxEndIndex, s), this._addTextDebugCollisionBoxes(r, t, e, s.verticalTextBoxStartIndex, s.verticalTextBoxEndIndex, s), this._addIconDebugCollisionBoxes(i, t, e, s.iconBoxStartIndex, s.iconBoxEndIndex, s), this._addIconDebugCollisionBoxes(i, t, e, s.verticalIconBoxStartIndex, s.verticalIconBoxEndIndex, s); } } getSymbolInstanceTextSize(t, e, i, r) { const n = this.text.placedSymbolArray.get(e.rightJustifiedTextSymbolIndex >= 0 ? e.rightJustifiedTextSymbolIndex : e.centerJustifiedTextSymbolIndex >= 0 ? e.centerJustifiedTextSymbolIndex : e.leftJustifiedTextSymbolIndex >= 0 ? e.leftJustifiedTextSymbolIndex : e.verticalPlacedTextSymbolIndex >= 0 ? e.verticalPlacedTextSymbolIndex : r), s = Ru(this.textSizeData, t, n) / Vu; return this.tilePixelRatio * s } getSymbolInstanceIconSize(t, e, i) { const r = this.icon.placedSymbolArray.get(i), n = Ru(this.iconSizeData, t, r); return this.tilePixelRatio * n } _commitDebugCollisionVertexUpdate(t, e, i) { t.emplaceBack(e, -i, -i), t.emplaceBack(e, i, -i), t.emplaceBack(e, i, i), t.emplaceBack(e, -i, i); } _updateTextDebugCollisionBoxes(t, e, i, r, n, s) { for (let a = r; a < n; a++) { const r = i.get(a), n = this.getSymbolInstanceTextSize(t, s, e, a); this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt, n, r.padding); } } _updateIconDebugCollisionBoxes(t, e, i, r, n) { for (let s = r; s < n; s++) { const r = i.get(s), n = this.getSymbolInstanceIconSize(t, e, s); this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt, n, r.padding); } } updateCollisionDebugBuffers(t, e) { if (!this.hasDebugData()) return; this.hasTextCollisionBoxData() && this.textCollisionBox.collisionVertexArrayExt.clear(), this.hasIconCollisionBoxData() && this.iconCollisionBox.collisionVertexArrayExt.clear(); const i = Ou(this.iconSizeData, t), r = Ou(this.textSizeData, t); for (let n = 0; n < this.symbolInstances.length; n++) { const s = this.symbolInstances.get(n); this._updateTextDebugCollisionBoxes(r, t, e, s.textBoxStartIndex, s.textBoxEndIndex, s), this._updateTextDebugCollisionBoxes(r, t, e, s.verticalTextBoxStartIndex, s.verticalTextBoxEndIndex, s), this._updateIconDebugCollisionBoxes(i, t, e, s.iconBoxStartIndex, s.iconBoxEndIndex), this._updateIconDebugCollisionBoxes(i, t, e, s.verticalIconBoxStartIndex, s.verticalIconBoxEndIndex); } this.hasTextCollisionBoxData() && this.textCollisionBox.collisionVertexBufferExt && this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt), this.hasIconCollisionBoxData() && this.iconCollisionBox.collisionVertexBufferExt && this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt); } _deserializeCollisionBoxesForSymbol(t, e, i, r, n, s, a, o, l) { const h = {}; for (let r = e; r < i; r++) { const e = t.get(r); h.textBox = { x1: e.x1, y1: e.y1, x2: e.x2, y2: e.y2, padding: e.padding, anchorPointX: e.anchorPointX, anchorPointY: e.anchorPointY }, h.textFeatureIndex = e.featureIndex; break } for (let e = r; e < n; e++) { const i = t.get(e); h.verticalTextBox = { x1: i.x1, y1: i.y1, x2: i.x2, y2: i.y2, padding: i.padding, anchorPointX: i.anchorPointX, anchorPointY: i.anchorPointY }, h.verticalTextFeatureIndex = i.featureIndex; break } for (let e = s; e < a; e++) { const i = t.get(e); h.iconBox = { x1: i.x1, y1: i.y1, x2: i.x2, y2: i.y2, padding: i.padding, anchorPointX: i.anchorPointX, anchorPointY: i.anchorPointY }, h.iconFeatureIndex = i.featureIndex; break } for (let e = o; e < l; e++) { const i = t.get(e); h.verticalIconBox = { x1: i.x1, y1: i.y1, x2: i.x2, y2: i.y2, padding: i.padding, anchorPointX: i.anchorPointX, anchorPointY: i.anchorPointY }, h.verticalIconFeatureIndex = i.featureIndex; break } return h } deserializeCollisionBoxes(t) { this.collisionArrays = []; for (let e = 0; e < this.symbolInstances.length; e++) { const i = this.symbolInstances.get(e); this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t, i.textBoxStartIndex, i.textBoxEndIndex, i.verticalTextBoxStartIndex, i.verticalTextBoxEndIndex, i.iconBoxStartIndex, i.iconBoxEndIndex, i.verticalIconBoxStartIndex, i.verticalIconBoxEndIndex)); } } hasTextData() { return this.text.segments.get().length > 0 } hasIconData() { return this.icon.segments.get().length > 0 } hasDebugData() { return this.textCollisionBox && this.iconCollisionBox } hasTextCollisionBoxData() { return this.hasDebugData() && this.textCollisionBox.segments.get().length > 0 } hasIconCollisionBoxData() { return this.hasDebugData() && this.iconCollisionBox.segments.get().length > 0 } addIndicesForPlacedSymbol(t, e) { const i = t.placedSymbolArray.get(e), r = i.vertexStartIndex + 4 * i.numGlyphs; for (let e = i.vertexStartIndex; e < r; e += 4)t.indexArray.emplaceBack(e, e + 1, e + 2), t.indexArray.emplaceBack(e + 1, e + 2, e + 3); } getSortedSymbolIndexes(t) { if (this.sortedAngle === t && void 0 !== this.symbolInstanceIndexes) return this.symbolInstanceIndexes; const e = Math.sin(t), i = Math.cos(t), r = [], n = [], s = []; for (let t = 0; t < this.symbolInstances.length; ++t) { s.push(t); const a = this.symbolInstances.get(t); r.push(0 | Math.round(e * a.anchorX + i * a.anchorY)), n.push(a.featureIndex); } return s.sort(((t, e) => r[t] - r[e] || n[e] - n[t])), s } addToSortKeyRanges(t, e) { const i = this.sortKeyRanges[this.sortKeyRanges.length - 1]; i && i.sortKey === e ? i.symbolInstanceEnd = t + 1 : this.sortKeyRanges.push({ sortKey: e, symbolInstanceStart: t, symbolInstanceEnd: t + 1 }); } sortFeatures(t) { if (this.sortFeaturesByY && this.sortedAngle !== t && !(this.text.segments.get().length > 1 || this.icon.segments.get().length > 1)) { this.symbolInstanceIndexes = this.getSortedSymbolIndexes(t), this.sortedAngle = t, this.text.indexArray.clear(), this.icon.indexArray.clear(), this.featureSortOrder = []; for (const t of this.symbolInstanceIndexes) { const e = this.symbolInstances.get(t); this.featureSortOrder.push(e.featureIndex), [e.rightJustifiedTextSymbolIndex, e.centerJustifiedTextSymbolIndex, e.leftJustifiedTextSymbolIndex].forEach(((t, e, i) => { t >= 0 && i.indexOf(t) === e && this.addIndicesForPlacedSymbol(this.text, t); })), e.verticalPlacedTextSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.text, e.verticalPlacedTextSymbolIndex), e.placedIconSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.icon, e.placedIconSymbolIndex), e.verticalPlacedIconSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.icon, e.verticalPlacedIconSymbolIndex); } this.text.indexBuffer && this.text.indexBuffer.updateData(this.text.indexArray), this.icon.indexBuffer && this.icon.indexBuffer.updateData(this.icon.indexArray); } } } Rr("SymbolBucket", Sp, { omit: ["layers", "collisionBoxArray", "features", "compareText"] }), Sp.MAX_GLYPHS = 65535, Sp.addDynamicAttributes = bp; const zp = new Ns({ "symbol-placement": new Os(X.layout_symbol["symbol-placement"]), "symbol-spacing": new Os(X.layout_symbol["symbol-spacing"]), "symbol-avoid-edges": new Os(X.layout_symbol["symbol-avoid-edges"]), "symbol-sort-key": new Us(X.layout_symbol["symbol-sort-key"]), "symbol-z-order": new Os(X.layout_symbol["symbol-z-order"]), "icon-allow-overlap": new Os(X.layout_symbol["icon-allow-overlap"]), "icon-ignore-placement": new Os(X.layout_symbol["icon-ignore-placement"]), "icon-optional": new Os(X.layout_symbol["icon-optional"]), "icon-rotation-alignment": new Os(X.layout_symbol["icon-rotation-alignment"]), "icon-size": new Us(X.layout_symbol["icon-size"]), "icon-text-fit": new Os(X.layout_symbol["icon-text-fit"]), "icon-text-fit-padding": new Os(X.layout_symbol["icon-text-fit-padding"]), "icon-image": new Us(X.layout_symbol["icon-image"]), "icon-rotate": new Us(X.layout_symbol["icon-rotate"]), "icon-padding": new Os(X.layout_symbol["icon-padding"]), "icon-keep-upright": new Os(X.layout_symbol["icon-keep-upright"]), "icon-offset": new Us(X.layout_symbol["icon-offset"]), "icon-anchor": new Us(X.layout_symbol["icon-anchor"]), "icon-pitch-alignment": new Os(X.layout_symbol["icon-pitch-alignment"]), "text-pitch-alignment": new Os(X.layout_symbol["text-pitch-alignment"]), "text-rotation-alignment": new Os(X.layout_symbol["text-rotation-alignment"]), "text-field": new Us(X.layout_symbol["text-field"]), "text-font": new Us(X.layout_symbol["text-font"]), "text-size": new Us(X.layout_symbol["text-size"]), "text-max-width": new Us(X.layout_symbol["text-max-width"]), "text-line-height": new Us(X.layout_symbol["text-line-height"]), "text-letter-spacing": new Us(X.layout_symbol["text-letter-spacing"]), "text-justify": new Us(X.layout_symbol["text-justify"]), "text-radial-offset": new Us(X.layout_symbol["text-radial-offset"]), "text-variable-anchor": new Os(X.layout_symbol["text-variable-anchor"]), "text-anchor": new Us(X.layout_symbol["text-anchor"]), "text-max-angle": new Os(X.layout_symbol["text-max-angle"]), "text-writing-mode": new Os(X.layout_symbol["text-writing-mode"]), "text-rotate": new Us(X.layout_symbol["text-rotate"]), "text-padding": new Os(X.layout_symbol["text-padding"]), "text-keep-upright": new Os(X.layout_symbol["text-keep-upright"]), "text-transform": new Us(X.layout_symbol["text-transform"]), "text-offset": new Us(X.layout_symbol["text-offset"]), "text-allow-overlap": new Os(X.layout_symbol["text-allow-overlap"]), "text-ignore-placement": new Os(X.layout_symbol["text-ignore-placement"]), "text-optional": new Os(X.layout_symbol["text-optional"]) }); var Ip = { paint: new Ns({ "icon-opacity": new Us(X.paint_symbol["icon-opacity"]), "icon-color": new Us(X.paint_symbol["icon-color"]), "icon-halo-color": new Us(X.paint_symbol["icon-halo-color"]), "icon-halo-width": new Us(X.paint_symbol["icon-halo-width"]), "icon-halo-blur": new Us(X.paint_symbol["icon-halo-blur"]), "icon-translate": new Os(X.paint_symbol["icon-translate"]), "icon-translate-anchor": new Os(X.paint_symbol["icon-translate-anchor"]), "text-opacity": new Us(X.paint_symbol["text-opacity"]), "text-color": new Us(X.paint_symbol["text-color"], { runtimeType: ot, getOverride: t => t.textColor, hasOverride: t => !!t.textColor }), "text-halo-color": new Us(X.paint_symbol["text-halo-color"]), "text-halo-width": new Us(X.paint_symbol["text-halo-width"]), "text-halo-blur": new Us(X.paint_symbol["text-halo-blur"]), "text-translate": new Os(X.paint_symbol["text-translate"]), "text-translate-anchor": new Os(X.paint_symbol["text-translate-anchor"]) }), layout: zp }; class Mp { constructor(t) { this.type = t.property.overrides ? t.property.overrides.runtimeType : rt, this.defaultValue = t; } evaluate(t) { if (t.formattedSection) { const e = this.defaultValue.property.overrides; if (e && e.hasOverride(t.formattedSection)) return e.getOverride(t.formattedSection) } return t.feature && t.featureState ? this.defaultValue.evaluate(t.feature, t.featureState) : this.defaultValue.property.specification.default } eachChild(t) { this.defaultValue.isConstant() || t(this.defaultValue.value._styleExpression.expression); } outputDefined() { return !1 } serialize() { return null } } Rr("FormatSectionOverride", Mp, { omit: ["defaultValue"] }); class Tp extends oo { constructor(t) { super(t, Ip); } recalculate(t, e) { if (super.recalculate(t, e), "auto" === this.layout.get("icon-rotation-alignment") && (this.layout._values["icon-rotation-alignment"] = "point" !== this.layout.get("symbol-placement") ? "map" : "viewport"), "auto" === this.layout.get("text-rotation-alignment") && (this.layout._values["text-rotation-alignment"] = "point" !== this.layout.get("symbol-placement") ? "map" : "viewport"), "auto" === this.layout.get("text-pitch-alignment") && (this.layout._values["text-pitch-alignment"] = this.layout.get("text-rotation-alignment")), "auto" === this.layout.get("icon-pitch-alignment") && (this.layout._values["icon-pitch-alignment"] = this.layout.get("icon-rotation-alignment")), "point" === this.layout.get("symbol-placement")) { const t = this.layout.get("text-writing-mode"); if (t) { const e = []; for (const i of t) e.indexOf(i) < 0 && e.push(i); this.layout._values["text-writing-mode"] = e; } else this.layout._values["text-writing-mode"] = ["horizontal"]; } this._setPaintOverrides(); } getValueAndResolveTokens(t, e, i, r) { const n = this.layout.get(t).evaluate(e, {}, i, r), s = this._unevaluatedLayout._values[t]; return s.isDataDriven() || Ui(s.value) || !n ? n : function (t, e) { return e.replace(/{([^{}]+)}/g, ((e, i) => i in t ? String(t[i]) : "")) }(e.properties, n) } createBucket(t) { return new Sp(t) } queryRadius() { return 0 } queryIntersectsFeature() { return !1 } _setPaintOverrides() { for (const t of Ip.paint.overridableProperties) { if (!Tp.hasPaintOverride(this.layout, t)) continue; const e = this.paint.get(t), i = new Mp(e), r = new Oi(i, e.property.specification); let n = null; n = "constant" === e.value.kind || "source" === e.value.kind ? new Zi("source", r) : new qi("composite", r, e.value.zoomStops, e.value._interpolationType), this.paint._values[t] = new Fs(e.property, n, e.parameters); } } _handleOverridablePaintPropertyUpdate(t, e, i) { return !(!this.layout || e.isDataDriven() || i.isDataDriven()) && Tp.hasPaintOverride(this.layout, t) } static hasPaintOverride(t, e) { const i = t.get("text-field"), r = Ip.paint.properties[e]; let n = !1; const s = t => { for (const e of t) if (r.overrides && r.overrides.hasOverride(e)) return void (n = !0) }; if ("constant" === i.value.kind && i.value.value instanceof St) s(i.value.value.sections); else if ("source" === i.value.kind) { const t = e => { n || (e instanceof Pt && Tt(e.value) === ct ? s(e.value.sections) : e instanceof Ft ? s(e.sections) : e.eachChild(t)); }, e = i.value; e._styleExpression && t(e._styleExpression.expression); } return n } getProgramConfiguration(t) { return new Qa(this, t) } } var Ep = { paint: new Ns({ "background-color": new Os(X.paint_background["background-color"]), "background-pattern": new Zs(X.paint_background["background-pattern"]), "background-opacity": new Os(X.paint_background["background-opacity"]) }) }, Cp = { paint: new Ns({ "raster-opacity": new Os(X.paint_raster["raster-opacity"]), "raster-hue-rotate": new Os(X.paint_raster["raster-hue-rotate"]), "raster-brightness-min": new Os(X.paint_raster["raster-brightness-min"]), "raster-brightness-max": new Os(X.paint_raster["raster-brightness-max"]), "raster-saturation": new Os(X.paint_raster["raster-saturation"]), "raster-contrast": new Os(X.paint_raster["raster-contrast"]), "raster-resampling": new Os(X.paint_raster["raster-resampling"]), "raster-fade-duration": new Os(X.paint_raster["raster-fade-duration"]) }) }; class Pp extends oo { constructor(t) { super(t, {}), this.implementation = t; } is3D() { return "3d" === this.implementation.renderingMode } hasOffscreenPass() { return void 0 !== this.implementation.prerender } recalculate() { } updateTransitions() { } hasTransition() { } serialize() { } onAdd(t) { this.implementation.onAdd && this.implementation.onAdd(t, t.painter.context.gl); } onRemove(t) { this.implementation.onRemove && this.implementation.onRemove(t, t.painter.context.gl); } } var Dp = { paint: new Ns({ "sky-type": new Os(X.paint_sky["sky-type"]), "sky-atmosphere-sun": new Os(X.paint_sky["sky-atmosphere-sun"]), "sky-atmosphere-sun-intensity": new Os(X.paint_sky["sky-atmosphere-sun-intensity"]), "sky-gradient-center": new Os(X.paint_sky["sky-gradient-center"]), "sky-gradient-radius": new Os(X.paint_sky["sky-gradient-radius"]), "sky-gradient": new qs(X.paint_sky["sky-gradient"]), "sky-atmosphere-halo-color": new Os(X.paint_sky["sky-atmosphere-halo-color"]), "sky-atmosphere-color": new Os(X.paint_sky["sky-atmosphere-color"]), "sky-opacity": new Os(X.paint_sky["sky-opacity"]) }) }; function Bp(t, e, i) { const r = Qo(0, 0, 1), n = gl(ml()); return function (t, e, i) { i *= .5; var r = e[0], n = e[1], s = e[2], a = e[3], o = Math.sin(i), l = Math.cos(i); t[0] = r * l - s * o, t[1] = n * l + a * o, t[2] = s * l + r * o, t[3] = a * l - n * o; }(n, n, i ? -u(t) + Math.PI : u(t)), xl(n, n, -u(e)), hl(r, r, n), sl(r, r) } const Vp = { circle: class extends oo { constructor(t) { super(t, Lo); } createBucket(t) { return new xo(t) } queryRadius(t) { const e = t; return Co("circle-radius", this, e) + Co("circle-stroke-width", this, e) + Po(this.paint.get("circle-translate")) } queryIntersectsFeature(t, e, i, r, n, s, a, o) { const l = "map" === this.paint.get("circle-pitch-alignment"); if (l && t.queryGeometry.isAboveHorizon) return !1; const h = Bo(this.paint.get("circle-translate"), this.paint.get("circle-translate-anchor"), s.angle, t.pixelToTileUnitsFactor), u = this.paint.get("circle-radius").evaluate(e, i) + this.paint.get("circle-stroke-width").evaluate(e, i), c = l ? u * t.pixelToTileUnitsFactor : u; for (const e of r) for (const i of e) { const e = i.add(h), r = o && s.elevation ? s.elevation.exaggeration() * o.getElevationAt(e.x, e.y, !0) : 0, n = l ? e : wl(e, r, a), u = l ? t.tilespaceRays.map((t => Sl(t, r))) : t.queryGeometry.screenGeometry; let p = c; const d = yl([], [i.x, i.y, r, 1], a); if ("viewport" === this.paint.get("circle-pitch-scale") && "map" === this.paint.get("circle-pitch-alignment") ? p *= d[3] / s.cameraToCenterDistance : "map" === this.paint.get("circle-pitch-scale") && "viewport" === this.paint.get("circle-pitch-alignment") && (p *= s.cameraToCenterDistance / d[3]), vo(u, n, p)) return !0 } return !1 } getProgramIds() { return ["circle"] } getProgramConfiguration(t) { return new Qa(this, t) } }, heatmap: class extends oo { createBucket(t) { return new zl(t) } constructor(t) { super(t, Pl), this._updateColorRamp(); } _handleSpecialPaintPropertyUpdate(t) { "heatmap-color" === t && this._updateColorRamp(); } _updateColorRamp() { this.colorRamp = Dl({ expression: this._transitionablePaint._values["heatmap-color"].value.expression, evaluationKey: "heatmapDensity", image: this.colorRamp }), this.colorRampTexture = null; } resize() { this.heatmapFbo && (this.heatmapFbo.destroy(), this.heatmapFbo = null); } queryRadius() { return 0 } queryIntersectsFeature() { return !1 } hasOffscreenPass() { return 0 !== this.paint.get("heatmap-opacity") && "none" !== this.visibility } getProgramIds() { return ["heatmap", "heatmapTexture"] } getProgramConfiguration(t) { return new Qa(this, t) } }, hillshade: class extends oo { constructor(t) { super(t, Bl); } hasOffscreenPass() { return 0 !== this.paint.get("hillshade-exaggeration") && "none" !== this.visibility } getProgramIds() { return ["hillshade", "hillshadePrepare"] } getProgramConfiguration(t) { return new Qa(this, t) } }, fill: class extends oo { constructor(t) { super(t, bh); } getProgramIds() { const t = this.paint.get("fill-pattern"), e = t && t.constantOr(1), i = [e ? "fillPattern" : "fill"]; return this.paint.get("fill-antialias") && i.push(e && !this.getPaintProperty("fill-outline-color") ? "fillOutlinePattern" : "fillOutline"), i } getProgramConfiguration(t) { return new Qa(this, t) } recalculate(t, e) { super.recalculate(t, e); const i = this.paint._values["fill-outline-color"]; "constant" === i.value.kind && void 0 === i.value.value && (this.paint._values["fill-outline-color"] = this.paint._values["fill-color"]); } createBucket(t) { return new _h(t) } queryRadius() { return Po(this.paint.get("fill-translate")) } queryIntersectsFeature(t, e, i, r, n, s) { return !t.queryGeometry.isAboveHorizon && bo(Do(t.tilespaceGeometry, this.paint.get("fill-translate"), this.paint.get("fill-translate-anchor"), s.angle, t.pixelToTileUnitsFactor), r) } isTileClipped() { return !0 } }, "fill-extrusion": class extends oo { constructor(t) { super(t, du); } createBucket(t) { return new cu(t) } queryRadius() { return Po(this.paint.get("fill-extrusion-translate")) } is3D() { return !0 } getProgramIds() { return [this.paint.get("fill-extrusion-pattern").constantOr(1) ? "fillExtrusionPattern" : "fillExtrusion"] } getProgramConfiguration(t) { return new Qa(this, t) } queryIntersectsFeature(t, e, r, n, s, a, o, l, h) { const u = Bo(this.paint.get("fill-extrusion-translate"), this.paint.get("fill-extrusion-translate-anchor"), a.angle, t.pixelToTileUnitsFactor), c = this.paint.get("fill-extrusion-height").evaluate(e, r), p = this.paint.get("fill-extrusion-base").evaluate(e, r), d = [0, 0], f = l && a.elevation, y = a.elevation ? a.elevation.exaggeration() : 1; if (f) { const e = t.tile.getBucket(this).centroidVertexArray, i = h + 1; if (i < e.length) { const t = e.get(i); d[0] = t.a_centroid_pos0, d[1] = t.a_centroid_pos1; } } if (0 === d[0] && 1 === d[1]) return !1; const m = function (t, e, r, n, s, a, o, l, h) { return a ? function (t, e, i, r, n, s, a, o, l) { const h = [], u = [], c = [0, 0, 0, 1]; for (const p of t) { const t = [], d = []; for (const h of p) { const u = h.x + r.x, p = h.y + r.y, f = gu(u, p, e, i, s, a, o, l); c[0] = u, c[1] = p, c[2] = f.base, c[3] = 1, yl(c, c, n), c[3] = Math.max(c[3], 1e-5); const y = mu([c[0] / c[3], c[1] / c[3], c[2] / c[3]]); c[0] = u, c[1] = p, c[2] = f.top, c[3] = 1, yl(c, c, n), c[3] = Math.max(c[3], 1e-5); const m = mu([c[0] / c[3], c[1] / c[3], c[2] / c[3]]); t.push(y), d.push(m); } h.push(t), u.push(d); } return [h, u] }(t, e, r, n, s, a, o, l, h) : function (t, e, r, n, s) { const a = [], o = [], l = s[8] * e, h = s[9] * e, u = s[10] * e, c = s[11] * e, p = s[8] * r, d = s[9] * r, f = s[10] * r, y = s[11] * r; for (const e of t) { const t = [], r = []; for (const a of e) { const e = a.x + n.x, o = a.y + n.y, m = s[0] * e + s[4] * o + s[12], g = s[1] * e + s[5] * o + s[13], x = s[2] * e + s[6] * o + s[14], _ = s[3] * e + s[7] * o + s[15], v = m + l, b = g + h, w = x + u, k = Math.max(_ + c, 1e-5), A = m + p, S = g + d, z = x + f, I = Math.max(_ + y, 1e-5), M = new i(v / k, b / k); M.z = w / k, t.push(M); const T = new i(A / I, S / I); T.z = z / I, r.push(T); } a.push(t), o.push(r); } return [a, o] }(t, e, r, n, s) }(n, p, c, u, o, f ? l : null, d, y, a.center.lat), g = t.queryGeometry; return function (t, e, i) { let r = 1 / 0; bo(i, e) && (r = yu(i, e[0])); for (let n = 0; n < e.length; n++) { const s = e[n], a = t[n]; for (let t = 0; t < s.length - 1; t++) { const e = s[t], n = [e, s[t + 1], a[t + 1], a[t], e]; _o(i, n) && (r = Math.min(r, yu(i, n))); } } return r !== 1 / 0 && r }(m[0], m[1], g.isPointQuery() ? g.screenBounds : g.screenGeometry) } }, line: class extends oo { constructor(t) { super(t, zu), this.gradientVersion = 0; } _handleSpecialPaintPropertyUpdate(t) { if ("line-gradient" === t) { const t = this._transitionablePaint._values["line-gradient"].value.expression; this.stepInterpolant = t._styleExpression && t._styleExpression.expression instanceof be, this.gradientVersion = (this.gradientVersion + 1) % o; } } gradientExpression() { return this._transitionablePaint._values["line-gradient"].value.expression } recalculate(t, e) { super.recalculate(t, e), this.paint._values["line-floorwidth"] = Iu.possiblyEvaluate(this._transitioningPaint._values["line-width"].value, t); } createBucket(t) { return new Au(t) } getProgramIds() { const t = this.paint.get("line-dasharray"), e = this.paint.get("line-pattern").constantOr(1), i = this.paint.get("line-gradient"); return [e ? "linePattern" : t ? "lineSDF" : i ? "lineGradient" : "line"] } getProgramConfiguration(t) { return new Qa(this, t) } queryRadius(t) { const e = t, i = Mu(Co("line-width", this, e), Co("line-gap-width", this, e)), r = Co("line-offset", this, e); return i / 2 + Math.abs(r) + Po(this.paint.get("line-translate")) } queryIntersectsFeature(t, e, r, n, s, a) { if (t.queryGeometry.isAboveHorizon) return !1; const o = Do(t.tilespaceGeometry, this.paint.get("line-translate"), this.paint.get("line-translate-anchor"), a.angle, t.pixelToTileUnitsFactor), l = t.pixelToTileUnitsFactor / 2 * Mu(this.paint.get("line-width").evaluate(e, r), this.paint.get("line-gap-width").evaluate(e, r)), h = this.paint.get("line-offset").evaluate(e, r); return h && (n = function (t, e) { const r = [], n = new i(0, 0); for (let i = 0; i < t.length; i++) { const s = t[i], a = []; for (let t = 0; t < s.length; t++) { const i = s[t - 1], r = s[t], o = s[t + 1], l = 0 === t ? n : r.sub(i)._unit()._perp(), h = t === s.length - 1 ? n : o.sub(r)._unit()._perp(), u = l._add(h)._unit(); u._mult(1 / (u.x * h.x + u.y * h.y)), a.push(u._mult(e)._add(r)); } r.push(a); } return r }(n, h * t.pixelToTileUnitsFactor)), function (t, e, i) { for (let r = 0; r < e.length; r++) { const n = e[r]; if (t.length >= 3) for (let e = 0; e < n.length; e++)if (Mo(t, n[e])) return !0; if (wo(t, n, i)) return !0 } return !1 }(o, n, l) } isTileClipped() { return !0 } }, symbol: Tp, background: class extends oo { constructor(t) { super(t, Ep); } getProgramIds() { return [this.paint.get("background-pattern") ? "backgroundPattern" : "background"] } }, raster: class extends oo { constructor(t) { super(t, Cp); } getProgramIds() { return ["raster"] } }, sky: class extends oo { constructor(t) { super(t, Dp), this._updateColorRamp(); } _handleSpecialPaintPropertyUpdate(t) { "sky-gradient" === t ? this._updateColorRamp() : "sky-atmosphere-sun" !== t && "sky-atmosphere-halo-color" !== t && "sky-atmosphere-color" !== t && "sky-atmosphere-sun-intensity" !== t || (this._skyboxInvalidated = !0); } _updateColorRamp() { this.colorRamp = Dl({ expression: this._transitionablePaint._values["sky-gradient"].value.expression, evaluationKey: "skyRadialProgress" }), this.colorRampTexture && (this.colorRampTexture.destroy(), this.colorRampTexture = null); } needsSkyboxCapture(t) { if (this._skyboxInvalidated || !this.skyboxTexture || !this.skyboxGeometry) return !0; if (!this.paint.get("sky-atmosphere-sun")) { const e = t.style.light.properties.get("position"); return this._lightPosition.azimuthal !== e.azimuthal || this._lightPosition.polar !== e.polar } } getCenter(t, e) { const i = this.paint.get("sky-type"); if ("atmosphere" === i) { const i = this.paint.get("sky-atmosphere-sun"), r = !i, n = t.style.light, s = n.properties.get("position"); return r && "viewport" === n.properties.get("anchor") && C("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."), r ? Bp(s.azimuthal, 90 - s.polar, e) : Bp(i[0], 90 - i[1], e) } if ("gradient" === i) { const t = this.paint.get("sky-gradient-center"); return Bp(t[0], 90 - t[1], e) } } is3D() { return !1 } isSky() { return !0 } markSkyboxValid(t) { this._skyboxInvalidated = !1, this._lightPosition = t.style.light.properties.get("position"); } hasOffscreenPass() { return !0 } getProgramIds() { const t = this.paint.get("sky-type"); return "atmosphere" === t ? ["skyboxCapture", "skybox"] : "gradient" === t ? ["skyboxGradient"] : null } } }, { HTMLImageElement: Lp, HTMLCanvasElement: Fp, HTMLVideoElement: Rp, ImageData: Op, ImageBitmap: Up } = n; class $p { constructor(t, e, i, r) { this.context = t, this.format = i, this.texture = t.gl.createTexture(), this.update(e, r); } update(t, e, i) { const { width: r, height: n } = t, s = !(this.size && this.size[0] === r && this.size[1] === n || i), { context: a } = this, { gl: o } = a; if (this.useMipmap = Boolean(e && e.useMipmap), o.bindTexture(o.TEXTURE_2D, this.texture), a.pixelStoreUnpackFlipY.set(!1), a.pixelStoreUnpack.set(1), a.pixelStoreUnpackPremultiplyAlpha.set(this.format === o.RGBA && (!e || !1 !== e.premultiply)), s) this.size = [r, n], t instanceof Lp || t instanceof Fp || t instanceof Rp || t instanceof Op || Up && t instanceof Up ? o.texImage2D(o.TEXTURE_2D, 0, this.format, this.format, o.UNSIGNED_BYTE, t) : o.texImage2D(o.TEXTURE_2D, 0, this.format, r, n, 0, this.format, o.UNSIGNED_BYTE, t.data); else { const { x: e, y: s } = i || { x: 0, y: 0 }; t instanceof Lp || t instanceof Fp || t instanceof Rp || t instanceof Op || Up && t instanceof Up ? o.texSubImage2D(o.TEXTURE_2D, 0, e, s, o.RGBA, o.UNSIGNED_BYTE, t) : o.texSubImage2D(o.TEXTURE_2D, 0, e, s, r, n, o.RGBA, o.UNSIGNED_BYTE, t.data); } this.useMipmap && this.isSizePowerOfTwo() && o.generateMipmap(o.TEXTURE_2D); } bind(t, e, i) { const { context: r } = this, { gl: n } = r; n.bindTexture(n.TEXTURE_2D, this.texture), i !== n.LINEAR_MIPMAP_NEAREST || this.isSizePowerOfTwo() || (i = n.LINEAR), t !== this.filter && (n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, t), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, i || t), this.filter = t), e !== this.wrap && (n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, e), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, e), this.wrap = e); } isSizePowerOfTwo() { return this.size[0] === this.size[1] && Math.log(this.size[0]) / Math.LN2 % 1 == 0 } destroy() { const { gl: t } = this.context; t.deleteTexture(this.texture), this.texture = null; } } class Zp { constructor(t, e) { this.width = t, this.height = e, this.nextRow = 0, this.image = new El({ width: t, height: e }), this.positions = {}, this.uploaded = !1; } getDash(t, e) { const i = this.getKey(t, e); return this.positions[i] } trim() { const t = this.width, e = this.height = k(this.nextRow); this.image.resize({ width: t, height: e }); } getKey(t, e) { return t.join(",") + e } getDashRanges(t, e, i) { const r = []; let n = t.length % 2 == 1 ? -t[t.length - 1] * i : 0, s = t[0] * i, a = !0; r.push({ left: n, right: s, isDash: a, zeroLength: 0 === t[0] }); let o = t[0]; for (let e = 1; e < t.length; e++) { a = !a; const l = t[e]; n = o * i, o += l, s = o * i, r.push({ left: n, right: s, isDash: a, zeroLength: 0 === l }); } return r } addRoundDash(t, e, i) { const r = e / 2; for (let e = -i; e <= i; e++) { const n = this.width * (this.nextRow + i + e); let s = 0, a = t[s]; for (let o = 0; o < this.width; o++) { o / a.right > 1 && (a = t[++s]); const l = Math.abs(o - a.left), h = Math.abs(o - a.right), u = Math.min(l, h); let c; const p = e / i * (r + 1); if (a.isDash) { const t = r - Math.abs(p); c = Math.sqrt(u * u + t * t); } else c = r - Math.sqrt(u * u + p * p); this.image.data[n + o] = Math.max(0, Math.min(255, c + 128)); } } } addRegularDash(t, e) { for (let e = t.length - 1; e >= 0; --e) { const i = t[e], r = t[e + 1]; i.zeroLength ? t.splice(e, 1) : r && r.isDash === i.isDash && (r.left = i.left, t.splice(e, 1)); } const i = t[0], r = t[t.length - 1]; i.isDash === r.isDash && (i.left = r.left - this.width, r.right = i.right + this.width); const n = this.width * this.nextRow; let s = 0, a = t[s]; for (let i = 0; i < this.width; i++) { i / a.right > 1 && (a = t[++s]); const r = Math.abs(i - a.left), o = Math.abs(i - a.right), l = Math.min(r, o); this.image.data[n + i] = Math.max(0, Math.min(255, (a.isDash ? l : -l) + e + 128)); } } addDash(t, e) { const i = this.getKey(t, e); if (this.positions[i]) return this.positions[i]; const r = "round" === e, n = r ? 7 : 0, s = 2 * n + 1; if (this.nextRow + s > this.height) return C("LineAtlas out of space"), null; 0 === t.length && t.push(1); let a = 0; for (let e = 0; e < t.length; e++)t[e] < 0 && (C("Negative value is found in line dasharray, replacing values with 0"), t[e] = 0), a += t[e]; if (0 !== a) { const i = this.width / a, s = this.getDashRanges(t, this.width, i); r ? this.addRoundDash(s, i, n) : this.addRegularDash(s, "square" === e ? .5 * i : 0); } const o = this.nextRow + n; this.nextRow += s; const l = { tl: [o, n], br: [a, 0] }; return this.positions[i] = l, l } } Rr("LineAtlas", Zp); class qp { constructor(t) { this._callback = t, this._triggered = !1, "undefined" != typeof MessageChannel && (this._channel = new MessageChannel, this._channel.port2.onmessage = () => { this._triggered = !1, this._callback(); }); } trigger() { this._triggered || (this._triggered = !0, this._channel ? this._channel.port1.postMessage(!0) : setTimeout((() => { this._triggered = !1, this._callback(); }), 0)); } remove() { delete this._channel, this._callback = () => { }; } } const Np = n.performance; function jp(t) { const e = t ? t.url.toString() : void 0; return Np.getEntriesByName(e) } class Gp { constructor() { this.tasks = {}, this.taskQueue = [], S(["process"], this), this.invoker = new qp(this.process), this.nextId = 0; } add(t, e) { const i = this.nextId++, r = function ({ type: t, isSymbolTile: e, zoom: i }) { return i = i || 0, "message" === t ? 0 : "maybePrepare" !== t || e ? "parseTile" !== t || e ? "parseTile" === t && e ? 300 - i : "maybePrepare" === t && e ? 400 - i : 500 : 200 - i : 100 - i }(e); if (0 === r) { B(); try { t(); } finally { } return { cancel: () => { } } } return this.tasks[i] = { fn: t, metadata: e, priority: r, id: i }, this.taskQueue.push(i), this.invoker.trigger(), { cancel: () => { delete this.tasks[i]; } } } process() { B(); try { if (this.taskQueue = this.taskQueue.filter((t => !!this.tasks[t])), !this.taskQueue.length) return; const t = this.pick(); if (null === t) return; const e = this.tasks[t]; if (delete this.tasks[t], this.taskQueue.length && this.invoker.trigger(), !e) return; e.fn(); } finally { } } pick() { let t = null, e = 1 / 0; for (let i = 0; i < this.taskQueue.length; i++) { const r = this.tasks[this.taskQueue[i]]; r.priority < e && (e = r.priority, t = i); } if (null === t) return null; const i = this.taskQueue[t]; return this.taskQueue.splice(t, 1), i } remove() { this.invoker.remove(); } } class Xp { constructor(t) { this._stringToNumber = {}, this._numberToString = []; for (let e = 0; e < t.length; e++) { const i = t[e]; this._stringToNumber[i] = e, this._numberToString[e] = i; } } encode(t) { return this._stringToNumber[t] } decode(t) { return this._numberToString[t] } } class Kp { constructor(t, e, i, r, n) { this.type = "Feature", this._vectorTileFeature = t, t._z = e, t._x = i, t._y = r, this.properties = t.properties, this.id = n; } get geometry() { return void 0 === this._geometry && (this._geometry = this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x, this._vectorTileFeature._y, this._vectorTileFeature._z).geometry), this._geometry } set geometry(t) { this._geometry = t; } toJSON() { const t = { geometry: this.geometry }; for (const e in this) "_geometry" !== e && "_vectorTileFeature" !== e && (t[e] = this[e]); return t } } var Hp = Hs([{ name: "a_pos", type: "Int16", components: 2 }]); class Wp { constructor(t, e, i) { this.tileID = t, this.uid = b(), this.uses = 0, this.tileSize = e, this.tileZoom = i, this.buckets = {}, this.expirationTime = null, this.queryPadding = 0, this.hasSymbolBuckets = !1, this.hasRTLText = !1, this.dependencies = {}, this.expiredRequestCount = 0, this.state = "loading"; } registerFadeDuration(t) { const e = t + this.timeAdded; e < vs.now() || this.fadeEndTime && e < this.fadeEndTime || (this.fadeEndTime = e); } wasRequested() { return "errored" === this.state || "loaded" === this.state || "reloading" === this.state } loadVectorData(t, e, i) { if (this.hasData() && this.unloadVectorData(), this.state = "loaded", t) { t.featureIndex && (this.latestFeatureIndex = t.featureIndex, t.rawTileData ? (this.latestRawTileData = t.rawTileData, this.latestFeatureIndex.rawTileData = t.rawTileData) : this.latestRawTileData && (this.latestFeatureIndex.rawTileData = this.latestRawTileData)), this.collisionBoxArray = t.collisionBoxArray, this.buckets = function (t, e) { const i = {}; if (!e) return i; for (const r of t) { const t = r.layerIds.map((t => e.getLayer(t))).filter(Boolean); if (0 !== t.length) { r.layers = t, r.stateDependentLayerIds && (r.stateDependentLayers = r.stateDependentLayerIds.map((e => t.filter((t => t.id === e))[0]))); for (const e of t) i[e.id] = r; } } return i }(t.buckets, e.style), this.hasSymbolBuckets = !1; for (const t in this.buckets) { const e = this.buckets[t]; if (e instanceof Sp) { if (this.hasSymbolBuckets = !0, !i) break; e.justReloaded = !0; } } if (this.hasRTLText = !1, this.hasSymbolBuckets) for (const t in this.buckets) { const e = this.buckets[t]; if (e instanceof Sp && e.hasRTLText) { this.hasRTLText = !0, Ts.isLoading() || Ts.isLoaded() || "deferred" !== Ms() || function () { if ("deferred" !== ks || !As) throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified"); ks = bs, zs(), As && hs({ url: As }, (t => { t ? Ss(t) : (ks = ws, zs()); })); }(); break } } this.queryPadding = 0; for (const t in this.buckets) { const i = this.buckets[t]; this.queryPadding = Math.max(this.queryPadding, e.style.getLayer(t).queryRadius(i)); } t.imageAtlas && (this.imageAtlas = t.imageAtlas), t.glyphAtlasImage && (this.glyphAtlasImage = t.glyphAtlasImage), t.lineAtlas && (this.lineAtlas = t.lineAtlas); } else this.collisionBoxArray = new va; } unloadVectorData() { for (const t in this.buckets) this.buckets[t].destroy(); this.buckets = {}, this.imageAtlas && (this.imageAtlas = null), this.lineAtlas && (this.lineAtlas = null), this.imageAtlasTexture && this.imageAtlasTexture.destroy(), this.glyphAtlasTexture && this.glyphAtlasTexture.destroy(), this.lineAtlasTexture && this.lineAtlasTexture.destroy(), this.latestFeatureIndex = null, this.state = "unloaded"; } getBucket(t) { return this.buckets[t.id] } upload(t) { for (const e in this.buckets) { const i = this.buckets[e]; i.uploadPending() && i.upload(t); } const e = t.gl; this.imageAtlas && !this.imageAtlas.uploaded && (this.imageAtlasTexture = new $p(t, this.imageAtlas.image, e.RGBA), this.imageAtlas.uploaded = !0), this.glyphAtlasImage && (this.glyphAtlasTexture = new $p(t, this.glyphAtlasImage, e.ALPHA), this.glyphAtlasImage = null), this.lineAtlas && !this.lineAtlas.uploaded && (this.lineAtlasTexture = new $p(t, this.lineAtlas.image, e.ALPHA), this.lineAtlas.uploaded = !0); } prepare(t) { this.imageAtlas && this.imageAtlas.patchUpdatedImages(t, this.imageAtlasTexture); } queryRenderedFeatures(t, e, i, r, n, s, a, o) { return this.latestFeatureIndex && this.latestFeatureIndex.rawTileData ? this.latestFeatureIndex.query({ tileResult: r, pixelPosMatrix: a, transform: s, params: n }, t, e, i) : {} } querySourceFeatures(t, e) { const i = this.latestFeatureIndex; if (!i || !i.rawTileData) return; const r = i.loadVTLayers(), n = e ? e.sourceLayer : "", s = r._geojsonTileLayer || r[n]; if (!s) return; const a = er(e && e.filter), { z: o, x: l, y: h } = this.tileID.canonical, u = { z: o, x: l, y: h }; for (let e = 0; e < s.length; e++) { const r = s.feature(e); if (a.needGeometry) { const t = mo(r, !0); if (!a.filter(new Es(this.tileID.overscaledZ), t, this.tileID.canonical)) continue } else if (!a.filter(new Es(this.tileID.overscaledZ), r)) continue; const c = i.getId(r, n), p = new Kp(r, o, l, h, c); p.tile = u, t.push(p); } } hasData() { return "loaded" === this.state || "reloading" === this.state || "expired" === this.state } patternsLoaded() { return this.imageAtlas && !!Object.keys(this.imageAtlas.patternPositions).length } setExpiryData(t) { const e = this.expirationTime; if (t.cacheControl) { const e = V(t.cacheControl); e["max-age"] && (this.expirationTime = Date.now() + 1e3 * e["max-age"]); } else t.expires && (this.expirationTime = new Date(t.expires).getTime()); if (this.expirationTime) { const t = Date.now(); let i = !1; if (this.expirationTime > t) i = !1; else if (e) if (this.expirationTime < e) i = !0; else { const r = this.expirationTime - e; r ? this.expirationTime = t + Math.max(r, 3e4) : i = !0; } else i = !0; i ? (this.expiredRequestCount++, this.state = "expired") : this.expiredRequestCount = 0; } } getExpiryTimeout() { if (this.expirationTime) return this.expiredRequestCount ? 1e3 * (1 << Math.min(this.expiredRequestCount - 1, 31)) : Math.min(this.expirationTime - (new Date).getTime(), Math.pow(2, 31) - 1) } setFeatureState(t, e) { if (!this.latestFeatureIndex || !this.latestFeatureIndex.rawTileData || 0 === Object.keys(t).length) return; const i = this.latestFeatureIndex.loadVTLayers(); for (const r in this.buckets) { if (!e.style.hasLayer(r)) continue; const n = this.buckets[r], s = n.layers[0].sourceLayer || "_geojsonTileLayer", a = i[s], o = t[s]; if (!a || !o || 0 === Object.keys(o).length) continue; n.update(o, a, this.imageAtlas && this.imageAtlas.patternPositions || {}); const l = e && e.style && e.style.getLayer(r); l && (this.queryPadding = Math.max(this.queryPadding, l.queryRadius(n))); } } holdingForFade() { return void 0 !== this.symbolFadeHoldUntil } symbolFadeFinished() { return !this.symbolFadeHoldUntil || this.symbolFadeHoldUntil < vs.now() } clearFadeHold() { this.symbolFadeHoldUntil = void 0; } setHoldDuration(t) { this.symbolFadeHoldUntil = vs.now() + t; } setDependencies(t, e) { const i = {}; for (const t of e) i[t] = !0; this.dependencies[t] = i; } hasDependency(t, e) { for (const i of t) { const t = this.dependencies[i]; if (t) for (const i of e) if (t[i]) return !0 } return !1 } clearQueryDebugViz() { } } class Yp { constructor() { this.state = {}, this.stateChanges = {}, this.deletedStates = {}; } updateState(t, e, i) { const r = String(e); if (this.stateChanges[t] = this.stateChanges[t] || {}, this.stateChanges[t][r] = this.stateChanges[t][r] || {}, _(this.stateChanges[t][r], i), null === this.deletedStates[t]) { this.deletedStates[t] = {}; for (const e in this.state[t]) e !== r && (this.deletedStates[t][e] = null); } else if (this.deletedStates[t] && null === this.deletedStates[t][r]) { this.deletedStates[t][r] = {}; for (const e in this.state[t][r]) i[e] || (this.deletedStates[t][r][e] = null); } else for (const e in i) this.deletedStates[t] && this.deletedStates[t][r] && null === this.deletedStates[t][r][e] && delete this.deletedStates[t][r][e]; } removeFeatureState(t, e, i) { if (null === this.deletedStates[t]) return; const r = String(e); if (this.deletedStates[t] = this.deletedStates[t] || {}, i && void 0 !== e) null !== this.deletedStates[t][r] && (this.deletedStates[t][r] = this.deletedStates[t][r] || {}, this.deletedStates[t][r][i] = null); else if (void 0 !== e) if (this.stateChanges[t] && this.stateChanges[t][r]) for (i in this.deletedStates[t][r] = {}, this.stateChanges[t][r]) this.deletedStates[t][r][i] = null; else this.deletedStates[t][r] = null; else this.deletedStates[t] = null; } getState(t, e) { const i = String(e), r = _({}, (this.state[t] || {})[i], (this.stateChanges[t] || {})[i]); if (null === this.deletedStates[t]) return {}; if (this.deletedStates[t]) { const i = this.deletedStates[t][e]; if (null === i) return {}; for (const t in i) delete r[t]; } return r } initializeTileState(t, e) { t.setFeatureState(this.state, e); } coalesceChanges(t, e) { const i = {}; for (const t in this.stateChanges) { this.state[t] = this.state[t] || {}; const e = {}; for (const i in this.stateChanges[t]) this.state[t][i] || (this.state[t][i] = {}), _(this.state[t][i], this.stateChanges[t][i]), e[i] = this.state[t][i]; i[t] = e; } for (const t in this.deletedStates) { this.state[t] = this.state[t] || {}; const e = {}; if (null === this.deletedStates[t]) for (const i in this.state[t]) e[i] = {}, this.state[t][i] = {}; else for (const i in this.deletedStates[t]) { if (null === this.deletedStates[t][i]) this.state[t][i] = {}; else for (const e of Object.keys(this.deletedStates[t][i])) delete this.state[t][i][e]; e[i] = this.state[t][i]; } i[t] = i[t] || {}, _(i[t], e); } if (this.stateChanges = {}, this.deletedStates = {}, 0 !== Object.keys(i).length) for (const r in t) t[r].setFeatureState(i, e); } } class Jp { constructor(t) { this.size = t, this.minimums = [], this.maximums = [], this.leaves = []; } getElevation(t, e) { const i = this.toIdx(t, e); return { min: this.minimums[i], max: this.maximums[i] } } isLeaf(t, e) { return this.leaves[this.toIdx(t, e)] } toIdx(t, e) { return e * this.size + t } } function Qp(t, e, i, r) { let n = 0, s = Number.MAX_VALUE; for (let a = 0; a < 3; a++)if (Math.abs(r[a]) < 1e-15) { if (i[a] < t[a] || i[a] > e[a]) return null } else { const o = 1 / r[a]; let l = (t[a] - i[a]) * o, h = (e[a] - i[a]) * o; if (l > h) { const t = l; l = h, h = t; } if (l > n && (n = l), h < s && (s = h), n > s) return null } return n } function td(t, e, i, r, n, s, a, o, l, h, u) { const c = r - t, p = n - e, d = s - i, f = a - t, y = o - e, m = l - i, g = u[1] * m - u[2] * y, x = u[2] * f - u[0] * m, _ = u[0] * y - u[1] * f, v = c * g + p * x + d * _; if (Math.abs(v) < 1e-15) return null; const b = 1 / v, w = h[0] - t, k = h[1] - e, A = h[2] - i, S = (w * g + k * x + A * _) * b; if (S < 0 || S > 1) return null; const z = k * d - A * p, I = A * c - w * d, M = w * p - k * c, T = (u[0] * z + u[1] * I + u[2] * M) * b; return T < 0 || S + T > 1 ? null : (f * z + y * I + m * M) * b } function ed(t, e, i) { return (t - e) / (i - e) } function id(t, e, i, r, n, s, a, o, l) { const h = 1 << i, u = s - r, c = a - n, p = (t + 1) / h * u + r, d = (e + 0) / h * c + n, f = (e + 1) / h * c + n; o[0] = (t + 0) / h * u + r, o[1] = d, l[0] = p, l[1] = f; } class rd { constructor(t) { if (this.maximums = [], this.minimums = [], this.leaves = [], this.childOffsets = [], this.nodeCount = 0, this.dem = t, this._siblingOffset = [[0, 0], [1, 0], [0, 1], [1, 1]], !this.dem) return; const e = function (t) { const e = Math.ceil(Math.log2(t.dim / 8)), i = []; let r = Math.ceil(Math.pow(2, e)); const n = 1 / r, s = (t, e, i, r, n) => { const s = r ? 1 : 0, a = (t + 1) * i - s, o = e * i, l = (e + 1) * i - s; n[0] = t * i, n[1] = o, n[2] = a, n[3] = l; }; let a = new Jp(r); const o = []; for (let e = 0; e < r * r; e++) { s(e % r, Math.floor(e / r), n, !1, o); const i = sd(o[0], o[1], t), l = sd(o[2], o[1], t), h = sd(o[2], o[3], t), u = sd(o[0], o[3], t); a.minimums.push(Math.min(i, l, h, u)), a.maximums.push(Math.max(i, l, h, u)), a.leaves.push(1); } for (i.push(a), r /= 2; r >= 1; r /= 2) { const t = i[i.length - 1]; a = new Jp(r); for (let e = 0; e < r * r; e++) { s(e % r, Math.floor(e / r), 2, !0, o); const i = t.getElevation(o[0], o[1]), n = t.getElevation(o[2], o[1]), l = t.getElevation(o[2], o[3]), h = t.getElevation(o[0], o[3]), u = t.isLeaf(o[0], o[1]), c = t.isLeaf(o[2], o[1]), p = t.isLeaf(o[2], o[3]), d = t.isLeaf(o[0], o[3]), f = Math.min(i.min, n.min, l.min, h.min), y = Math.max(i.max, n.max, l.max, h.max), m = u && c && p && d; a.maximums.push(y), a.minimums.push(f), a.leaves.push(y - f <= 5 && m ? 1 : 0); } i.push(a); } return i }(this.dem), i = e.length - 1, r = e[i]; this._addNode(r.minimums[0], r.maximums[0], r.leaves[0]), this._construct(e, 0, 0, i, 0); } raycastRoot(t, e, i, r, n, s, a = 1) { return Qp([t, e, -100], [i, r, this.maximums[0] * a], n, s) } raycast(t, e, i, r, n, s, a = 1) { if (!this.nodeCount) return null; const o = this.raycastRoot(t, e, i, r, n, s, a); if (null == o) return null; const l = [], h = [], u = [], c = [], p = [{ idx: 0, t: o, nodex: 0, nodey: 0, depth: 0 }]; for (; p.length > 0;) { const { idx: o, t: d, nodex: f, nodey: y, depth: m } = p.pop(); if (this.leaves[o]) { id(f, y, m, t, e, i, r, u, c); const o = 1 << m, l = (f + 0) / o, h = (f + 1) / o, p = (y + 0) / o, g = (y + 1) / o, x = sd(l, p, this.dem) * a, _ = sd(h, p, this.dem) * a, v = sd(h, g, this.dem) * a, b = sd(l, g, this.dem) * a, w = td(u[0], u[1], x, c[0], u[1], _, c[0], c[1], v, n, s), k = td(c[0], c[1], v, u[0], c[1], b, u[0], u[1], x, n, s), A = Math.min(null !== w ? w : Number.MAX_VALUE, null !== k ? k : Number.MAX_VALUE); if (A !== Number.MAX_VALUE) return A; { const t = nl([], n, s, d); if (nd(x, _, b, v, ed(t[0], u[0], c[0]), ed(t[1], u[1], c[1])) >= t[2]) return d } continue } let g = 0; for (let p = 0; p < this._siblingOffset.length; p++) { id((f << 1) + this._siblingOffset[p][0], (y << 1) + this._siblingOffset[p][1], m + 1, t, e, i, r, u, c), u[2] = -100, c[2] = this.maximums[this.childOffsets[o] + p] * a; const d = Qp(u, c, n, s); if (null != d) { const t = d; l[p] = t; let e = !1; for (let i = 0; i < g && !e; i++)t >= l[h[i]] && (h.splice(i, 0, p), e = !0); e || (h[g] = p), g++; } } for (let t = 0; t < g; t++) { const e = h[t]; p.push({ idx: this.childOffsets[o] + e, t: l[e], nodex: (f << 1) + this._siblingOffset[e][0], nodey: (y << 1) + this._siblingOffset[e][1], depth: m + 1 }); } } return null } _addNode(t, e, i) { return this.minimums.push(t), this.maximums.push(e), this.leaves.push(i), this.childOffsets.push(0), this.nodeCount++ } _construct(t, e, i, r, n) { if (1 === t[r].isLeaf(e, i)) return; this.childOffsets[n] || (this.childOffsets[n] = this.nodeCount); const s = r - 1, a = t[s]; let o, l = 0; for (let t = 0; t < this._siblingOffset.length; t++) { const r = 2 * e + this._siblingOffset[t][0], n = 2 * i + this._siblingOffset[t][1], s = a.getElevation(r, n), h = a.isLeaf(r, n), u = this._addNode(s.min, s.max, h); h && (l |= 1 << t), o || (o = u); } for (let r = 0; r < this._siblingOffset.length; r++)l & 1 << r || this._construct(t, 2 * e + this._siblingOffset[r][0], 2 * i + this._siblingOffset[r][1], s, o + r); } } function nd(t, e, i, r, n, s) { return Ae(Ae(t, i, s), Ae(e, r, s), n) } function sd(t, e, i) { const r = i.dim, n = y(t * r - .5, 0, r - 1), s = y(e * r - .5, 0, r - 1), a = Math.floor(n), o = Math.floor(s), l = Math.min(a + 1, r - 1), h = Math.min(o + 1, r - 1); return nd(i.get(a, o), i.get(l, o), i.get(a, h), i.get(l, h), n - a, s - o) } const ad = { mapbox: [6553.6, 25.6, .1, 1e4], terrarium: [256, 1, 1 / 256, 32768] }; class od { get tree() { return this._tree || this._buildQuadTree(), this._tree } constructor(t, e, i, r = !1, n = !1) { if (this.uid = t, e.height !== e.width) throw new RangeError("DEM tiles must be square"); if (i && "mapbox" !== i && "terrarium" !== i) return C(`"${i}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`); this.stride = e.height; const s = this.dim = e.height - 2; if (this.data = new Uint32Array(e.data.buffer), this.encoding = i || "mapbox", this.borderReady = r, !r) { for (let t = 0; t < s; t++)this.data[this._idx(-1, t)] = this.data[this._idx(0, t)], this.data[this._idx(s, t)] = this.data[this._idx(s - 1, t)], this.data[this._idx(t, -1)] = this.data[this._idx(t, 0)], this.data[this._idx(t, s)] = this.data[this._idx(t, s - 1)]; this.data[this._idx(-1, -1)] = this.data[this._idx(0, 0)], this.data[this._idx(s, -1)] = this.data[this._idx(s - 1, 0)], this.data[this._idx(-1, s)] = this.data[this._idx(0, s - 1)], this.data[this._idx(s, s)] = this.data[this._idx(s - 1, s - 1)], n && this._buildQuadTree(); } } _buildQuadTree() { this._tree = new rd(this); } get(t, e, i = !1) { const r = new Uint8Array(this.data.buffer); i && (t = y(t, -1, this.dim), e = y(e, -1, this.dim)); const n = 4 * this._idx(t, e); return ("terrarium" === this.encoding ? this._unpackTerrarium : this._unpackMapbox)(r[n], r[n + 1], r[n + 2]) } static getUnpackVector(t) { return ad[t] } get unpackVector() { return ad[this.encoding] } _idx(t, e) { if (t < -1 || t >= this.dim + 1 || e < -1 || e >= this.dim + 1) throw new RangeError("out of range source coordinates for DEM data"); return (e + 1) * this.stride + (t + 1) } _unpackMapbox(t, e, i) { return (256 * t * 256 + 256 * e + i) / 10 - 1e4 } _unpackTerrarium(t, e, i) { return 256 * t + e + i / 256 - 32768 } static pack(t, e) { const i = [0, 0, 0, 0], r = od.getUnpackVector(e); let n = Math.floor((t + r[3]) / r[2]); return i[2] = n % 256, n = Math.floor(n / 256), i[1] = n % 256, n = Math.floor(n / 256), i[0] = n, i } getPixels() { return new Cl({ width: this.stride, height: this.stride }, new Uint8Array(this.data.buffer)) } backfillBorder(t, e, i) { if (this.dim !== t.dim) throw new Error("dem dimension mismatch"); let r = e * this.dim, n = e * this.dim + this.dim, s = i * this.dim, a = i * this.dim + this.dim; switch (e) { case -1: r = n - 1; break; case 1: n = r + 1; }switch (i) { case -1: s = a - 1; break; case 1: a = s + 1; }const o = -e * this.dim, l = -i * this.dim; for (let e = s; e < a; e++)for (let i = r; i < n; i++)this.data[this._idx(i, e)] = t.data[this._idx(i + o, e + l)]; } onDeserialize() { this._tree && (this._tree.dem = this); } } Rr("DEMData", od), Rr("DemMinMaxQuadTree", rd, { omit: ["dem"] }); class ld { constructor(t, e) { this.max = t, this.onRemove = e, this.reset(); } reset() { for (const t in this.data) for (const e of this.data[t]) e.timeout && clearTimeout(e.timeout), this.onRemove(e.value); return this.data = {}, this.order = [], this } add(t, e, i) { const r = t.wrapped().key; void 0 === this.data[r] && (this.data[r] = []); const n = { value: e, timeout: void 0 }; if (void 0 !== i && (n.timeout = setTimeout((() => { this.remove(t, n); }), i)), this.data[r].push(n), this.order.push(r), this.order.length > this.max) { const t = this._getAndRemoveByKey(this.order[0]); t && this.onRemove(t); } return this } has(t) { return t.wrapped().key in this.data } getAndRemove(t) { return this.has(t) ? this._getAndRemoveByKey(t.wrapped().key) : null } _getAndRemoveByKey(t) { const e = this.data[t].shift(); return e.timeout && clearTimeout(e.timeout), 0 === this.data[t].length && delete this.data[t], this.order.splice(this.order.indexOf(t), 1), e.value } getByKey(t) { const e = this.data[t]; return e ? e[0].value : null } get(t) { return this.has(t) ? this.data[t.wrapped().key][0].value : null } remove(t, e) { if (!this.has(t)) return this; const i = t.wrapped().key, r = void 0 === e ? 0 : this.data[i].indexOf(e), n = this.data[i][r]; return this.data[i].splice(r, 1), n.timeout && clearTimeout(n.timeout), 0 === this.data[i].length && delete this.data[i], this.onRemove(n.value), this.order.splice(this.order.indexOf(i), 1), this } setMaxSize(t) { for (this.max = t; this.order.length > this.max;) { const t = this._getAndRemoveByKey(this.order[0]); t && this.onRemove(t); } return this } filter(t) { const e = []; for (const i in this.data) for (const r of this.data[i]) t(r.value) || e.push(r); for (const t of e) this.remove(t.value.tileID, t); } } class hd { constructor(t, e, i) { this.func = t, this.mask = e, this.range = i; } } hd.ReadOnly = !1, hd.ReadWrite = !0, hd.disabled = new hd(519, hd.ReadOnly, [0, 1]); const ud = 7680; class cd { constructor(t, e, i, r, n, s) { this.test = t, this.ref = e, this.mask = i, this.fail = r, this.depthFail = n, this.pass = s; } } cd.disabled = new cd({ func: 519, mask: 0 }, 0, 0, ud, ud, ud); class pd { constructor(t, e, i) { this.blendFunction = t, this.blendColor = e, this.mask = i; } } pd.Replace = [1, 0], pd.disabled = new pd(pd.Replace, wt.transparent, [!1, !1, !1, !1]), pd.unblended = new pd(pd.Replace, wt.transparent, [!0, !0, !0, !0]), pd.alphaBlended = new pd([1, 771], wt.transparent, [!0, !0, !0, !0]); const dd = 1029, fd = 2305; class yd { constructor(t, e, i) { this.enable = t, this.mode = e, this.frontFace = i; } } yd.disabled = new yd(!1, dd, fd), yd.backCCW = new yd(!0, dd, fd), yd.backCW = new yd(!0, dd, 2304), yd.frontCW = new yd(!0, 1028, 2304), yd.frontCCW = new yd(!0, 1028, fd); class md extends q { constructor(t, e, i) { super(), this.id = t, this._onlySymbols = i, e.on("data", (t => { "source" === t.dataType && "metadata" === t.sourceDataType && (this._sourceLoaded = !0), this._sourceLoaded && !this._paused && "source" === t.dataType && "content" === t.sourceDataType && (this.reload(), this.transform && this.update(this.transform)); })), e.on("error", (() => { this._sourceErrored = !0; })), this._source = e, this._tiles = {}, this._cache = new ld(0, this._unloadTile.bind(this)), this._timers = {}, this._cacheTimers = {}, this._maxTileCacheSize = null, this._loadedParentTiles = {}, this._coveredTiles = {}, this._state = new Yp; } onAdd(t) { this.map = t, this._maxTileCacheSize = t ? t._maxTileCacheSize : null; } loaded() { if (this._sourceErrored) return !0; if (!this._sourceLoaded) return !1; if (!this._source.loaded()) return !1; for (const t in this._tiles) { const e = this._tiles[t]; if ("loaded" !== e.state && "errored" !== e.state) return !1 } return !0 } getSource() { return this._source } pause() { this._paused = !0; } resume() { if (!this._paused) return; const t = this._shouldReloadOnResume; this._paused = !1, this._shouldReloadOnResume = !1, t && this.reload(), this.transform && this.update(this.transform); } _loadTile(t, e) { return t.isSymbolTile = this._onlySymbols, this._source.loadTile(t, e) } _unloadTile(t) { if (this._source.unloadTile) return this._source.unloadTile(t, (() => { })) } _abortTile(t) { if (this._source.abortTile) return this._source.abortTile(t, (() => { })) } serialize() { return this._source.serialize() } prepare(t) { this._source.prepare && this._source.prepare(), this._state.coalesceChanges(this._tiles, this.map ? this.map.painter : null); for (const e in this._tiles) { const i = this._tiles[e]; i.upload(t), i.prepare(this.map.style.imageManager); } } getIds() { return x(this._tiles).map((t => t.tileID)).sort(gd).map((t => t.key)) } getRenderableIds(t) { const e = []; for (const i in this._tiles) this._isIdRenderable(+i, t) && e.push(this._tiles[i]); return t ? e.sort(((t, e) => { const r = t.tileID, n = e.tileID, s = new i(r.canonical.x, r.canonical.y)._rotate(this.transform.angle), a = new i(n.canonical.x, n.canonical.y)._rotate(this.transform.angle); return r.overscaledZ - n.overscaledZ || a.y - s.y || a.x - s.x })).map((t => t.tileID.key)) : e.map((t => t.tileID)).sort(gd).map((t => t.key)) } hasRenderableParent(t) { const e = this.findLoadedParent(t, 0); return !!e && this._isIdRenderable(e.tileID.key) } _isIdRenderable(t, e) { return this._tiles[t] && this._tiles[t].hasData() && !this._coveredTiles[t] && (e || !this._tiles[t].holdingForFade()) } reload() { if (this._paused) this._shouldReloadOnResume = !0; else { this._cache.reset(); for (const t in this._tiles) "errored" !== this._tiles[t].state && this._reloadTile(+t, "reloading"); } } _reloadTile(t, e) { const i = this._tiles[t]; i && ("loading" !== i.state && (i.state = e), this._loadTile(i, this._tileLoaded.bind(this, i, t, e))); } _tileLoaded(t, e, i, r) { if (r) return t.state = "errored", void (404 !== r.status ? this._source.fire(new Z(r, { tile: t })) : this.update(this.transform)); t.timeAdded = vs.now(), "expired" === i && (t.refreshedUponExpiration = !0), this._setTileReloadTimer(e, t), "raster-dem" === this.getSource().type && t.dem && this._backfillDEM(t), this._state.initializeTileState(t, this.map ? this.map.painter : null), this._source.fire(new $("data", { dataType: "source", tile: t, coord: t.tileID, sourceCacheId: this.id })); } _backfillDEM(t) { const e = this.getRenderableIds(); for (let r = 0; r < e.length; r++) { const n = e[r]; if (t.neighboringTiles && t.neighboringTiles[n]) { const e = this.getTileByID(n); i(t, e), i(e, t); } } function i(t, e) { if (!t.dem || t.dem.borderReady) return; t.needsHillshadePrepare = !0, t.needsDEMTextureUpload = !0; let i = e.tileID.canonical.x - t.tileID.canonical.x; const r = e.tileID.canonical.y - t.tileID.canonical.y, n = Math.pow(2, t.tileID.canonical.z), s = e.tileID.key; 0 === i && 0 === r || Math.abs(r) > 1 || (Math.abs(i) > 1 && (1 === Math.abs(i + n) ? i += n : 1 === Math.abs(i - n) && (i -= n)), e.dem && t.dem && (t.dem.backfillBorder(e.dem, i, r), t.neighboringTiles && t.neighboringTiles[s] && (t.neighboringTiles[s].backfilled = !0))); } } getTile(t) { return this.getTileByID(t.key) } getTileByID(t) { return this._tiles[t] } _retainLoadedChildren(t, e, i, r) { for (const n in this._tiles) { let s = this._tiles[n]; if (r[n] || !s.hasData() || s.tileID.overscaledZ <= e || s.tileID.overscaledZ > i) continue; let a = s.tileID; for (; s && s.tileID.overscaledZ > e + 1;) { const t = s.tileID.scaledTo(s.tileID.overscaledZ - 1); s = this._tiles[t.key], s && s.hasData() && (a = t); } let o = a; for (; o.overscaledZ > e;)if (o = o.scaledTo(o.overscaledZ - 1), t[o.key]) { r[a.key] = a; break } } } findLoadedParent(t, e) { if (t.key in this._loadedParentTiles) { const i = this._loadedParentTiles[t.key]; return i && i.tileID.overscaledZ >= e ? i : null } for (let i = t.overscaledZ - 1; i >= e; i--) { const e = t.scaledTo(i), r = this._getLoadedTile(e); if (r) return r } } _getLoadedTile(t) { const e = this._tiles[t.key]; return e && e.hasData() ? e : this._cache.getByKey(this._source.reparseOverscaled ? t.wrapped().key : t.canonical.key) } updateCacheSize(t, e) { e = e || this._source.tileSize; const i = Math.ceil(t.width / e) + 1, r = Math.ceil(t.height / e) + 1, n = Math.floor(i * r * 5), s = "number" == typeof this._maxTileCacheSize ? Math.min(this._maxTileCacheSize, n) : n; this._cache.setMaxSize(s); } handleWrapJump(t) { const e = Math.round((t - (void 0 === this._prevLng ? t : this._prevLng)) / 360); if (this._prevLng = t, e) { const t = {}; for (const i in this._tiles) { const r = this._tiles[i]; r.tileID = r.tileID.unwrapTo(r.tileID.wrap + e), t[r.tileID.key] = r; } this._tiles = t; for (const t in this._timers) clearTimeout(this._timers[t]), delete this._timers[t]; for (const t in this._tiles) this._setTileReloadTimer(+t, this._tiles[t]); } } update(t, e, i) { if (this.transform = t, !this._sourceLoaded || this._paused || this.transform.freezeTileCoverage) return; if (this.usedForTerrain && !i) return; let r; this.updateCacheSize(t, e), this.handleWrapJump(this.transform.center.lng), this._coveredTiles = {}, this.used || this.usedForTerrain ? this._source.tileID ? r = t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t => new Xh(t.canonical.z, t.wrap, t.canonical.z, t.canonical.x, t.canonical.y))) : (r = t.coveringTiles({ tileSize: e || this._source.tileSize, minzoom: this._source.minzoom, maxzoom: this._source.maxzoom, roundZoom: this._source.roundZoom && !i, reparseOverscaled: this._source.reparseOverscaled, isTerrainDEM: this.usedForTerrain }), this._source.hasTile && (r = r.filter((t => this._source.hasTile(t))))) : r = []; const n = this._updateRetainedTiles(r); if (xd(this._source.type) && 0 !== r.length) { const t = {}, e = {}, i = Object.keys(n); for (const r of i) { const i = n[r], s = this._tiles[r]; if (!s || s.fadeEndTime && s.fadeEndTime <= vs.now()) continue; const a = this.findLoadedParent(i, Math.max(i.overscaledZ - md.maxOverzooming, this._source.minzoom)); a && (this._addTile(a.tileID), t[a.tileID.key] = a.tileID), e[r] = i; } const s = r[r.length - 1].overscaledZ; for (const t in this._tiles) { const i = this._tiles[t]; if (n[t] || !i.hasData()) continue; let r = i.tileID; for (; r.overscaledZ > s;) { r = r.scaledTo(r.overscaledZ - 1); const s = this._tiles[r.key]; if (s && s.hasData() && e[r.key]) { n[t] = i.tileID; break } } } for (const e in t) n[e] || (this._coveredTiles[e] = !0, n[e] = t[e]); } for (const t in n) this._tiles[t].clearFadeHold(); const s = function (t, e) { const i = []; for (const r in t) r in e || i.push(r); return i }(this._tiles, n); for (const t of s) { const e = this._tiles[t]; e.hasSymbolBuckets && !e.holdingForFade() ? e.setHoldDuration(this.map._fadeDuration) : e.hasSymbolBuckets && !e.symbolFadeFinished() || this._removeTile(+t); } this._updateLoadedParentTileCache(), this._onlySymbols && this._source.afterUpdate && this._source.afterUpdate(); } releaseSymbolFadeTiles() { for (const t in this._tiles) this._tiles[t].holdingForFade() && this._removeTile(+t); } _updateRetainedTiles(t) { const e = {}; if (0 === t.length) return e; const i = {}, r = t[t.length - 1].overscaledZ, n = t[0].overscaledZ, s = Math.max(n - md.maxOverzooming, this._source.minzoom), a = Math.max(n + md.maxUnderzooming, this._source.minzoom), o = {}; for (const i of t) { const t = this._addTile(i); e[i.key] = i, t.hasData() || r < this._source.maxzoom && (o[i.key] = i); } this._retainLoadedChildren(o, r, a, e); for (const r of t) { let t = this._tiles[r.key]; if (t.hasData()) continue; if (r.canonical.z >= this._source.maxzoom) { const t = r.children(this._source.maxzoom)[0], i = this.getTile(t); if (i && i.hasData()) { e[t.key] = t; continue } } else { const t = r.children(this._source.maxzoom); if (e[t[0].key] && e[t[1].key] && e[t[2].key] && e[t[3].key]) continue } let n = t.wasRequested(); for (let a = r.overscaledZ - 1; a >= s; --a) { const s = r.scaledTo(a); if (i[s.key]) break; if (i[s.key] = !0, t = this.getTile(s), !t && n && (t = this._addTile(s)), t && (e[s.key] = s, n = t.wasRequested(), t.hasData())) break } } return e } _updateLoadedParentTileCache() { this._loadedParentTiles = {}; for (const t in this._tiles) { const e = []; let i, r = this._tiles[t].tileID; for (; r.overscaledZ > 0;) { if (r.key in this._loadedParentTiles) { i = this._loadedParentTiles[r.key]; break } e.push(r.key); const t = r.scaledTo(r.overscaledZ - 1); if (i = this._getLoadedTile(t), i) break; r = t; } for (const t of e) this._loadedParentTiles[t] = i; } } _addTile(t) { let e = this._tiles[t.key]; if (e) return e; e = this._cache.getAndRemove(t), e && (this._setTileReloadTimer(t.key, e), e.tileID = t, this._state.initializeTileState(e, this.map ? this.map.painter : null), this._cacheTimers[t.key] && (clearTimeout(this._cacheTimers[t.key]), delete this._cacheTimers[t.key], this._setTileReloadTimer(t.key, e))); const i = Boolean(e); return i || (e = new Wp(t, this._source.tileSize * t.overscaleFactor(), this.transform.tileZoom), this._loadTile(e, this._tileLoaded.bind(this, e, t.key, e.state))), e ? (e.uses++, this._tiles[t.key] = e, i || this._source.fire(new $("dataloading", { tile: e, coord: e.tileID, dataType: "source" })), e) : null } _setTileReloadTimer(t, e) { t in this._timers && (clearTimeout(this._timers[t]), delete this._timers[t]); const i = e.getExpiryTimeout(); i && (this._timers[t] = setTimeout((() => { this._reloadTile(t, "expired"), delete this._timers[t]; }), i)); } _removeTile(t) { const e = this._tiles[t]; e && (e.uses--, delete this._tiles[t], this._timers[t] && (clearTimeout(this._timers[t]), delete this._timers[t]), e.uses > 0 || (e.hasData() && "reloading" !== e.state ? this._cache.add(e.tileID, e, e.getExpiryTimeout()) : (e.aborted = !0, this._abortTile(e), this._unloadTile(e)))); } clearTiles() { this._shouldReloadOnResume = !1, this._paused = !1; for (const t in this._tiles) this._removeTile(+t); this._cache.reset(); } tilesIn(t, e, i) { const r = [], n = this.transform; if (!n) return r; for (const s in this._tiles) { const a = this._tiles[s]; if (i && a.clearQueryDebugViz(), a.holdingForFade()) continue; const o = t.containsTile(a, n, e); o && r.push(o); } return r } getVisibleCoordinates(t) { const e = this.getRenderableIds(t).map((t => this._tiles[t].tileID)); for (const t of e) t.projMatrix = this.transform.calculateProjMatrix(t.toUnwrapped()); return e } hasTransition() { if (this._source.hasTransition()) return !0; if (xd(this._source.type)) for (const t in this._tiles) { const e = this._tiles[t]; if (void 0 !== e.fadeEndTime && e.fadeEndTime >= vs.now()) return !0 } return !1 } setFeatureState(t, e, i) { this._state.updateState(t = t || "_geojsonTileLayer", e, i); } removeFeatureState(t, e, i) { this._state.removeFeatureState(t = t || "_geojsonTileLayer", e, i); } getFeatureState(t, e) { return this._state.getState(t = t || "_geojsonTileLayer", e) } setDependencies(t, e, i) { const r = this._tiles[t]; r && r.setDependencies(e, i); } reloadTilesForDependencies(t, e) { for (const i in this._tiles) this._tiles[i].hasDependency(t, e) && this._reloadTile(+i, "reloading"); this._cache.filter((i => !i.hasDependency(t, e))); } } function gd(t, e) { const i = Math.abs(2 * t.wrap) - +(t.wrap < 0), r = Math.abs(2 * e.wrap) - +(e.wrap < 0); return t.overscaledZ - e.overscaledZ || r - i || e.canonical.y - t.canonical.y || e.canonical.x - t.canonical.x } function xd(t) { return "raster" === t || "image" === t || "video" === t } md.maxOverzooming = 10, md.maxUnderzooming = 3; class _d { constructor(t, e, i) { this._demTile = t, this._dem = this._demTile.dem, this._scale = e, this._offset = i; } static create(t, e, i) { const r = i || t.findDEMTileFor(e); if (!r || !r.dem) return; const n = r.dem, s = r.tileID, a = 1 << e.canonical.z - s.canonical.z; return new _d(r, r.tileSize / co / a, [(e.canonical.x / a - s.canonical.x) * n.dim, (e.canonical.y / a - s.canonical.y) * n.dim]) } tileCoordToPixel(t, e) { const r = e * this._scale + this._offset[1], n = Math.floor(t * this._scale + this._offset[0]), s = Math.floor(r); return new i(n, s) } getElevationAt(t, e, i, r) { const n = t * this._scale + this._offset[0], s = e * this._scale + this._offset[1], a = Math.floor(n), o = Math.floor(s), l = this._dem; return r = !!r, i ? Ae(Ae(l.get(a, o, r), l.get(a, o + 1, r), s - o), Ae(l.get(a + 1, o, r), l.get(a + 1, o + 1, r), s - o), n - a) : l.get(a, o, r) } getElevationAtPixel(t, e, i) { return this._dem.get(t, e, !!i) } getMeterToDEM(t) { return (1 << this._demTile.tileID.canonical.z) * Ph(1, t) * this._dem.stride } } class vd { constructor(t, e) { this.tileID = t, this.x = t.canonical.x, this.y = t.canonical.y, this.z = t.canonical.z, this.grid = new Dr(co, 16, 0), this.featureIndexArray = new Ma, this.promoteId = e; } insert(t, e, i, r, n, s = 0) { const a = this.featureIndexArray.length; this.featureIndexArray.emplaceBack(i, r, n, s); const o = this.grid; for (let t = 0; t < e.length; t++) { const i = e[t], r = [1 / 0, 1 / 0, -1 / 0, -1 / 0]; for (let t = 0; t < i.length; t++) { const e = i[t]; r[0] = Math.min(r[0], e.x), r[1] = Math.min(r[1], e.y), r[2] = Math.max(r[2], e.x), r[3] = Math.max(r[3], e.y); } r[0] < co && r[1] < co && r[2] >= 0 && r[3] >= 0 && o.insert(a, r[0], r[1], r[2], r[3]); } } loadVTLayers() { return this.vtLayers || (this.vtLayers = new au.VectorTile(new ju(this.rawTileData)).layers, this.sourceLayerCoder = new Xp(this.vtLayers ? Object.keys(this.vtLayers).sort() : ["_geojsonTileLayer"])), this.vtLayers } query(t, e, i, r) { this.loadVTLayers(); const n = t.params || {}, s = er(n.filter), a = t.tileResult, o = t.transform, l = a.bufferedTilespaceBounds, h = this.grid.query(l.min.x, l.min.y, l.max.x, l.max.y, ((t, e, i, r) => To(a.bufferedTilespaceGeometry, t, e, i, r))); h.sort(wd); let u = null; o.elevation && h.length > 0 && (u = _d.create(o.elevation, this.tileID)); const c = {}; let p; for (let o = 0; o < h.length; o++) { const l = h[o]; if (l === p) continue; p = l; const d = this.featureIndexArray.get(l); let f = null; this.loadMatchingFeature(c, d, s, n.layers, n.availableImages, e, i, r, ((e, i, r, n = 0) => (f || (f = yo(e)), i.queryIntersectsFeature(a, e, r, f, this.z, t.transform, t.pixelPosMatrix, u, n)))); } return c } loadMatchingFeature(t, e, i, r, n, s, a, o, l) { const { featureIndex: h, bucketIndex: u, sourceLayerIndex: c, layoutVertexArrayOffset: p } = e, d = this.bucketLayerIDs[u]; if (r && !function (t, e) { for (let i = 0; i < t.length; i++)if (e.indexOf(t[i]) >= 0) return !0; return !1 }(r, d)) return; const f = this.sourceLayerCoder.decode(c), y = this.vtLayers[f].feature(h); if (i.needGeometry) { const t = mo(y, !0); if (!i.filter(new Es(this.tileID.overscaledZ), t, this.tileID.canonical)) return } else if (!i.filter(new Es(this.tileID.overscaledZ), y)) return; const m = this.getId(y, f); for (let e = 0; e < d.length; e++) { const i = d[e]; if (r && r.indexOf(i) < 0) continue; const u = s[i]; if (!u) continue; let c = {}; void 0 !== m && o && (c = o.getState(u.sourceLayer || "_geojsonTileLayer", m)); const f = _({}, a[i]); f.paint = bd(f.paint, u.paint, y, c, n), f.layout = bd(f.layout, u.layout, y, c, n); const g = !l || l(y, u, c, p); if (!g) continue; const x = new Kp(y, this.z, this.x, this.y, m); x.layer = f; let v = t[i]; void 0 === v && (v = t[i] = []), v.push({ featureIndex: h, feature: x, intersectionZ: g }); } } lookupSymbolFeatures(t, e, i, r, n, s, a, o) { const l = {}; this.loadVTLayers(); const h = er(n); for (const n of t) this.loadMatchingFeature(l, { bucketIndex: i, sourceLayerIndex: r, featureIndex: n, layoutVertexArrayOffset: 0 }, h, s, a, o, e); return l } hasLayer(t) { for (const e of this.bucketLayerIDs) for (const i of e) if (t === i) return !0; return !1 } getId(t, e) { let i = t.id; return this.promoteId && (i = t.properties["string" == typeof this.promoteId ? this.promoteId : this.promoteId[e]], "boolean" == typeof i && (i = Number(i))), i } } function bd(t, e, i, r, n) { return I(t, ((t, s) => { const a = e instanceof Rs ? e.get(s) : null; return a && a.evaluate ? a.evaluate(i, r, n) : a })) } function wd(t, e) { return e - t } Rr("FeatureIndex", vd, { omit: ["rawTileData", "sourceLayerCoder"] }); class kd { constructor(t) { const e = {}, i = []; for (const r in t) { const n = t[r], s = e[r] = {}; for (const t in n) { const e = n[+t]; if (!e || 0 === e.bitmap.width || 0 === e.bitmap.height) continue; const r = e.metrics.localGlyph ? 2 : 1, a = { x: 0, y: 0, w: e.bitmap.width + 2 * r, h: e.bitmap.height + 2 * r }; i.push(a), s[t] = { rect: a, metrics: e.metrics }; } } const { w: r, h: n } = fc(i), s = new El({ width: r || 1, height: n || 1 }); for (const i in t) { const r = t[i]; for (const t in r) { const n = r[+t]; if (!n || 0 === n.bitmap.width || 0 === n.bitmap.height) continue; const a = e[i][t].rect, o = n.metrics.localGlyph ? 2 : 1; El.copy(n.bitmap, s, { x: 0, y: 0 }, { x: a.x + o, y: a.y + o }, n.bitmap); } } this.image = s, this.positions = e; } } Rr("GlyphAtlas", kd); class Ad { constructor(t) { this.tileID = new Xh(t.tileID.overscaledZ, t.tileID.wrap, t.tileID.canonical.z, t.tileID.canonical.x, t.tileID.canonical.y), this.tileZoom = t.tileZoom, this.uid = t.uid, this.zoom = t.zoom, this.pixelRatio = t.pixelRatio, this.tileSize = t.tileSize, this.source = t.source, this.overscaling = this.tileID.overscaleFactor(), this.showCollisionBoxes = t.showCollisionBoxes, this.collectResourceTiming = !!t.collectResourceTiming, this.returnDependencies = !!t.returnDependencies, this.promoteId = t.promoteId, this.enableTerrain = !!t.enableTerrain, this.isSymbolTile = t.isSymbolTile; } parse(t, e, i, r, n) { this.status = "parsing", this.data = t, this.collisionBoxArray = new va; const s = new Xp(Object.keys(t.layers).sort()), a = new vd(this.tileID, this.promoteId); a.bucketLayerIDs = []; const o = {}, l = new Zp(256, 256), h = { featureIndex: a, iconDependencies: {}, patternDependencies: {}, glyphDependencies: {}, lineAtlas: l, availableImages: i }, u = e.familiesBySource[this.source]; for (const e in u) { const r = t.layers[e]; if (!r) continue; let n = !1, l = !1; for (const t of u[e]) "symbol" === t[0].type ? n = !0 : l = !0; if (!0 === this.isSymbolTile && !n) continue; if (!1 === this.isSymbolTile && !l) continue; 1 === r.version && C(`Vector tile source "${this.source}" layer "${e}" does not use vector tile spec v2 and therefore may have some rendering errors.`); const c = s.encode(e), p = []; for (let t = 0; t < r.length; t++) { const i = r.feature(t), n = a.getId(i, e); p.push({ feature: i, id: n, index: t, sourceLayerIndex: c }); } for (const t of u[e]) { const e = t[0]; void 0 !== this.isSymbolTile && "symbol" === e.type !== this.isSymbolTile || e.minzoom && this.zoom < Math.floor(e.minzoom) || e.maxzoom && this.zoom >= e.maxzoom || "none" !== e.visibility && (Sd(t, this.zoom, i), (o[e.id] = e.createBucket({ index: a.bucketLayerIDs.length, layers: t, zoom: this.zoom, pixelRatio: this.pixelRatio, overscaling: this.overscaling, collisionBoxArray: this.collisionBoxArray, sourceLayerIndex: c, sourceID: this.source, enableTerrain: this.enableTerrain })).populate(p, h, this.tileID.canonical), a.bucketLayerIDs.push(t.map((t => t.id)))); } } let c, p, d, f; l.trim(); const y = { type: "maybePrepare", isSymbolTile: this.isSymbolTile, zoom: this.zoom }, m = I(h.glyphDependencies, (t => Object.keys(t).map(Number))); Object.keys(m).length ? r.send("getGlyphs", { uid: this.uid, stacks: m }, ((t, e) => { c || (c = t, p = e, v.call(this)); }), void 0, !1, y) : p = {}; const g = Object.keys(h.iconDependencies); g.length ? r.send("getImages", { icons: g, source: this.source, tileID: this.tileID, type: "icons" }, ((t, e) => { c || (c = t, d = e, v.call(this)); }), void 0, !1, y) : d = {}; const _ = Object.keys(h.patternDependencies); function v() { if (c) return n(c); if (p && d && f) { const t = new kd(p), e = new mc(d, f); for (const r in o) { const n = o[r]; n instanceof Sp ? (Sd(n.layers, this.zoom, i), hp(n, p, t.positions, d, e.iconPositions, this.showCollisionBoxes, this.tileID.canonical, this.tileZoom)) : n.hasPattern && (n instanceof Au || n instanceof _h || n instanceof cu) && (Sd(n.layers, this.zoom, i), n.addFeatures(h, this.tileID.canonical, e.patternPositions)); } this.status = "done", n(null, { buckets: x(o).filter((t => !t.isEmpty())), featureIndex: a, collisionBoxArray: this.collisionBoxArray, glyphAtlasImage: t.image, lineAtlas: l, imageAtlas: e, glyphMap: this.returnDependencies ? p : null, iconMap: this.returnDependencies ? d : null, glyphPositions: this.returnDependencies ? t.positions : null }); } } _.length ? r.send("getImages", { icons: _, source: this.source, tileID: this.tileID, type: "patterns" }, ((t, e) => { c || (c = t, f = e, v.call(this)); }), void 0, !1, y) : f = {}, v.call(this); } } function Sd(t, e, i) { const r = new Es(e); for (const e of t) e.recalculate(r, i); }
|
|
39
|
+
/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */function zd(t) { let e = t.length; for (; --e >= 0;)t[e] = 0; } const Id = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]), Md = new Uint8Array([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]), Td = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]), Ed = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Cd = new Array(576); zd(Cd); const Pd = new Array(60); zd(Pd); const Dd = new Array(512); zd(Dd); const Bd = new Array(256); zd(Bd); const Vd = new Array(29); zd(Vd); const Ld = new Array(30); function Fd(t, e, i, r, n) { this.static_tree = t, this.extra_bits = e, this.extra_base = i, this.elems = r, this.max_length = n, this.has_stree = t && t.length; } let Rd, Od, Ud; function $d(t, e) { this.dyn_tree = t, this.max_code = 0, this.stat_desc = e; } zd(Ld); const Zd = t => t < 256 ? Dd[t] : Dd[256 + (t >>> 7)], qd = (t, e) => { t.pending_buf[t.pending++] = 255 & e, t.pending_buf[t.pending++] = e >>> 8 & 255; }, Nd = (t, e, i) => { t.bi_valid > 16 - i ? (t.bi_buf |= e << t.bi_valid & 65535, qd(t, t.bi_buf), t.bi_buf = e >> 16 - t.bi_valid, t.bi_valid += i - 16) : (t.bi_buf |= e << t.bi_valid & 65535, t.bi_valid += i); }, jd = (t, e, i) => { Nd(t, i[2 * e], i[2 * e + 1]); }, Gd = (t, e) => { let i = 0; do { i |= 1 & t, t >>>= 1, i <<= 1; } while (--e > 0); return i >>> 1 }, Xd = (t, e, i) => { const r = new Array(16); let n, s, a = 0; for (n = 1; n <= 15; n++)r[n] = a = a + i[n - 1] << 1; for (s = 0; s <= e; s++) { let e = t[2 * s + 1]; 0 !== e && (t[2 * s] = Gd(r[e]++, e)); } }, Kd = t => { let e; for (e = 0; e < 286; e++)t.dyn_ltree[2 * e] = 0; for (e = 0; e < 30; e++)t.dyn_dtree[2 * e] = 0; for (e = 0; e < 19; e++)t.bl_tree[2 * e] = 0; t.dyn_ltree[512] = 1, t.opt_len = t.static_len = 0, t.last_lit = t.matches = 0; }, Hd = t => { t.bi_valid > 8 ? qd(t, t.bi_buf) : t.bi_valid > 0 && (t.pending_buf[t.pending++] = t.bi_buf), t.bi_buf = 0, t.bi_valid = 0; }, Wd = (t, e, i, r) => { const n = 2 * e, s = 2 * i; return t[n] < t[s] || t[n] === t[s] && r[e] <= r[i] }, Yd = (t, e, i) => { const r = t.heap[i]; let n = i << 1; for (; n <= t.heap_len && (n < t.heap_len && Wd(e, t.heap[n + 1], t.heap[n], t.depth) && n++, !Wd(e, r, t.heap[n], t.depth));)t.heap[i] = t.heap[n], i = n, n <<= 1; t.heap[i] = r; }, Jd = (t, e, i) => { let r, n, s, a, o = 0; if (0 !== t.last_lit) do { r = t.pending_buf[t.d_buf + 2 * o] << 8 | t.pending_buf[t.d_buf + 2 * o + 1], n = t.pending_buf[t.l_buf + o], o++, 0 === r ? jd(t, n, e) : (s = Bd[n], jd(t, s + 256 + 1, e), a = Id[s], 0 !== a && (n -= Vd[s], Nd(t, n, a)), r--, s = Zd(r), jd(t, s, i), a = Md[s], 0 !== a && (r -= Ld[s], Nd(t, r, a))); } while (o < t.last_lit); jd(t, 256, e); }, Qd = (t, e) => { const i = e.dyn_tree, r = e.stat_desc.static_tree, n = e.stat_desc.has_stree, s = e.stat_desc.elems; let a, o, l, h = -1; for (t.heap_len = 0, t.heap_max = 573, a = 0; a < s; a++)0 !== i[2 * a] ? (t.heap[++t.heap_len] = h = a, t.depth[a] = 0) : i[2 * a + 1] = 0; for (; t.heap_len < 2;)l = t.heap[++t.heap_len] = h < 2 ? ++h : 0, i[2 * l] = 1, t.depth[l] = 0, t.opt_len--, n && (t.static_len -= r[2 * l + 1]); for (e.max_code = h, a = t.heap_len >> 1; a >= 1; a--)Yd(t, i, a); l = s; do { a = t.heap[1], t.heap[1] = t.heap[t.heap_len--], Yd(t, i, 1), o = t.heap[1], t.heap[--t.heap_max] = a, t.heap[--t.heap_max] = o, i[2 * l] = i[2 * a] + i[2 * o], t.depth[l] = (t.depth[a] >= t.depth[o] ? t.depth[a] : t.depth[o]) + 1, i[2 * a + 1] = i[2 * o + 1] = l, t.heap[1] = l++, Yd(t, i, 1); } while (t.heap_len >= 2); t.heap[--t.heap_max] = t.heap[1], ((t, e) => { const i = e.dyn_tree, r = e.max_code, n = e.stat_desc.static_tree, s = e.stat_desc.has_stree, a = e.stat_desc.extra_bits, o = e.stat_desc.extra_base, l = e.stat_desc.max_length; let h, u, c, p, d, f, y = 0; for (p = 0; p <= 15; p++)t.bl_count[p] = 0; for (i[2 * t.heap[t.heap_max] + 1] = 0, h = t.heap_max + 1; h < 573; h++)u = t.heap[h], p = i[2 * i[2 * u + 1] + 1] + 1, p > l && (p = l, y++), i[2 * u + 1] = p, u > r || (t.bl_count[p]++, d = 0, u >= o && (d = a[u - o]), f = i[2 * u], t.opt_len += f * (p + d), s && (t.static_len += f * (n[2 * u + 1] + d))); if (0 !== y) { do { for (p = l - 1; 0 === t.bl_count[p];)p--; t.bl_count[p]--, t.bl_count[p + 1] += 2, t.bl_count[l]--, y -= 2; } while (y > 0); for (p = l; 0 !== p; p--)for (u = t.bl_count[p]; 0 !== u;)c = t.heap[--h], c > r || (i[2 * c + 1] !== p && (t.opt_len += (p - i[2 * c + 1]) * i[2 * c], i[2 * c + 1] = p), u--); } })(t, e), Xd(i, h, t.bl_count); }, tf = (t, e, i) => { let r, n, s = -1, a = e[1], o = 0, l = 7, h = 4; for (0 === a && (l = 138, h = 3), e[2 * (i + 1) + 1] = 65535, r = 0; r <= i; r++)n = a, a = e[2 * (r + 1) + 1], ++o < l && n === a || (o < h ? t.bl_tree[2 * n] += o : 0 !== n ? (n !== s && t.bl_tree[2 * n]++, t.bl_tree[32]++) : o <= 10 ? t.bl_tree[34]++ : t.bl_tree[36]++, o = 0, s = n, 0 === a ? (l = 138, h = 3) : n === a ? (l = 6, h = 3) : (l = 7, h = 4)); }, ef = (t, e, i) => { let r, n, s = -1, a = e[1], o = 0, l = 7, h = 4; for (0 === a && (l = 138, h = 3), r = 0; r <= i; r++)if (n = a, a = e[2 * (r + 1) + 1], !(++o < l && n === a)) { if (o < h) do { jd(t, n, t.bl_tree); } while (0 != --o); else 0 !== n ? (n !== s && (jd(t, n, t.bl_tree), o--), jd(t, 16, t.bl_tree), Nd(t, o - 3, 2)) : o <= 10 ? (jd(t, 17, t.bl_tree), Nd(t, o - 3, 3)) : (jd(t, 18, t.bl_tree), Nd(t, o - 11, 7)); o = 0, s = n, 0 === a ? (l = 138, h = 3) : n === a ? (l = 6, h = 3) : (l = 7, h = 4); } }; let rf = !1; const nf = (t, e, i, r) => { Nd(t, 0 + (r ? 1 : 0), 3), ((t, e, i, r) => { Hd(t), qd(t, i), qd(t, ~i), t.pending_buf.set(t.window.subarray(e, e + i), t.pending), t.pending += i; })(t, e, i); }; var sf = { _tr_init: t => { rf || ((() => { let t, e, i, r, n; const s = new Array(16); for (i = 0, r = 0; r < 28; r++)for (Vd[r] = i, t = 0; t < 1 << Id[r]; t++)Bd[i++] = r; for (Bd[i - 1] = r, n = 0, r = 0; r < 16; r++)for (Ld[r] = n, t = 0; t < 1 << Md[r]; t++)Dd[n++] = r; for (n >>= 7; r < 30; r++)for (Ld[r] = n << 7, t = 0; t < 1 << Md[r] - 7; t++)Dd[256 + n++] = r; for (e = 0; e <= 15; e++)s[e] = 0; for (t = 0; t <= 143;)Cd[2 * t + 1] = 8, t++, s[8]++; for (; t <= 255;)Cd[2 * t + 1] = 9, t++, s[9]++; for (; t <= 279;)Cd[2 * t + 1] = 7, t++, s[7]++; for (; t <= 287;)Cd[2 * t + 1] = 8, t++, s[8]++; for (Xd(Cd, 287, s), t = 0; t < 30; t++)Pd[2 * t + 1] = 5, Pd[2 * t] = Gd(t, 5); Rd = new Fd(Cd, Id, 257, 286, 15), Od = new Fd(Pd, Md, 0, 30, 15), Ud = new Fd(new Array(0), Td, 0, 19, 7); })(), rf = !0), t.l_desc = new $d(t.dyn_ltree, Rd), t.d_desc = new $d(t.dyn_dtree, Od), t.bl_desc = new $d(t.bl_tree, Ud), t.bi_buf = 0, t.bi_valid = 0, Kd(t); }, _tr_stored_block: nf, _tr_flush_block: (t, e, i, r) => { let n, s, a = 0; t.level > 0 ? (2 === t.strm.data_type && (t.strm.data_type = (t => { let e, i = 4093624447; for (e = 0; e <= 31; e++, i >>>= 1)if (1 & i && 0 !== t.dyn_ltree[2 * e]) return 0; if (0 !== t.dyn_ltree[18] || 0 !== t.dyn_ltree[20] || 0 !== t.dyn_ltree[26]) return 1; for (e = 32; e < 256; e++)if (0 !== t.dyn_ltree[2 * e]) return 1; return 0 })(t)), Qd(t, t.l_desc), Qd(t, t.d_desc), a = (t => { let e; for (tf(t, t.dyn_ltree, t.l_desc.max_code), tf(t, t.dyn_dtree, t.d_desc.max_code), Qd(t, t.bl_desc), e = 18; e >= 3 && 0 === t.bl_tree[2 * Ed[e] + 1]; e--); return t.opt_len += 3 * (e + 1) + 5 + 5 + 4, e })(t), n = t.opt_len + 3 + 7 >>> 3, s = t.static_len + 3 + 7 >>> 3, s <= n && (n = s)) : n = s = i + 5, i + 4 <= n && -1 !== e ? nf(t, e, i, r) : 4 === t.strategy || s === n ? (Nd(t, 2 + (r ? 1 : 0), 3), Jd(t, Cd, Pd)) : (Nd(t, 4 + (r ? 1 : 0), 3), ((t, e, i, r) => { let n; for (Nd(t, e - 257, 5), Nd(t, i - 1, 5), Nd(t, r - 4, 4), n = 0; n < r; n++)Nd(t, t.bl_tree[2 * Ed[n] + 1], 3); ef(t, t.dyn_ltree, e - 1), ef(t, t.dyn_dtree, i - 1); })(t, t.l_desc.max_code + 1, t.d_desc.max_code + 1, a + 1), Jd(t, t.dyn_ltree, t.dyn_dtree)), Kd(t), r && Hd(t); }, _tr_tally: (t, e, i) => (t.pending_buf[t.d_buf + 2 * t.last_lit] = e >>> 8 & 255, t.pending_buf[t.d_buf + 2 * t.last_lit + 1] = 255 & e, t.pending_buf[t.l_buf + t.last_lit] = 255 & i, t.last_lit++, 0 === e ? t.dyn_ltree[2 * i]++ : (t.matches++, e--, t.dyn_ltree[2 * (Bd[i] + 256 + 1)]++, t.dyn_dtree[2 * Zd(e)]++), t.last_lit === t.lit_bufsize - 1), _tr_align: t => { Nd(t, 2, 3), jd(t, 256, Cd), (t => { 16 === t.bi_valid ? (qd(t, t.bi_buf), t.bi_buf = 0, t.bi_valid = 0) : t.bi_valid >= 8 && (t.pending_buf[t.pending++] = 255 & t.bi_buf, t.bi_buf >>= 8, t.bi_valid -= 8); })(t); } }, af = (t, e, i, r) => { let n = 65535 & t | 0, s = t >>> 16 & 65535 | 0, a = 0; for (; 0 !== i;) { a = i > 2e3 ? 2e3 : i, i -= a; do { n = n + e[r++] | 0, s = s + n | 0; } while (--a); n %= 65521, s %= 65521; } return n | s << 16 | 0 }; const of = new Uint32Array((() => { let t, e = []; for (var i = 0; i < 256; i++) { t = i; for (var r = 0; r < 8; r++)t = 1 & t ? 3988292384 ^ t >>> 1 : t >>> 1; e[i] = t; } return e })()); var lf = (t, e, i, r) => { const n = of, s = r + i; t ^= -1; for (let i = r; i < s; i++)t = t >>> 8 ^ n[255 & (t ^ e[i])]; return -1 ^ t }, hf = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" }, uf = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 }; const { _tr_init: cf, _tr_stored_block: pf, _tr_flush_block: df, _tr_tally: ff, _tr_align: yf } = sf, { Z_NO_FLUSH: mf, Z_PARTIAL_FLUSH: gf, Z_FULL_FLUSH: xf, Z_FINISH: _f, Z_BLOCK: vf, Z_OK: bf, Z_STREAM_END: wf, Z_STREAM_ERROR: kf, Z_DATA_ERROR: Af, Z_BUF_ERROR: Sf, Z_DEFAULT_COMPRESSION: zf, Z_FILTERED: If, Z_HUFFMAN_ONLY: Mf, Z_RLE: Tf, Z_FIXED: Ef, Z_UNKNOWN: Cf, Z_DEFLATED: Pf } = uf, Df = 258, Bf = 262, Vf = 103, Lf = 113, Ff = 666, Rf = (t, e) => (t.msg = hf[e], e), Of = t => (t << 1) - (t > 4 ? 9 : 0), Uf = t => { let e = t.length; for (; --e >= 0;)t[e] = 0; }; let $f = (t, e, i) => (e << t.hash_shift ^ i) & t.hash_mask; const Zf = t => { const e = t.state; let i = e.pending; i > t.avail_out && (i = t.avail_out), 0 !== i && (t.output.set(e.pending_buf.subarray(e.pending_out, e.pending_out + i), t.next_out), t.next_out += i, e.pending_out += i, t.total_out += i, t.avail_out -= i, e.pending -= i, 0 === e.pending && (e.pending_out = 0)); }, qf = (t, e) => { df(t, t.block_start >= 0 ? t.block_start : -1, t.strstart - t.block_start, e), t.block_start = t.strstart, Zf(t.strm); }, Nf = (t, e) => { t.pending_buf[t.pending++] = e; }, jf = (t, e) => { t.pending_buf[t.pending++] = e >>> 8 & 255, t.pending_buf[t.pending++] = 255 & e; }, Gf = (t, e, i, r) => { let n = t.avail_in; return n > r && (n = r), 0 === n ? 0 : (t.avail_in -= n, e.set(t.input.subarray(t.next_in, t.next_in + n), i), 1 === t.state.wrap ? t.adler = af(t.adler, e, n, i) : 2 === t.state.wrap && (t.adler = lf(t.adler, e, n, i)), t.next_in += n, t.total_in += n, n) }, Xf = (t, e) => { let i, r, n = t.max_chain_length, s = t.strstart, a = t.prev_length, o = t.nice_match; const l = t.strstart > t.w_size - Bf ? t.strstart - (t.w_size - Bf) : 0, h = t.window, u = t.w_mask, c = t.prev, p = t.strstart + Df; let d = h[s + a - 1], f = h[s + a]; t.prev_length >= t.good_match && (n >>= 2), o > t.lookahead && (o = t.lookahead); do { if (i = e, h[i + a] === f && h[i + a - 1] === d && h[i] === h[s] && h[++i] === h[s + 1]) { s += 2, i++; do { } while (h[++s] === h[++i] && h[++s] === h[++i] && h[++s] === h[++i] && h[++s] === h[++i] && h[++s] === h[++i] && h[++s] === h[++i] && h[++s] === h[++i] && h[++s] === h[++i] && s < p); if (r = Df - (p - s), s = p - Df, r > a) { if (t.match_start = e, a = r, r >= o) break; d = h[s + a - 1], f = h[s + a]; } } } while ((e = c[e & u]) > l && 0 != --n); return a <= t.lookahead ? a : t.lookahead }, Kf = t => { const e = t.w_size; let i, r, n, s, a; do { if (s = t.window_size - t.lookahead - t.strstart, t.strstart >= e + (e - Bf)) { t.window.set(t.window.subarray(e, e + e), 0), t.match_start -= e, t.strstart -= e, t.block_start -= e, r = t.hash_size, i = r; do { n = t.head[--i], t.head[i] = n >= e ? n - e : 0; } while (--r); r = e, i = r; do { n = t.prev[--i], t.prev[i] = n >= e ? n - e : 0; } while (--r); s += e; } if (0 === t.strm.avail_in) break; if (r = Gf(t.strm, t.window, t.strstart + t.lookahead, s), t.lookahead += r, t.lookahead + t.insert >= 3) for (a = t.strstart - t.insert, t.ins_h = t.window[a], t.ins_h = $f(t, t.ins_h, t.window[a + 1]); t.insert && (t.ins_h = $f(t, t.ins_h, t.window[a + 3 - 1]), t.prev[a & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = a, a++, t.insert--, !(t.lookahead + t.insert < 3));); } while (t.lookahead < Bf && 0 !== t.strm.avail_in) }, Hf = (t, e) => { let i, r; for (; ;) { if (t.lookahead < Bf) { if (Kf(t), t.lookahead < Bf && e === mf) return 1; if (0 === t.lookahead) break } if (i = 0, t.lookahead >= 3 && (t.ins_h = $f(t, t.ins_h, t.window[t.strstart + 3 - 1]), i = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), 0 !== i && t.strstart - i <= t.w_size - Bf && (t.match_length = Xf(t, i)), t.match_length >= 3) if (r = ff(t, t.strstart - t.match_start, t.match_length - 3), t.lookahead -= t.match_length, t.match_length <= t.max_lazy_match && t.lookahead >= 3) { t.match_length--; do { t.strstart++, t.ins_h = $f(t, t.ins_h, t.window[t.strstart + 3 - 1]), i = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart; } while (0 != --t.match_length); t.strstart++; } else t.strstart += t.match_length, t.match_length = 0, t.ins_h = t.window[t.strstart], t.ins_h = $f(t, t.ins_h, t.window[t.strstart + 1]); else r = ff(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++; if (r && (qf(t, !1), 0 === t.strm.avail_out)) return 1 } return t.insert = t.strstart < 2 ? t.strstart : 2, e === _f ? (qf(t, !0), 0 === t.strm.avail_out ? 3 : 4) : t.last_lit && (qf(t, !1), 0 === t.strm.avail_out) ? 1 : 2 }, Wf = (t, e) => { let i, r, n; for (; ;) { if (t.lookahead < Bf) { if (Kf(t), t.lookahead < Bf && e === mf) return 1; if (0 === t.lookahead) break } if (i = 0, t.lookahead >= 3 && (t.ins_h = $f(t, t.ins_h, t.window[t.strstart + 3 - 1]), i = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), t.prev_length = t.match_length, t.prev_match = t.match_start, t.match_length = 2, 0 !== i && t.prev_length < t.max_lazy_match && t.strstart - i <= t.w_size - Bf && (t.match_length = Xf(t, i), t.match_length <= 5 && (t.strategy === If || 3 === t.match_length && t.strstart - t.match_start > 4096) && (t.match_length = 2)), t.prev_length >= 3 && t.match_length <= t.prev_length) { n = t.strstart + t.lookahead - 3, r = ff(t, t.strstart - 1 - t.prev_match, t.prev_length - 3), t.lookahead -= t.prev_length - 1, t.prev_length -= 2; do { ++t.strstart <= n && (t.ins_h = $f(t, t.ins_h, t.window[t.strstart + 3 - 1]), i = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart); } while (0 != --t.prev_length); if (t.match_available = 0, t.match_length = 2, t.strstart++, r && (qf(t, !1), 0 === t.strm.avail_out)) return 1 } else if (t.match_available) { if (r = ff(t, 0, t.window[t.strstart - 1]), r && qf(t, !1), t.strstart++, t.lookahead--, 0 === t.strm.avail_out) return 1 } else t.match_available = 1, t.strstart++, t.lookahead--; } return t.match_available && (r = ff(t, 0, t.window[t.strstart - 1]), t.match_available = 0), t.insert = t.strstart < 2 ? t.strstart : 2, e === _f ? (qf(t, !0), 0 === t.strm.avail_out ? 3 : 4) : t.last_lit && (qf(t, !1), 0 === t.strm.avail_out) ? 1 : 2 }; function Yf(t, e, i, r, n) { this.good_length = t, this.max_lazy = e, this.nice_length = i, this.max_chain = r, this.func = n; } const Jf = [new Yf(0, 0, 0, 0, ((t, e) => { let i = 65535; for (i > t.pending_buf_size - 5 && (i = t.pending_buf_size - 5); ;) { if (t.lookahead <= 1) { if (Kf(t), 0 === t.lookahead && e === mf) return 1; if (0 === t.lookahead) break } t.strstart += t.lookahead, t.lookahead = 0; const r = t.block_start + i; if ((0 === t.strstart || t.strstart >= r) && (t.lookahead = t.strstart - r, t.strstart = r, qf(t, !1), 0 === t.strm.avail_out)) return 1; if (t.strstart - t.block_start >= t.w_size - Bf && (qf(t, !1), 0 === t.strm.avail_out)) return 1 } return t.insert = 0, e === _f ? (qf(t, !0), 0 === t.strm.avail_out ? 3 : 4) : (t.strstart > t.block_start && qf(t, !1), 1) })), new Yf(4, 4, 8, 4, Hf), new Yf(4, 5, 16, 8, Hf), new Yf(4, 6, 32, 32, Hf), new Yf(4, 4, 16, 16, Wf), new Yf(8, 16, 32, 32, Wf), new Yf(8, 16, 128, 128, Wf), new Yf(8, 32, 128, 256, Wf), new Yf(32, 128, 258, 1024, Wf), new Yf(32, 258, 258, 4096, Wf)]; function Qf() { this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Pf, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new Uint16Array(1146), this.dyn_dtree = new Uint16Array(122), this.bl_tree = new Uint16Array(78), Uf(this.dyn_ltree), Uf(this.dyn_dtree), Uf(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new Uint16Array(16), this.heap = new Uint16Array(573), Uf(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new Uint16Array(573), Uf(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; } const ty = t => { const e = (t => { if (!t || !t.state) return Rf(t, kf); t.total_in = t.total_out = 0, t.data_type = Cf; const e = t.state; return e.pending = 0, e.pending_out = 0, e.wrap < 0 && (e.wrap = -e.wrap), e.status = e.wrap ? 42 : Lf, t.adler = 2 === e.wrap ? 0 : 1, e.last_flush = mf, cf(e), bf })(t); var i; return e === bf && ((i = t.state).window_size = 2 * i.w_size, Uf(i.head), i.max_lazy_match = Jf[i.level].max_lazy, i.good_match = Jf[i.level].good_length, i.nice_match = Jf[i.level].nice_length, i.max_chain_length = Jf[i.level].max_chain, i.strstart = 0, i.block_start = 0, i.lookahead = 0, i.insert = 0, i.match_length = i.prev_length = 2, i.match_available = 0, i.ins_h = 0), e }; var ey = (t, e, i, r, n, s) => { if (!t) return kf; let a = 1; if (e === zf && (e = 6), r < 0 ? (a = 0, r = -r) : r > 15 && (a = 2, r -= 16), n < 1 || n > 9 || i !== Pf || r < 8 || r > 15 || e < 0 || e > 9 || s < 0 || s > Ef) return Rf(t, kf); 8 === r && (r = 9); const o = new Qf; return t.state = o, o.strm = t, o.wrap = a, o.gzhead = null, o.w_bits = r, o.w_size = 1 << o.w_bits, o.w_mask = o.w_size - 1, o.hash_bits = n + 7, o.hash_size = 1 << o.hash_bits, o.hash_mask = o.hash_size - 1, o.hash_shift = ~~((o.hash_bits + 3 - 1) / 3), o.window = new Uint8Array(2 * o.w_size), o.head = new Uint16Array(o.hash_size), o.prev = new Uint16Array(o.w_size), o.lit_bufsize = 1 << n + 6, o.pending_buf_size = 4 * o.lit_bufsize, o.pending_buf = new Uint8Array(o.pending_buf_size), o.d_buf = 1 * o.lit_bufsize, o.l_buf = 3 * o.lit_bufsize, o.level = e, o.strategy = s, o.method = i, ty(t) }, iy = (t, e) => { let i, r; if (!t || !t.state || e > vf || e < 0) return t ? Rf(t, kf) : kf; const n = t.state; if (!t.output || !t.input && 0 !== t.avail_in || n.status === Ff && e !== _f) return Rf(t, 0 === t.avail_out ? Sf : kf); n.strm = t; const s = n.last_flush; if (n.last_flush = e, 42 === n.status) if (2 === n.wrap) t.adler = 0, Nf(n, 31), Nf(n, 139), Nf(n, 8), n.gzhead ? (Nf(n, (n.gzhead.text ? 1 : 0) + (n.gzhead.hcrc ? 2 : 0) + (n.gzhead.extra ? 4 : 0) + (n.gzhead.name ? 8 : 0) + (n.gzhead.comment ? 16 : 0)), Nf(n, 255 & n.gzhead.time), Nf(n, n.gzhead.time >> 8 & 255), Nf(n, n.gzhead.time >> 16 & 255), Nf(n, n.gzhead.time >> 24 & 255), Nf(n, 9 === n.level ? 2 : n.strategy >= Mf || n.level < 2 ? 4 : 0), Nf(n, 255 & n.gzhead.os), n.gzhead.extra && n.gzhead.extra.length && (Nf(n, 255 & n.gzhead.extra.length), Nf(n, n.gzhead.extra.length >> 8 & 255)), n.gzhead.hcrc && (t.adler = lf(t.adler, n.pending_buf, n.pending, 0)), n.gzindex = 0, n.status = 69) : (Nf(n, 0), Nf(n, 0), Nf(n, 0), Nf(n, 0), Nf(n, 0), Nf(n, 9 === n.level ? 2 : n.strategy >= Mf || n.level < 2 ? 4 : 0), Nf(n, 3), n.status = Lf); else { let e = Pf + (n.w_bits - 8 << 4) << 8, i = -1; i = n.strategy >= Mf || n.level < 2 ? 0 : n.level < 6 ? 1 : 6 === n.level ? 2 : 3, e |= i << 6, 0 !== n.strstart && (e |= 32), e += 31 - e % 31, n.status = Lf, jf(n, e), 0 !== n.strstart && (jf(n, t.adler >>> 16), jf(n, 65535 & t.adler)), t.adler = 1; } if (69 === n.status) if (n.gzhead.extra) { for (i = n.pending; n.gzindex < (65535 & n.gzhead.extra.length) && (n.pending !== n.pending_buf_size || (n.gzhead.hcrc && n.pending > i && (t.adler = lf(t.adler, n.pending_buf, n.pending - i, i)), Zf(t), i = n.pending, n.pending !== n.pending_buf_size));)Nf(n, 255 & n.gzhead.extra[n.gzindex]), n.gzindex++; n.gzhead.hcrc && n.pending > i && (t.adler = lf(t.adler, n.pending_buf, n.pending - i, i)), n.gzindex === n.gzhead.extra.length && (n.gzindex = 0, n.status = 73); } else n.status = 73; if (73 === n.status) if (n.gzhead.name) { i = n.pending; do { if (n.pending === n.pending_buf_size && (n.gzhead.hcrc && n.pending > i && (t.adler = lf(t.adler, n.pending_buf, n.pending - i, i)), Zf(t), i = n.pending, n.pending === n.pending_buf_size)) { r = 1; break } r = n.gzindex < n.gzhead.name.length ? 255 & n.gzhead.name.charCodeAt(n.gzindex++) : 0, Nf(n, r); } while (0 !== r); n.gzhead.hcrc && n.pending > i && (t.adler = lf(t.adler, n.pending_buf, n.pending - i, i)), 0 === r && (n.gzindex = 0, n.status = 91); } else n.status = 91; if (91 === n.status) if (n.gzhead.comment) { i = n.pending; do { if (n.pending === n.pending_buf_size && (n.gzhead.hcrc && n.pending > i && (t.adler = lf(t.adler, n.pending_buf, n.pending - i, i)), Zf(t), i = n.pending, n.pending === n.pending_buf_size)) { r = 1; break } r = n.gzindex < n.gzhead.comment.length ? 255 & n.gzhead.comment.charCodeAt(n.gzindex++) : 0, Nf(n, r); } while (0 !== r); n.gzhead.hcrc && n.pending > i && (t.adler = lf(t.adler, n.pending_buf, n.pending - i, i)), 0 === r && (n.status = Vf); } else n.status = Vf; if (n.status === Vf && (n.gzhead.hcrc ? (n.pending + 2 > n.pending_buf_size && Zf(t), n.pending + 2 <= n.pending_buf_size && (Nf(n, 255 & t.adler), Nf(n, t.adler >> 8 & 255), t.adler = 0, n.status = Lf)) : n.status = Lf), 0 !== n.pending) { if (Zf(t), 0 === t.avail_out) return n.last_flush = -1, bf } else if (0 === t.avail_in && Of(e) <= Of(s) && e !== _f) return Rf(t, Sf); if (n.status === Ff && 0 !== t.avail_in) return Rf(t, Sf); if (0 !== t.avail_in || 0 !== n.lookahead || e !== mf && n.status !== Ff) { let i = n.strategy === Mf ? ((t, e) => { let i; for (; ;) { if (0 === t.lookahead && (Kf(t), 0 === t.lookahead)) { if (e === mf) return 1; break } if (t.match_length = 0, i = ff(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++, i && (qf(t, !1), 0 === t.strm.avail_out)) return 1 } return t.insert = 0, e === _f ? (qf(t, !0), 0 === t.strm.avail_out ? 3 : 4) : t.last_lit && (qf(t, !1), 0 === t.strm.avail_out) ? 1 : 2 })(n, e) : n.strategy === Tf ? ((t, e) => { let i, r, n, s; const a = t.window; for (; ;) { if (t.lookahead <= Df) { if (Kf(t), t.lookahead <= Df && e === mf) return 1; if (0 === t.lookahead) break } if (t.match_length = 0, t.lookahead >= 3 && t.strstart > 0 && (n = t.strstart - 1, r = a[n], r === a[++n] && r === a[++n] && r === a[++n])) { s = t.strstart + Df; do { } while (r === a[++n] && r === a[++n] && r === a[++n] && r === a[++n] && r === a[++n] && r === a[++n] && r === a[++n] && r === a[++n] && n < s); t.match_length = Df - (s - n), t.match_length > t.lookahead && (t.match_length = t.lookahead); } if (t.match_length >= 3 ? (i = ff(t, 1, t.match_length - 3), t.lookahead -= t.match_length, t.strstart += t.match_length, t.match_length = 0) : (i = ff(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++), i && (qf(t, !1), 0 === t.strm.avail_out)) return 1 } return t.insert = 0, e === _f ? (qf(t, !0), 0 === t.strm.avail_out ? 3 : 4) : t.last_lit && (qf(t, !1), 0 === t.strm.avail_out) ? 1 : 2 })(n, e) : Jf[n.level].func(n, e); if (3 !== i && 4 !== i || (n.status = Ff), 1 === i || 3 === i) return 0 === t.avail_out && (n.last_flush = -1), bf; if (2 === i && (e === gf ? yf(n) : e !== vf && (pf(n, 0, 0, !1), e === xf && (Uf(n.head), 0 === n.lookahead && (n.strstart = 0, n.block_start = 0, n.insert = 0))), Zf(t), 0 === t.avail_out)) return n.last_flush = -1, bf } return e !== _f ? bf : n.wrap <= 0 ? wf : (2 === n.wrap ? (Nf(n, 255 & t.adler), Nf(n, t.adler >> 8 & 255), Nf(n, t.adler >> 16 & 255), Nf(n, t.adler >> 24 & 255), Nf(n, 255 & t.total_in), Nf(n, t.total_in >> 8 & 255), Nf(n, t.total_in >> 16 & 255), Nf(n, t.total_in >> 24 & 255)) : (jf(n, t.adler >>> 16), jf(n, 65535 & t.adler)), Zf(t), n.wrap > 0 && (n.wrap = -n.wrap), 0 !== n.pending ? bf : wf) }, ry = t => { if (!t || !t.state) return kf; const e = t.state.status; return 42 !== e && 69 !== e && 73 !== e && 91 !== e && e !== Vf && e !== Lf && e !== Ff ? Rf(t, kf) : (t.state = null, e === Lf ? Rf(t, Af) : bf) }; const ny = (t, e) => Object.prototype.hasOwnProperty.call(t, e); var sy = function (t) { const e = Array.prototype.slice.call(arguments, 1); for (; e.length;) { const i = e.shift(); if (i) { if ("object" != typeof i) throw new TypeError(i + "must be non-object"); for (const e in i) ny(i, e) && (t[e] = i[e]); } } return t }, ay = t => { let e = 0; for (let i = 0, r = t.length; i < r; i++)e += t[i].length; const i = new Uint8Array(e); for (let e = 0, r = 0, n = t.length; e < n; e++) { let n = t[e]; i.set(n, r), r += n.length; } return i }; let oy = !0; try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (t) { oy = !1; } const ly = new Uint8Array(256); for (let t = 0; t < 256; t++)ly[t] = t >= 252 ? 6 : t >= 248 ? 5 : t >= 240 ? 4 : t >= 224 ? 3 : t >= 192 ? 2 : 1; ly[254] = ly[254] = 1; var hy = t => { if ("function" == typeof TextEncoder && TextEncoder.prototype.encode) return (new TextEncoder).encode(t); let e, i, r, n, s, a = t.length, o = 0; for (n = 0; n < a; n++)i = t.charCodeAt(n), 55296 == (64512 & i) && n + 1 < a && (r = t.charCodeAt(n + 1), 56320 == (64512 & r) && (i = 65536 + (i - 55296 << 10) + (r - 56320), n++)), o += i < 128 ? 1 : i < 2048 ? 2 : i < 65536 ? 3 : 4; for (e = new Uint8Array(o), s = 0, n = 0; s < o; n++)i = t.charCodeAt(n), 55296 == (64512 & i) && n + 1 < a && (r = t.charCodeAt(n + 1), 56320 == (64512 & r) && (i = 65536 + (i - 55296 << 10) + (r - 56320), n++)), i < 128 ? e[s++] = i : i < 2048 ? (e[s++] = 192 | i >>> 6, e[s++] = 128 | 63 & i) : i < 65536 ? (e[s++] = 224 | i >>> 12, e[s++] = 128 | i >>> 6 & 63, e[s++] = 128 | 63 & i) : (e[s++] = 240 | i >>> 18, e[s++] = 128 | i >>> 12 & 63, e[s++] = 128 | i >>> 6 & 63, e[s++] = 128 | 63 & i); return e }, uy = (t, e) => { const i = e || t.length; if ("function" == typeof TextDecoder && TextDecoder.prototype.decode) return (new TextDecoder).decode(t.subarray(0, e)); let r, n; const s = new Array(2 * i); for (n = 0, r = 0; r < i;) { let e = t[r++]; if (e < 128) { s[n++] = e; continue } let a = ly[e]; if (a > 4) s[n++] = 65533, r += a - 1; else { for (e &= 2 === a ? 31 : 3 === a ? 15 : 7; a > 1 && r < i;)e = e << 6 | 63 & t[r++], a--; a > 1 ? s[n++] = 65533 : e < 65536 ? s[n++] = e : (e -= 65536, s[n++] = 55296 | e >> 10 & 1023, s[n++] = 56320 | 1023 & e); } } return ((t, e) => { if (e < 65534 && t.subarray && oy) return String.fromCharCode.apply(null, t.length === e ? t : t.subarray(0, e)); let i = ""; for (let r = 0; r < e; r++)i += String.fromCharCode(t[r]); return i })(s, n) }, cy = (t, e) => { (e = e || t.length) > t.length && (e = t.length); let i = e - 1; for (; i >= 0 && 128 == (192 & t[i]);)i--; return i < 0 || 0 === i ? e : i + ly[t[i]] > e ? i : e }, py = function () { this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0; }; const dy = Object.prototype.toString, { Z_NO_FLUSH: fy, Z_SYNC_FLUSH: yy, Z_FULL_FLUSH: my, Z_FINISH: gy, Z_OK: xy, Z_STREAM_END: _y, Z_DEFAULT_COMPRESSION: vy, Z_DEFAULT_STRATEGY: by, Z_DEFLATED: wy } = uf; function ky(t) { this.options = sy({ level: vy, method: wy, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: by }, t || {}); let e = this.options; e.raw && e.windowBits > 0 ? e.windowBits = -e.windowBits : e.gzip && e.windowBits > 0 && e.windowBits < 16 && (e.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new py, this.strm.avail_out = 0; let i = ey(this.strm, e.level, e.method, e.windowBits, e.memLevel, e.strategy); if (i !== xy) throw new Error(hf[i]); if (e.header && (n = e.header, (r = this.strm) && r.state && (2 !== r.state.wrap || (r.state.gzhead = n))), e.dictionary) { let t; if (t = "string" == typeof e.dictionary ? hy(e.dictionary) : "[object ArrayBuffer]" === dy.call(e.dictionary) ? new Uint8Array(e.dictionary) : e.dictionary, i = ((t, e) => { let i = e.length; if (!t || !t.state) return kf; const r = t.state, n = r.wrap; if (2 === n || 1 === n && 42 !== r.status || r.lookahead) return kf; if (1 === n && (t.adler = af(t.adler, e, i, 0)), r.wrap = 0, i >= r.w_size) { 0 === n && (Uf(r.head), r.strstart = 0, r.block_start = 0, r.insert = 0); let t = new Uint8Array(r.w_size); t.set(e.subarray(i - r.w_size, i), 0), e = t, i = r.w_size; } const s = t.avail_in, a = t.next_in, o = t.input; for (t.avail_in = i, t.next_in = 0, t.input = e, Kf(r); r.lookahead >= 3;) { let t = r.strstart, e = r.lookahead - 2; do { r.ins_h = $f(r, r.ins_h, r.window[t + 3 - 1]), r.prev[t & r.w_mask] = r.head[r.ins_h], r.head[r.ins_h] = t, t++; } while (--e); r.strstart = t, r.lookahead = 2, Kf(r); } return r.strstart += r.lookahead, r.block_start = r.strstart, r.insert = r.lookahead, r.lookahead = 0, r.match_length = r.prev_length = 2, r.match_available = 0, t.next_in = a, t.input = o, t.avail_in = s, r.wrap = n, bf })(this.strm, t), i !== xy) throw new Error(hf[i]); this._dict_set = !0; } var r, n; } function Ay(t, e) { const i = new ky(e); if (i.push(t, !0), i.err) throw i.msg || hf[i.err]; return i.result } ky.prototype.push = function (t, e) { const i = this.strm, r = this.options.chunkSize; let n, s; if (this.ended) return !1; for (s = e === ~~e ? e : !0 === e ? gy : fy, i.input = "string" == typeof t ? hy(t) : "[object ArrayBuffer]" === dy.call(t) ? new Uint8Array(t) : t, i.next_in = 0, i.avail_in = i.input.length; ;)if (0 === i.avail_out && (i.output = new Uint8Array(r), i.next_out = 0, i.avail_out = r), (s === yy || s === my) && i.avail_out <= 6) this.onData(i.output.subarray(0, i.next_out)), i.avail_out = 0; else { if (n = iy(i, s), n === _y) return i.next_out > 0 && this.onData(i.output.subarray(0, i.next_out)), n = ry(this.strm), this.onEnd(n), this.ended = !0, n === xy; if (0 !== i.avail_out) { if (s > 0 && i.next_out > 0) this.onData(i.output.subarray(0, i.next_out)), i.avail_out = 0; else if (0 === i.avail_in) break } else this.onData(i.output); } return !0 }, ky.prototype.onData = function (t) { this.chunks.push(t); }, ky.prototype.onEnd = function (t) { t === xy && (this.result = ay(this.chunks)), this.chunks = [], this.err = t, this.msg = this.strm.msg; }; var Sy = { Deflate: ky, deflate: Ay, deflateRaw: function (t, e) { return (e = e || {}).raw = !0, Ay(t, e) }, gzip: function (t, e) { return (e = e || {}).gzip = !0, Ay(t, e) }, constants: uf }, zy = function (t, e) { let i, r, n, s, a, o, l, h, u, c, p, d, f, y, m, g, x, _, v, b, w, k, A, S; const z = t.state; i = t.next_in, A = t.input, r = i + (t.avail_in - 5), n = t.next_out, S = t.output, s = n - (e - t.avail_out), a = n + (t.avail_out - 257), o = z.dmax, l = z.wsize, h = z.whave, u = z.wnext, c = z.window, p = z.hold, d = z.bits, f = z.lencode, y = z.distcode, m = (1 << z.lenbits) - 1, g = (1 << z.distbits) - 1; t: do { d < 15 && (p += A[i++] << d, d += 8, p += A[i++] << d, d += 8), x = f[p & m]; e: for (; ;) { if (_ = x >>> 24, p >>>= _, d -= _, _ = x >>> 16 & 255, 0 === _) S[n++] = 65535 & x; else { if (!(16 & _)) { if (0 == (64 & _)) { x = f[(65535 & x) + (p & (1 << _) - 1)]; continue e } if (32 & _) { z.mode = 12; break t } t.msg = "invalid literal/length code", z.mode = 30; break t } v = 65535 & x, _ &= 15, _ && (d < _ && (p += A[i++] << d, d += 8), v += p & (1 << _) - 1, p >>>= _, d -= _), d < 15 && (p += A[i++] << d, d += 8, p += A[i++] << d, d += 8), x = y[p & g]; i: for (; ;) { if (_ = x >>> 24, p >>>= _, d -= _, _ = x >>> 16 & 255, !(16 & _)) { if (0 == (64 & _)) { x = y[(65535 & x) + (p & (1 << _) - 1)]; continue i } t.msg = "invalid distance code", z.mode = 30; break t } if (b = 65535 & x, _ &= 15, d < _ && (p += A[i++] << d, d += 8, d < _ && (p += A[i++] << d, d += 8)), b += p & (1 << _) - 1, b > o) { t.msg = "invalid distance too far back", z.mode = 30; break t } if (p >>>= _, d -= _, _ = n - s, b > _) { if (_ = b - _, _ > h && z.sane) { t.msg = "invalid distance too far back", z.mode = 30; break t } if (w = 0, k = c, 0 === u) { if (w += l - _, _ < v) { v -= _; do { S[n++] = c[w++]; } while (--_); w = n - b, k = S; } } else if (u < _) { if (w += l + u - _, _ -= u, _ < v) { v -= _; do { S[n++] = c[w++]; } while (--_); if (w = 0, u < v) { _ = u, v -= _; do { S[n++] = c[w++]; } while (--_); w = n - b, k = S; } } } else if (w += u - _, _ < v) { v -= _; do { S[n++] = c[w++]; } while (--_); w = n - b, k = S; } for (; v > 2;)S[n++] = k[w++], S[n++] = k[w++], S[n++] = k[w++], v -= 3; v && (S[n++] = k[w++], v > 1 && (S[n++] = k[w++])); } else { w = n - b; do { S[n++] = S[w++], S[n++] = S[w++], S[n++] = S[w++], v -= 3; } while (v > 2); v && (S[n++] = S[w++], v > 1 && (S[n++] = S[w++])); } break } } break } } while (i < r && n < a); v = d >> 3, i -= v, d -= v << 3, p &= (1 << d) - 1, t.next_in = i, t.next_out = n, t.avail_in = i < r ? r - i + 5 : 5 - (i - r), t.avail_out = n < a ? a - n + 257 : 257 - (n - a), z.hold = p, z.bits = d; }; const Iy = new Uint16Array([3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0]), My = new Uint8Array([16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78]), Ty = new Uint16Array([1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0]), Ey = new Uint8Array([16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]); var Cy = (t, e, i, r, n, s, a, o) => { const l = o.bits; let h, u, c, p, d, f, y = 0, m = 0, g = 0, x = 0, _ = 0, v = 0, b = 0, w = 0, k = 0, A = 0, S = null, z = 0; const I = new Uint16Array(16), M = new Uint16Array(16); let T, E, C, P = null, D = 0; for (y = 0; y <= 15; y++)I[y] = 0; for (m = 0; m < r; m++)I[e[i + m]]++; for (_ = l, x = 15; x >= 1 && 0 === I[x]; x--); if (_ > x && (_ = x), 0 === x) return n[s++] = 20971520, n[s++] = 20971520, o.bits = 1, 0; for (g = 1; g < x && 0 === I[g]; g++); for (_ < g && (_ = g), w = 1, y = 1; y <= 15; y++)if (w <<= 1, w -= I[y], w < 0) return -1; if (w > 0 && (0 === t || 1 !== x)) return -1; for (M[1] = 0, y = 1; y < 15; y++)M[y + 1] = M[y] + I[y]; for (m = 0; m < r; m++)0 !== e[i + m] && (a[M[e[i + m]]++] = m); if (0 === t ? (S = P = a, f = 19) : 1 === t ? (S = Iy, z -= 257, P = My, D -= 257, f = 256) : (S = Ty, P = Ey, f = -1), A = 0, m = 0, y = g, d = s, v = _, b = 0, c = -1, k = 1 << _, p = k - 1, 1 === t && k > 852 || 2 === t && k > 592) return 1; for (; ;) { T = y - b, a[m] < f ? (E = 0, C = a[m]) : a[m] > f ? (E = P[D + a[m]], C = S[z + a[m]]) : (E = 96, C = 0), h = 1 << y - b, u = 1 << v, g = u; do { u -= h, n[d + (A >> b) + u] = T << 24 | E << 16 | C | 0; } while (0 !== u); for (h = 1 << y - 1; A & h;)h >>= 1; if (0 !== h ? (A &= h - 1, A += h) : A = 0, m++, 0 == --I[y]) { if (y === x) break; y = e[i + a[m]]; } if (y > _ && (A & p) !== c) { for (0 === b && (b = _), d += g, v = y - b, w = 1 << v; v + b < x && (w -= I[v + b], !(w <= 0));)v++, w <<= 1; if (k += 1 << v, 1 === t && k > 852 || 2 === t && k > 592) return 1; c = A & p, n[c] = _ << 24 | v << 16 | d - s | 0; } } return 0 !== A && (n[d + A] = y - b << 24 | 64 << 16 | 0), o.bits = _, 0 }; const { Z_FINISH: Py, Z_BLOCK: Dy, Z_TREES: By, Z_OK: Vy, Z_STREAM_END: Ly, Z_NEED_DICT: Fy, Z_STREAM_ERROR: Ry, Z_DATA_ERROR: Oy, Z_MEM_ERROR: Uy, Z_BUF_ERROR: $y, Z_DEFLATED: Zy } = uf, qy = 12, Ny = 30, jy = t => (t >>> 24 & 255) + (t >>> 8 & 65280) + ((65280 & t) << 8) + ((255 & t) << 24); function Gy() { this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; } const Xy = t => { if (!t || !t.state) return Ry; const e = t.state; return e.wsize = 0, e.whave = 0, e.wnext = 0, (t => { if (!t || !t.state) return Ry; const e = t.state; return t.total_in = t.total_out = e.total = 0, t.msg = "", e.wrap && (t.adler = 1 & e.wrap), e.mode = 1, e.last = 0, e.havedict = 0, e.dmax = 32768, e.head = null, e.hold = 0, e.bits = 0, e.lencode = e.lendyn = new Int32Array(852), e.distcode = e.distdyn = new Int32Array(592), e.sane = 1, e.back = -1, Vy })(t) }; let Ky, Hy, Wy = !0; const Yy = t => { if (Wy) { Ky = new Int32Array(512), Hy = new Int32Array(32); let e = 0; for (; e < 144;)t.lens[e++] = 8; for (; e < 256;)t.lens[e++] = 9; for (; e < 280;)t.lens[e++] = 7; for (; e < 288;)t.lens[e++] = 8; for (Cy(1, t.lens, 0, 288, Ky, 0, t.work, { bits: 9 }), e = 0; e < 32;)t.lens[e++] = 5; Cy(2, t.lens, 0, 32, Hy, 0, t.work, { bits: 5 }), Wy = !1; } t.lencode = Ky, t.lenbits = 9, t.distcode = Hy, t.distbits = 5; }, Jy = (t, e, i, r) => { let n; const s = t.state; return null === s.window && (s.wsize = 1 << s.wbits, s.wnext = 0, s.whave = 0, s.window = new Uint8Array(s.wsize)), r >= s.wsize ? (s.window.set(e.subarray(i - s.wsize, i), 0), s.wnext = 0, s.whave = s.wsize) : (n = s.wsize - s.wnext, n > r && (n = r), s.window.set(e.subarray(i - r, i - r + n), s.wnext), (r -= n) ? (s.window.set(e.subarray(i - r, i), 0), s.wnext = r, s.whave = s.wsize) : (s.wnext += n, s.wnext === s.wsize && (s.wnext = 0), s.whave < s.wsize && (s.whave += n))), 0 }; var Qy = Xy, tm = (t, e) => { if (!t) return Ry; const i = new Gy; t.state = i, i.window = null; const r = ((t, e) => { let i; if (!t || !t.state) return Ry; const r = t.state; return e < 0 ? (i = 0, e = -e) : (i = 1 + (e >> 4), e < 48 && (e &= 15)), e && (e < 8 || e > 15) ? Ry : (null !== r.window && r.wbits !== e && (r.window = null), r.wrap = i, r.wbits = e, Xy(t)) })(t, e); return r !== Vy && (t.state = null), r }, em = (t, e) => { let i, r, n, s, a, o, l, h, u, c, p, d, f, y, m, g, x, _, v, b, w, k, A = 0; const S = new Uint8Array(4); let z, I; const M = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); if (!t || !t.state || !t.output || !t.input && 0 !== t.avail_in) return Ry; i = t.state, i.mode === qy && (i.mode = 13), a = t.next_out, n = t.output, l = t.avail_out, s = t.next_in, r = t.input, o = t.avail_in, h = i.hold, u = i.bits, c = o, p = l, k = Vy; t: for (; ;)switch (i.mode) { case 1: if (0 === i.wrap) { i.mode = 13; break } for (; u < 16;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } if (2 & i.wrap && 35615 === h) { i.check = 0, S[0] = 255 & h, S[1] = h >>> 8 & 255, i.check = lf(i.check, S, 2, 0), h = 0, u = 0, i.mode = 2; break } if (i.flags = 0, i.head && (i.head.done = !1), !(1 & i.wrap) || (((255 & h) << 8) + (h >> 8)) % 31) { t.msg = "incorrect header check", i.mode = Ny; break } if ((15 & h) !== Zy) { t.msg = "unknown compression method", i.mode = Ny; break } if (h >>>= 4, u -= 4, w = 8 + (15 & h), 0 === i.wbits) i.wbits = w; else if (w > i.wbits) { t.msg = "invalid window size", i.mode = Ny; break } i.dmax = 1 << i.wbits, t.adler = i.check = 1, i.mode = 512 & h ? 10 : qy, h = 0, u = 0; break; case 2: for (; u < 16;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } if (i.flags = h, (255 & i.flags) !== Zy) { t.msg = "unknown compression method", i.mode = Ny; break } if (57344 & i.flags) { t.msg = "unknown header flags set", i.mode = Ny; break } i.head && (i.head.text = h >> 8 & 1), 512 & i.flags && (S[0] = 255 & h, S[1] = h >>> 8 & 255, i.check = lf(i.check, S, 2, 0)), h = 0, u = 0, i.mode = 3; case 3: for (; u < 32;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } i.head && (i.head.time = h), 512 & i.flags && (S[0] = 255 & h, S[1] = h >>> 8 & 255, S[2] = h >>> 16 & 255, S[3] = h >>> 24 & 255, i.check = lf(i.check, S, 4, 0)), h = 0, u = 0, i.mode = 4; case 4: for (; u < 16;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } i.head && (i.head.xflags = 255 & h, i.head.os = h >> 8), 512 & i.flags && (S[0] = 255 & h, S[1] = h >>> 8 & 255, i.check = lf(i.check, S, 2, 0)), h = 0, u = 0, i.mode = 5; case 5: if (1024 & i.flags) { for (; u < 16;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } i.length = h, i.head && (i.head.extra_len = h), 512 & i.flags && (S[0] = 255 & h, S[1] = h >>> 8 & 255, i.check = lf(i.check, S, 2, 0)), h = 0, u = 0; } else i.head && (i.head.extra = null); i.mode = 6; case 6: if (1024 & i.flags && (d = i.length, d > o && (d = o), d && (i.head && (w = i.head.extra_len - i.length, i.head.extra || (i.head.extra = new Uint8Array(i.head.extra_len)), i.head.extra.set(r.subarray(s, s + d), w)), 512 & i.flags && (i.check = lf(i.check, r, d, s)), o -= d, s += d, i.length -= d), i.length)) break t; i.length = 0, i.mode = 7; case 7: if (2048 & i.flags) { if (0 === o) break t; d = 0; do { w = r[s + d++], i.head && w && i.length < 65536 && (i.head.name += String.fromCharCode(w)); } while (w && d < o); if (512 & i.flags && (i.check = lf(i.check, r, d, s)), o -= d, s += d, w) break t } else i.head && (i.head.name = null); i.length = 0, i.mode = 8; case 8: if (4096 & i.flags) { if (0 === o) break t; d = 0; do { w = r[s + d++], i.head && w && i.length < 65536 && (i.head.comment += String.fromCharCode(w)); } while (w && d < o); if (512 & i.flags && (i.check = lf(i.check, r, d, s)), o -= d, s += d, w) break t } else i.head && (i.head.comment = null); i.mode = 9; case 9: if (512 & i.flags) { for (; u < 16;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } if (h !== (65535 & i.check)) { t.msg = "header crc mismatch", i.mode = Ny; break } h = 0, u = 0; } i.head && (i.head.hcrc = i.flags >> 9 & 1, i.head.done = !0), t.adler = i.check = 0, i.mode = qy; break; case 10: for (; u < 32;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } t.adler = i.check = jy(h), h = 0, u = 0, i.mode = 11; case 11: if (0 === i.havedict) return t.next_out = a, t.avail_out = l, t.next_in = s, t.avail_in = o, i.hold = h, i.bits = u, Fy; t.adler = i.check = 1, i.mode = qy; case qy: if (e === Dy || e === By) break t; case 13: if (i.last) { h >>>= 7 & u, u -= 7 & u, i.mode = 27; break } for (; u < 3;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } switch (i.last = 1 & h, h >>>= 1, u -= 1, 3 & h) { case 0: i.mode = 14; break; case 1: if (Yy(i), i.mode = 20, e === By) { h >>>= 2, u -= 2; break t } break; case 2: i.mode = 17; break; case 3: t.msg = "invalid block type", i.mode = Ny; }h >>>= 2, u -= 2; break; case 14: for (h >>>= 7 & u, u -= 7 & u; u < 32;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } if ((65535 & h) != (h >>> 16 ^ 65535)) { t.msg = "invalid stored block lengths", i.mode = Ny; break } if (i.length = 65535 & h, h = 0, u = 0, i.mode = 15, e === By) break t; case 15: i.mode = 16; case 16: if (d = i.length, d) { if (d > o && (d = o), d > l && (d = l), 0 === d) break t; n.set(r.subarray(s, s + d), a), o -= d, s += d, l -= d, a += d, i.length -= d; break } i.mode = qy; break; case 17: for (; u < 14;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } if (i.nlen = 257 + (31 & h), h >>>= 5, u -= 5, i.ndist = 1 + (31 & h), h >>>= 5, u -= 5, i.ncode = 4 + (15 & h), h >>>= 4, u -= 4, i.nlen > 286 || i.ndist > 30) { t.msg = "too many length or distance symbols", i.mode = Ny; break } i.have = 0, i.mode = 18; case 18: for (; i.have < i.ncode;) { for (; u < 3;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } i.lens[M[i.have++]] = 7 & h, h >>>= 3, u -= 3; } for (; i.have < 19;)i.lens[M[i.have++]] = 0; if (i.lencode = i.lendyn, i.lenbits = 7, z = { bits: i.lenbits }, k = Cy(0, i.lens, 0, 19, i.lencode, 0, i.work, z), i.lenbits = z.bits, k) { t.msg = "invalid code lengths set", i.mode = Ny; break } i.have = 0, i.mode = 19; case 19: for (; i.have < i.nlen + i.ndist;) { for (; A = i.lencode[h & (1 << i.lenbits) - 1], m = A >>> 24, g = A >>> 16 & 255, x = 65535 & A, !(m <= u);) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } if (x < 16) h >>>= m, u -= m, i.lens[i.have++] = x; else { if (16 === x) { for (I = m + 2; u < I;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } if (h >>>= m, u -= m, 0 === i.have) { t.msg = "invalid bit length repeat", i.mode = Ny; break } w = i.lens[i.have - 1], d = 3 + (3 & h), h >>>= 2, u -= 2; } else if (17 === x) { for (I = m + 3; u < I;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } h >>>= m, u -= m, w = 0, d = 3 + (7 & h), h >>>= 3, u -= 3; } else { for (I = m + 7; u < I;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } h >>>= m, u -= m, w = 0, d = 11 + (127 & h), h >>>= 7, u -= 7; } if (i.have + d > i.nlen + i.ndist) { t.msg = "invalid bit length repeat", i.mode = Ny; break } for (; d--;)i.lens[i.have++] = w; } } if (i.mode === Ny) break; if (0 === i.lens[256]) { t.msg = "invalid code -- missing end-of-block", i.mode = Ny; break } if (i.lenbits = 9, z = { bits: i.lenbits }, k = Cy(1, i.lens, 0, i.nlen, i.lencode, 0, i.work, z), i.lenbits = z.bits, k) { t.msg = "invalid literal/lengths set", i.mode = Ny; break } if (i.distbits = 6, i.distcode = i.distdyn, z = { bits: i.distbits }, k = Cy(2, i.lens, i.nlen, i.ndist, i.distcode, 0, i.work, z), i.distbits = z.bits, k) { t.msg = "invalid distances set", i.mode = Ny; break } if (i.mode = 20, e === By) break t; case 20: i.mode = 21; case 21: if (o >= 6 && l >= 258) { t.next_out = a, t.avail_out = l, t.next_in = s, t.avail_in = o, i.hold = h, i.bits = u, zy(t, p), a = t.next_out, n = t.output, l = t.avail_out, s = t.next_in, r = t.input, o = t.avail_in, h = i.hold, u = i.bits, i.mode === qy && (i.back = -1); break } for (i.back = 0; A = i.lencode[h & (1 << i.lenbits) - 1], m = A >>> 24, g = A >>> 16 & 255, x = 65535 & A, !(m <= u);) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } if (g && 0 == (240 & g)) { for (_ = m, v = g, b = x; A = i.lencode[b + ((h & (1 << _ + v) - 1) >> _)], m = A >>> 24, g = A >>> 16 & 255, x = 65535 & A, !(_ + m <= u);) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } h >>>= _, u -= _, i.back += _; } if (h >>>= m, u -= m, i.back += m, i.length = x, 0 === g) { i.mode = 26; break } if (32 & g) { i.back = -1, i.mode = qy; break } if (64 & g) { t.msg = "invalid literal/length code", i.mode = Ny; break } i.extra = 15 & g, i.mode = 22; case 22: if (i.extra) { for (I = i.extra; u < I;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } i.length += h & (1 << i.extra) - 1, h >>>= i.extra, u -= i.extra, i.back += i.extra; } i.was = i.length, i.mode = 23; case 23: for (; A = i.distcode[h & (1 << i.distbits) - 1], m = A >>> 24, g = A >>> 16 & 255, x = 65535 & A, !(m <= u);) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } if (0 == (240 & g)) { for (_ = m, v = g, b = x; A = i.distcode[b + ((h & (1 << _ + v) - 1) >> _)], m = A >>> 24, g = A >>> 16 & 255, x = 65535 & A, !(_ + m <= u);) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } h >>>= _, u -= _, i.back += _; } if (h >>>= m, u -= m, i.back += m, 64 & g) { t.msg = "invalid distance code", i.mode = Ny; break } i.offset = x, i.extra = 15 & g, i.mode = 24; case 24: if (i.extra) { for (I = i.extra; u < I;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } i.offset += h & (1 << i.extra) - 1, h >>>= i.extra, u -= i.extra, i.back += i.extra; } if (i.offset > i.dmax) { t.msg = "invalid distance too far back", i.mode = Ny; break } i.mode = 25; case 25: if (0 === l) break t; if (d = p - l, i.offset > d) { if (d = i.offset - d, d > i.whave && i.sane) { t.msg = "invalid distance too far back", i.mode = Ny; break } d > i.wnext ? (d -= i.wnext, f = i.wsize - d) : f = i.wnext - d, d > i.length && (d = i.length), y = i.window; } else y = n, f = a - i.offset, d = i.length; d > l && (d = l), l -= d, i.length -= d; do { n[a++] = y[f++]; } while (--d); 0 === i.length && (i.mode = 21); break; case 26: if (0 === l) break t; n[a++] = i.length, l--, i.mode = 21; break; case 27: if (i.wrap) { for (; u < 32;) { if (0 === o) break t; o--, h |= r[s++] << u, u += 8; } if (p -= l, t.total_out += p, i.total += p, p && (t.adler = i.check = i.flags ? lf(i.check, n, p, a - p) : af(i.check, n, p, a - p)), p = l, (i.flags ? h : jy(h)) !== i.check) { t.msg = "incorrect data check", i.mode = Ny; break } h = 0, u = 0; } i.mode = 28; case 28: if (i.wrap && i.flags) { for (; u < 32;) { if (0 === o) break t; o--, h += r[s++] << u, u += 8; } if (h !== (4294967295 & i.total)) { t.msg = "incorrect length check", i.mode = Ny; break } h = 0, u = 0; } i.mode = 29; case 29: k = Ly; break t; case Ny: k = Oy; break t; case 31: return Uy; default: return Ry }return t.next_out = a, t.avail_out = l, t.next_in = s, t.avail_in = o, i.hold = h, i.bits = u, (i.wsize || p !== t.avail_out && i.mode < Ny && (i.mode < 27 || e !== Py)) && Jy(t, t.output, t.next_out, p - t.avail_out), c -= t.avail_in, p -= t.avail_out, t.total_in += c, t.total_out += p, i.total += p, i.wrap && p && (t.adler = i.check = i.flags ? lf(i.check, n, p, t.next_out - p) : af(i.check, n, p, t.next_out - p)), t.data_type = i.bits + (i.last ? 64 : 0) + (i.mode === qy ? 128 : 0) + (20 === i.mode || 15 === i.mode ? 256 : 0), (0 === c && 0 === p || e === Py) && k === Vy && (k = $y), k }, im = t => { if (!t || !t.state) return Ry; let e = t.state; return e.window && (e.window = null), t.state = null, Vy }, rm = (t, e) => { const i = e.length; let r, n, s; return t && t.state ? (r = t.state, 0 !== r.wrap && 11 !== r.mode ? Ry : 11 === r.mode && (n = 1, n = af(n, e, i, 0), n !== r.check) ? Oy : (s = Jy(t, e, i, i), s ? (r.mode = 31, Uy) : (r.havedict = 1, Vy))) : Ry }, nm = function () { this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1; }; const sm = Object.prototype.toString, { Z_NO_FLUSH: am, Z_FINISH: om, Z_OK: lm, Z_STREAM_END: hm, Z_NEED_DICT: um, Z_STREAM_ERROR: cm, Z_DATA_ERROR: pm, Z_MEM_ERROR: dm } = uf; function fm(t) { this.options = sy({ chunkSize: 65536, windowBits: 15, to: "" }, t || {}); const e = this.options; e.raw && e.windowBits >= 0 && e.windowBits < 16 && (e.windowBits = -e.windowBits, 0 === e.windowBits && (e.windowBits = -15)), !(e.windowBits >= 0 && e.windowBits < 16) || t && t.windowBits || (e.windowBits += 32), e.windowBits > 15 && e.windowBits < 48 && 0 == (15 & e.windowBits) && (e.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new py, this.strm.avail_out = 0; let i = tm(this.strm, e.windowBits); if (i !== lm) throw new Error(hf[i]); if (this.header = new nm, ((t, e) => { if (!t || !t.state) return Ry; const i = t.state; 0 == (2 & i.wrap) || (i.head = e, e.done = !1); })(this.strm, this.header), e.dictionary && ("string" == typeof e.dictionary ? e.dictionary = hy(e.dictionary) : "[object ArrayBuffer]" === sm.call(e.dictionary) && (e.dictionary = new Uint8Array(e.dictionary)), e.raw && (i = rm(this.strm, e.dictionary), i !== lm))) throw new Error(hf[i]) } function ym(t, e) { const i = new fm(e); if (i.push(t), i.err) throw i.msg || hf[i.err]; return i.result } fm.prototype.push = function (t, e) { const i = this.strm, r = this.options.chunkSize, n = this.options.dictionary; let s, a, o; if (this.ended) return !1; for (a = e === ~~e ? e : !0 === e ? om : am, i.input = "[object ArrayBuffer]" === sm.call(t) ? new Uint8Array(t) : t, i.next_in = 0, i.avail_in = i.input.length; ;) { for (0 === i.avail_out && (i.output = new Uint8Array(r), i.next_out = 0, i.avail_out = r), s = em(i, a), s === um && n && (s = rm(i, n), s === lm ? s = em(i, a) : s === pm && (s = um)); i.avail_in > 0 && s === hm && i.state.wrap > 0 && 0 !== t[i.next_in];)Qy(i), s = em(i, a); switch (s) { case cm: case pm: case um: case dm: return this.onEnd(s), this.ended = !0, !1 }if (o = i.avail_out, i.next_out && (0 === i.avail_out || s === hm)) if ("string" === this.options.to) { let t = cy(i.output, i.next_out), e = i.next_out - t, n = uy(i.output, t); i.next_out = e, i.avail_out = r - e, e && i.output.set(i.output.subarray(t, t + e), 0), this.onData(n); } else this.onData(i.output.length === i.next_out ? i.output : i.output.subarray(0, i.next_out)); if (s !== lm || 0 !== o) { if (s === hm) return s = im(this.strm), this.onEnd(s), this.ended = !0, !0; if (0 === i.avail_in) break } } return !0 }, fm.prototype.onData = function (t) { this.chunks.push(t); }, fm.prototype.onEnd = function (t) { t === lm && (this.result = "string" === this.options.to ? this.chunks.join("") : ay(this.chunks)), this.chunks = [], this.err = t, this.msg = this.strm.msg; }; var mm = { Inflate: fm, inflate: ym, inflateRaw: function (t, e) { return (e = e || {}).raw = !0, ym(t, e) }, ungzip: ym, constants: uf }; const { Deflate: gm, deflate: xm, deflateRaw: _m, gzip: vm } = Sy, { Inflate: bm, inflate: wm, inflateRaw: km, ungzip: Am } = mm; var Sm = { Deflate: gm, deflate: xm, deflateRaw: _m, gzip: vm, Inflate: bm, inflate: wm, inflateRaw: km, ungzip: Am, constants: uf }; class zm { constructor(t) { this.entries = {}, this.scheduler = t; } request(t, e, i, r) { const n = this.entries[t] = this.entries[t] || { callbacks: [] }; if (n.result) { const [t, i] = n.result; return this.scheduler ? this.scheduler.add((() => { r(t, i); }), e) : r(t, i), () => { } } return n.callbacks.push(r), n.cancel || (n.cancel = i(((i, r) => { n.result = [i, r]; for (const t of n.callbacks) this.scheduler ? this.scheduler.add((() => { t(i, r); }), e) : t(i, r); setTimeout((() => delete this.entries[t]), 3e3); }))), () => { n.result || (n.callbacks = n.callbacks.filter((t => t !== r)), n.callbacks.length || (n.cancel(), delete this.entries[t])); } } } const Im = 2654435769; function Mm(t) { return t.charCodeAt(0) } function Tm(t, e, i) { const r = JSON.stringify(t.request); return t.data && (this.deduped.entries[r] = { result: [null, t.data] }), this.deduped.request(r, { type: "parseTile", isSymbolTile: t.isSymbolTile, zoom: t.tileZoom }, (e => { const r = hs(t.request, ((t, r, n, s) => { if (t) e(t); else if (r) { const t = function (t) { let e = ""; for (let i = 0; i < t.length; i++)e += String.fromCharCode(t[i]); let i = null; try { i = JSON.parse(e); } catch (t) { } return i }(new Uint8Array(r)); if (Array.isArray(t)) { const r = function (t) { return Sm.inflate(function (t, e) { const i = function (t) { const e = t.length; let i = e >> 2; 0 != (3 & e) && ++i; const r = new Uint32Array(i); for (let i = 0; i < e; ++i)r[i >> 2] |= t[i] << ((3 & i) << 3); return r }(new Uint8Array(atob(t).split("").map(Mm))), r = function (t) { const e = t.length, i = []; for (let r = 0; r < e; r += 4)i[r >> 2] = t.charCodeAt(r) | t.charCodeAt(r + 1) << 8 | t.charCodeAt(r + 2) << 16 | t.charCodeAt(r + 3) << 24; return i }(e), n = i.length - 1; let s, a, o, l = i[n - 1], h = i[0], u = Math.floor(6 + 52 / (n + 1)) * Im & 4294967295; for (; 0 !== u;) { for (a = u >>> 2 & 3, o = n; o > 0; --o)l = i[o - 1], s = (l >>> 5 ^ h << 2) + (h >>> 3 ^ l << 4) ^ (u ^ h) + (r[3 & o ^ a] ^ l), h = i[o] = i[o] - s & 4294967295; l = i[n], s = (l >>> 5 ^ h << 2) + (h >>> 3 ^ l << 4) ^ (u ^ h) + (r[3 & o ^ a] ^ l), h = i[0] = i[0] - s & 4294967295, u = u - Im & 4294967295; } return function (t) { const e = t.length << 2, i = new Uint8Array(e); for (let r = 0; r < e; ++r)i[r] = t[r >> 2] >> ((3 & r) << 3); return i }(i) }(t, function (t) { t = t.replace(/[^a-z0-9]/g, ""); for (var e, i = 0, r = []; i < t.length; i += 2)e = parseInt(t.substr(i, 2), 16), e = (e ^= (i / 2 & 2) > 0 ? 2 : 1) >> 4 | (15 & e) << 4, r.push(String.fromCharCode(e)); return r.join("") }("82626121-5782-1454-1247-617142522121"))).buffer }(t[t[0]]); e(null, { vectorTile: i ? void 0 : new au.VectorTile(new ju(r)), rawData: r, cacheControl: n, expires: s }); } else e(null, { vectorTile: i ? void 0 : new au.VectorTile(new ju(r)), rawData: r, cacheControl: n, expires: s }); } })); return () => { r.cancel(), e(); } }), e) } t.AUTH_ERR_MSG = Ln, t.Aabb = bl, t.Actor = class { constructor(t, e, i) { this.target = t, this.parent = e, this.mapId = i, this.callbacks = {}, this.cancelCallbacks = {}, S(["receive"], this), this.target.addEventListener("message", this.receive, !1), this.globalScope = B() ? t : n, this.scheduler = new Gp; } send(t, e, i, r, n = !1, s) { const a = Math.round(1e18 * Math.random()).toString(36).substring(0, 10); i && (i.metadata = s, this.callbacks[a] = i); const o = F(this.globalScope) ? void 0 : []; return this.target.postMessage({ id: a, type: t, hasCallback: !!i, targetMapId: r, mustQueue: n, sourceMapId: this.mapId, data: $r(e, o) }, o), { cancel: () => { i && delete this.callbacks[a], this.target.postMessage({ id: a, type: "<cancel>", targetMapId: r, sourceMapId: this.mapId }); } } } receive(t) { const e = t.data, i = e.id; if (i && (!e.targetMapId || this.mapId === e.targetMapId)) if ("<cancel>" === e.type) { const t = this.cancelCallbacks[i]; delete this.cancelCallbacks[i], t && t.cancel(); } else if (e.mustQueue || B()) { const t = this.callbacks[i]; this.cancelCallbacks[i] = this.scheduler.add((() => this.processTask(i, e)), t && t.metadata || { type: "message" }); } else this.processTask(i, e); } processTask(t, e) { if ("<response>" === e.type) { const i = this.callbacks[t]; delete this.callbacks[t], i && (e.error ? i(Zr(e.error)) : i(null, Zr(e.data))); } else { const i = F(this.globalScope) ? void 0 : [], r = e.hasCallback ? (e, r) => { delete this.cancelCallbacks[t], this.target.postMessage({ id: t, type: "<response>", sourceMapId: this.mapId, error: e ? $r(e) : null, data: $r(r, i) }, i); } : t => { }, n = Zr(e.data); if (this.parent[e.type]) this.parent[e.type](e.sourceMapId, n, r); else if (this.parent.getWorkerSource) { const t = e.type.split("."); this.parent.getWorkerSource(e.sourceMapId, t[0], n.source)[t[1]](n, r); } else r(new Error(`Could not find function ${e.type}`)); } } remove() { this.scheduler.remove(), this.target.removeEventListener("message", this.receive, !1); } }, t.CRS = Sh, t.CanonicalTileID = jh, t.Color = wt, t.ColorMode = pd, t.CullFaceMode = yd, t.DEMData = od, t.DataConstantProperty = Os, t.DedupedRequest = zm, t.DepthMode = hd, t.EXTENT = co, t.Elevation = class { getAtPointOrZero(t, e = 0) { return this.getAtPoint(t, e) || 0 } getAtPoint(t, e, i = !0) { null == e && (e = null); const r = this._source(); if (!r) return e; if (t.y < 0 || t.y > 1) return e; const n = r.getSource().maxzoom, s = 1 << n, a = Math.floor(t.x), o = t.x - a, l = new Xh(n, a, n, Math.floor(o * s), Math.floor(t.y * s)), h = this.findDEMTileFor(l); if (!h || !h.dem) return e; const u = h.dem, c = 1 << h.tileID.canonical.z, p = (o * c - h.tileID.canonical.x) * u.dim, d = (t.y * c - h.tileID.canonical.y) * u.dim, f = Math.floor(p), y = Math.floor(d); return (i ? this.exaggeration() : 1) * Ae(Ae(u.get(f, y), u.get(f, y + 1), d - y), Ae(u.get(f + 1, y), u.get(f + 1, y + 1), d - y), p - f) } getAtTileOffset(t, e, i) { const r = 1 << t.canonical.z; return this.getAtPointOrZero(new Bh(t.wrap + (t.canonical.x + e / co) / r, (t.canonical.y + i / co) / r)) } getForTilePoints(t, e, i, r) { const n = _d.create(this, t, r); return !!n && (e.forEach((t => { t[2] = this.exaggeration() * n.getElevationAt(t[0], t[1], i); })), !0) } getMinMaxForTile(t) { const e = this.findDEMTileFor(t); if (!e || !e.dem) return null; const i = e.dem.tree, r = e.tileID, n = 1 << t.canonical.z - r.canonical.z; let s = t.canonical.x / n - r.canonical.x, a = t.canonical.y / n - r.canonical.y, o = 0; for (let e = 0; e < t.canonical.z - r.canonical.z && !i.leaves[o]; e++) { s *= 2, a *= 2; const t = 2 * Math.floor(a) + Math.floor(s); o = i.childOffsets[o] + t, s %= 1, a %= 1; } return { min: this.exaggeration() * i.minimums[o], max: this.exaggeration() * i.maximums[o] } } getMinElevationBelowMSL() { throw new Error("Pure virtual method called.") } raycast(t, e, i) { throw new Error("Pure virtual method called.") } pointCoordinate(t) { throw new Error("Pure virtual method called.") } _source() { throw new Error("Pure virtual method called.") } exaggeration() { throw new Error("Pure virtual method called.") } findDEMTileFor(t) { throw new Error("Pure virtual method called.") } get visibleDemTiles() { throw new Error("Getter must be implemented in subclass.") } }, t.ErrorEvent = Z, t.EvaluationParameters = Es, t.Event = $, t.Evented = q, t.FreeCameraOptions = Zh, t.Frustum = vl, t.GlyphManager = Wc, t.ImagePosition = yc, t.LineAtlas = Zp, t.LngLat = G, t.LngLatBounds = N, t.LocalGlyphMode = Hc, t.MAX_SAFE_INTEGER = o, t.MercatorCoordinate = Bh, t.ONE_EM = Vu, t.OverscaledTileID = Xh, t.Properties = Ns, t.RGBAImage = Cl, t.Ray = _l, t.RequestManager = class { constructor(t, e, i) { this._transformRequestFn = t, this._customAccessToken = e, this._silenceAuthErrors = !!i, this._createSkuToken(); } _createSkuToken() { const t = function () { let t = ""; for (let e = 0; e < 10; e++)t += "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62 * Math.random())]; return { token: ["1", Vn, t].join(""), tokenExpiresAt: Date.now() + 432e5 } }(); this._skuToken = t.token, this._skuTokenExpiresAt = t.tokenExpiresAt; } _isSkuTokenExpired() { return Date.now() > this._skuTokenExpiresAt } transformRequest(t, e) { return this._transformRequestFn && this._transformRequestFn(t, e) || { url: t } } normalizeStyleURL(t, e) { if (!Fn(t)) return t; const i = Un(t); return i.path = `/styles/v1${i.path}`, this._makeAPIURL(i, this._customAccessToken || e) } normalizeGlyphsURL(t, e) { if (!Fn(t)) return t; const i = Un(t); return i.path = `/fonts/v1${i.path}`, this._makeAPIURL(i, this._customAccessToken || e) } normalizeSourceURL(t, e) { if (!Fn(t)) return t; const i = Un(t); return i.path = `/v4/${i.authority}.json`, i.params.push("secure"), this._makeAPIURL(i, this._customAccessToken || e) } normalizeSpriteURL(t, e, i, r) { const n = Un(t); return Fn(t) ? (n.path = `/styles/v1${n.path}/sprite${e}${i}`, this._makeAPIURL(n, this._customAccessToken || r)) : (n.path += `${e}${i}`, $n(n)) } normalizeTileURL(t, e, i) { if (this._isSkuTokenExpired() && this._createSkuToken(), t && !Fn(t)) return t; const r = Un(t); r.path = r.path.replace(/(\.(png|jpg)\d*)(?=$)/, `${e || i && "raster" !== r.authority && 512 === i ? "@2x" : ""}${Tn.supported ? ".webp" : "$1"}`), "raster" === r.authority ? r.path = `/${Mn.RASTER_URL_PREFIX}${r.path}` : (r.path = r.path.replace(/^.+\/v4\//, "/"), r.path = `/${Mn.TILE_URL_VERSION}${r.path}`); const n = this._customAccessToken || function (t) { for (const e of t) { const t = e.match(/^access_token=(.*)$/); if (t) return t[1] } return null }(r.params) || Mn.ACCESS_TOKEN; return Mn.REQUIRE_ACCESS_TOKEN && n && this._skuToken && r.params.push(`sku=${this._skuToken}`), this._makeAPIURL(r, n) } canonicalizeTileURL(t, e) { const i = Un(t); if (!i.path.match(/^(\/v4\/|\/raster\/v1\/)/) || !i.path.match(/\.[\w]+$/)) return t; let r = "mapbox://"; i.path.match(/^\/raster\/v1\//) ? r += `raster/${i.path.replace(`/${Mn.RASTER_URL_PREFIX}/`, "")}` : r += `tiles/${i.path.replace(`/${Mn.TILE_URL_VERSION}/`, "")}`; let n = i.params; return e && (n = n.filter((t => !t.match(/^access_token=/)))), n.length && (r += `?${n.join("&")}`), r } canonicalizeTileset(t, e) { const i = !!e && Fn(e), r = []; for (const e of t.tiles || []) Rn(e) ? r.push(this.canonicalizeTileURL(e, i)) : r.push(e); return r } _makeAPIURL(t, e) { const i = "See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes", r = Un(Mn.API_URL); if (t.protocol = r.protocol, t.authority = r.authority, "http" === t.protocol) { const e = t.params.indexOf("secure"); e >= 0 && t.params.splice(e, 1); } if ("/" !== r.path && (t.path = `${r.path}${t.path}`), !Mn.REQUIRE_ACCESS_TOKEN) return $n(t); if (e = e || Mn.ACCESS_TOKEN, !this._silenceAuthErrors) { if (!e) throw new Error(`An API access token is required to use Mapbox GL. ${i}`); if ("s" === e[0]) throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`) } return t.params = t.params.filter((t => -1 === t.indexOf("access_token"))), t.params.push(`access_token=${e || ""}`), $n(t) } }, t.ResourceType = ss, t.SegmentVector = uo, t.SourceCache = md, t.StencilMode = cd, t.StructArrayLayout1ui2 = ga, t.StructArrayLayout2f1f2i16 = la, t.StructArrayLayout2i4 = Ys, t.StructArrayLayout2ui4 = ma, t.StructArrayLayout3f12 = na, t.StructArrayLayout3ui6 = ua, t.StructArrayLayout4i8 = Js, t.Texture = $p, t.Tile = Wp, t.Transform = Hh, t.Transitionable = Ds, t.Uniform1f = Za, t.Uniform1i = class extends $a { constructor(t, e) { super(t, e), this.current = 0; } set(t) { this.current !== t && (this.current = t, this.gl.uniform1i(this.location, t)); } }, t.Uniform2f = class extends $a { constructor(t, e) { super(t, e), this.current = [0, 0]; } set(t) { t[0] === this.current[0] && t[1] === this.current[1] || (this.current = t, this.gl.uniform2f(this.location, t[0], t[1])); } }, t.Uniform3f = class extends $a { constructor(t, e) { super(t, e), this.current = [0, 0, 0]; } set(t) { t[0] === this.current[0] && t[1] === this.current[1] && t[2] === this.current[2] || (this.current = t, this.gl.uniform3f(this.location, t[0], t[1], t[2])); } }, t.Uniform4f = qa, t.UniformColor = Na, t.UniformMatrix3f = class extends $a { constructor(t, e) { super(t, e), this.current = Ga; } set(t) { for (let e = 0; e < 9; e++)if (t[e] !== this.current[e]) { this.current = t, this.gl.uniformMatrix3fv(this.location, !1, t); break } } }, t.UniformMatrix4f = class extends $a { constructor(t, e) { super(t, e), this.current = ja; } set(t) { if (t[12] !== this.current[12] || t[0] !== this.current[0]) return this.current = t, void this.gl.uniformMatrix4fv(this.location, !1, t); for (let e = 1; e < 16; e++)if (t[e] !== this.current[e]) { this.current = t, this.gl.uniformMatrix4fv(this.location, !1, t); break } } }, t.ValidationError = K, t.VectorTileWorkerSource = class extends q { constructor(t, e, i, r, n) { super(), this.actor = t, this.layerIndex = e, this.availableImages = i, this.loadVectorData = n || Tm, this.loading = {}, this.loaded = {}, this.deduped = new zm(t.scheduler), this.isSpriteLoaded = r, this.scheduler = t.scheduler; } loadTile(t, e) { const i = t.uid, r = t && t.request, n = r && r.collectResourceTiming, s = this.loading[i] = new Ad(t); s.abort = this.loadVectorData(t, ((a, o) => { const l = !this.loading[i]; if (delete this.loading[i], l || a || !o) return s.status = "done", l || (this.loaded[i] = s), e(a); const h = o.rawData, u = {}; o.expires && (u.expires = o.expires), o.cacheControl && (u.cacheControl = o.cacheControl), s.vectorTile = o.vectorTile || new au.VectorTile(new ju(h)); const c = () => { s.parse(s.vectorTile, this.layerIndex, this.availableImages, this.actor, ((t, i) => { if (t || !i) return e(t); const s = {}; if (n) { const t = jp(r); t.length > 0 && (s.resourceTiming = JSON.parse(JSON.stringify(t))); } e(null, _({ rawTileData: h.slice(0) }, i, u, s)); })); }; this.isSpriteLoaded ? c() : this.once("isSpriteLoaded", (() => { this.scheduler ? this.scheduler.add(c, { type: "parseTile", isSymbolTile: t.isSymbolTile, zoom: t.tileZoom }) : c(); })), this.loaded = this.loaded || {}, this.loaded[i] = s; })); } reloadTile(t, e) { const i = this.loaded, r = t.uid, n = this; if (i && i[r]) { const s = i[r]; s.showCollisionBoxes = t.showCollisionBoxes, s.enableTerrain = !!t.enableTerrain; const a = (t, i) => { const r = s.reloadCallback; r && (delete s.reloadCallback, s.parse(s.vectorTile, n.layerIndex, this.availableImages, n.actor, r)), e(t, i); }; "parsing" === s.status ? s.reloadCallback = a : "done" === s.status && (s.vectorTile ? s.parse(s.vectorTile, this.layerIndex, this.availableImages, this.actor, a) : a()); } } abortTile(t, e) { const i = t.uid, r = this.loading[i]; r && (r.abort && r.abort(), delete this.loading[i]), e(); } removeTile(t, e) { const i = this.loaded, r = t.uid; i && i[r] && delete i[r], e(); } }, t.WritingMode = gc, t.ZoomHistory = qr, t.add = tl, t.addDynamicAttributes = bp, t.altitudeFromMercatorZ = Dh, t.asyncAll = g, t.bezier = d, t.bindAll = S, t.bufferConvexPolygon = function (t, e) { const i = []; for (let r = 0; r < t.length; r++) { const n = m(r - 1, -1, t.length - 1), s = m(r + 1, -1, t.length - 1), a = t[r], o = t[s], l = t[n].sub(a).unit(), h = o.sub(a).unit(), u = h.angleWithSep(l.x, l.y), c = l.add(h).unit().mult(-1 * e / Math.sin(u / 2)); i.push(a.add(c)); } return i }, t.cacheEntryPossiblyAdded = function (t) { ns++, ns > es && (t.getActor().send("enforceCacheSizeLimit", ts), ns = 0); }, t.clamp = y, t.clearTileCache = function (t) { const e = n.caches.delete(Yn); t && e.catch(t).then((() => t())); }, t.clipLine = Zc, t.clone = function (t) { var e = new Fo(16); return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e }, t.clone$1 = T, t.collisionCircleLayout = Bu, t.config = Mn, t.create = Oo, t.create$1 = Ro, t.createExpression = $i, t.createFilter = er, t.createLayout = Hs, t.createStyleLayer = function (t) { return "custom" === t.type ? new Pp(t) : new Vp[t.type](t) }, t.createTransform = function (t) { const e = new Wh(t.minZoom, t.maxZoom, t.minPitch, t.maxPitch, t.renderWorldCopies); return Jh({ transform: e }), Yh.transform = e, e }, t.degToRad = u, t.div = function (t, e, i) { return t[0] = e[0] / i[0], t[1] = e[1] / i[1], t[2] = e[2] / i[2], t }, t.dot = al, t.ease = f, t.easeCubicInOut = p, t.emitValidationErrors = Pr, t.endsWith = z, t.enforceCacheSizeLimit = function (t) { is(), Jn && Jn.then((e => { e.keys().then((i => { for (let r = 0; r < i.length - t; r++)e.delete(i[r]); })); })); }, t.evaluateSizeForFeature = Ru, t.evaluateSizeForZoom = Ou, t.evaluateVariableOffset = lp, t.evented = Is, t.exported = vs, t.exported$1 = Tn, t.extend = _, t.filterObject = M, t.fromMat4 = function (t, e) { return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[4], t[4] = e[5], t[5] = e[6], t[6] = e[8], t[7] = e[9], t[8] = e[10], t }, t.fromRotation = function (t, e) { var i = Math.sin(e), r = Math.cos(e); return t[0] = r, t[1] = i, t[2] = 0, t[3] = -i, t[4] = r, t[5] = 0, t[6] = 0, t[7] = 0, t[8] = 1, t }, t.getAnchorAlignment = Ec, t.getAnchorJustification = up, t.getBounds = function (t) { let e = 1 / 0, r = 1 / 0, n = -1 / 0, s = -1 / 0; for (const i of t) e = Math.min(e, i.x), r = Math.min(r, i.y), n = Math.max(n, i.x), s = Math.max(s, i.y); return { min: new i(e, r), max: new i(n, s) } }, t.getCRS = function () { return Yh.crs }, t.getCRSCode = Qh, t.getImage = ms, t.getJSON = function (t, e) { return ls(_(t, { type: "json" }), e) }, t.getMapSessionAPI = Hn, t.getPerformanceMeasurement = jp, t.getReferrer = os, t.getVideo = function (t, e) { const i = n.document.createElement("video"); i.muted = !0, i.onloadstart = function () { e(null, i); }; for (let e = 0; e < t.length; e++) { const r = n.document.createElement("source"); ps(t[e]) || (i.crossOrigin = "Anonymous"), r.src = t[e], i.appendChild(r); } return { cancel: () => { } } }, t.identity = Uo, t.invert = $o, t.isMapAuthenticated = function (t) { return Wn.has(t) }, t.isMapboxURL = Fn, t.length = Jo, t.loadVectorTile = Tm, t.makeRequest = ls, t.mercatorXfromLng = Ch, t.mercatorYfromLat = Ih, t.mercatorZfromAltitude = Ph, t.mul = Ho, t.mul$1 = pl, t.multiply = Zo, t.mvt = au, t.nextPowerOfTwo = k, t.normalize = sl, t.number = Ae, t.ortho = function (t, e, i, r, n, s, a) { var o = 1 / (e - i), l = 1 / (r - n), h = 1 / (s - a); return t[0] = -2 * o, t[1] = 0, t[2] = 0, t[3] = 0, t[4] = 0, t[5] = -2 * l, t[6] = 0, t[7] = 0, t[8] = 0, t[9] = 0, t[10] = 2 * h, t[11] = 0, t[12] = (e + i) * o, t[13] = (n + r) * l, t[14] = (a + s) * h, t[15] = 1, t }, t.pbf = ju, t.pick = function (t, e) { const i = {}; for (let r = 0; r < e.length; r++) { const n = e[r]; n in t && (i[n] = t[n]); } return i }, t.plugin = Ts, t.pointGeometry = i, t.polygonIntersectsBox = To, t.polygonIntersectsPolygon = _o, t.polygonizeBounds = function (t, e, r = 0, n = !0) { const s = new i(r, r), a = t.sub(s), o = e.add(s), l = [a, new i(o.x, a.y), o, new i(a.x, o.y)]; return n && l.push(a), l }, t.posAttributes = Hp, t.postMapLoadEvent = Xn, t.postTurnstileEvent = jn, t.potpack = fc, t.prevPowerOfTwo = function (t) { return t <= 1 ? 1 : Math.pow(2, Math.floor(Math.log(t) / Math.LN2)) }, t.refProperties = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"], t.registerForPluginStateChange = function (t) { return t({ pluginStatus: ks, pluginURL: As }), Is.on("pluginStateChange", t), t }, t.removeAuthState = function (t) { Wn.delete(t); }, t.renderColorRamp = Dl, t.rotateX = jo, t.rotateY = function (t, e, i) { var r = Math.sin(i), n = Math.cos(i), s = e[0], a = e[1], o = e[2], l = e[3], h = e[8], u = e[9], c = e[10], p = e[11]; return e !== t && (t[4] = e[4], t[5] = e[5], t[6] = e[6], t[7] = e[7], t[12] = e[12], t[13] = e[13], t[14] = e[14], t[15] = e[15]), t[0] = s * n - h * r, t[1] = a * n - u * r, t[2] = o * n - c * r, t[3] = l * n - p * r, t[8] = s * r + h * n, t[9] = a * r + u * n, t[10] = o * r + c * n, t[11] = l * r + p * n, t }, t.rotateZ = Go, t.scale = No, t.scale$1 = fl, t.scale$2 = rl, t.scaleAndAdd = nl, t.setCacheLimits = function (t, e) { ts = t, es = e; }, t.smoothstep = function (t, e, i) { return (i = y((i - t) / (e - t), 0, 1)) * i * (3 - 2 * i) }, t.spec = X, t.storeAuthState = function (t, e) { e ? Wn.add(t) : Wn.delete(t); }, t.sub = cl, t.subtract = el, t.symbolSize = Uu, t.transformMat3 = function (t, e, i) { var r = e[0], n = e[1], s = e[2]; return t[0] = r * i[0] + n * i[3] + s * i[6], t[1] = r * i[1] + n * i[4] + s * i[7], t[2] = r * i[2] + n * i[5] + s * i[8], t }, t.transformMat4 = ll, t.transformMat4$1 = yl, t.translate = qo, t.triggerPluginCompletionEvent = Ss, t.uniqueId = b, t.updateProjectionContext = function (t) { t && t.hasOwnProperty("crs") && zh(t.crs) && (Yh.crs = t.crs); }, t.updateTransform = Jh, t.uuid = w, t.validateCRS = zh, t.validateCustomStyleLayer = function (t) { const e = [], i = t.id; return void 0 === i && e.push({ message: `layers.${i}: missing required property "id"` }), void 0 === t.render && e.push({ message: `layers.${i}: missing required method "render"` }), t.renderingMode && "2d" !== t.renderingMode && "3d" !== t.renderingMode && e.push({ message: `layers.${i}: property "renderingMode" must be either "2d" or "3d"` }), e }, t.validateFog = Tr, t.validateLight = Mr, t.validateStyle = Ir, t.values = x, t.version = e, t.warnOnce = C, t.window = n, t.wrap = m;
|
|
40
|
+
}));
|
|
41
|
+
|
|
42
|
+
define(["./shared"], (function (e) { "use strict"; function t(e) { const r = typeof e; if ("number" === r || "boolean" === r || "string" === r || null == e) return JSON.stringify(e); if (Array.isArray(e)) { let r = "["; for (const n of e) r += `${t(n)},`; return `${r}]` } const n = Object.keys(e).sort(); let o = "{"; for (let r = 0; r < n.length; r++)o += `${JSON.stringify(n[r])}:${t(e[n[r]])},`; return `${o}}` } function r(r) { let n = ""; for (const o of e.refProperties) n += `/${t(r[o])}`; return n } class n { constructor(e) { this.keyCache = {}, e && this.replace(e); } replace(e) { this._layerConfigs = {}, this._layers = {}, this.update(e, []); } update(t, n) { for (const r of t) { this._layerConfigs[r.id] = r; const t = this._layers[r.id] = e.createStyleLayer(r); t._featureFilter = e.createFilter(t.filter), this.keyCache[r.id] && delete this.keyCache[r.id]; } for (const e of n) delete this.keyCache[e], delete this._layerConfigs[e], delete this._layers[e]; this.familiesBySource = {}; const o = function (e, t) { const n = {}; for (let o = 0; o < e.length; o++) { const i = t && t[e[o].id] || r(e[o]); t && (t[e[o].id] = i); let s = n[i]; s || (s = n[i] = []), s.push(e[o]); } const o = []; for (const e in n) o.push(n[e]); return o }(e.values(this._layerConfigs), this.keyCache); for (const e of o) { const t = e.map((e => this._layers[e.id])), r = t[0]; if ("none" === r.visibility) continue; const n = r.source || ""; let o = this.familiesBySource[n]; o || (o = this.familiesBySource[n] = {}); const i = r.sourceLayer || "_geojsonTileLayer"; let s = o[i]; s || (s = o[i] = []), s.push(t); } } } const { ImageBitmap: o } = e.window; class i { loadTile(t, r) { const { uid: n, encoding: i, rawImageData: s, padding: a, buildQuadTree: l } = t, u = o && s instanceof o ? this.getImageData(s, a) : s; r(null, new e.DEMData(n, u, i, a < 1, l)); } getImageData(t, r) { this.offscreenCanvas && this.offscreenCanvasContext || (this.offscreenCanvas = new OffscreenCanvas(t.width, t.height), this.offscreenCanvasContext = this.offscreenCanvas.getContext("2d")), this.offscreenCanvas.width = t.width, this.offscreenCanvas.height = t.height, this.offscreenCanvasContext.drawImage(t, 0, 0, t.width, t.height); const n = this.offscreenCanvasContext.getImageData(-r, -r, t.width + 2 * r, t.height + 2 * r); return this.offscreenCanvasContext.clearRect(0, 0, this.offscreenCanvas.width, this.offscreenCanvas.height), new e.RGBAImage({ width: n.width, height: n.height }, n.data) } } var s = function e(t, r) { var n, o = t && t.type; if ("FeatureCollection" === o) for (n = 0; n < t.features.length; n++)e(t.features[n], r); else if ("GeometryCollection" === o) for (n = 0; n < t.geometries.length; n++)e(t.geometries[n], r); else if ("Feature" === o) e(t.geometry, r); else if ("Polygon" === o) a(t.coordinates, r); else if ("MultiPolygon" === o) for (n = 0; n < t.coordinates.length; n++)a(t.coordinates[n], r); return t }; function a(e, t) { if (0 !== e.length) { l(e[0], t); for (var r = 1; r < e.length; r++)l(e[r], !t); } } function l(e, t) { for (var r = 0, n = 0, o = 0, i = e.length, s = i - 1; o < i; s = o++) { var a = (e[o][0] - e[s][0]) * (e[s][1] + e[o][1]), l = r + a; n += Math.abs(r) >= Math.abs(a) ? r - l + a : a - l + r, r = l; } r + n >= 0 != !!t && e.reverse(); } const u = e.mvt.VectorTileFeature.prototype.toGeoJSON; class h { constructor(t) { this._feature = t, this.extent = e.EXTENT, this.type = t.type, this.properties = t.tags, "id" in t && !isNaN(t.id) && (this.id = parseInt(t.id, 10)); } loadGeometry() { if (1 === this._feature.type) { const t = []; for (const r of this._feature.geometry) t.push([new e.pointGeometry(r[0], r[1])]); return t } { const t = []; for (const r of this._feature.geometry) { const n = []; for (const t of r) n.push(new e.pointGeometry(t[0], t[1])); t.push(n); } return t } } toGeoJSON(e, t, r) { return u.call(this, e, t, r) } } class c { constructor(t) { this.layers = { _geojsonTileLayer: this }, this.name = "_geojsonTileLayer", this.extent = e.EXTENT, this.length = t.length, this._features = t; } feature(e) { return new h(this._features[e]) } } var f = p; function p(e, t, r, n, o) { this.properties = {}, this.extent = r, this.type = 0, this._pbf = e, this._geometry = -1, this._keys = n, this._values = o, e.readFields(d, this, t); } function d(e, t, r) { 1 == e ? t.id = r.readVarint() : 2 == e ? function (e, t) { for (var r = e.readVarint() + e.pos; e.pos < r;) { var n = t._keys[e.readVarint()], o = t._values[e.readVarint()]; t.properties[n] = o; } }(r, t) : 3 == e ? t.type = r.readVarint() : 4 == e && (t._geometry = r.pos); } function g(e) { for (var t, r, n = 0, o = 0, i = e.length, s = i - 1; o < i; s = o++)n += ((r = e[s]).x - (t = e[o]).x) * (t.y + r.y); return n } p.types = ["Unknown", "Point", "LineString", "Polygon"], p.prototype.loadGeometry = function () { var t = this._pbf; t.pos = this._geometry; for (var r, n = t.readVarint() + t.pos, o = 1, i = 0, s = 0, a = 0, l = []; t.pos < n;) { if (i <= 0) { var u = t.readVarint(); o = 7 & u, i = u >> 3; } if (i--, 1 === o || 2 === o) s += t.readSVarint(), a += t.readSVarint(), 1 === o && (r && l.push(r), r = []), r.push(new e.pointGeometry(s, a)); else { if (7 !== o) throw new Error("unknown command " + o); r && r.push(r[0].clone()); } } return r && l.push(r), l }, p.prototype.bbox = function () { var e = this._pbf; e.pos = this._geometry; for (var t = e.readVarint() + e.pos, r = 1, n = 0, o = 0, i = 0, s = 1 / 0, a = -1 / 0, l = 1 / 0, u = -1 / 0; e.pos < t;) { if (n <= 0) { var h = e.readVarint(); r = 7 & h, n = h >> 3; } if (n--, 1 === r || 2 === r) (o += e.readSVarint()) < s && (s = o), o > a && (a = o), (i += e.readSVarint()) < l && (l = i), i > u && (u = i); else if (7 !== r) throw new Error("unknown command " + r) } return [s, l, a, u] }, p.prototype.toGeoJSON = function (e, t, r) { var n, o, i = this.extent * Math.pow(2, r), s = this.extent * e, a = this.extent * t, l = this.loadGeometry(), u = p.types[this.type]; function h(e) { for (var t = 0; t < e.length; t++) { var r = e[t]; e[t] = [360 * (r.x + s) / i - 180, 360 / Math.PI * Math.atan(Math.exp((180 - 360 * (r.y + a) / i) * Math.PI / 180)) - 90]; } } switch (this.type) { case 1: var c = []; for (n = 0; n < l.length; n++)c[n] = l[n][0]; h(l = c); break; case 2: for (n = 0; n < l.length; n++)h(l[n]); break; case 3: for (l = function (e) { var t = e.length; if (t <= 1) return [e]; for (var r, n, o = [], i = 0; i < t; i++) { var s = g(e[i]); 0 !== s && (void 0 === n && (n = s < 0), n === s < 0 ? (r && o.push(r), r = [e[i]]) : r.push(e[i])); } return r && o.push(r), o }(l), n = 0; n < l.length; n++)for (o = 0; o < l[n].length; o++)h(l[n][o]); }1 === l.length ? l = l[0] : u = "Multi" + u; var f = { type: "Feature", geometry: { type: u, coordinates: l }, properties: this.properties }; return "id" in this && (f.id = this.id), f }; var m = y; function y(e, t) { this.version = 1, this.name = null, this.extent = 4096, this.length = 0, this._pbf = e, this._keys = [], this._values = [], this._features = [], e.readFields(v, this, t), this.length = this._features.length; } function v(e, t, r) { 15 === e ? t.version = r.readVarint() : 1 === e ? t.name = r.readString() : 5 === e ? t.extent = r.readVarint() : 2 === e ? t._features.push(r.pos) : 3 === e ? t._keys.push(r.readString()) : 4 === e && t._values.push(function (e) { for (var t = null, r = e.readVarint() + e.pos; e.pos < r;) { var n = e.readVarint() >> 3; t = 1 === n ? e.readString() : 2 === n ? e.readFloat() : 3 === n ? e.readDouble() : 4 === n ? e.readVarint64() : 5 === n ? e.readVarint() : 6 === n ? e.readSVarint() : 7 === n ? e.readBoolean() : null; } return t }(r)); } function S(e, t, r) { if (3 === e) { var n = new m(r, r.readVarint() + r.pos); n.length && (t[n.name] = n); } } y.prototype.feature = function (e) { if (e < 0 || e >= this._features.length) throw new Error("feature index out of bounds"); this._pbf.pos = this._features[e]; var t = this._pbf.readVarint() + this._pbf.pos; return new f(this._pbf, t, this.extent, this._keys, this._values) }; var x = { VectorTile: function (e, t) { this.layers = e.readFields(S, {}, t); }, VectorTileFeature: f, VectorTileLayer: m }.VectorTileFeature, w = M; function M(e, t) { this.options = t || {}, this.features = e, this.length = e.length; } function P(e, t) { this.id = "number" == typeof e.id ? e.id : void 0, this.type = e.type, this.rawGeometry = 1 === e.type ? [e.geometry] : e.geometry, this.properties = e.tags, this.extent = t || 4096; } M.prototype.feature = function (e) { return new P(this.features[e], this.options.extent) }, P.prototype.loadGeometry = function () { var t = this.rawGeometry; this.geometry = []; for (var r = 0; r < t.length; r++) { for (var n = t[r], o = [], i = 0; i < n.length; i++)o.push(new e.pointGeometry(n[i][0], n[i][1])); this.geometry.push(o); } return this.geometry }, P.prototype.bbox = function () { this.geometry || this.loadGeometry(); for (var e = this.geometry, t = 1 / 0, r = -1 / 0, n = 1 / 0, o = -1 / 0, i = 0; i < e.length; i++)for (var s = e[i], a = 0; a < s.length; a++) { var l = s[a]; t = Math.min(t, l.x), r = Math.max(r, l.x), n = Math.min(n, l.y), o = Math.max(o, l.y); } return [t, n, r, o] }, P.prototype.toGeoJSON = x.prototype.toGeoJSON; var _ = C, b = w; function C(t) { var r = new e.pbf; return function (e, t) { for (var r in e.layers) t.writeMessage(3, k, e.layers[r]); }(t, r), r.finish() } function k(e, t) { var r; t.writeVarintField(15, e.version || 1), t.writeStringField(1, e.name || ""), t.writeVarintField(5, e.extent || 4096); var n = { keys: [], values: [], keycache: {}, valuecache: {} }; for (r = 0; r < e.length; r++)n.feature = e.feature(r), t.writeMessage(2, T, n); var o = n.keys; for (r = 0; r < o.length; r++)t.writeStringField(3, o[r]); var i = n.values; for (r = 0; r < i.length; r++)t.writeMessage(4, V, i[r]); } function T(e, t) { var r = e.feature; void 0 !== r.id && t.writeVarintField(1, r.id), t.writeMessage(2, I, e), t.writeVarintField(3, r.type), t.writeMessage(4, O, r); } function I(e, t) { var r = e.feature, n = e.keys, o = e.values, i = e.keycache, s = e.valuecache; for (var a in r.properties) { var l = r.properties[a], u = i[a]; if (null !== l) { void 0 === u && (n.push(a), i[a] = u = n.length - 1), t.writeVarint(u); var h = typeof l; "string" !== h && "boolean" !== h && "number" !== h && (l = JSON.stringify(l)); var c = h + ":" + l, f = s[c]; void 0 === f && (o.push(l), s[c] = f = o.length - 1), t.writeVarint(f); } } } function E(e, t) { return (t << 3) + (7 & e) } function L(e) { return e << 1 ^ e >> 31 } function O(e, t) { for (var r = e.loadGeometry(), n = e.type, o = 0, i = 0, s = r.length, a = 0; a < s; a++) { var l = r[a], u = 1; 1 === n && (u = l.length), t.writeVarint(E(1, u)); for (var h = 3 === n ? l.length - 1 : l.length, c = 0; c < h; c++) { 1 === c && 1 !== n && t.writeVarint(E(2, h - 1)); var f = l[c].x - o, p = l[c].y - i; t.writeVarint(L(f)), t.writeVarint(L(p)), o += f, i += p; } 3 === n && t.writeVarint(E(7, 1)); } } function V(e, t) { var r = typeof e; "string" === r ? t.writeStringField(1, e) : "boolean" === r ? t.writeBooleanField(7, e) : "number" === r && (e % 1 != 0 ? t.writeDoubleField(3, e) : e < 0 ? t.writeSVarintField(6, e) : t.writeVarintField(5, e)); } function G(e, t, r, n, o, i) { if (o - n <= r) return; const s = n + o >> 1; F(e, t, s, n, o, i % 2), G(e, t, r, n, s - 1, i + 1), G(e, t, r, s + 1, o, i + 1); } function F(e, t, r, n, o, i) { for (; o > n;) { if (o - n > 600) { const s = o - n + 1, a = r - n + 1, l = Math.log(s), u = .5 * Math.exp(2 * l / 3), h = .5 * Math.sqrt(l * u * (s - u) / s) * (a - s / 2 < 0 ? -1 : 1); F(e, t, r, Math.max(n, Math.floor(r - a * u / s + h)), Math.min(o, Math.floor(r + (s - a) * u / s + h)), i); } const s = t[2 * r + i]; let a = n, l = o; for (z(e, t, n, r), t[2 * o + i] > s && z(e, t, n, o); a < l;) { for (z(e, t, a, l), a++, l--; t[2 * a + i] < s;)a++; for (; t[2 * l + i] > s;)l--; } t[2 * n + i] === s ? z(e, t, n, l) : (l++, z(e, t, l, o)), l <= r && (n = l + 1), r <= l && (o = l - 1); } } function z(e, t, r, n) { N(e, r, n), N(t, 2 * r, 2 * n), N(t, 2 * r + 1, 2 * n + 1); } function N(e, t, r) { const n = e[t]; e[t] = e[r], e[r] = n; } function D(e, t, r, n) { const o = e - r, i = t - n; return o * o + i * i } _.fromVectorTileJs = C, _.fromGeojsonVt = function (e, t) { t = t || {}; var r = {}; for (var n in e) r[n] = new w(e[n].features, t), r[n].name = n, r[n].version = t.version, r[n].extent = t.extent; return C({ layers: r }) }, _.GeoJSONWrapper = b; const J = e => e[0], Z = e => e[1]; class R { constructor(e, t = J, r = Z, n = 64, o = Float64Array) { this.nodeSize = n, this.points = e; const i = e.length < 65536 ? Uint16Array : Uint32Array, s = this.ids = new i(e.length), a = this.coords = new o(2 * e.length); for (let n = 0; n < e.length; n++)s[n] = n, a[2 * n] = t(e[n]), a[2 * n + 1] = r(e[n]); G(s, a, n, 0, s.length - 1, 0); } range(e, t, r, n) { return function (e, t, r, n, o, i, s) { const a = [0, e.length - 1, 0], l = []; let u, h; for (; a.length;) { const c = a.pop(), f = a.pop(), p = a.pop(); if (f - p <= s) { for (let s = p; s <= f; s++)u = t[2 * s], h = t[2 * s + 1], u >= r && u <= o && h >= n && h <= i && l.push(e[s]); continue } const d = Math.floor((p + f) / 2); u = t[2 * d], h = t[2 * d + 1], u >= r && u <= o && h >= n && h <= i && l.push(e[d]); const g = (c + 1) % 2; (0 === c ? r <= u : n <= h) && (a.push(p), a.push(d - 1), a.push(g)), (0 === c ? o >= u : i >= h) && (a.push(d + 1), a.push(f), a.push(g)); } return l }(this.ids, this.coords, e, t, r, n, this.nodeSize) } within(e, t, r) { return function (e, t, r, n, o, i) { const s = [0, e.length - 1, 0], a = [], l = o * o; for (; s.length;) { const u = s.pop(), h = s.pop(), c = s.pop(); if (h - c <= i) { for (let o = c; o <= h; o++)D(t[2 * o], t[2 * o + 1], r, n) <= l && a.push(e[o]); continue } const f = Math.floor((c + h) / 2), p = t[2 * f], d = t[2 * f + 1]; D(p, d, r, n) <= l && a.push(e[f]); const g = (u + 1) % 2; (0 === u ? r - o <= p : n - o <= d) && (s.push(c), s.push(f - 1), s.push(g)), (0 === u ? r + o >= p : n + o >= d) && (s.push(f + 1), s.push(h), s.push(g)); } return a }(this.ids, this.coords, e, t, r, this.nodeSize) } } const Y = { minZoom: 0, maxZoom: 16, minPoints: 2, radius: 40, extent: 512, nodeSize: 64, log: !1, generateId: !1, reduce: null, map: e => e }, W = Math.fround || (X = new Float32Array(1), e => (X[0] = +e, X[0])); var X; let j = 3857; class A { constructor(e) { this.options = ee(Object.create(Y), e), this.trees = new Array(this.options.maxZoom + 1), j = e.mapCRS; } load(e) { const { log: t, minZoom: r, maxZoom: n, nodeSize: o } = this.options; t && console.time("total time"); const i = `prepare ${e.length} points`; t && console.time(i), this.points = e; let s = []; for (let t = 0; t < e.length; t++)e[t].geometry && s.push(B(e[t], t)); this.trees[n + 1] = new R(s, te, re, o, Float32Array), t && console.timeEnd(i); for (let e = n; e >= r; e--) { const r = +Date.now(); s = this._cluster(s, e), this.trees[e] = new R(s, te, re, o, Float32Array), t && console.log("z%d: %d clusters in %dms", e, s.length, +Date.now() - r); } return t && console.timeEnd("total time"), this } getClusters(e, t) { let r = ((e[0] + 180) % 360 + 360) % 360 - 180; const n = Math.max(-90, Math.min(90, e[1])); let o = 180 === e[2] ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180; const i = Math.max(-90, Math.min(90, e[3])); if (e[2] - e[0] >= 360) r = -180, o = 180; else if (r > o) { const e = this.getClusters([r, n, 180, i], t), s = this.getClusters([-180, n, o, i], t); return e.concat(s) } const s = this.trees[this._limitZoom(t)], a = s.range(Q(r), H(i), Q(o), H(n)), l = []; for (const e of a) { const t = s.points[e]; l.push(t.numPoints ? q(t) : this.points[t.index]); } return l } getChildren(e) { const t = this._getOriginId(e), r = this._getOriginZoom(e), n = "No cluster with the specified id.", o = this.trees[r]; if (!o) throw new Error(n); const i = o.points[t]; if (!i) throw new Error(n); const s = this.options.radius / (this.options.extent * Math.pow(2, r - 1)), a = o.within(i.x, i.y, s), l = []; for (const t of a) { const r = o.points[t]; r.parentId === e && l.push(r.numPoints ? q(r) : this.points[r.index]); } if (0 === l.length) throw new Error(n); return l } getLeaves(e, t, r) { const n = []; return this._appendLeaves(n, e, t = t || 10, r = r || 0, 0), n } getTile(e, t, r) { const n = this.trees[this._limitZoom(e)], o = Math.pow(2, e), { extent: i, radius: s } = this.options, a = s / i, l = (r - a) / o, u = (r + 1 + a) / o, h = { features: [] }; return this._addTileFeatures(n.range((t - a) / o, l, (t + 1 + a) / o, u), n.points, t, r, o, h), 0 === t && this._addTileFeatures(n.range(1 - a / o, l, 1, u), n.points, o, r, o, h), t === o - 1 && this._addTileFeatures(n.range(0, l, a / o, u), n.points, -1, r, o, h), h.features.length ? h : null } getClusterExpansionZoom(e) { let t = this._getOriginZoom(e) - 1; for (; t <= this.options.maxZoom;) { const r = this.getChildren(e); if (t++, 1 !== r.length) break; e = r[0].properties.cluster_id; } return t } _appendLeaves(e, t, r, n, o) { const i = this.getChildren(t); for (const t of i) { const i = t.properties; if (i && i.cluster ? o + i.point_count <= n ? o += i.point_count : o = this._appendLeaves(e, i.cluster_id, r, n, o) : o < n ? o++ : e.push(t), e.length === r) break } return o } _addTileFeatures(e, t, r, n, o, i) { for (const s of e) { const e = t[s], a = e.numPoints; let l, u, h; if (a) l = U(e), u = e.x, h = e.y; else { const t = this.points[e.index]; l = t.properties, u = Q(t.geometry.coordinates[0]), h = H(t.geometry.coordinates[1]); } const c = { type: 1, geometry: [[Math.round(this.options.extent * (u * o - r)), Math.round(this.options.extent * (h * o - n))]], tags: l }; let f; a ? f = e.id : this.options.generateId ? f = e.index : this.points[e.index].id && (f = this.points[e.index].id), void 0 !== f && (c.id = f), i.features.push(c); } } _limitZoom(e) { return Math.max(this.options.minZoom, Math.min(+e, this.options.maxZoom + 1)) } _cluster(e, t) { const r = [], { radius: n, extent: o, reduce: i, minPoints: s } = this.options, a = n / (o * Math.pow(2, t)); for (let n = 0; n < e.length; n++) { const o = e[n]; if (o.zoom <= t) continue; o.zoom = t; const l = this.trees[t + 1], u = l.within(o.x, o.y, a), h = o.numPoints || 1; let c = h; for (const e of u) { const r = l.points[e]; r.zoom > t && (c += r.numPoints || 1); } if (c >= s) { let e = o.x * h, s = o.y * h, a = i && h > 1 ? this._map(o, !0) : null; const f = (n << 5) + (t + 1) + this.points.length; for (const r of u) { const n = l.points[r]; if (n.zoom <= t) continue; n.zoom = t; const u = n.numPoints || 1; e += n.x * u, s += n.y * u, n.parentId = f, i && (a || (a = this._map(o, !0)), i(a, this._map(n))); } o.parentId = f, r.push($(e / c, s / c, f, c, a)); } else if (r.push(o), c > 1) for (const e of u) { const n = l.points[e]; n.zoom <= t || (n.zoom = t, r.push(n)); } } return r } _getOriginId(e) { return e - this.points.length >> 5 } _getOriginZoom(e) { return (e - this.points.length) % 32 } _map(e, t) { if (e.numPoints) return t ? ee({}, e.properties) : e.properties; const r = this.points[e.index].properties, n = this.options.map(r); return t && n === r ? ee({}, n) : n } } function $(e, t, r, n, o) { return { x: W(e), y: W(t), zoom: 1 / 0, id: r, parentId: -1, numPoints: n, properties: o } } function B(e, t) { const [r, n] = e.geometry.coordinates; return { x: W(Q(r)), y: W(H(n)), zoom: 1 / 0, index: t, parentId: -1 } } function q(e) { return { type: "Feature", id: e.id, properties: U(e), geometry: { type: "Point", coordinates: [(t = e.x, 360 * (t - .5)), K(e.y)] } }; var t; } function U(e) { const t = e.numPoints, r = t >= 1e4 ? `${Math.round(t / 1e3)}k` : t >= 1e3 ? Math.round(t / 100) / 10 + "k" : t; return ee(ee({}, e.properties), { cluster: !0, cluster_id: e.id, point_count: t, point_count_abbreviated: r }) } function Q(e) { return e / 360 + .5 } function H(t) { switch (j) { case e.CRS.EPSG4326.CODE: case e.CRS.EPSG4490.CODE: { const e = .25 - t / 360; return e < 0 ? 0 : e > .5 ? .5 : e } case e.CRS.EPSG3857.CODE: case e.CRS.EPSG900913.CODE: { const e = Math.sin(t * Math.PI / 180), r = .5 - .25 * Math.log((1 + e) / (1 - e)) / Math.PI; return r < 0 ? 0 : r > 1 ? 1 : r } } } function K(t) { switch (j) { case e.CRS.EPSG4326.CODE: case e.CRS.EPSG4490.CODE: return 90 - 360 * t; case e.CRS.EPSG3857.CODE: case e.CRS.EPSG900913.CODE: { const e = (180 - 360 * t) * Math.PI / 180; return 360 * Math.atan(Math.exp(e)) / Math.PI - 90 } } } function ee(e, t) { for (const r in t) e[r] = t[r]; return e } function te(e) { return e.x } function re(e) { return e.y } function ne(e, t, r, n) { for (var o, i = n, s = r - t >> 1, a = r - t, l = e[t], u = e[t + 1], h = e[r], c = e[r + 1], f = t + 3; f < r; f += 3) { var p = oe(e[f], e[f + 1], l, u, h, c); if (p > i) o = f, i = p; else if (p === i) { var d = Math.abs(f - s); d < a && (o = f, a = d); } } i > n && (o - t > 3 && ne(e, t, o, n), e[o + 2] = i, r - o > 3 && ne(e, o, r, n)); } function oe(e, t, r, n, o, i) { var s = o - r, a = i - n; if (0 !== s || 0 !== a) { var l = ((e - r) * s + (t - n) * a) / (s * s + a * a); l > 1 ? (r = o, n = i) : l > 0 && (r += s * l, n += a * l); } return (s = e - r) * s + (a = t - n) * a } function ie(e, t, r, n) { var o = { id: void 0 === e ? null : e, type: t, geometry: r, tags: n, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 }; return function (e) { var t = e.geometry, r = e.type; if ("Point" === r || "MultiPoint" === r || "LineString" === r) se(e, t); else if ("Polygon" === r || "MultiLineString" === r) for (var n = 0; n < t.length; n++)se(e, t[n]); else if ("MultiPolygon" === r) for (n = 0; n < t.length; n++)for (var o = 0; o < t[n].length; o++)se(e, t[n][o]); }(o), o } function se(e, t) { for (var r = 0; r < t.length; r += 3)e.minX = Math.min(e.minX, t[r]), e.minY = Math.min(e.minY, t[r + 1]), e.maxX = Math.max(e.maxX, t[r]), e.maxY = Math.max(e.maxY, t[r + 1]); } let ae = 3857; function le(e, t, r, n) { if (t.geometry) { var o = t.geometry.coordinates, i = t.geometry.type, s = Math.pow(r.tolerance / ((1 << r.maxZoom) * r.extent), 2), a = [], l = t.id; if (r.promoteId ? l = t.properties[r.promoteId] : r.generateId && (l = n || 0), "Point" === i) ue(o, a); else if ("MultiPoint" === i) for (var u = 0; u < o.length; u++)ue(o[u], a); else if ("LineString" === i) he(o, a, s, !1); else if ("MultiLineString" === i) { if (r.lineMetrics) { for (u = 0; u < o.length; u++)he(o[u], a = [], s, !1), e.push(ie(l, "LineString", a, t.properties)); return } ce(o, a, s, !1); } else if ("Polygon" === i) ce(o, a, s, !0); else { if ("MultiPolygon" !== i) { if ("GeometryCollection" === i) { for (u = 0; u < t.geometry.geometries.length; u++)le(e, { id: l, geometry: t.geometry.geometries[u], properties: t.properties }, r, n); return } throw new Error("Input data is not a valid GeoJSON object.") } for (u = 0; u < o.length; u++) { var h = []; ce(o[u], h, s, !0), a.push(h); } } e.push(ie(l, i, a, t.properties)); } } function ue(e, t) { t.push(fe(e[0])), t.push(pe(e[1])), t.push(0); } function he(e, t, r, n) { for (var o, i, s = 0, a = 0; a < e.length; a++) { var l = fe(e[a][0]), u = pe(e[a][1]); t.push(l), t.push(u), t.push(0), a > 0 && (s += n ? (o * u - l * i) / 2 : Math.sqrt(Math.pow(l - o, 2) + Math.pow(u - i, 2))), o = l, i = u; } var h = t.length - 3; t[2] = 1, ne(t, 0, h, r), t[h + 2] = 1, t.size = Math.abs(s), t.start = 0, t.end = t.size; } function ce(e, t, r, n) { for (var o = 0; o < e.length; o++) { var i = []; he(e[o], i, r, n), t.push(i); } } function fe(e) { return e / 360 + .5 } function pe(t) { switch (ae) { case e.CRS.EPSG4326.CODE: case e.CRS.EPSG4490.CODE: return (r = .25 - t / 360) < 0 ? 0 : r > .5 ? .5 : r; case e.CRS.EPSG3857.CODE: case e.CRS.EPSG900913.CODE: var r, n = Math.sin(t * Math.PI / 180); return (r = .5 - .25 * Math.log((1 + n) / (1 - n)) / Math.PI) < 0 ? 0 : r > 1 ? 1 : r } } function de(e, t, r, n, o, i, s, a) { if (n /= t, i >= (r /= t) && s < n) return e; if (s < r || i >= n) return null; for (var l = [], u = 0; u < e.length; u++) { var h = e[u], c = h.geometry, f = h.type, p = 0 === o ? h.minX : h.minY, d = 0 === o ? h.maxX : h.maxY; if (p >= r && d < n) l.push(h); else if (!(d < r || p >= n)) { var g = []; if ("Point" === f || "MultiPoint" === f) ge(c, g, r, n, o); else if ("LineString" === f) me(c, g, r, n, o, !1, a.lineMetrics); else if ("MultiLineString" === f) ve(c, g, r, n, o, !1); else if ("Polygon" === f) ve(c, g, r, n, o, !0); else if ("MultiPolygon" === f) for (var m = 0; m < c.length; m++) { var y = []; ve(c[m], y, r, n, o, !0), y.length && g.push(y); } if (g.length) { if (a.lineMetrics && "LineString" === f) { for (m = 0; m < g.length; m++)l.push(ie(h.id, f, g[m], h.tags)); continue } "LineString" !== f && "MultiLineString" !== f || (1 === g.length ? (f = "LineString", g = g[0]) : f = "MultiLineString"), "Point" !== f && "MultiPoint" !== f || (f = 3 === g.length ? "Point" : "MultiPoint"), l.push(ie(h.id, f, g, h.tags)); } } } return l.length ? l : null } function ge(e, t, r, n, o) { for (var i = 0; i < e.length; i += 3) { var s = e[i + o]; s >= r && s <= n && (t.push(e[i]), t.push(e[i + 1]), t.push(e[i + 2])); } } function me(e, t, r, n, o, i, s) { for (var a, l, u = ye(e), h = 0 === o ? xe : we, c = e.start, f = 0; f < e.length - 3; f += 3) { var p = e[f], d = e[f + 1], g = e[f + 2], m = e[f + 3], y = e[f + 4], v = 0 === o ? p : d, S = 0 === o ? m : y, x = !1; s && (a = Math.sqrt(Math.pow(p - m, 2) + Math.pow(d - y, 2))), v < r ? S > r && (l = h(u, p, d, m, y, r), s && (u.start = c + a * l)) : v > n ? S < n && (l = h(u, p, d, m, y, n), s && (u.start = c + a * l)) : Se(u, p, d, g), S < r && v >= r && (l = h(u, p, d, m, y, r), x = !0), S > n && v <= n && (l = h(u, p, d, m, y, n), x = !0), !i && x && (s && (u.end = c + a * l), t.push(u), u = ye(e)), s && (c += a); } var w = e.length - 3; p = e[w], d = e[w + 1], g = e[w + 2], (v = 0 === o ? p : d) >= r && v <= n && Se(u, p, d, g), w = u.length - 3, i && w >= 3 && (u[w] !== u[0] || u[w + 1] !== u[1]) && Se(u, u[0], u[1], u[2]), u.length && t.push(u); } function ye(e) { var t = []; return t.size = e.size, t.start = e.start, t.end = e.end, t } function ve(e, t, r, n, o, i) { for (var s = 0; s < e.length; s++)me(e[s], t, r, n, o, i, !1); } function Se(e, t, r, n) { e.push(t), e.push(r), e.push(n); } function xe(e, t, r, n, o, i) { var s = (i - t) / (n - t); return e.push(i), e.push(r + (o - r) * s), e.push(1), s } function we(e, t, r, n, o, i) { var s = (i - r) / (o - r); return e.push(t + (n - t) * s), e.push(i), e.push(1), s } function Me(e, t) { for (var r = [], n = 0; n < e.length; n++) { var o, i = e[n], s = i.type; if ("Point" === s || "MultiPoint" === s || "LineString" === s) o = Pe(i.geometry, t); else if ("MultiLineString" === s || "Polygon" === s) { o = []; for (var a = 0; a < i.geometry.length; a++)o.push(Pe(i.geometry[a], t)); } else if ("MultiPolygon" === s) for (o = [], a = 0; a < i.geometry.length; a++) { for (var l = [], u = 0; u < i.geometry[a].length; u++)l.push(Pe(i.geometry[a][u], t)); o.push(l); } r.push(ie(i.id, s, o, i.tags)); } return r } function Pe(e, t) { var r = []; r.size = e.size, void 0 !== e.start && (r.start = e.start, r.end = e.end); for (var n = 0; n < e.length; n += 3)r.push(e[n] + t, e[n + 1], e[n + 2]); return r } function _e(e, t) { if (e.transformed) return e; var r, n, o, i = 1 << e.z, s = e.x, a = e.y; for (r = 0; r < e.features.length; r++) { var l = e.features[r], u = l.geometry, h = l.type; if (l.geometry = [], 1 === h) for (n = 0; n < u.length; n += 2)l.geometry.push(be(u[n], u[n + 1], t, i, s, a)); else for (n = 0; n < u.length; n++) { var c = []; for (o = 0; o < u[n].length; o += 2)c.push(be(u[n][o], u[n][o + 1], t, i, s, a)); l.geometry.push(c); } } return e.transformed = !0, e } function be(e, t, r, n, o, i) { return [Math.round(r * (e * n - o)), Math.round(r * (t * n - i))] } function Ce(e, t, r, n, o) { for (var i = t === o.maxZoom ? 0 : o.tolerance / ((1 << t) * o.extent), s = { features: [], numPoints: 0, numSimplified: 0, numFeatures: 0, source: null, x: r, y: n, z: t, transformed: !1, minX: 2, minY: 1, maxX: -1, maxY: 0 }, a = 0; a < e.length; a++) { s.numFeatures++, ke(s, e[a], i, o); var l = e[a].minX, u = e[a].minY, h = e[a].maxX, c = e[a].maxY; l < s.minX && (s.minX = l), u < s.minY && (s.minY = u), h > s.maxX && (s.maxX = h), c > s.maxY && (s.maxY = c); } return s } function ke(e, t, r, n) { var o = t.geometry, i = t.type, s = []; if ("Point" === i || "MultiPoint" === i) for (var a = 0; a < o.length; a += 3)s.push(o[a]), s.push(o[a + 1]), e.numPoints++, e.numSimplified++; else if ("LineString" === i) Te(s, o, e, r, !1, !1); else if ("MultiLineString" === i || "Polygon" === i) for (a = 0; a < o.length; a++)Te(s, o[a], e, r, "Polygon" === i, 0 === a); else if ("MultiPolygon" === i) for (var l = 0; l < o.length; l++) { var u = o[l]; for (a = 0; a < u.length; a++)Te(s, u[a], e, r, !0, 0 === a); } if (s.length) { var h = t.tags || null; if ("LineString" === i && n.lineMetrics) { for (var c in h = {}, t.tags) h[c] = t.tags[c]; h.mapbox_clip_start = o.start / o.size, h.mapbox_clip_end = o.end / o.size; } var f = { geometry: s, type: "Polygon" === i || "MultiPolygon" === i ? 3 : "LineString" === i || "MultiLineString" === i ? 2 : 1, tags: h }; null !== t.id && (f.id = t.id), e.features.push(f); } } function Te(e, t, r, n, o, i) { var s = n * n; if (n > 0 && t.size < (o ? s : n)) r.numPoints += t.length / 3; else { for (var a = [], l = 0; l < t.length; l += 3)(0 === n || t[l + 2] > s) && (r.numSimplified++, a.push(t[l]), a.push(t[l + 1])), r.numPoints++; o && function (e, t) { for (var r = 0, n = 0, o = e.length, i = o - 2; n < o; i = n, n += 2)r += (e[n] - e[i]) * (e[n + 1] + e[i + 1]); if (r > 0 === t) for (n = 0, o = e.length; n < o / 2; n += 2) { var s = e[n], a = e[n + 1]; e[n] = e[o - 2 - n], e[n + 1] = e[o - 1 - n], e[o - 2 - n] = s, e[o - 1 - n] = a; } }(a, i), e.push(a); } } function Ie(e, t) { var r; (r = (t = this.options = function (e, t) { for (var r in t) e[r] = t[r]; return e }(Object.create(this.options), t)).mapCRS) && (ae = r); var n = t.debug; if (n && console.time("preprocess data"), t.maxZoom < 0 || t.maxZoom > 24) throw new Error("maxZoom should be in the 0-24 range"); if (t.promoteId && t.generateId) throw new Error("promoteId and generateId cannot be used together."); var o = function (e, t) { var r = []; if ("FeatureCollection" === e.type) for (var n = 0; n < e.features.length; n++)le(r, e.features[n], t, n); else le(r, "Feature" === e.type ? e : { geometry: e }, t); return r }(e, t); this.tiles = {}, this.tileCoords = [], n && (console.timeEnd("preprocess data"), console.log("index: maxZoom: %d, maxPoints: %d", t.indexMaxZoom, t.indexMaxPoints), console.time("generate tiles"), this.stats = {}, this.total = 0), o = function (e, t) { var r = t.buffer / t.extent, n = e, o = de(e, 1, -1 - r, r, 0, -1, 2, t), i = de(e, 1, 1 - r, 2 + r, 0, -1, 2, t); return (o || i) && (n = de(e, 1, -r, 1 + r, 0, -1, 2, t) || [], o && (n = Me(o, 1).concat(n)), i && (n = n.concat(Me(i, -1)))), n }(o, t), o.length && this.splitTile(o, 0, 0, 0), n && (o.length && console.log("features: %d, points: %d", this.tiles[0].numFeatures, this.tiles[0].numPoints), console.timeEnd("generate tiles"), console.log("tiles generated:", this.total, JSON.stringify(this.stats))); } function Ee(e, t, r) { return 32 * ((1 << e) * r + t) + e } function Le(e, t) { const r = e.tileID.canonical; if (!this._geoJSONIndex) return t(null, null); const n = this._geoJSONIndex.getTile(r.z, r.x, r.y); if (!n) return t(null, null); const o = new c(n.features); let i = _(o); 0 === i.byteOffset && i.byteLength === i.buffer.byteLength || (i = new Uint8Array(i)), t(null, { vectorTile: o, rawData: i.buffer }); } Ie.prototype.options = { maxZoom: 14, indexMaxZoom: 5, indexMaxPoints: 1e5, tolerance: 3, extent: 4096, buffer: 64, lineMetrics: !1, promoteId: null, generateId: !1, debug: 0 }, Ie.prototype.splitTile = function (e, t, r, n, o, i, s) { for (var a = [e, t, r, n], l = this.options, u = l.debug; a.length;) { n = a.pop(), r = a.pop(), t = a.pop(), e = a.pop(); var h = 1 << t, c = Ee(t, r, n), f = this.tiles[c]; if (!f && (u > 1 && console.time("creation"), f = this.tiles[c] = Ce(e, t, r, n, l), this.tileCoords.push({ z: t, x: r, y: n }), u)) { u > 1 && (console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)", t, r, n, f.numFeatures, f.numPoints, f.numSimplified), console.timeEnd("creation")); var p = "z" + t; this.stats[p] = (this.stats[p] || 0) + 1, this.total++; } if (f.source = e, o) { if (t === l.maxZoom || t === o) continue; var d = 1 << o - t; if (r !== Math.floor(i / d) || n !== Math.floor(s / d)) continue } else if (t === l.indexMaxZoom || f.numPoints <= l.indexMaxPoints) continue; if (f.source = null, 0 !== e.length) { u > 1 && console.time("clipping"); var g, m, y, v, S, x, w = .5 * l.buffer / l.extent, M = .5 - w, P = .5 + w, _ = 1 + w; g = m = y = v = null, S = de(e, h, r - w, r + P, 0, f.minX, f.maxX, l), x = de(e, h, r + M, r + _, 0, f.minX, f.maxX, l), e = null, S && (g = de(S, h, n - w, n + P, 1, f.minY, f.maxY, l), m = de(S, h, n + M, n + _, 1, f.minY, f.maxY, l), S = null), x && (y = de(x, h, n - w, n + P, 1, f.minY, f.maxY, l), v = de(x, h, n + M, n + _, 1, f.minY, f.maxY, l), x = null), u > 1 && console.timeEnd("clipping"), a.push(g || [], t + 1, 2 * r, 2 * n), a.push(m || [], t + 1, 2 * r, 2 * n + 1), a.push(y || [], t + 1, 2 * r + 1, 2 * n), a.push(v || [], t + 1, 2 * r + 1, 2 * n + 1); } } }, Ie.prototype.getTile = function (e, t, r) { var n = this.options, o = n.extent, i = n.debug; if (e < 0 || e > 24) return null; var s = 1 << e, a = Ee(e, t = (t % s + s) % s, r); if (this.tiles[a]) return _e(this.tiles[a], o); i > 1 && console.log("drilling down to z%d-%d-%d", e, t, r); for (var l, u = e, h = t, c = r; !l && u > 0;)u--, h = Math.floor(h / 2), c = Math.floor(c / 2), l = this.tiles[Ee(u, h, c)]; return l && l.source ? (i > 1 && console.log("found parent tile z%d-%d-%d", u, h, c), i > 1 && console.time("drilling down"), this.splitTile(l.source, u, h, c, e, t, r), i > 1 && console.timeEnd("drilling down"), this.tiles[a] ? _e(this.tiles[a], o) : null) : null }; class Oe extends e.VectorTileWorkerSource { constructor(e, t, r, n, o) { super(e, t, r, n, Le), o && (this.loadGeoJSON = o); } loadData(t, r) { const n = t && t.request, o = n && n.collectResourceTiming; this.loadGeoJSON(t, ((i, a) => { if (i || !a) return r(i); if ("object" != typeof a) return r(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)); { s(a, !0); try { if (t.filter) { const r = e.createExpression(t.filter, { type: "boolean", "property-type": "data-driven", overridable: !1, transition: !1 }); if ("error" === r.result) throw new Error(r.value.map((e => `${e.key}: ${e.message}`)).join(", ")); const n = a.features.filter((e => r.value.evaluate({ zoom: 0 }, e))); a = { type: "FeatureCollection", features: n }; } this._geoJSONIndex = t.cluster ? new A(function ({ superclusterOptions: t, clusterProperties: r }) { if (!r || !t) return t; const n = {}, o = {}, i = { accumulated: null, zoom: 0 }, s = { properties: null }, a = Object.keys(r); for (const t of a) { const [i, s] = r[t], a = e.createExpression(s), l = e.createExpression("string" == typeof i ? [i, ["accumulated"], ["get", t]] : i); n[t] = a.value, o[t] = l.value; } return t.map = e => { s.properties = e; const t = {}; for (const e of a) t[e] = n[e].evaluate(i, s); return t }, t.reduce = (e, t) => { s.properties = t; for (const t of a) i.accumulated = e[t], e[t] = o[t].evaluate(i, s); }, t }(t)).load(a.features) : function (e, t) { return new Ie(e, t) }(a, t.geojsonVtOptions); } catch (i) { return r(i) } this.loaded = {}; const l = {}; if (o) { const r = e.getPerformanceMeasurement(n); r && (l.resourceTiming = {}, l.resourceTiming[t.source] = JSON.parse(JSON.stringify(r))); } r(null, l); } })); } reloadTile(e, t) { const r = this.loaded; return r && r[e.uid] ? super.reloadTile(e, t) : this.loadTile(e, t) } loadGeoJSON(t, r) { if (t.request) e.getJSON(t.request, r); else { if ("string" != typeof t.data) return r(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)); try { return r(null, JSON.parse(t.data)) } catch (e) { return r(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)) } } } getClusterExpansionZoom(e, t) { try { t(null, this._geoJSONIndex.getClusterExpansionZoom(e.clusterId)); } catch (e) { t(e); } } getClusterChildren(e, t) { try { t(null, this._geoJSONIndex.getChildren(e.clusterId)); } catch (e) { t(e); } } getClusterLeaves(e, t) { try { t(null, this._geoJSONIndex.getLeaves(e.clusterId, e.limit, e.offset)); } catch (e) { t(e); } } } class Ve { constructor(t) { this.self = t, this.actor = new e.Actor(t, this), this.layerIndexes = {}, this.availableImages = {}, this.isSpriteLoaded = !1, this.workerSourceTypes = { vector: e.VectorTileWorkerSource, geojson: Oe }, this.workerSources = {}, this.demWorkerSources = {}, this.self.registerWorkerSource = (e, t) => { if (this.workerSourceTypes[e]) throw new Error(`Worker source with name "${e}" already registered.`); this.workerSourceTypes[e] = t; }, this.self.registerRTLTextPlugin = t => { if (e.plugin.isParsed()) throw new Error("RTL text plugin already registered."); e.plugin.applyArabicShaping = t.applyArabicShaping, e.plugin.processBidirectionalText = t.processBidirectionalText, e.plugin.processStyledBidirectionalText = t.processStyledBidirectionalText; }; } checkIfReady(e, t, r) { r(); } setReferrer(e, t) { this.referrer = t; } spriteLoaded(t, r) { this.isSpriteLoaded = r; for (const n in this.workerSources[t]) { const o = this.workerSources[t][n]; for (const t in o) o[t] instanceof e.VectorTileWorkerSource && (o[t].isSpriteLoaded = r, o[t].fire(new e.Event("isSpriteLoaded"))); } } setImages(e, t, r) { this.availableImages[e] = t; for (const r in this.workerSources[e]) { const n = this.workerSources[e][r]; for (const e in n) n[e].availableImages = t; } r(); } enableTerrain(e, t, r) { this.terrain = t, r(); } setLayers(e, t, r) { this.getLayerIndex(e).replace(t), r(); } updateLayers(e, t, r) { this.getLayerIndex(e).update(t.layers, t.removedIds), r(); } loadTile(t, r, n) { const o = this.enableTerrain ? e.extend({ enableTerrain: this.terrain }, r) : r; this.getWorkerSource(t, r.type, r.source).loadTile(o, n); } loadDEMTile(t, r, n) { const o = this.enableTerrain ? e.extend({ buildQuadTree: this.terrain }, r) : r; this.getDEMWorkerSource(t, r.source).loadTile(o, n); } reloadTile(t, r, n) { const o = this.enableTerrain ? e.extend({ enableTerrain: this.terrain }, r) : r; this.getWorkerSource(t, r.type, r.source).reloadTile(o, n); } abortTile(e, t, r) { this.getWorkerSource(e, t.type, t.source).abortTile(t, r); } removeTile(e, t, r) { this.getWorkerSource(e, t.type, t.source).removeTile(t, r); } removeSource(e, t, r) { if (!this.workerSources[e] || !this.workerSources[e][t.type] || !this.workerSources[e][t.type][t.source]) return; const n = this.workerSources[e][t.type][t.source]; delete this.workerSources[e][t.type][t.source], void 0 !== n.removeSource ? n.removeSource(t, r) : r(); } loadWorkerSource(e, t, r) { try { this.self.importScripts(t.url), r(); } catch (e) { r(e.toString()); } } syncRTLPluginState(t, r, n) { try { e.plugin.setState(r); const t = e.plugin.getPluginURL(); if (e.plugin.isLoaded() && !e.plugin.isParsed() && null != t) { this.self.importScripts(t); const r = e.plugin.isParsed(); n(r ? void 0 : new Error(`RTL Text Plugin failed to import scripts from ${t}`), r); } } catch (e) { n(e.toString()); } } getAvailableImages(e) { let t = this.availableImages[e]; return t || (t = []), t } getLayerIndex(e) { let t = this.layerIndexes[e]; return t || (t = this.layerIndexes[e] = new n), t } getWorkerSource(e, t, r) { if (this.workerSources[e] || (this.workerSources[e] = {}), this.workerSources[e][t] || (this.workerSources[e][t] = {}), !this.workerSources[e][t][r]) { const n = { send: (t, r, n, o, i, s) => { this.actor.send(t, r, n, e, i, s); }, scheduler: this.actor.scheduler }; this.workerSources[e][t][r] = new this.workerSourceTypes[t](n, this.getLayerIndex(e), this.getAvailableImages(e), this.isSpriteLoaded); } return this.workerSources[e][t][r] } getDEMWorkerSource(e, t) { return this.demWorkerSources[e] || (this.demWorkerSources[e] = {}), this.demWorkerSources[e][t] || (this.demWorkerSources[e][t] = new i), this.demWorkerSources[e][t] } enforceCacheSizeLimit(t, r) { e.enforceCacheSizeLimit(r); } getWorkerPerformanceMetrics(e, t, r) { r(void 0, void 0); } } return "undefined" != typeof WorkerGlobalScope && "undefined" != typeof self && self instanceof WorkerGlobalScope && (self.worker = new Ve(self)), Ve }));
|
|
43
|
+
|
|
44
|
+
define(["./shared"], (function (t) { "use strict"; function e(t, e) { void 0 === e && (e = {}); var i = e.insertAt; if (t && "undefined" != typeof document) { var r = document.head || document.getElementsByTagName("head")[0], o = document.createElement("style"); o.type = "text/css", "top" === i && r.firstChild ? r.insertBefore(o, r.firstChild) : r.appendChild(o), o.styleSheet ? o.styleSheet.cssText = t : o.appendChild(document.createTextNode(t)); } } e(".mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E %3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E %3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E %3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E %3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E %3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E %3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E %3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E %3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E %3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E %3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E %3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E %3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E %3C/svg%3E\")}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E %3Cdefs%3E %3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E %3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E %3C/defs%3E %3Cmask id='clip'%3E %3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%3E %3C/mask%3E %3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E %3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E %3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E %3C/g%3E %3Cg id='fill' opacity='0.9' fill='%23fff'%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%3E %3C/g%3E %3C/svg%3E\")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E %3Cdefs%3E %3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E %3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E %3C/defs%3E %3Cmask id='clip'%3E %3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%3E %3C/mask%3E %3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E %3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E %3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E %3C/g%3E %3Cg id='fill' opacity='1' fill='%23fff'%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%3E %3C/g%3E %3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E %3Cdefs%3E %3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E %3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E %3C/defs%3E %3Cmask id='clip'%3E %3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%3E %3C/mask%3E %3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E %3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E %3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E %3C/g%3E %3Cg id='fill' opacity='1' fill='%23000'%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%3E %3C/g%3E %3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E\");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform;opacity:1;transition:opacity .2s}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:\"\";position:absolute;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}.mapboxgl-ctrl-minimap{border:2px solid rgba(0,0,0,.2);border-radius:4px;background:#f8f8f9;transition:all .6s}.mapboxgl-ctrl-pitch button{font-weight:700;font-size:14px}.sfmap-default-div-icon{cursor:pointer}.mapbox-default-icon-path{background:url(img/marker-icon.png)}"), e(".mapboxgl-handler-measure .mapboxgl-popup-tip{visibility:hidden}.mapboxgl-handler-measure .mapboxgl-popup-content{padding:0;cursor:pointer;user-select:none}.mapboxgl-handler-measure .mapboxgl-handler-measure-popup{position:relative}.mapboxgl-handler-measure .mapboxgl-handler-measure-content{font-size:14px;font-weight:700;text-align:center;width:14px;height:14px;line-height:14px;padding:3px 5px;background:#fff;border-width:2px;border-style:solid;border-radius:2px}.mapboxgl-handler-measure .mapboxgl-handler-measure-trush-icon{position:absolute;display:inline-block;width:14px;height:14px;text-align:center;line-height:16px;color:#fff;top:-12px;right:-9px}.mapboxgl-handler-measure .mapboxgl-handler-measure-trush-icon:hover{opacity:.85}"), e(".spider-leg-container{width:1px;height:1px;overflow:display;will-change:transform}.spider-leg-container:hover{cursor:pointer}.spider-leg-container .spider-leg-pin{position:relative;z-index:1}.spider-leg-container .spider-leg-pin.default-spider-pin{position:relative;width:32px;height:32px;margin-left:-16px;margin-top:-32px;background-image:url(<<<WINDOW-LOCATION-ORIGIN-AND-CONTEXT>>>v3.1/docs/assets/icon/blue.png)}.spider-leg-container .spider-leg-line{position:absolute;bottom:0;left:0;width:2px;background-color:#343434;opacity:.45;transform-origin:bottom;z-index:0;height:0}.spider-leg-container:hover .spider-leg-line{opacity:1}.spider-leg-container.animate{-webkit-transition:margin .15s linear;-moz-transition:margin .15s linear;-ms-transition:margin .15s linear;-o-transition:margin .15s linear;transition:margin .15s linear}.spider-leg-container.exit,.spider-leg-container.initial{margin-left:0!important;margin-top:0!important;height:0}.spider-leg-container.animate .spider-leg-line{-webkit-transition:all .15s linear;-moz-transition:all .15s linear;-ms-transition:all .15s linear;-o-transition:all .15s linear;transition:all .15s linear;-webkit-transition-delay:inherit;-moz-transition-delay:inherit;-ms-transition-delay:inherit;-o-transition-delay:inherit;transition-delay:inherit}.spider-leg-container.animate.exit .spider-leg-line,.spider-leg-container.animate.initial .spider-leg-line{height:0!important}"); var i = r; function r(t) { return !function (t) { return "undefined" == typeof window || "undefined" == typeof document ? "not a browser" : Array.prototype && Array.prototype.every && Array.prototype.filter && Array.prototype.forEach && Array.prototype.indexOf && Array.prototype.lastIndexOf && Array.prototype.map && Array.prototype.some && Array.prototype.reduce && Array.prototype.reduceRight && Array.isArray ? Function.prototype && Function.prototype.bind ? Object.keys && Object.create && Object.getPrototypeOf && Object.getOwnPropertyNames && Object.isSealed && Object.isFrozen && Object.isExtensible && Object.getOwnPropertyDescriptor && Object.defineProperty && Object.defineProperties && Object.seal && Object.freeze && Object.preventExtensions ? "JSON" in window && "parse" in JSON && "stringify" in JSON ? function () { if (!("Worker" in window && "Blob" in window && "URL" in window)) return !1; var t, e, i = new Blob([""], { type: "text/javascript" }), r = URL.createObjectURL(i); try { e = new Worker(r), t = !0; } catch (e) { t = !1; } return e && e.terminate(), URL.revokeObjectURL(r), t }() ? "Uint8ClampedArray" in window ? ArrayBuffer.isView ? function () { var t = document.createElement("canvas"); t.width = t.height = 1; var e = t.getContext("2d"); if (!e) return !1; var i = e.getImageData(0, 0, 1, 1); return i && i.width === t.width }() ? (void 0 === o[e = t && t.failIfMajorPerformanceCaveat] && (o[e] = function (t) { var e, i = function (t) { var e = document.createElement("canvas"), i = Object.create(r.webGLContextAttributes); return i.failIfMajorPerformanceCaveat = t, e.getContext("webgl", i) || e.getContext("experimental-webgl", i) }(t); if (!i) return !1; try { e = i.createShader(i.VERTEX_SHADER); } catch (t) { return !1 } return !(!e || i.isContextLost()) && (i.shaderSource(e, "void main() {}"), i.compileShader(e), !0 === i.getShaderParameter(e, i.COMPILE_STATUS)) }(e)), o[e] ? document.documentMode ? "insufficient ECMAScript 6 support" : void 0 : "insufficient WebGL support") : "insufficient Canvas/getImageData support" : "insufficient ArrayBuffer support" : "insufficient Uint8ClampedArray support" : "insufficient worker support" : "insufficient JSON support" : "insufficient Object support" : "insufficient Function support" : "insufficent Array support"; var e; }(t) } var o = {}; r.webGLContextAttributes = { antialias: !1, alpha: !0, stencil: !0, depth: !0 }; const n = { create: function (e, i, r) { const o = t.window.document.createElement(e); return void 0 !== i && (o.className = i), r && r.appendChild(o), o }, createNS: function (e, i) { return t.window.document.createElementNS(e, i) } }, s = t.window.document && t.window.document.documentElement.style, a = s && void 0 !== s.userSelect ? "userSelect" : "WebkitUserSelect"; let l; n.disableDrag = function () { s && a && (l = s[a], s[a] = "none"); }, n.enableDrag = function () { s && a && (s[a] = l); }, n.setTransform = function (t, e) { t.style.transform = e; }; let c = !1; try { const e = Object.defineProperty({}, "passive", { get() { c = !0; } }); t.window.addEventListener("test", e, e), t.window.removeEventListener("test", e, e); } catch (t) { c = !1; } n.addEventListener = function (t, e, i, r = {}) { t.addEventListener(e, i, "passive" in r && c ? r : r.capture); }, n.removeEventListener = function (t, e, i, r = {}) { t.removeEventListener(e, i, "passive" in r && c ? r : r.capture); }; const h = function (e) { e.preventDefault(), e.stopPropagation(), t.window.removeEventListener("click", h, !0); }; function u(e, i, r) { const o = e.offsetWidth === i.width ? 1 : e.offsetWidth / i.width; return new t.pointGeometry((r.clientX - i.left) * o, (r.clientY - i.top) * o) } function d(t, e) { if (Array.isArray(t)) { if (!Array.isArray(e) || t.length !== e.length) return !1; for (let i = 0; i < t.length; i++)if (!d(t[i], e[i])) return !1; return !0 } if ("object" == typeof t && null !== t && null !== e) { if ("object" != typeof e) return !1; if (Object.keys(t).length !== Object.keys(e).length) return !1; for (const i in t) if (!d(t[i], e[i])) return !1; return !0 } return t === e } n.suppressClick = function () { t.window.addEventListener("click", h, !0), t.window.setTimeout((() => { t.window.removeEventListener("click", h, !0); }), 0); }, n.mousePos = function (t, e) { const i = t.getBoundingClientRect(); return u(t, i, e) }, n.touchPos = function (t, e) { const i = t.getBoundingClientRect(), r = []; for (let o = 0; o < e.length; o++)r.push(u(t, i, e[o])); return r }, n.mouseButton = function (e) { return void 0 !== t.window.InstallTrigger && 2 === e.button && e.ctrlKey && t.window.navigator.platform.toUpperCase().indexOf("MAC") >= 0 ? 0 : e.button }, n.remove = function (t) { t.parentNode && t.parentNode.removeChild(t); }, n.getStyle = function (t, e) { let i = t.style[e] || t.currentStyle && t.currentStyle[e]; if ((!i || "auto" === i) && document.defaultView) { const r = document.defaultView.getComputedStyle(t, null); i = r ? r[e] : null; } return "auto" === i ? null : i }; const p = { 0: 1, 2: 2 }; class m { constructor(t) { this.reset(), this._clickTolerance = t.clickTolerance || 1; } reset() { this._active = !1, this._moved = !1, delete this._lastPoint, delete this._eventButton; } _correctButton(t, e) { return !1 } _move(t, e) { return {} } mousedown(t, e) { if (this._lastPoint) return; const i = n.mouseButton(t); this._correctButton(t, i) && (this._lastPoint = e, this._eventButton = i); } mousemoveWindow(t, e) { const i = this._lastPoint; if (i) if (t.preventDefault(), function (t, e) { const i = p[e]; return void 0 === t.buttons || (t.buttons & i) !== i }(t, this._eventButton)) this.reset(); else if (this._moved || !(e.dist(i) < this._clickTolerance)) return this._moved = !0, this._lastPoint = e, this._move(i, e) } mouseupWindow(t) { this._lastPoint && n.mouseButton(t) === this._eventButton && (this._moved && n.suppressClick(), this.reset()); } enable() { this._enabled = !0; } disable() { this._enabled = !1, this.reset(); } isEnabled() { return this._enabled } isActive() { return this._active } } class _ extends m { mousedown(t, e) { super.mousedown(t, e), this._lastPoint && (this._active = !0); } _correctButton(t, e) { return 0 === e && !t.ctrlKey } _move(t, e) { return { around: e, panDelta: e.sub(t) } } } class f extends m { _correctButton(t, e) { return 0 === e && t.ctrlKey || 2 === e } _move(t, e) { const i = .8 * (e.x - t.x); if (i) return this._active = !0, { bearingDelta: i } } contextmenu(t) { t.preventDefault(); } } class g extends m { _correctButton(t, e) { return 0 === e && t.ctrlKey || 2 === e } _move(t, e) { const i = -.5 * (e.y - t.y); if (i) return this._active = !0, { pitchDelta: i } } contextmenu(t) { t.preventDefault(); } } const v = { showCompass: !0, showZoom: !0, visualizePitch: !1 }; class x { constructor(e, i, r = !1) { this._clickTolerance = 10, this.element = i, this.mouseRotate = new f({ clickTolerance: e.dragRotate._mouseRotate._clickTolerance }), this.map = e, r && (this.mousePitch = new g({ clickTolerance: e.dragRotate._mousePitch._clickTolerance })), t.bindAll(["mousedown", "mousemove", "mouseup", "touchstart", "touchmove", "touchend", "reset"], this), n.addEventListener(i, "mousedown", this.mousedown), n.addEventListener(i, "touchstart", this.touchstart, { passive: !1 }), n.addEventListener(i, "touchmove", this.touchmove), n.addEventListener(i, "touchend", this.touchend), n.addEventListener(i, "touchcancel", this.reset); } down(t, e) { this.mouseRotate.mousedown(t, e), this.mousePitch && this.mousePitch.mousedown(t, e), n.disableDrag(); } move(t, e) { const i = this.map, r = this.mouseRotate.mousemoveWindow(t, e); if (r && r.bearingDelta && i.setBearing(i.getBearing() + r.bearingDelta), this.mousePitch) { const r = this.mousePitch.mousemoveWindow(t, e); r && r.pitchDelta && i.setPitch(i.getPitch() + r.pitchDelta); } } off() { const t = this.element; n.removeEventListener(t, "mousedown", this.mousedown), n.removeEventListener(t, "touchstart", this.touchstart, { passive: !1 }), n.removeEventListener(t, "touchmove", this.touchmove), n.removeEventListener(t, "touchend", this.touchend), n.removeEventListener(t, "touchcancel", this.reset), this.offTemp(); } offTemp() { n.enableDrag(), n.removeEventListener(t.window, "mousemove", this.mousemove), n.removeEventListener(t.window, "mouseup", this.mouseup); } mousedown(e) { this.down(t.extend({}, e, { ctrlKey: !0, preventDefault: () => e.preventDefault() }), n.mousePos(this.element, e)), n.addEventListener(t.window, "mousemove", this.mousemove), n.addEventListener(t.window, "mouseup", this.mouseup); } mousemove(t) { this.move(t, n.mousePos(this.element, t)); } mouseup(t) { this.mouseRotate.mouseupWindow(t), this.mousePitch && this.mousePitch.mouseupWindow(t), this.offTemp(); } touchstart(t) { 1 !== t.targetTouches.length ? this.reset() : (this._startPos = this._lastPos = n.touchPos(this.element, t.targetTouches)[0], this.down({ type: "mousedown", button: 0, ctrlKey: !0, preventDefault: () => t.preventDefault() }, this._startPos)); } touchmove(t) { 1 !== t.targetTouches.length ? this.reset() : (this._lastPos = n.touchPos(this.element, t.targetTouches)[0], this.move({ preventDefault: () => t.preventDefault() }, this._lastPos)); } touchend(t) { 0 === t.targetTouches.length && this._startPos && this._lastPos && this._startPos.dist(this._lastPos) < this._clickTolerance && this.element.click(), this.reset(); } reset() { this.mouseRotate.reset(), this.mousePitch && this.mousePitch.reset(), delete this._startPos, delete this._lastPos, this.offTemp(); } } const y = { maxWidth: 100, unit: "metric" }; function b(t, e, i) { const r = i && i.maxWidth || 100, o = t._container.clientHeight / 2, n = t.unproject([0, o]), s = t.unproject([r, o]), a = n.distanceTo(s); if (i && "imperial" === i.unit) { const i = 3.2808 * a; i > 5280 ? w(e, r, i / 5280, t._getUIString("ScaleControl.Miles"), t) : w(e, r, i, t._getUIString("ScaleControl.Feet"), t); } else i && "nautical" === i.unit ? w(e, r, a / 1852, t._getUIString("ScaleControl.NauticalMiles"), t) : a >= 1e3 ? w(e, r, a / 1e3, t._getUIString("ScaleControl.Kilometers"), t) : w(e, r, a, t._getUIString("ScaleControl.Meters"), t); } function w(t, e, i, r, o) { const n = function (t) { const e = Math.pow(10, `${Math.floor(t)}`.length - 1); let i = t / e; return i = i >= 10 ? 10 : i >= 5 ? 5 : i >= 3 ? 3 : i >= 2 ? 2 : i >= 1 ? 1 : function (t) { const e = Math.pow(10, Math.ceil(-Math.log(t) / Math.LN10)); return Math.round(t * e) / e }(i), e * i }(i), s = n / i; o._requestDomTask((() => { t.style.width = e * s + "px", t.innerHTML = `${n} ${r}`; })); } class E extends t.Event { preventDefault() { this._defaultPrevented = !0; } get defaultPrevented() { return this._defaultPrevented } constructor(e, i, r, o = {}) { const s = n.mousePos(i.getCanvasContainer(), r), a = i.unproject(s); super(e, t.extend({ point: s, lngLat: a, originalEvent: r }, o)), this._defaultPrevented = !1, this.target = i; } } class T extends t.Event { preventDefault() { this._defaultPrevented = !0; } get defaultPrevented() { return this._defaultPrevented } constructor(e, i, r) { const o = "touchend" === e ? r.changedTouches : r.touches, s = n.touchPos(i.getCanvasContainer(), o), a = s.map((t => i.unproject(t))), l = s.reduce(((t, e, i, r) => t.add(e.div(r.length))), new t.pointGeometry(0, 0)); super(e, { points: s, point: l, lngLats: a, lngLat: i.unproject(l), originalEvent: r }), this._defaultPrevented = !1; } } class C extends t.Event { preventDefault() { this._defaultPrevented = !0; } get defaultPrevented() { return this._defaultPrevented } constructor(t, e, i) { super(t, { originalEvent: i }), this._defaultPrevented = !1; } } function S(e, i, r) { if (e = new t.LngLat(e.lng, e.lat), i) { const o = new t.LngLat(e.lng - 360, e.lat), n = new t.LngLat(e.lng + 360, e.lat), s = 360 * Math.ceil(Math.abs(e.lng - r.center.lng) / 360), a = r.locationPoint(e).distSqr(i), l = i.x < 0 || i.y < 0 || i.x > r.width || i.y > r.height; r.locationPoint(o).distSqr(i) < a && (l || Math.abs(o.lng - r.center.lng) < s) ? e = o : r.locationPoint(n).distSqr(i) < a && (l || Math.abs(n.lng - r.center.lng) < s) && (e = n); } for (; Math.abs(e.lng - r.center.lng) > 180;) { const t = r.locationPoint(e); if (t.x >= 0 && t.y >= 0 && t.x <= r.width && t.y <= r.height) break; e.lng > r.center.lng ? e.lng -= 360 : e.lng += 360; } return e } const A = { center: "translate(-50%,-50%)", top: "translate(-50%,0)", "top-left": "translate(0,0)", "top-right": "translate(-100%,0)", bottom: "translate(-50%,-100%)", "bottom-left": "translate(0,-100%)", "bottom-right": "translate(-100%,-100%)", left: "translate(0,-50%)", right: "translate(-100%,-50%)" }; function L(t, e, i) { const r = t.classList; for (const t in A) r.remove(`mapboxgl-${i}-anchor-${t}`); r.add(`mapboxgl-${i}-anchor-${e}`); } const I = { closeButton: !0, closeOnClick: !0, focusAfterOpen: !0, className: "", maxWidth: "240px" }, M = ["a[href]", "[tabindex]:not([tabindex='-1'])", "[contenteditable]:not([contenteditable='false'])", "button:not([disabled])", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].join(", "); class P extends t.Evented { constructor(e) { super(), this.options = t.extend(Object.create(I), e), t.bindAll(["_update", "_onClose", "remove", "_onMouseMove", "_onMouseUp", "_onDrag"], this); } addTo(e) { return this._map && this.remove(), this._map = e, this.options.closeOnClick && this._map.on("click", this._onClose), this.options.closeOnMove && this._map.on("move", this._onClose), this._map.on("remove", this.remove), this._update(), this._focusFirstElement(), this._trackPointer ? (this._map.on("mousemove", this._onMouseMove), this._map.on("mouseup", this._onMouseUp), this._container && this._container.classList.add("mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.add("mapboxgl-track-pointer")) : this._map.on("move", this._update), this.fire(new t.Event("open")), this } isOpen() { return !!this._map } remove() { return this._content && n.remove(this._content), this._container && (n.remove(this._container), delete this._container), this._map && (this._map.off("move", this._update), this._map.off("move", this._onClose), this._map.off("click", this._onClose), this._map.off("remove", this.remove), this._map.off("mousemove", this._onMouseMove), this._map.off("mouseup", this._onMouseUp), this._map.off("drag", this._onDrag), delete this._map), this.fire(new t.Event("close")), this } getLngLat() { return this._lngLat } setLngLat(e) { return this._lngLat = t.LngLat.convert(e), this._pos = null, this._trackPointer = !1, this._update(), this._map && (this._map.on("move", this._update), this._map.off("mousemove", this._onMouseMove), this._container && this._container.classList.remove("mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")), this } trackPointer() { return this._trackPointer = !0, this._pos = null, this._update(), this._map && (this._map.off("move", this._update), this._map.on("mousemove", this._onMouseMove), this._map.on("drag", this._onDrag), this._container && this._container.classList.add("mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.add("mapboxgl-track-pointer")), this } getElement() { return this._container } setText(e) { return this.setDOMContent(t.window.document.createTextNode(e)) } setHTML(e) { const i = t.window.document.createDocumentFragment(), r = t.window.document.createElement("body"); let o; for (r.innerHTML = e; o = r.firstChild, o;)i.appendChild(o); return this.setDOMContent(i) } getMaxWidth() { return this._container && this._container.style.maxWidth } setMaxWidth(t) { return this.options.maxWidth = t, this._update(), this } setDOMContent(t) { if (this._content) for (; this._content.hasChildNodes();)this._content.firstChild && this._content.removeChild(this._content.firstChild); else this._content = n.create("div", "mapboxgl-popup-content", this._container); return this._content.appendChild(t), this._createCloseButton(), this._update(), this._focusFirstElement(), this } addClassName(t) { this._container && this._container.classList.add(t); } removeClassName(t) { this._container && this._container.classList.remove(t); } setOffset(t) { return this.options.offset = t, this._update(), this } toggleClassName(t) { if (this._container) return this._container.classList.toggle(t) } _createCloseButton() { this.options.closeButton && (this._closeButton = n.create("button", "mapboxgl-popup-close-button", this._content), this._closeButton.type = "button", this._closeButton.setAttribute("aria-label", "Close popup"), this._closeButton.innerHTML = "×", this._closeButton.addEventListener("click", this._onClose)); } _onMouseUp(t) { this._update(t.point); } _onMouseMove(t) { this._update(t.point); } _onDrag(t) { this._update(t.point); } _update(t) { if (!this._map || !this._lngLat && !this._trackPointer || !this._content) return; if (this._container || (this._container = n.create("div", "mapboxgl-popup", this._map.getContainer()), this._tip = n.create("div", "mapboxgl-popup-tip", this._container), this._container.appendChild(this._content), this.options.className && this.options.className.split(" ").forEach((t => this._container.classList.add(t))), this._trackPointer && this._container.classList.add("mapboxgl-popup-track-pointer")), this.options.maxWidth && this._container.style.maxWidth !== this.options.maxWidth && (this._container.style.maxWidth = this.options.maxWidth), this._map.transform.renderWorldCopies && !this._trackPointer && (this._lngLat = S(this._lngLat, this._pos, this._map.transform)), this._trackPointer && !t) return; const e = this._pos = this._trackPointer && t ? t : this._map.project(this._lngLat); let i = this.options.anchor; const r = z(this.options.offset); if (!i) { const t = this._container.offsetWidth, o = this._container.offsetHeight; let n; n = e.y + r.bottom.y < o ? ["top"] : e.y > this._map.transform.height - o ? ["bottom"] : [], e.x < t / 2 ? n.push("left") : e.x > this._map.transform.width - t / 2 && n.push("right"), i = 0 === n.length ? "bottom" : n.join("-"); } const o = e.add(r[i]).round(); this._map._requestDomTask((() => { this._container && i && (n.setTransform(this._container, `${A[i]} translate(${o.x}px,${o.y}px)`), L(this._container, i, "popup")); })); } _focusFirstElement() { if (!this.options.focusAfterOpen || !this._container) return; const t = this._container.querySelector(M); t && t.focus(); } _onClose() { this.remove(); } _setOpacity(t) { this._content && (this._content.style.opacity = t), this._tip && (this._tip.style.opacity = t); } } function z(e) { if (e) { if ("number" == typeof e) { const i = Math.round(Math.sqrt(.5 * Math.pow(e, 2))); return { center: new t.pointGeometry(0, 0), top: new t.pointGeometry(0, e), "top-left": new t.pointGeometry(i, i), "top-right": new t.pointGeometry(-i, i), bottom: new t.pointGeometry(0, -e), "bottom-left": new t.pointGeometry(i, -i), "bottom-right": new t.pointGeometry(-i, -i), left: new t.pointGeometry(e, 0), right: new t.pointGeometry(-e, 0) } } if (e instanceof t.pointGeometry || Array.isArray(e)) { const i = t.pointGeometry.convert(e); return { center: i, top: i, "top-left": i, "top-right": i, bottom: i, "bottom-left": i, "bottom-right": i, left: i, right: i } } return { center: t.pointGeometry.convert(e.center || [0, 0]), top: t.pointGeometry.convert(e.top || [0, 0]), "top-left": t.pointGeometry.convert(e["top-left"] || [0, 0]), "top-right": t.pointGeometry.convert(e["top-right"] || [0, 0]), bottom: t.pointGeometry.convert(e.bottom || [0, 0]), "bottom-left": t.pointGeometry.convert(e["bottom-left"] || [0, 0]), "bottom-right": t.pointGeometry.convert(e["bottom-right"] || [0, 0]), left: t.pointGeometry.convert(e.left || [0, 0]), right: t.pointGeometry.convert(e.right || [0, 0]) } } return z(new t.pointGeometry(0, 0)) } function D(t) { const { userImage: e } = t; return !!(e && e.render && e.render()) && (t.data.replace(new Uint8Array(e.data.buffer)), !0) } class k extends t.Evented { constructor() { super(), this.images = {}, this.updatedImages = {}, this.callbackDispatchedThisFrame = {}, this.loaded = !1, this.requestors = [], this.patterns = {}, this.atlasImage = new t.RGBAImage({ width: 1, height: 1 }), this.dirty = !0; } isLoaded() { return this.loaded } setLoaded(t) { if (this.loaded !== t && (this.loaded = t, t)) { for (const { ids: t, callback: e } of this.requestors) this._notify(t, e); this.requestors = []; } } getImage(t) { return this.images[t] } addImage(t, e) { this._validate(t, e) && (this.images[t] = e); } _validate(e, i) { let r = !0; return this._validateStretch(i.stretchX, i.data && i.data.width) || (this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "stretchX" value`))), r = !1), this._validateStretch(i.stretchY, i.data && i.data.height) || (this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "stretchY" value`))), r = !1), this._validateContent(i.content, i) || (this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "content" value`))), r = !1), r } _validateStretch(t, e) { if (!t) return !0; let i = 0; for (const r of t) { if (r[0] < i || r[1] < r[0] || e < r[1]) return !1; i = r[1]; } return !0 } _validateContent(t, e) { return !(t && (4 !== t.length || t[0] < 0 || e.data.width < t[0] || t[1] < 0 || e.data.height < t[1] || t[2] < 0 || e.data.width < t[2] || t[3] < 0 || e.data.height < t[3] || t[2] < t[0] || t[3] < t[1])) } updateImage(t, e) { e.version = this.images[t].version + 1, this.images[t] = e, this.updatedImages[t] = !0; } removeImage(t) { const e = this.images[t]; delete this.images[t], delete this.patterns[t], e.userImage && e.userImage.onRemove && e.userImage.onRemove(); } listImages() { return Object.keys(this.images) } getImages(t, e) { let i = !0; if (!this.isLoaded()) for (const e of t) this.images[e] || (i = !1); this.isLoaded() || i ? this._notify(t, e) : this.requestors.push({ ids: t, callback: e }); } _notify(e, i) { const r = {}; for (const i of e) { this.images[i] || this.fire(new t.Event("styleimagemissing", { id: i })); const e = this.images[i]; e ? r[i] = { data: e.data.clone(), pixelRatio: e.pixelRatio, sdf: e.sdf, version: e.version, stretchX: e.stretchX, stretchY: e.stretchY, content: e.content, hasRenderCallback: Boolean(e.userImage && e.userImage.render) } : t.warnOnce(`Image "${i}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`); } i(null, r); } getPixelSize() { const { width: t, height: e } = this.atlasImage; return { width: t, height: e } } getPattern(e) { const i = this.patterns[e], r = this.getImage(e); if (!r) return null; if (i && i.position.version === r.version) return i.position; if (i) i.position.version = r.version; else { const i = { w: r.data.width + 2, h: r.data.height + 2, x: 0, y: 0 }, o = new t.ImagePosition(i, r); this.patterns[e] = { bin: i, position: o }; } return this._updatePatternAtlas(), this.patterns[e].position } bind(e) { const i = e.gl; this.atlasTexture ? this.dirty && (this.atlasTexture.update(this.atlasImage), this.dirty = !1) : this.atlasTexture = new t.Texture(e, this.atlasImage, i.RGBA), this.atlasTexture.bind(i.LINEAR, i.CLAMP_TO_EDGE); } _updatePatternAtlas() { const e = []; for (const t in this.patterns) e.push(this.patterns[t].bin); const { w: i, h: r } = t.potpack(e), o = this.atlasImage; o.resize({ width: i || 1, height: r || 1 }); for (const e in this.patterns) { const { bin: i } = this.patterns[e], r = i.x + 1, n = i.y + 1, s = this.images[e].data, a = s.width, l = s.height; t.RGBAImage.copy(s, o, { x: 0, y: 0 }, { x: r, y: n }, { width: a, height: l }), t.RGBAImage.copy(s, o, { x: 0, y: l - 1 }, { x: r, y: n - 1 }, { width: a, height: 1 }), t.RGBAImage.copy(s, o, { x: 0, y: 0 }, { x: r, y: n + l }, { width: a, height: 1 }), t.RGBAImage.copy(s, o, { x: a - 1, y: 0 }, { x: r - 1, y: n }, { width: 1, height: l }), t.RGBAImage.copy(s, o, { x: 0, y: 0 }, { x: r + a, y: n }, { width: 1, height: l }); } this.dirty = !0; } beginFrame() { this.callbackDispatchedThisFrame = {}; } dispatchRenderCallbacks(t) { for (const e of t) { if (this.callbackDispatchedThisFrame[e]) continue; this.callbackDispatchedThisFrame[e] = !0; const t = this.images[e]; D(t) && this.updateImage(e, t); } } } const R = new t.Properties({ anchor: new t.DataConstantProperty(t.spec.light.anchor), position: new class { constructor() { this.specification = t.spec.light.position; } possiblyEvaluate(e, i) { return function ([e, i, r]) { const o = t.degToRad(i + 90), n = t.degToRad(r); return { x: e * Math.cos(o) * Math.sin(n), y: e * Math.sin(o) * Math.sin(n), z: e * Math.cos(n), azimuthal: i, polar: r } }(e.expression.evaluate(i)) } interpolate(e, i, r) { return { x: t.number(e.x, i.x, r), y: t.number(e.y, i.y, r), z: t.number(e.z, i.z, r), azimuthal: t.number(e.azimuthal, i.azimuthal, r), polar: t.number(e.polar, i.polar, r) } } }, color: new t.DataConstantProperty(t.spec.light.color), intensity: new t.DataConstantProperty(t.spec.light.intensity) }), F = "-transition"; class O extends t.Evented { constructor(e) { super(), this._transitionable = new t.Transitionable(R), this.setLight(e), this._transitioning = this._transitionable.untransitioned(); } getLight() { return this._transitionable.serialize() } setLight(e, i = {}) { if (!this._validate(t.validateLight, e, i)) for (const i in e) { const r = e[i]; t.endsWith(i, F) ? this._transitionable.setTransition(i.slice(0, -F.length), r) : this._transitionable.setValue(i, r); } } updateTransitions(t) { this._transitioning = this._transitionable.transitioned(t, this._transitioning); } hasTransition() { return this._transitioning.hasTransition() } recalculate(t) { this.properties = this._transitioning.possiblyEvaluate(t); } _validate(e, i, r) { return (!r || !1 !== r.validate) && t.emitValidationErrors(this, e.call(t.validateStyle, t.extend({ value: i, style: { glyphs: !0, sprite: !0 }, styleSpec: t.spec }))) } } const B = new t.Properties({ source: new t.DataConstantProperty(t.spec.terrain.source), exaggeration: new t.DataConstantProperty(t.spec.terrain.exaggeration) }), U = "-transition"; class N extends t.Evented { constructor(e) { super(), this._transitionable = new t.Transitionable(B), this.set(e), this._transitioning = this._transitionable.untransitioned(); } get() { return this._transitionable.serialize() } set(e) { for (const i in e) { const r = e[i]; t.endsWith(i, U) ? this._transitionable.setTransition(i.slice(0, -U.length), r) : this._transitionable.setValue(i, r); } } updateTransitions(t) { this._transitioning = this._transitionable.transitioned(t, this._transitioning); } hasTransition() { return this._transitioning.hasTransition() } recalculate(t) { this.properties = this._transitioning.possiblyEvaluate(t); } } function G(e, i, r, o) { const n = t.smoothstep(45, 65, r), [s, a] = j(e, o), l = t.length(i); let c = 1 - Math.min(1, Math.exp((l - s) / (a - s) * -6)); return c *= c * c, c = Math.min(1, 1.00747 * c), c * n * e.alpha } function j(t, e) { const i = .5 / Math.tan(.5 * e); return [t.range[0] + i, t.range[1] + i] } const H = new t.Properties({ range: new t.DataConstantProperty(t.spec.fog.range), color: new t.DataConstantProperty(t.spec.fog.color), "horizon-blend": new t.DataConstantProperty(t.spec.fog["horizon-blend"]) }), V = "-transition"; class W extends t.Evented { constructor(e) { super(), this._transitionable = new t.Transitionable(H), this.set(e), this._transitioning = this._transitionable.untransitioned(); } get state() { return { range: this.properties.get("range"), horizonBlend: this.properties.get("horizon-blend"), alpha: this.properties.get("color").a } } get() { return this._transitionable.serialize() } set(e) { if (!this._validate(t.validateFog, e)) for (const i in e) { const r = e[i]; t.endsWith(i, V) ? this._transitionable.setTransition(i.slice(0, -V.length), r) : this._transitionable.setValue(i, r); } } getOpacity(e) { const i = this.properties && this.properties.get("color") || 1; return t.smoothstep(45, 65, e) * i.a } getOpacityAtLatLng(e, i) { return function (e, i, r) { const o = t.MercatorCoordinate.fromLngLat(i), n = r.elevation ? r.elevation.getAtPointOrZero(o) : 0, s = [o.x, o.y, n]; return t.transformMat4(s, s, r.mercatorFogMatrix), G(e, s, r.pitch, r._fov) }(this.state, e, i) } getFovAdjustedRange(t) { return j(this.state, t) } updateTransitions(t) { this._transitioning = this._transitionable.transitioned(t, this._transitioning); } hasTransition() { return this._transitioning.hasTransition() } recalculate(t) { this.properties = this._transitioning.possiblyEvaluate(t); } _validate(e, i, r) { return (!r || !1 !== r.validate) && t.emitValidationErrors(this, e.call(t.validateStyle, t.extend({ value: i, style: { glyphs: !0, sprite: !0 }, styleSpec: t.spec }))) } } class Z { constructor(e, i) { this.workerPool = e, this.actors = [], this.currentActor = 0, this.id = t.uniqueId(); const r = this.workerPool.acquire(this.id); for (let t = 0; t < r.length; t++) { const e = new Z.Actor(r[t], i, this.id); e.name = `Worker ${t}`, this.actors.push(e); } this.ready = !1, this.broadcast("checkIfReady", null, (() => { this.ready = !0; })); } broadcast(e, i, r) { t.asyncAll(this.actors, ((t, r) => { t.send(e, i, r); }), r = r || function () { }); } getActor() { return this.currentActor = (this.currentActor + 1) % this.actors.length, this.actors[this.currentActor] } remove() { this.actors.forEach((t => { t.remove(); })), this.actors = [], this.workerPool.release(this.id); } } function Y(e, i, r) { return i * (t.EXTENT / (e.tileSize * Math.pow(2, r - e.tileID.overscaledZ))) } Z.Actor = t.Actor; class q { constructor(t, e, i, r) { this.screenBounds = t, this.cameraPoint = e, this._screenRaycastCache = {}, this._cameraRaycastCache = {}, this.isAboveHorizon = i, this.screenGeometry = this.bufferedScreenGeometry(0), this.screenGeometryMercator = this.screenGeometry.map((t => r.pointCoordinate3D(t))), this.cameraGeometry = this.bufferedCameraGeometry(0); } static createFromScreenPoints(e, i) { let r, o; if (e instanceof t.pointGeometry || "number" == typeof e[0]) { const n = t.pointGeometry.convert(e); r = [t.pointGeometry.convert(e)], o = i.isPointAboveHorizon(n); } else { const n = t.pointGeometry.convert(e[0]), s = t.pointGeometry.convert(e[1]); r = [n, s], o = t.polygonizeBounds(n, s).every((t => i.isPointAboveHorizon(t))); } return new q(r, i.getCameraPoint(), o, i) } isPointQuery() { return 1 === this.screenBounds.length } bufferedScreenGeometry(e) { return t.polygonizeBounds(this.screenBounds[0], 1 === this.screenBounds.length ? this.screenBounds[0] : this.screenBounds[1], e) } bufferedCameraGeometry(e) { const i = this.screenBounds[0], r = 1 === this.screenBounds.length ? this.screenBounds[0].add(new t.pointGeometry(1, 1)) : this.screenBounds[1], o = t.polygonizeBounds(i, r, 0, !1); return this.cameraPoint.y > r.y && (this.cameraPoint.x > i.x && this.cameraPoint.x < r.x ? o.splice(3, 0, this.cameraPoint) : this.cameraPoint.x >= r.x ? o[2] = this.cameraPoint : this.cameraPoint.x <= i.x && (o[3] = this.cameraPoint)), t.bufferConvexPolygon(o, e) } containsTile(e, i, r) { const o = e.queryPadding + 1, n = r ? this._bufferedCameraMercator(o, i).map((t => e.tileID.getTilePoint(t))) : this._bufferedScreenMercator(o, i).map((t => e.tileID.getTilePoint(t))), s = this.screenGeometryMercator.map((t => e.tileID.getTileVec3(t))), a = s.map((e => new t.pointGeometry(e[0], e[1]))), l = i.getFreeCameraOptions().position || new t.MercatorCoordinate(0, 0, 0), c = e.tileID.getTileVec3(l), h = s.map((e => { const i = t.sub(e, e, c); return t.normalize(i, i), new t.Ray(c, i) })), u = Y(e, 1, i.zoom); if (t.polygonIntersectsBox(n, 0, 0, t.EXTENT, t.EXTENT)) return { queryGeometry: this, tilespaceGeometry: a, tilespaceRays: h, bufferedTilespaceGeometry: n, bufferedTilespaceBounds: (d = t.getBounds(n), d.min.x = t.clamp(d.min.x, 0, t.EXTENT), d.min.y = t.clamp(d.min.y, 0, t.EXTENT), d.max.x = t.clamp(d.max.x, 0, t.EXTENT), d.max.y = t.clamp(d.max.y, 0, t.EXTENT), d), tile: e, tileID: e.tileID, pixelToTileUnitsFactor: u }; var d; } _bufferedScreenMercator(t, e) { const i = X(t); if (this._screenRaycastCache[i]) return this._screenRaycastCache[i]; { const r = this.bufferedScreenGeometry(t).map((t => e.pointCoordinate3D(t))); return this._screenRaycastCache[i] = r, r } } _bufferedCameraMercator(t, e) { const i = X(t); if (this._cameraRaycastCache[i]) return this._cameraRaycastCache[i]; { const r = this.bufferedCameraGeometry(t).map((t => e.pointCoordinate3D(t))); return this._cameraRaycastCache[i] = r, r } } } function X(t) { return 100 * t | 0 } function Q(e, i, r) { const o = function (o, n) { if (o) return r(o); if (n) { const o = t.pick(t.extend(n, e), ["tiles", "minzoom", "maxzoom", "attribution", "mapbox_logo", "bounds", "scheme", "tileSize", "encoding", "zoomOffset"]); n.vector_layers && (o.vectorLayers = n.vector_layers, o.vectorLayerIds = o.vectorLayers.map((t => t.id))), o.tiles = i.canonicalizeTileset(o, e.url), r(null, o); } }; return e.url ? t.getJSON(i.transformRequest(i.normalizeSourceURL(e.url), t.ResourceType.Source), o) : t.exported.frame((() => o(null, e))) } class K { constructor(e, i, r) { this.bounds = t.LngLatBounds.convert(this.validateBounds(e)), this.minzoom = i || 0, this.maxzoom = r || 24; } validateBounds(t) { return Array.isArray(t) && 4 === t.length ? [Math.max(-180, t[0]), Math.max(-90, t[1]), Math.min(180, t[2]), Math.min(90, t[3])] : [-180, -90, 180, 90] } contains(e) { const i = Math.pow(2, e.z), r = Math.floor(t.mercatorXfromLng(this.bounds.getWest()) * i), o = Math.floor(t.mercatorYfromLat(this.bounds.getNorth()) * i), n = Math.ceil(t.mercatorXfromLng(this.bounds.getEast()) * i), s = Math.ceil(t.mercatorYfromLat(this.bounds.getSouth()) * i); return e.x >= r && e.x < n && e.y >= o && e.y < s } } class J { constructor(t, e, i) { this.context = t; const r = t.gl; this.buffer = r.createBuffer(), this.dynamicDraw = Boolean(i), this.context.unbindVAO(), t.bindElementBuffer.set(this.buffer), r.bufferData(r.ELEMENT_ARRAY_BUFFER, e.arrayBuffer, this.dynamicDraw ? r.DYNAMIC_DRAW : r.STATIC_DRAW), this.dynamicDraw || delete e.arrayBuffer; } bind() { this.context.bindElementBuffer.set(this.buffer); } updateData(t) { const e = this.context.gl; this.context.unbindVAO(), this.bind(), e.bufferSubData(e.ELEMENT_ARRAY_BUFFER, 0, t.arrayBuffer); } destroy() { this.buffer && (this.context.gl.deleteBuffer(this.buffer), delete this.buffer); } } const $ = { Int8: "BYTE", Uint8: "UNSIGNED_BYTE", Int16: "SHORT", Uint16: "UNSIGNED_SHORT", Int32: "INT", Uint32: "UNSIGNED_INT", Float32: "FLOAT" }; class tt { constructor(t, e, i, r) { this.length = e.length, this.attributes = i, this.itemSize = e.bytesPerElement, this.dynamicDraw = r, this.context = t; const o = t.gl; this.buffer = o.createBuffer(), t.bindVertexBuffer.set(this.buffer), o.bufferData(o.ARRAY_BUFFER, e.arrayBuffer, this.dynamicDraw ? o.DYNAMIC_DRAW : o.STATIC_DRAW), this.dynamicDraw || delete e.arrayBuffer; } bind() { this.context.bindVertexBuffer.set(this.buffer); } updateData(t) { const e = this.context.gl; this.bind(), e.bufferSubData(e.ARRAY_BUFFER, 0, t.arrayBuffer); } enableAttributes(t, e) { for (let i = 0; i < this.attributes.length; i++) { const r = e.attributes[this.attributes[i].name]; void 0 !== r && t.enableVertexAttribArray(r); } } setVertexAttribPointers(t, e, i) { for (let r = 0; r < this.attributes.length; r++) { const o = this.attributes[r], n = e.attributes[o.name]; void 0 !== n && t.vertexAttribPointer(n, o.components, t[$[o.type]], !1, this.itemSize, o.offset + this.itemSize * (i || 0)); } } destroy() { this.buffer && (this.context.gl.deleteBuffer(this.buffer), delete this.buffer); } } class et { constructor(t) { this.gl = t.gl, this.default = this.getDefault(), this.current = this.default, this.dirty = !1; } get() { return this.current } set(t) { } getDefault() { return this.default } setDefault() { this.set(this.default); } } class it extends et { getDefault() { return t.Color.transparent } set(t) { const e = this.current; (t.r !== e.r || t.g !== e.g || t.b !== e.b || t.a !== e.a || this.dirty) && (this.gl.clearColor(t.r, t.g, t.b, t.a), this.current = t, this.dirty = !1); } } class rt extends et { getDefault() { return 1 } set(t) { (t !== this.current || this.dirty) && (this.gl.clearDepth(t), this.current = t, this.dirty = !1); } } class ot extends et { getDefault() { return 0 } set(t) { (t !== this.current || this.dirty) && (this.gl.clearStencil(t), this.current = t, this.dirty = !1); } } class nt extends et { getDefault() { return [!0, !0, !0, !0] } set(t) { const e = this.current; (t[0] !== e[0] || t[1] !== e[1] || t[2] !== e[2] || t[3] !== e[3] || this.dirty) && (this.gl.colorMask(t[0], t[1], t[2], t[3]), this.current = t, this.dirty = !1); } } class st extends et { getDefault() { return !0 } set(t) { (t !== this.current || this.dirty) && (this.gl.depthMask(t), this.current = t, this.dirty = !1); } } class at extends et { getDefault() { return 255 } set(t) { (t !== this.current || this.dirty) && (this.gl.stencilMask(t), this.current = t, this.dirty = !1); } } class lt extends et { getDefault() { return { func: this.gl.ALWAYS, ref: 0, mask: 255 } } set(t) { const e = this.current; (t.func !== e.func || t.ref !== e.ref || t.mask !== e.mask || this.dirty) && (this.gl.stencilFunc(t.func, t.ref, t.mask), this.current = t, this.dirty = !1); } } class ct extends et { getDefault() { const t = this.gl; return [t.KEEP, t.KEEP, t.KEEP] } set(t) { const e = this.current; (t[0] !== e[0] || t[1] !== e[1] || t[2] !== e[2] || this.dirty) && (this.gl.stencilOp(t[0], t[1], t[2]), this.current = t, this.dirty = !1); } } class ht extends et { getDefault() { return !1 } set(t) { if (t === this.current && !this.dirty) return; const e = this.gl; t ? e.enable(e.STENCIL_TEST) : e.disable(e.STENCIL_TEST), this.current = t, this.dirty = !1; } } class ut extends et { getDefault() { return [0, 1] } set(t) { const e = this.current; (t[0] !== e[0] || t[1] !== e[1] || this.dirty) && (this.gl.depthRange(t[0], t[1]), this.current = t, this.dirty = !1); } } class dt extends et { getDefault() { return !1 } set(t) { if (t === this.current && !this.dirty) return; const e = this.gl; t ? e.enable(e.DEPTH_TEST) : e.disable(e.DEPTH_TEST), this.current = t, this.dirty = !1; } } class pt extends et { getDefault() { return this.gl.LESS } set(t) { (t !== this.current || this.dirty) && (this.gl.depthFunc(t), this.current = t, this.dirty = !1); } } class mt extends et { getDefault() { return !1 } set(t) { if (t === this.current && !this.dirty) return; const e = this.gl; t ? e.enable(e.BLEND) : e.disable(e.BLEND), this.current = t, this.dirty = !1; } } class _t extends et { getDefault() { const t = this.gl; return [t.ONE, t.ZERO] } set(t) { const e = this.current; (t[0] !== e[0] || t[1] !== e[1] || this.dirty) && (this.gl.blendFunc(t[0], t[1]), this.current = t, this.dirty = !1); } } class ft extends et { getDefault() { return t.Color.transparent } set(t) { const e = this.current; (t.r !== e.r || t.g !== e.g || t.b !== e.b || t.a !== e.a || this.dirty) && (this.gl.blendColor(t.r, t.g, t.b, t.a), this.current = t, this.dirty = !1); } } class gt extends et { getDefault() { return this.gl.FUNC_ADD } set(t) { (t !== this.current || this.dirty) && (this.gl.blendEquation(t), this.current = t, this.dirty = !1); } } class vt extends et { getDefault() { return !1 } set(t) { if (t === this.current && !this.dirty) return; const e = this.gl; t ? e.enable(e.CULL_FACE) : e.disable(e.CULL_FACE), this.current = t, this.dirty = !1; } } class xt extends et { getDefault() { return this.gl.BACK } set(t) { (t !== this.current || this.dirty) && (this.gl.cullFace(t), this.current = t, this.dirty = !1); } } class yt extends et { getDefault() { return this.gl.CCW } set(t) { (t !== this.current || this.dirty) && (this.gl.frontFace(t), this.current = t, this.dirty = !1); } } class bt extends et { getDefault() { return null } set(t) { (t !== this.current || this.dirty) && (this.gl.useProgram(t), this.current = t, this.dirty = !1); } } class wt extends et { getDefault() { return this.gl.TEXTURE0 } set(t) { (t !== this.current || this.dirty) && (this.gl.activeTexture(t), this.current = t, this.dirty = !1); } } class Et extends et { getDefault() { const t = this.gl; return [0, 0, t.drawingBufferWidth, t.drawingBufferHeight] } set(t) { const e = this.current; (t[0] !== e[0] || t[1] !== e[1] || t[2] !== e[2] || t[3] !== e[3] || this.dirty) && (this.gl.viewport(t[0], t[1], t[2], t[3]), this.current = t, this.dirty = !1); } } class Tt extends et { getDefault() { return null } set(t) { if (t === this.current && !this.dirty) return; const e = this.gl; e.bindFramebuffer(e.FRAMEBUFFER, t), this.current = t, this.dirty = !1; } } class Ct extends et { getDefault() { return null } set(t) { if (t === this.current && !this.dirty) return; const e = this.gl; e.bindRenderbuffer(e.RENDERBUFFER, t), this.current = t, this.dirty = !1; } } class St extends et { getDefault() { return null } set(t) { if (t === this.current && !this.dirty) return; const e = this.gl; e.bindTexture(e.TEXTURE_2D, t), this.current = t, this.dirty = !1; } } class At extends et { getDefault() { return null } set(t) { if (t === this.current && !this.dirty) return; const e = this.gl; e.bindBuffer(e.ARRAY_BUFFER, t), this.current = t, this.dirty = !1; } } class Lt extends et { getDefault() { return null } set(t) { const e = this.gl; e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, t), this.current = t, this.dirty = !1; } } class It extends et { constructor(t) { super(t), this.vao = t.extVertexArrayObject; } getDefault() { return null } set(t) { this.vao && (t !== this.current || this.dirty) && (this.vao.bindVertexArrayOES(t), this.current = t, this.dirty = !1); } } class Mt extends et { getDefault() { return 4 } set(t) { if (t === this.current && !this.dirty) return; const e = this.gl; e.pixelStorei(e.UNPACK_ALIGNMENT, t), this.current = t, this.dirty = !1; } } class Pt extends et { getDefault() { return !1 } set(t) { if (t === this.current && !this.dirty) return; const e = this.gl; e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t), this.current = t, this.dirty = !1; } } class zt extends et { getDefault() { return !1 } set(t) { if (t === this.current && !this.dirty) return; const e = this.gl; e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, t), this.current = t, this.dirty = !1; } } class Dt extends et { constructor(t, e) { super(t), this.context = t, this.parent = e; } getDefault() { return null } } class kt extends Dt { setDirty() { this.dirty = !0; } set(t) { if (t === this.current && !this.dirty) return; this.context.bindFramebuffer.set(this.parent); const e = this.gl; e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, t, 0), this.current = t, this.dirty = !1; } } class Rt extends Dt { attachment() { return this.gl.DEPTH_ATTACHMENT } set(t) { if (t === this.current && !this.dirty) return; this.context.bindFramebuffer.set(this.parent); const e = this.gl; e.framebufferRenderbuffer(e.FRAMEBUFFER, this.attachment(), e.RENDERBUFFER, t), this.current = t, this.dirty = !1; } } class Ft extends Rt { attachment() { return this.gl.DEPTH_STENCIL_ATTACHMENT } } class Ot { constructor(t, e, i, r) { this.context = t, this.width = e, this.height = i; const o = this.framebuffer = t.gl.createFramebuffer(); this.colorAttachment = new kt(t, o), r && (this.depthAttachment = new Rt(t, o)); } destroy() { const t = this.context.gl, e = this.colorAttachment.get(); if (e && t.deleteTexture(e), this.depthAttachment) { const e = this.depthAttachment.get(); e && t.deleteRenderbuffer(e); } t.deleteFramebuffer(this.framebuffer); } } class Bt { constructor(t) { this.gl = t, this.extVertexArrayObject = this.gl.getExtension("OES_vertex_array_object"), this.clearColor = new it(this), this.clearDepth = new rt(this), this.clearStencil = new ot(this), this.colorMask = new nt(this), this.depthMask = new st(this), this.stencilMask = new at(this), this.stencilFunc = new lt(this), this.stencilOp = new ct(this), this.stencilTest = new ht(this), this.depthRange = new ut(this), this.depthTest = new dt(this), this.depthFunc = new pt(this), this.blend = new mt(this), this.blendFunc = new _t(this), this.blendColor = new ft(this), this.blendEquation = new gt(this), this.cullFace = new vt(this), this.cullFaceSide = new xt(this), this.frontFace = new yt(this), this.program = new bt(this), this.activeTexture = new wt(this), this.viewport = new Et(this), this.bindFramebuffer = new Tt(this), this.bindRenderbuffer = new Ct(this), this.bindTexture = new St(this), this.bindVertexBuffer = new At(this), this.bindElementBuffer = new Lt(this), this.bindVertexArrayOES = this.extVertexArrayObject && new It(this), this.pixelStoreUnpack = new Mt(this), this.pixelStoreUnpackPremultiplyAlpha = new Pt(this), this.pixelStoreUnpackFlipY = new zt(this), this.extTextureFilterAnisotropic = t.getExtension("EXT_texture_filter_anisotropic") || t.getExtension("MOZ_EXT_texture_filter_anisotropic") || t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"), this.extTextureFilterAnisotropic && (this.extTextureFilterAnisotropicMax = t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)), this.extTextureFilterAnisotropicForceOff = !1, this.extTextureHalfFloat = t.getExtension("OES_texture_half_float"), this.extTextureHalfFloat && (t.getExtension("OES_texture_half_float_linear"), this.extRenderToTextureHalfFloat = t.getExtension("EXT_color_buffer_half_float")), this.extTimerQuery = t.getExtension("EXT_disjoint_timer_query"), this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE); } setDefault() { this.unbindVAO(), this.clearColor.setDefault(), this.clearDepth.setDefault(), this.clearStencil.setDefault(), this.colorMask.setDefault(), this.depthMask.setDefault(), this.stencilMask.setDefault(), this.stencilFunc.setDefault(), this.stencilOp.setDefault(), this.stencilTest.setDefault(), this.depthRange.setDefault(), this.depthTest.setDefault(), this.depthFunc.setDefault(), this.blend.setDefault(), this.blendFunc.setDefault(), this.blendColor.setDefault(), this.blendEquation.setDefault(), this.cullFace.setDefault(), this.cullFaceSide.setDefault(), this.frontFace.setDefault(), this.program.setDefault(), this.activeTexture.setDefault(), this.bindFramebuffer.setDefault(), this.pixelStoreUnpack.setDefault(), this.pixelStoreUnpackPremultiplyAlpha.setDefault(), this.pixelStoreUnpackFlipY.setDefault(); } setDirty() { this.clearColor.dirty = !0, this.clearDepth.dirty = !0, this.clearStencil.dirty = !0, this.colorMask.dirty = !0, this.depthMask.dirty = !0, this.stencilMask.dirty = !0, this.stencilFunc.dirty = !0, this.stencilOp.dirty = !0, this.stencilTest.dirty = !0, this.depthRange.dirty = !0, this.depthTest.dirty = !0, this.depthFunc.dirty = !0, this.blend.dirty = !0, this.blendFunc.dirty = !0, this.blendColor.dirty = !0, this.blendEquation.dirty = !0, this.cullFace.dirty = !0, this.cullFaceSide.dirty = !0, this.frontFace.dirty = !0, this.program.dirty = !0, this.activeTexture.dirty = !0, this.viewport.dirty = !0, this.bindFramebuffer.dirty = !0, this.bindRenderbuffer.dirty = !0, this.bindTexture.dirty = !0, this.bindVertexBuffer.dirty = !0, this.bindElementBuffer.dirty = !0, this.extVertexArrayObject && (this.bindVertexArrayOES.dirty = !0), this.pixelStoreUnpack.dirty = !0, this.pixelStoreUnpackPremultiplyAlpha.dirty = !0, this.pixelStoreUnpackFlipY.dirty = !0; } createIndexBuffer(t, e) { return new J(this, t, e) } createVertexBuffer(t, e, i) { return new tt(this, t, e, i) } createRenderbuffer(t, e, i) { const r = this.gl, o = r.createRenderbuffer(); return this.bindRenderbuffer.set(o), r.renderbufferStorage(r.RENDERBUFFER, t, e, i), this.bindRenderbuffer.set(null), o } createFramebuffer(t, e, i) { return new Ot(this, t, e, i) } clear({ color: t, depth: e, stencil: i }) { const r = this.gl; let o = 0; t && (o |= r.COLOR_BUFFER_BIT, this.clearColor.set(t), this.colorMask.set([!0, !0, !0, !0])), void 0 !== e && (o |= r.DEPTH_BUFFER_BIT, this.depthRange.set([0, 1]), this.clearDepth.set(e), this.depthMask.set(!0)), void 0 !== i && (o |= r.STENCIL_BUFFER_BIT, this.clearStencil.set(i), this.stencilMask.set(255)), r.clear(o); } setCullFace(t) { !1 === t.enable ? this.cullFace.set(!1) : (this.cullFace.set(!0), this.cullFaceSide.set(t.mode), this.frontFace.set(t.frontFace)); } setDepthMode(t) { t.func !== this.gl.ALWAYS || t.mask ? (this.depthTest.set(!0), this.depthFunc.set(t.func), this.depthMask.set(t.mask), this.depthRange.set(t.range)) : this.depthTest.set(!1); } setStencilMode(t) { t.test.func !== this.gl.ALWAYS || t.mask ? (this.stencilTest.set(!0), this.stencilMask.set(t.mask), this.stencilOp.set([t.fail, t.depthFail, t.pass]), this.stencilFunc.set({ func: t.test.func, ref: t.ref, mask: t.test.mask })) : this.stencilTest.set(!1); } setColorMode(e) { d(e.blendFunction, t.ColorMode.Replace) ? this.blend.set(!1) : (this.blend.set(!0), this.blendFunc.set(e.blendFunction), this.blendColor.set(e.blendColor)), this.colorMask.set(e.mask); } unbindVAO() { this.extVertexArrayObject && this.bindVertexArrayOES.set(null); } } class Ut extends t.Evented { constructor(e, i, r, o) { super(), this.id = e, this.dispatcher = r, this.setEventedParent(o), this.type = "raster", this.minzoom = 0, this.maxzoom = 22, this.roundZoom = !0, this.scheme = "xyz", this.tileSize = 512, this.zoomOffset = 0, this._loaded = !1, this._options = t.extend({ type: "raster" }, i), t.extend(this, t.pick(i, ["url", "scheme", "tileSize", "zoomOffset", "transformBBOX"])); } load() { this._loaded = !1, this.fire(new t.Event("dataloading", { dataType: "source" })), this._tileJSONRequest = Q(this._options, this.map._requestManager, ((e, i) => { this._tileJSONRequest = null, this._loaded = !0, e ? this.fire(new t.ErrorEvent(e)) : i && (t.extend(this, i), i.bounds && (this.tileBounds = new K(i.bounds, this.minzoom, this.maxzoom)), t.postTurnstileEvent(i.tiles), this.fire(new t.Event("data", { dataType: "source", sourceDataType: "metadata" })), this.fire(new t.Event("data", { dataType: "source", sourceDataType: "content" }))); })); } loaded() { return this._loaded } onAdd(t) { this.map = t, this.load(); } onRemove() { this._tileJSONRequest && (this._tileJSONRequest.cancel(), this._tileJSONRequest = null); } serialize() { return t.extend({}, this._options) } hasTile(t) { return !this.tileBounds || this.tileBounds.contains(t.canonical) } loadTile(e, i) { const r = t.exported.devicePixelRatio >= 2, o = this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles, this.scheme, this.zoomOffset, this.transformBBOX), r, this.tileSize); e.request = t.getImage(this.map._requestManager.transformRequest(o, t.ResourceType.Tile), ((r, o, n, s) => { if (delete e.request, e.aborted) e.state = "unloaded", i(null); else if (r) e.state = "errored", i(r); else if (o) { this.map._refreshExpiredTiles && e.setExpiryData({ cacheControl: n, expires: s }); const r = this.map.painter.context, a = r.gl; e.texture = this.map.painter.getTileTexture(o.width), e.texture ? e.texture.update(o, { useMipmap: !0 }) : (e.texture = new t.Texture(r, o, a.RGBA, { useMipmap: !0 }), e.texture.bind(a.LINEAR, a.CLAMP_TO_EDGE, a.LINEAR_MIPMAP_NEAREST), r.extTextureFilterAnisotropic && a.texParameterf(a.TEXTURE_2D, r.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, r.extTextureFilterAnisotropicMax)), e.state = "loaded", t.cacheEntryPossiblyAdded(this.dispatcher), i(null); } })); } abortTile(t, e) { t.request && (t.request.cancel(), delete t.request), e(); } unloadTile(t, e) { t.texture && this.map.painter.saveTileTexture(t.texture), e(); } hasTransition() { return !1 } } let Nt; var Gt = t.createLayout([{ name: "a_pos", type: "Int16", components: 2 }, { name: "a_texture_pos", type: "Int16", components: 2 }]); class jt extends t.Evented { constructor(t, e, i, r) { super(), this.id = t, this.dispatcher = i, this.coordinates = e.coordinates, this.type = "image", this.minzoom = 0, this.maxzoom = 22, this.tileSize = 512, this.tiles = {}, this._loaded = !1, this.setEventedParent(r), this.options = e; } load(e, i) { this._loaded = !1, this.fire(new t.Event("dataloading", { dataType: "source" })), this.url = this.options.url, t.getImage(this.map._requestManager.transformRequest(this.url, t.ResourceType.Image), ((r, o) => { this._loaded = !0, r ? this.fire(new t.ErrorEvent(r)) : o && (this.image = t.exported.getImageData(o), e && (this.coordinates = e), i && i(), this._finishLoading()); })); } loaded() { return this._loaded } updateImage(t) { return this.image && t.url ? (this.options.url = t.url, this.load(t.coordinates, (() => { this.texture = null; })), this) : this } _finishLoading() { this.map && (this.setCoordinates(this.coordinates), this.fire(new t.Event("data", { dataType: "source", sourceDataType: "metadata" }))); } onAdd(t) { this.map = t, this.load(); } setCoordinates(e) { this.coordinates = e; const i = e.map(t.MercatorCoordinate.fromLngLat); this.tileID = function (e) { let i = 1 / 0, r = 1 / 0, o = -1 / 0, n = -1 / 0; for (const t of e) i = Math.min(i, t.x), r = Math.min(r, t.y), o = Math.max(o, t.x), n = Math.max(n, t.y); const s = Math.max(o - i, n - r), a = Math.max(0, Math.floor(-Math.log(s) / Math.LN2)), l = Math.pow(2, a); return new t.CanonicalTileID(a, Math.floor((i + o) / 2 * l), Math.floor((r + n) / 2 * l)) }(i), this.minzoom = this.maxzoom = this.tileID.z; const r = i.map((t => this.tileID.getTilePoint(t)._round())); return this._boundsArray = new t.StructArrayLayout4i8, this._boundsArray.emplaceBack(r[0].x, r[0].y, 0, 0), this._boundsArray.emplaceBack(r[1].x, r[1].y, t.EXTENT, 0), this._boundsArray.emplaceBack(r[3].x, r[3].y, 0, t.EXTENT), this._boundsArray.emplaceBack(r[2].x, r[2].y, t.EXTENT, t.EXTENT), this.boundsBuffer && (this.boundsBuffer.destroy(), delete this.boundsBuffer), this.fire(new t.Event("data", { dataType: "source", sourceDataType: "content" })), this } prepare() { if (0 === Object.keys(this.tiles).length || !this.image) return; const e = this.map.painter.context, i = e.gl; this.boundsBuffer || (this.boundsBuffer = e.createVertexBuffer(this._boundsArray, Gt.members)), this.boundsSegments || (this.boundsSegments = t.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture || (this.texture = new t.Texture(e, this.image, i.RGBA), this.texture.bind(i.LINEAR, i.CLAMP_TO_EDGE)); for (const t in this.tiles) { const e = this.tiles[t]; "loaded" !== e.state && (e.state = "loaded", e.texture = this.texture); } } loadTile(t, e) { this.tileID && this.tileID.equals(t.tileID.canonical) ? (this.tiles[String(t.tileID.wrap)] = t, t.buckets = {}, e(null)) : (t.state = "errored", e(null)); } serialize() { return { type: "image", url: this.options.url, coordinates: this.coordinates } } hasTransition() { return !1 } } const Ht = { vector: class extends t.Evented { constructor(e, i, r, o) { if (super(), this.id = e, this.dispatcher = r, this.type = "vector", this.minzoom = 0, this.maxzoom = 22, this.scheme = "xyz", this.tileSize = 512, this.zoomOffset = 0, this.reparseOverscaled = !0, this.isTileClipped = !0, this._loaded = !1, t.extend(this, t.pick(i, ["url", "scheme", "tileSize", "promoteId", "zoomOffset"])), this._options = t.extend({ type: "vector" }, i), this._collectResourceTiming = i.collectResourceTiming, 512 !== this.tileSize) throw new Error("vector tile sources must have a tileSize of 512"); this.setEventedParent(o), this._tileWorkers = {}, this._deduped = new t.DedupedRequest; } load() { this._loaded = !1, this.fire(new t.Event("dataloading", { dataType: "source" })), this._tileJSONRequest = Q(this._options, this.map._requestManager, ((e, i) => { this._tileJSONRequest = null, this._loaded = !0, e ? this.fire(new t.ErrorEvent(e)) : i && (t.extend(this, i), i.bounds && (this.tileBounds = new K(i.bounds, this.minzoom, this.maxzoom)), t.postTurnstileEvent(i.tiles, this.map._requestManager._customAccessToken), this.fire(new t.Event("data", { dataType: "source", sourceDataType: "metadata" })), this.fire(new t.Event("data", { dataType: "source", sourceDataType: "content" }))); })); } loaded() { return this._loaded } hasTile(t) { return !this.tileBounds || this.tileBounds.contains(t.canonical) } onAdd(t) { this.map = t, this.load(); } setSourceProperty(t) { this._tileJSONRequest && this._tileJSONRequest.cancel(), t(); const e = this.map.style._getSourceCaches(this.id); for (const t of e) t.clearTiles(); this.load(); } setTiles(t) { return this.setSourceProperty((() => { this._options.tiles = t; })), this } setUrl(t) { return this.setSourceProperty((() => { this.url = t, this._options.url = t; })), this } onRemove() { this._tileJSONRequest && (this._tileJSONRequest.cancel(), this._tileJSONRequest = null); } serialize() { return t.extend({}, this._options) } loadTile(e, i) { const r = this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles, this.scheme)), o = { request: this.map._requestManager.transformRequest(r, t.ResourceType.Tile), data: void 0, uid: e.uid, tileID: e.tileID, tileZoom: e.tileZoom, zoom: e.tileID.overscaledZ, tileSize: this.tileSize * e.tileID.overscaleFactor(), type: this.type, source: this.id, pixelRatio: t.exported.devicePixelRatio, showCollisionBoxes: this.map.showCollisionBoxes, promoteId: this.promoteId, isSymbolTile: e.isSymbolTile }; if (o.request.collectResourceTiming = this._collectResourceTiming, e.actor && "expired" !== e.state) "loading" === e.state ? e.reloadCallback = i : e.request = e.actor.send("reloadTile", o, n.bind(this)); else if (e.actor = this._tileWorkers[r] = this._tileWorkers[r] || this.dispatcher.getActor(), this.dispatcher.ready) e.request = e.actor.send("loadTile", o, n.bind(this), void 0, !0); else { const i = t.loadVectorTile.call({ deduped: this._deduped }, o, ((t, i) => { t || !i ? n.call(this, t) : (o.data = { cacheControl: i.cacheControl, expires: i.expires, rawData: i.rawData.slice(0) }, e.actor && e.actor.send("loadTile", o, n.bind(this), void 0, !0)); }), !0); e.request = { cancel: i }; } function n(r, o) { return delete e.request, e.aborted ? i(null) : r && 404 !== r.status ? i(r) : (o && o.resourceTiming && (e.resourceTiming = o.resourceTiming), this.map._refreshExpiredTiles && o && e.setExpiryData(o), e.loadVectorData(o, this.map.painter), t.cacheEntryPossiblyAdded(this.dispatcher), i(null), void (e.reloadCallback && (this.loadTile(e, e.reloadCallback), e.reloadCallback = null))) } } abortTile(t) { t.request && (t.request.cancel(), delete t.request), t.actor && t.actor.send("abortTile", { uid: t.uid, type: this.type, source: this.id }); } unloadTile(t) { t.unloadVectorData(), t.actor && t.actor.send("removeTile", { uid: t.uid, type: this.type, source: this.id }); } hasTransition() { return !1 } afterUpdate() { this._tileWorkers = {}; } }, raster: Ut, "raster-dem": class extends Ut { constructor(e, i, r, o) { super(e, i, r, o), this.type = "raster-dem", this.maxzoom = 22, this._options = t.extend({ type: "raster-dem" }, i), this.encoding = i.encoding || "mapbox"; } loadTile(e, i) { const r = this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles, this.scheme, this.zoomOffset), !1, this.tileSize); function o(t, r) { t && (e.state = "errored", i(t)), r && (e.dem = r, e.dem.onDeserialize(), e.needsHillshadePrepare = !0, e.needsDEMTextureUpload = !0, e.state = "loaded", i(null)); } e.request = t.getImage(this.map._requestManager.transformRequest(r, t.ResourceType.Tile), function (r, n, s, a) { if (delete e.request, e.aborted) e.state = "unloaded", i(null); else if (r) e.state = "errored", i(r); else if (n) { this.map._refreshExpiredTiles && e.setExpiryData({ cacheControl: s, expires: a }); const i = t.window.ImageBitmap && n instanceof t.window.ImageBitmap && (null == Nt && (Nt = t.window.OffscreenCanvas && new t.window.OffscreenCanvas(1, 1).getContext("2d") && "function" == typeof t.window.createImageBitmap), Nt), r = 1 - (n.width - t.prevPowerOfTwo(n.width)) / 2; r < 1 || e.neighboringTiles || (e.neighboringTiles = this._getNeighboringTiles(e.tileID)); const l = i ? n : t.exported.getImageData(n, r), c = { uid: e.uid, coord: e.tileID, source: this.id, rawImageData: l, encoding: this.encoding, padding: r }; e.actor && "expired" !== e.state || (e.actor = this.dispatcher.getActor(), e.actor.send("loadDEMTile", c, o.bind(this), void 0, !0)); } }.bind(this)); } _getNeighboringTiles(e) { const i = e.canonical, r = Math.pow(2, i.z), o = (i.x - 1 + r) % r, n = 0 === i.x ? e.wrap - 1 : e.wrap, s = (i.x + 1 + r) % r, a = i.x + 1 === r ? e.wrap + 1 : e.wrap, l = {}; return l[new t.OverscaledTileID(e.overscaledZ, n, i.z, o, i.y).key] = { backfilled: !1 }, l[new t.OverscaledTileID(e.overscaledZ, a, i.z, s, i.y).key] = { backfilled: !1 }, i.y > 0 && (l[new t.OverscaledTileID(e.overscaledZ, n, i.z, o, i.y - 1).key] = { backfilled: !1 }, l[new t.OverscaledTileID(e.overscaledZ, e.wrap, i.z, i.x, i.y - 1).key] = { backfilled: !1 }, l[new t.OverscaledTileID(e.overscaledZ, a, i.z, s, i.y - 1).key] = { backfilled: !1 }), i.y + 1 < r && (l[new t.OverscaledTileID(e.overscaledZ, n, i.z, o, i.y + 1).key] = { backfilled: !1 }, l[new t.OverscaledTileID(e.overscaledZ, e.wrap, i.z, i.x, i.y + 1).key] = { backfilled: !1 }, l[new t.OverscaledTileID(e.overscaledZ, a, i.z, s, i.y + 1).key] = { backfilled: !1 }), l } unloadTile(t) { t.demTexture && this.map.painter.saveTileTexture(t.demTexture), t.fbo && (t.fbo.destroy(), delete t.fbo), t.dem && delete t.dem, delete t.neighboringTiles, t.state = "unloaded"; } }, geojson: class extends t.Evented { constructor(e, i, r, o) { super(), this.id = e, this.type = "geojson", this.minzoom = 0, this.maxzoom = 18, this.tileSize = 512, this.isTileClipped = !0, this.reparseOverscaled = !0, this._loaded = !1, this.actor = r.getActor(), this.setEventedParent(o), this._data = i.data, this._options = t.extend({}, i), this._collectResourceTiming = i.collectResourceTiming, void 0 !== i.maxzoom && (this.maxzoom = i.maxzoom), i.type && (this.type = i.type), i.attribution && (this.attribution = i.attribution), this.promoteId = i.promoteId; const n = t.EXTENT / this.tileSize; this.workerOptions = t.extend({ source: this.id, cluster: i.cluster || !1, geojsonVtOptions: { buffer: (void 0 !== i.buffer ? i.buffer : 128) * n, tolerance: (void 0 !== i.tolerance ? i.tolerance : .375) * n, extent: t.EXTENT, maxZoom: this.maxzoom, lineMetrics: i.lineMetrics || !1, generateId: i.generateId || !1 }, superclusterOptions: { maxZoom: void 0 !== i.clusterMaxZoom ? i.clusterMaxZoom : this.maxzoom - 1, minPoints: Math.max(2, i.clusterMinPoints || 2), extent: t.EXTENT, radius: (void 0 !== i.clusterRadius ? i.clusterRadius : 50) * n, log: !1, generateId: i.generateId || !1 }, clusterProperties: i.clusterProperties, filter: i.filter }, i.workerOptions); } onAdd(t) { this.map = t, this.setData(this._data); } setData(t) { return this._data = t, this._updateWorkerData(), this } getClusterExpansionZoom(t, e) { return this.actor.send("geojson.getClusterExpansionZoom", { clusterId: t, source: this.id }, e), this } getClusterChildren(t, e) { return this.actor.send("geojson.getClusterChildren", { clusterId: t, source: this.id }, e), this } getClusterLeaves(t, e, i, r) { return this.actor.send("geojson.getClusterLeaves", { source: this.id, clusterId: t, limit: e, offset: i }, r), this } _updateWorkerData() { if (this._pendingLoad) return void (this._coalesce = !0); this.fire(new t.Event("dataloading", { dataType: "source" })), this._loaded = !1; const e = t.extend({}, this.workerOptions), i = this._data; "string" == typeof i ? (e.request = this.map._requestManager.transformRequest(t.exported.resolveURL(i), t.ResourceType.Source), e.request.collectResourceTiming = this._collectResourceTiming) : e.data = JSON.stringify(i); const r = this.map.getCRS().CODE; this.workerOptions.geojsonVtOptions.mapCRS = r, this.workerOptions.superclusterOptions && (this.workerOptions.superclusterOptions.mapCRS = r), this._pendingLoad = this.actor.send(`${this.type}.loadData`, e, ((e, i) => { if (this._loaded = !0, this._pendingLoad = null, e) this.fire(new t.ErrorEvent(e)); else { const e = { dataType: "source", sourceDataType: this._metadataFired ? "content" : "metadata" }; this._collectResourceTiming && i && i.resourceTiming && i.resourceTiming[this.id] && (e.resourceTiming = i.resourceTiming[this.id]), this.fire(new t.Event("data", e)), this._metadataFired = !0; } this._coalesce && (this._updateWorkerData(), this._coalesce = !1); })); } loaded() { return this._loaded } loadTile(e, i) { const r = e.actor ? "reloadTile" : "loadTile"; e.actor = this.actor, e.request = this.actor.send(r, { type: this.type, uid: e.uid, tileID: e.tileID, tileZoom: e.tileZoom, zoom: e.tileID.overscaledZ, maxZoom: this.maxzoom, tileSize: this.tileSize, source: this.id, pixelRatio: t.exported.devicePixelRatio, showCollisionBoxes: this.map.showCollisionBoxes, promoteId: this.promoteId }, ((t, o) => (delete e.request, e.unloadVectorData(), e.aborted ? i(null) : t ? i(t) : (e.loadVectorData(o, this.map.painter, "reloadTile" === r), i(null)))), void 0, "loadTile" === r); } abortTile(t) { t.request && (t.request.cancel(), delete t.request), t.aborted = !0; } unloadTile(t) { t.unloadVectorData(), this.actor.send("removeTile", { uid: t.uid, type: this.type, source: this.id }); } onRemove() { this._pendingLoad && this._pendingLoad.cancel(); } serialize() { return t.extend({}, this._options, { type: this.type, data: this._data }) } hasTransition() { return !1 } }, video: class extends jt { constructor(t, e, i, r) { super(t, e, i, r), this.roundZoom = !0, this.type = "video", this.options = e; } load() { this._loaded = !1; const e = this.options; this.urls = []; for (const i of e.urls) this.urls.push(this.map._requestManager.transformRequest(i, t.ResourceType.Source).url); t.getVideo(this.urls, ((e, i) => { this._loaded = !0, e ? this.fire(new t.ErrorEvent(e)) : i && (this.video = i, this.video.loop = !0, this.video.addEventListener("playing", (() => { this.map.triggerRepaint(); })), this.map && this.video.play(), this._finishLoading()); })); } pause() { this.video && this.video.pause(); } play() { this.video && this.video.play(); } seek(e) { if (this.video) { const i = this.video.seekable; e < i.start(0) || e > i.end(0) ? this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${this.id}`, null, `Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))) : this.video.currentTime = e; } } getVideo() { return this.video } onAdd(t) { this.map || (this.map = t, this.load(), this.video && (this.video.play(), this.setCoordinates(this.coordinates))); } prepare() { if (0 === Object.keys(this.tiles).length || this.video.readyState < 2) return; const e = this.map.painter.context, i = e.gl; this.boundsBuffer || (this.boundsBuffer = e.createVertexBuffer(this._boundsArray, Gt.members)), this.boundsSegments || (this.boundsSegments = t.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture ? this.video.paused || (this.texture.bind(i.LINEAR, i.CLAMP_TO_EDGE), i.texSubImage2D(i.TEXTURE_2D, 0, 0, 0, i.RGBA, i.UNSIGNED_BYTE, this.video)) : (this.texture = new t.Texture(e, this.video, i.RGBA), this.texture.bind(i.LINEAR, i.CLAMP_TO_EDGE)); for (const t in this.tiles) { const e = this.tiles[t]; "loaded" !== e.state && (e.state = "loaded", e.texture = this.texture); } } serialize() { return { type: "video", urls: this.urls, coordinates: this.coordinates } } hasTransition() { return this.video && !this.video.paused } }, image: jt, canvas: class extends jt { constructor(e, i, r, o) { super(e, i, r, o), i.coordinates ? Array.isArray(i.coordinates) && 4 === i.coordinates.length && !i.coordinates.some((t => !Array.isArray(t) || 2 !== t.length || t.some((t => "number" != typeof t)))) || this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`, null, '"coordinates" property must be an array of 4 longitude/latitude array pairs'))) : this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`, null, 'missing required property "coordinates"'))), i.animate && "boolean" != typeof i.animate && this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`, null, 'optional "animate" property must be a boolean value'))), i.canvas ? "string" == typeof i.canvas || i.canvas instanceof t.window.HTMLCanvasElement || this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`, null, '"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))) : this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`, null, 'missing required property "canvas"'))), this.options = i, this.animate = void 0 === i.animate || i.animate; } load() { this._loaded = !0, this.canvas || (this.canvas = this.options.canvas instanceof t.window.HTMLCanvasElement ? this.options.canvas : t.window.document.getElementById(this.options.canvas)), this.width = this.canvas.width, this.height = this.canvas.height, this._hasInvalidDimensions() ? this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))) : (this.play = function () { this._playing = !0, this.map.triggerRepaint(); }, this.pause = function () { this._playing && (this.prepare(), this._playing = !1); }, this._finishLoading()); } getCanvas() { return this.canvas } onAdd(t) { this.map = t, this.load(), this.canvas && this.animate && this.play(); } onRemove() { this.pause(); } prepare() { let e = !1; if (this.canvas.width !== this.width && (this.width = this.canvas.width, e = !0), this.canvas.height !== this.height && (this.height = this.canvas.height, e = !0), this._hasInvalidDimensions()) return; if (0 === Object.keys(this.tiles).length) return; const i = this.map.painter.context, r = i.gl; this.boundsBuffer || (this.boundsBuffer = i.createVertexBuffer(this._boundsArray, Gt.members)), this.boundsSegments || (this.boundsSegments = t.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture ? (e || this._playing) && this.texture.update(this.canvas, { premultiply: !0 }) : this.texture = new t.Texture(i, this.canvas, r.RGBA, { premultiply: !0 }); for (const t in this.tiles) { const e = this.tiles[t]; "loaded" !== e.state && (e.state = "loaded", e.texture = this.texture); } } serialize() { return { type: "canvas", coordinates: this.coordinates } } hasTransition() { return this._playing } _hasInvalidDimensions() { for (const t of [this.canvas.width, this.canvas.height]) if (isNaN(t) || t <= 0) return !0; return !1 } } }, Vt = function (e, i, r, o) { const n = new Ht[i.type](e, i, r, o); if (n.id !== e) throw new Error(`Expected Source id to be ${e} instead of ${n.id}`); return t.bindAll(["load", "abort", "unload", "serialize", "prepare"], n), n }; function Wt(e, i) { const r = t.identity([]); return t.scale(r, r, [.5 * e.width, .5 * -e.height, 1]), t.translate(r, r, [1, -1, 0]), t.multiply(r, r, e.calculateProjMatrix(i.toUnwrapped())) } function Zt(t, e, i, r, o, n, s, a = !1) { const l = t.tilesIn(r, s, a); l.sort(qt); const c = []; for (const r of l) c.push({ wrappedTileID: r.tile.tileID.wrapped().key, queryResults: r.tile.queryRenderedFeatures(e, i, t._state, r, o, n, Wt(t.transform, r.tile.tileID), a) }); const h = function (t) { const e = {}, i = {}; for (const r of t) { const t = r.queryResults, o = r.wrappedTileID, n = i[o] = i[o] || {}; for (const i in t) { const r = t[i], o = n[i] = n[i] || {}, s = e[i] = e[i] || []; for (const t of r) o[t.featureIndex] || (o[t.featureIndex] = !0, s.push(t)); } } return e }(c); for (const e in h) h[e].forEach((e => { const i = e.feature, r = t.getFeatureState(i.layer["source-layer"], i.id); i.source = i.layer.source, i.layer["source-layer"] && (i.sourceLayer = i.layer["source-layer"]), i.state = r; })); return h } function Yt(t, e) { const i = t.getRenderableIds().map((e => t.getTileByID(e))), r = [], o = {}; for (let t = 0; t < i.length; t++) { const n = i[t], s = n.tileID.canonical.key; o[s] || (o[s] = !0, n.querySourceFeatures(r, e)); } return r } function qt(t, e) { const i = t.tileID, r = e.tileID; return i.overscaledZ - r.overscaledZ || i.canonical.y - r.canonical.y || i.wrap - r.wrap || i.canonical.x - r.canonical.x } function Xt() { return null != ea.workerClass ? new ea.workerClass : new t.window.Worker(ea.workerUrl) } const Qt = "mapboxgl_preloaded_worker_pool"; class Kt { constructor() { this.active = {}; } acquire(t) { if (!this.workers) for (this.workers = []; this.workers.length < Kt.workerCount;)this.workers.push(new Xt); return this.active[t] = !0, this.workers.slice() } release(t) { delete this.active[t], 0 === this.numActive() && (this.workers.forEach((t => { t.terminate(); })), this.workers = null); } isPreloaded() { return !!this.active[Qt] } numActive() { return Object.keys(this.active).length } } const Jt = Math.floor(t.exported.hardwareConcurrency / 2); let $t; function te() { return $t || ($t = new Kt), $t } function ee(e, i) { const r = {}; for (const t in e) "ref" !== t && (r[t] = e[t]); return t.refProperties.forEach((t => { t in i && (r[t] = i[t]); })), r } function ie(t) { t = t.slice(); const e = Object.create(null); for (let i = 0; i < t.length; i++)e[t[i].id] = t[i]; for (let i = 0; i < t.length; i++)"ref" in t[i] && (t[i] = ee(t[i], e[t[i].ref])); return t } Kt.workerCount = Math.max(Math.min(Jt, 6), 1); const re = { setStyle: "setStyle", addLayer: "addLayer", removeLayer: "removeLayer", setPaintProperty: "setPaintProperty", setLayoutProperty: "setLayoutProperty", setFilter: "setFilter", addSource: "addSource", removeSource: "removeSource", setGeoJSONSourceData: "setGeoJSONSourceData", setLayerZoomRange: "setLayerZoomRange", setLayerProperty: "setLayerProperty", setCenter: "setCenter", setZoom: "setZoom", setBearing: "setBearing", setPitch: "setPitch", setSprite: "setSprite", setGlyphs: "setGlyphs", setTransition: "setTransition", setLight: "setLight", setTerrain: "setTerrain", setFog: "setFog" }; function oe(t, e, i) { i.push({ command: re.addSource, args: [t, e[t]] }); } function ne(t, e, i) { e.push({ command: re.removeSource, args: [t] }), i[t] = !0; } function se(t, e, i, r) { ne(t, i, r), oe(t, e, i); } function ae(t, e, i) { let r; for (r in t[i]) if (t[i].hasOwnProperty(r) && "data" !== r && !d(t[i][r], e[i][r])) return !1; for (r in e[i]) if (e[i].hasOwnProperty(r) && "data" !== r && !d(t[i][r], e[i][r])) return !1; return !0 } function le(t, e, i, r, o, n) { let s; for (s in e = e || {}, t = t || {}) t.hasOwnProperty(s) && (d(t[s], e[s]) || i.push({ command: n, args: [r, s, e[s], o] })); for (s in e) e.hasOwnProperty(s) && !t.hasOwnProperty(s) && (d(t[s], e[s]) || i.push({ command: n, args: [r, s, e[s], o] })); } function ce(t) { return t.id } function he(t, e) { return t[e.id] = e, t } class ue { constructor(t, e) { this.reset(t, e); } reset(t, e) { this.points = t || [], this._distances = [0]; for (let t = 1; t < this.points.length; t++)this._distances[t] = this._distances[t - 1] + this.points[t].dist(this.points[t - 1]); this.length = this._distances[this._distances.length - 1], this.padding = Math.min(e || 0, .5 * this.length), this.paddedLength = this.length - 2 * this.padding; } lerp(e) { if (1 === this.points.length) return this.points[0]; e = t.clamp(e, 0, 1); let i = 1, r = this._distances[i]; const o = e * this.paddedLength + this.padding; for (; r < o && i < this._distances.length;)r = this._distances[++i]; const n = i - 1, s = this._distances[n], a = r - s, l = a > 0 ? (o - s) / a : 0; return this.points[n].mult(1 - l).add(this.points[i].mult(l)) } } class de { constructor(t, e, i) { const r = this.boxCells = [], o = this.circleCells = []; this.xCellCount = Math.ceil(t / i), this.yCellCount = Math.ceil(e / i); for (let t = 0; t < this.xCellCount * this.yCellCount; t++)r.push([]), o.push([]); this.circleKeys = [], this.boxKeys = [], this.bboxes = [], this.circles = [], this.width = t, this.height = e, this.xScale = this.xCellCount / t, this.yScale = this.yCellCount / e, this.boxUid = 0, this.circleUid = 0; } keysLength() { return this.boxKeys.length + this.circleKeys.length } insert(t, e, i, r, o) { this._forEachCell(e, i, r, o, this._insertBoxCell, this.boxUid++), this.boxKeys.push(t), this.bboxes.push(e), this.bboxes.push(i), this.bboxes.push(r), this.bboxes.push(o); } insertCircle(t, e, i, r) { this._forEachCell(e - r, i - r, e + r, i + r, this._insertCircleCell, this.circleUid++), this.circleKeys.push(t), this.circles.push(e), this.circles.push(i), this.circles.push(r); } _insertBoxCell(t, e, i, r, o, n) { this.boxCells[o].push(n); } _insertCircleCell(t, e, i, r, o, n) { this.circleCells[o].push(n); } _query(t, e, i, r, o, n) { if (i < 0 || t > this.width || r < 0 || e > this.height) return !o && []; const s = []; if (t <= 0 && e <= 0 && this.width <= i && this.height <= r) { if (o) return !0; for (let t = 0; t < this.boxKeys.length; t++)s.push({ key: this.boxKeys[t], x1: this.bboxes[4 * t], y1: this.bboxes[4 * t + 1], x2: this.bboxes[4 * t + 2], y2: this.bboxes[4 * t + 3] }); for (let t = 0; t < this.circleKeys.length; t++) { const e = this.circles[3 * t], i = this.circles[3 * t + 1], r = this.circles[3 * t + 2]; s.push({ key: this.circleKeys[t], x1: e - r, y1: i - r, x2: e + r, y2: i + r }); } return n ? s.filter(n) : s } return this._forEachCell(t, e, i, r, this._queryCell, s, { hitTest: o, seenUids: { box: {}, circle: {} } }, n), o ? s.length > 0 : s } _queryCircle(t, e, i, r, o) { const n = t - i, s = t + i, a = e - i, l = e + i; if (s < 0 || n > this.width || l < 0 || a > this.height) return !r && []; const c = []; return this._forEachCell(n, a, s, l, this._queryCellCircle, c, { hitTest: r, circle: { x: t, y: e, radius: i }, seenUids: { box: {}, circle: {} } }, o), r ? c.length > 0 : c } query(t, e, i, r, o) { return this._query(t, e, i, r, !1, o) } hitTest(t, e, i, r, o) { return this._query(t, e, i, r, !0, o) } hitTestCircle(t, e, i, r) { return this._queryCircle(t, e, i, !0, r) } _queryCell(t, e, i, r, o, n, s, a) { const l = s.seenUids, c = this.boxCells[o]; if (null !== c) { const o = this.bboxes; for (const h of c) if (!l.box[h]) { l.box[h] = !0; const c = 4 * h; if (t <= o[c + 2] && e <= o[c + 3] && i >= o[c + 0] && r >= o[c + 1] && (!a || a(this.boxKeys[h]))) { if (s.hitTest) return n.push(!0), !0; n.push({ key: this.boxKeys[h], x1: o[c], y1: o[c + 1], x2: o[c + 2], y2: o[c + 3] }); } } } const h = this.circleCells[o]; if (null !== h) { const o = this.circles; for (const c of h) if (!l.circle[c]) { l.circle[c] = !0; const h = 3 * c; if (this._circleAndRectCollide(o[h], o[h + 1], o[h + 2], t, e, i, r) && (!a || a(this.circleKeys[c]))) { if (s.hitTest) return n.push(!0), !0; { const t = o[h], e = o[h + 1], i = o[h + 2]; n.push({ key: this.circleKeys[c], x1: t - i, y1: e - i, x2: t + i, y2: e + i }); } } } } } _queryCellCircle(t, e, i, r, o, n, s, a) { const l = s.circle, c = s.seenUids, h = this.boxCells[o]; if (null !== h) { const t = this.bboxes; for (const e of h) if (!c.box[e]) { c.box[e] = !0; const i = 4 * e; if (this._circleAndRectCollide(l.x, l.y, l.radius, t[i + 0], t[i + 1], t[i + 2], t[i + 3]) && (!a || a(this.boxKeys[e]))) return n.push(!0), !0 } } const u = this.circleCells[o]; if (null !== u) { const t = this.circles; for (const e of u) if (!c.circle[e]) { c.circle[e] = !0; const i = 3 * e; if (this._circlesCollide(t[i], t[i + 1], t[i + 2], l.x, l.y, l.radius) && (!a || a(this.circleKeys[e]))) return n.push(!0), !0 } } } _forEachCell(t, e, i, r, o, n, s, a) { const l = this._convertToXCellCoord(t), c = this._convertToYCellCoord(e), h = this._convertToXCellCoord(i), u = this._convertToYCellCoord(r); for (let d = l; d <= h; d++)for (let l = c; l <= u; l++)if (o.call(this, t, e, i, r, this.xCellCount * l + d, n, s, a)) return } _convertToXCellCoord(t) { return Math.max(0, Math.min(this.xCellCount - 1, Math.floor(t * this.xScale))) } _convertToYCellCoord(t) { return Math.max(0, Math.min(this.yCellCount - 1, Math.floor(t * this.yScale))) } _circlesCollide(t, e, i, r, o, n) { const s = r - t, a = o - e, l = i + n; return l * l > s * s + a * a } _circleAndRectCollide(t, e, i, r, o, n, s) { const a = (n - r) / 2, l = Math.abs(t - (r + a)); if (l > a + i) return !1; const c = (s - o) / 2, h = Math.abs(e - (o + c)); if (h > c + i) return !1; if (l <= a || h <= c) return !0; const u = l - a, d = h - c; return u * u + d * d <= i * i } } const pe = Math.tan(85 * Math.PI / 180); function me(e, i, r, o, n) { const s = t.create(); return i ? (t.scale(s, s, [1 / n, 1 / n, 1]), r || t.rotateZ(s, s, o.angle)) : t.multiply(s, o.labelPlaneMatrix, e), s } function _e(e, i, r, o, n) { if (i) { const i = t.clone(e); return t.scale(i, i, [n, n, 1]), r || t.rotateZ(i, i, -o.angle), i } return o.glCoordMatrix } function fe(e, i, r = 0) { const o = [e.x, e.y, r, 1]; r ? t.transformMat4$1(o, o, i) : Ae(o, o, i); const n = o[3]; return { point: new t.pointGeometry(o[0] / n, o[1] / n), signedDistanceFromCamera: n } } function ge(t, e) { return Math.min(.5 + t / e * .5, 1.5) } function ve(t, e) { const i = t[0] / t[3], r = t[1] / t[3]; return i >= -e[0] && i <= e[0] && r >= -e[1] && r <= e[1] } function xe(e, i, r, o, n, s, a, l, c) { const h = o ? e.textSizeData : e.iconSizeData, u = t.evaluateSizeForZoom(h, r.transform.zoom), d = [256 / r.width * 2 + 1, 256 / r.height * 2 + 1], p = o ? e.text.dynamicLayoutVertexArray : e.icon.dynamicLayoutVertexArray; p.clear(); const m = e.lineVertexArray, _ = o ? e.text.placedSymbolArray : e.icon.placedSymbolArray, f = r.transform.width / r.transform.height; let g = !1; for (let o = 0; o < _.length; o++) { const v = _.get(o); if (v.hidden || v.writingMode === t.WritingMode.vertical && !g) { Se(v.numGlyphs, p); continue } g = !1; const x = c ? c({ x: v.anchorX, y: v.anchorY }) : 0, y = [v.anchorX, v.anchorY, x, 1]; if (t.transformMat4$1(y, y, i), !ve(y, d)) { Se(v.numGlyphs, p); continue } const b = ge(r.transform.cameraToCenterDistance, y[3]), w = t.evaluateSizeForFeature(h, u, v), E = a ? w / b : w * b, T = new t.pointGeometry(v.anchorX, v.anchorY), C = fe(T, n, x); if (C.signedDistanceFromCamera <= 0) { Se(v.numGlyphs, p); continue } const S = C.point; let A = {}; const L = a ? null : c, I = we(v, E, !1, l, i, n, s, e.glyphOffsetArray, m, p, S, T, A, f, L); g = I.useVertical, L && I.needsFlipping && (A = {}), (I.notEnoughRoom || g || I.needsFlipping && we(v, E, !0, l, i, n, s, e.glyphOffsetArray, m, p, S, T, A, f, L).notEnoughRoom) && Se(v.numGlyphs, p); } o ? e.text.dynamicLayoutVertexBuffer.updateData(p) : e.icon.dynamicLayoutVertexBuffer.updateData(p); } function ye(t, e, i, r, o, n, s, a, l, c, h, u, d) { const p = a.glyphStartIndex + a.numGlyphs, m = a.lineStartIndex, _ = a.lineStartIndex + a.lineLength, f = e.getoffsetX(a.glyphStartIndex), g = e.getoffsetX(p - 1), v = Te(t * f, i, r, o, n, s, a.segment, m, _, l, c, h, u, d, !0); if (!v) return null; const x = Te(t * g, i, r, o, n, s, a.segment, m, _, l, c, h, u, d, !0); return x ? { first: v, last: x } : null } function be(e, i, r, o) { return e.writingMode === t.WritingMode.horizontal && Math.abs(r.y - i.y) > Math.abs(r.x - i.x) * o ? { useVertical: !0 } : e.writingMode === t.WritingMode.vertical ? i.y < r.y ? { needsFlipping: !0 } : null : 0 !== e.flipState && function (t, e, i) { const r = (e.x - t.x) * i; return 0 === r || Math.abs((e.y - t.y) / r) > pe }(i, r, o) ? 1 === e.flipState ? { needsFlipping: !0 } : null : i.x > r.x ? { needsFlipping: !0 } : null } function we(e, i, r, o, n, s, a, l, c, h, u, d, p, m, _) { const f = i / 24, g = e.lineOffsetX * f, v = e.lineOffsetY * f; let x; if (e.numGlyphs > 1) { const t = e.glyphStartIndex + e.numGlyphs, i = e.lineStartIndex, n = e.lineStartIndex + e.lineLength, h = ye(f, l, g, v, r, u, d, e, c, s, p, _); if (!h) return { notEnoughRoom: !0 }; const y = fe(h.first.point, a).point, b = fe(h.last.point, a).point; if (o && !r) { const t = be(e, y, b, m); if (e.flipState = t && t.needsFlipping ? 1 : 2, t) return t } x = [h.first]; for (let o = e.glyphStartIndex + 1; o < t - 1; o++)x.push(Te(f * l.getoffsetX(o), g, v, r, u, d, e.segment, i, n, c, s, p, _)); x.push(h.last); } else { if (o && !r) { const i = fe(d, n).point, r = e.lineStartIndex + e.segment + 1, o = new t.pointGeometry(c.getx(r), c.gety(r)), s = fe(o, n), a = be(e, i, s.signedDistanceFromCamera > 0 ? s.point : Ee(d, o, i, 1, n), m); if (e.flipState = a && a.needsFlipping ? 1 : 2, a) return a } const i = Te(f * l.getoffsetX(e.glyphStartIndex), g, v, r, u, d, e.segment, e.lineStartIndex, e.lineStartIndex + e.lineLength, c, s, p, _); if (!i) return { notEnoughRoom: !0 }; x = [i]; } for (const e of x) t.addDynamicAttributes(h, e.point, e.angle); return {} } function Ee(t, e, i, r, o, n) { const s = t.add(t.sub(e)._unit()), a = fe(s, o, n ? n(s) : 0).point, l = i.sub(a); return i.add(l._mult(r / l.mag())) } function Te(e, i, r, o, n, s, a, l, c, h, u, d, p, m, _) { const f = o ? e - i : e + i; let g = f > 0 ? 1 : -1, v = 0; o && (g *= -1, v = Math.PI), g < 0 && (v += Math.PI); let x = g > 0 ? l + a : l + a + 1, y = n, b = n, w = 0, E = 0; const T = Math.abs(f), C = [], S = []; let A = s; const L = () => { const e = x - g; return 0 === w ? s : new t.pointGeometry(h.getx(e), h.gety(e)) }, I = () => Ee(L(), A, b, T - w + 1, u, p); for (; w + E <= T;) { if (x += g, x < l || x >= c) return null; if (b = y, C.push(y), m && S.push(A || L()), y = d[x], void 0 === y) { A = new t.pointGeometry(h.getx(x), h.gety(x)); const e = fe(A, u, p ? p(A) : 0); y = e.signedDistanceFromCamera > 0 ? d[x] = e.point : I(); } else A = null; w += E, E = b.dist(y); } _ && p && (A = A || new t.pointGeometry(h.getx(x), h.gety(x)), d[x] = y = void 0 === d[x] ? y : I(), E = b.dist(y)); const M = (T - w) / E, P = y.sub(b), z = P.mult(M)._add(b); r && z._add(P._unit()._perp()._mult(r * g)); const D = v + Math.atan2(y.y - b.y, y.x - b.x); return C.push(z), m && (A = A || new t.pointGeometry(h.getx(x), h.gety(x)), S.push(function (e, i, r) { const o = 1 - r; return new t.pointGeometry(e.x * o + i.x * r, e.y * o + i.y * r) }(S.length > 0 ? S[S.length - 1] : A, A, M))), { point: z, angle: D, path: C, tilePath: S } } const Ce = new Float32Array([-1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0]); function Se(t, e) { for (let i = 0; i < t; i++) { const t = e.length; e.resize(t + 4), e.float32.set(Ce, 3 * t); } } function Ae(t, e, i) { const r = e[0], o = e[1]; return t[0] = i[0] * r + i[4] * o + i[12], t[1] = i[1] * r + i[5] * o + i[13], t[3] = i[3] * r + i[7] * o + i[15], t } const Le = 100; class Ie { constructor(t, e, i = new de(t.width + 200, t.height + 200, 25), r = new de(t.width + 200, t.height + 200, 25)) { this.transform = t, this.grid = i, this.ignoredGrid = r, this.pitchfactor = Math.cos(t._pitch) * t.cameraToCenterDistance, this.screenRightBoundary = t.width + Le, this.screenBottomBoundary = t.height + Le, this.gridRightBoundary = t.width + 200, this.gridBottomBoundary = t.height + 200, this.fogState = e; } placeCollisionBox(t, e, i, r, o, n, s) { const a = this.projectAndGetPerspectiveRatio(n, e.anchorPointX, e.anchorPointY, e.elevation, e.tileID), l = o * a.perspectiveRatio, c = (e.x1 * t + i.x - e.padding) * l + a.point.x, h = (e.y1 * t + i.y - e.padding) * l + a.point.y, u = (e.x2 * t + i.x + e.padding) * l + a.point.x, d = (e.y2 * t + i.y + e.padding) * l + a.point.y, p = a.perspectiveRatio <= .55 || a.aboveHorizon; return !this.isInsideGrid(c, h, u, d) || !r && this.grid.hitTest(c, h, u, d, s) || p ? { box: [], offscreen: !1 } : { box: [c, h, u, d], offscreen: this.isOffscreen(c, h, u, d) } } placeCollisionCircles(e, i, r, o, n, s, a, l, c, h, u, d, p, m) { const _ = [], f = this.transform.elevation, g = f ? t => f.getAtTileOffset(m, t.x, t.y) : t => 0, v = new t.pointGeometry(i.anchorX, i.anchorY), x = g(v), y = this.projectAndGetPerspectiveRatio(s, v.x, v.y, x, m), { perspectiveRatio: b } = y, w = (h ? n / b : n * b) / t.ONE_EM, E = fe(v, a, x).point, T = y.signedDistanceFromCamera > 0 ? ye(w, o, i.lineOffsetX * w, i.lineOffsetY * w, !1, E, v, i, r, a, {}, f && !h ? g : null, h && !!f) : null; let C = !1, S = !1, A = !0; if (T && !y.aboveHorizon) { const i = .5 * d * b + p, r = new t.pointGeometry(-100, -100), o = new t.pointGeometry(this.screenRightBoundary, this.screenBottomBoundary), n = new ue, s = T.first, a = T.last; let h = []; for (let t = s.path.length - 1; t >= 1; t--)h.push(s.path[t]); for (let t = 1; t < a.path.length; t++)h.push(a.path[t]); const m = 2.5 * i; if (l) { const t = h.map(f ? (t, e) => { const i = g(e < s.path.length - 1 ? s.tilePath[s.path.length - 1 - e] : a.tilePath[e - s.path.length + 2]); return fe(t, l, i) } : t => fe(t, l)); h = t.some((t => t.signedDistanceFromCamera <= 0)) ? [] : t.map((t => t.point)); } let v = []; if (h.length > 0) { const e = h[0].clone(), i = h[0].clone(); for (let t = 1; t < h.length; t++)e.x = Math.min(e.x, h[t].x), e.y = Math.min(e.y, h[t].y), i.x = Math.max(i.x, h[t].x), i.y = Math.max(i.y, h[t].y); v = e.x >= r.x && i.x <= o.x && e.y >= r.y && i.y <= o.y ? [h] : i.x < r.x || e.x > o.x || i.y < r.y || e.y > o.y ? [] : t.clipLine([h], r.x, r.y, o.x, o.y); } for (const t of v) { n.reset(t, .25 * i); let r = 0; r = n.length <= .5 * i ? 1 : Math.ceil(n.paddedLength / m) + 1; for (let t = 0; t < r; t++) { const o = t / Math.max(r - 1, 1), s = n.lerp(o), a = s.x + Le, l = s.y + Le; _.push(a, l, i, 0); const h = a - i, d = l - i, p = a + i, m = l + i; if (A = A && this.isOffscreen(h, d, p, m), S = S || this.isInsideGrid(h, d, p, m), !e && this.grid.hitTestCircle(a, l, i, u) && (C = !0, !c)) return { circles: [], offscreen: !1, collisionDetected: C } } } } return { circles: !c && C || !S ? [] : _, offscreen: A, collisionDetected: C } } queryRenderedSymbols(e) { if (0 === e.length || 0 === this.grid.keysLength() && 0 === this.ignoredGrid.keysLength()) return {}; const i = []; let r = 1 / 0, o = 1 / 0, n = -1 / 0, s = -1 / 0; for (const a of e) { const e = new t.pointGeometry(a.x + Le, a.y + Le); r = Math.min(r, e.x), o = Math.min(o, e.y), n = Math.max(n, e.x), s = Math.max(s, e.y), i.push(e); } const a = this.grid.query(r, o, n, s).concat(this.ignoredGrid.query(r, o, n, s)), l = {}, c = {}; for (const e of a) { const r = e.key; if (void 0 === l[r.bucketInstanceId] && (l[r.bucketInstanceId] = {}), l[r.bucketInstanceId][r.featureIndex]) continue; const o = [new t.pointGeometry(e.x1, e.y1), new t.pointGeometry(e.x2, e.y1), new t.pointGeometry(e.x2, e.y2), new t.pointGeometry(e.x1, e.y2)]; t.polygonIntersectsPolygon(i, o) && (l[r.bucketInstanceId][r.featureIndex] = !0, void 0 === c[r.bucketInstanceId] && (c[r.bucketInstanceId] = []), c[r.bucketInstanceId].push(r.featureIndex)); } return c } insertCollisionBox(t, e, i, r, o) { (e ? this.ignoredGrid : this.grid).insert({ bucketInstanceId: i, featureIndex: r, collisionGroupID: o }, t[0], t[1], t[2], t[3]); } insertCollisionCircles(t, e, i, r, o) { const n = e ? this.ignoredGrid : this.grid, s = { bucketInstanceId: i, featureIndex: r, collisionGroupID: o }; for (let e = 0; e < t.length; e += 4)n.insertCircle(s, t[e], t[e + 1], t[e + 2]); } projectAndGetPerspectiveRatio(e, i, r, o, n) { const s = [i, r, o || 0, 1]; let a = !1; if (o || this.transform.pitch > 0) { t.transformMat4$1(s, s, e); let l = !1; if (this.fogState && n) { const e = function (e, i, r, o, n, s) { const a = s.calculateFogTileMatrix(n), l = [i, r, o]; return t.transformMat4(l, l, a), G(e, l, s.pitch, s._fov) }(this.fogState, i, r, o || 0, n.toUnwrapped(), this.transform); l = e > .9; } a = s[2] > s[3] || l; } else Ae(s, s, e); return { point: new t.pointGeometry((s[0] / s[3] + 1) / 2 * this.transform.width + Le, (-s[1] / s[3] + 1) / 2 * this.transform.height + Le), perspectiveRatio: Math.min(.5 + this.transform.cameraToCenterDistance / s[3] * .5, 1.5), signedDistanceFromCamera: s[3], aboveHorizon: a } } isOffscreen(t, e, i, r) { return i < Le || t >= this.screenRightBoundary || r < Le || e > this.screenBottomBoundary } isInsideGrid(t, e, i, r) { return i >= 0 && t < this.gridRightBoundary && r >= 0 && e < this.gridBottomBoundary } getViewportMatrix() { const e = t.identity([]); return t.translate(e, e, [-100, -100, 0]), e } } class Me { constructor(t, e, i, r) { this.opacity = t ? Math.max(0, Math.min(1, t.opacity + (t.placed ? e : -e))) : r && i ? 1 : 0, this.placed = i; } isHidden() { return 0 === this.opacity && !this.placed } } class Pe { constructor(t, e, i, r, o) { this.text = new Me(t ? t.text : null, e, i, o), this.icon = new Me(t ? t.icon : null, e, r, o); } isHidden() { return this.text.isHidden() && this.icon.isHidden() } } class ze { constructor(t, e, i) { this.text = t, this.icon = e, this.skipFade = i; } } class De { constructor() { this.invProjMatrix = t.create(), this.viewportMatrix = t.create(), this.circles = []; } } class ke { constructor(t, e, i, r, o) { this.bucketInstanceId = t, this.featureIndex = e, this.sourceLayerIndex = i, this.bucketIndex = r, this.tileID = o; } } class Re { constructor(t) { this.crossSourceCollisions = t, this.maxGroupID = 0, this.collisionGroups = {}; } get(t) { if (this.crossSourceCollisions) return { ID: 0, predicate: null }; if (!this.collisionGroups[t]) { const e = ++this.maxGroupID; this.collisionGroups[t] = { ID: e, predicate: t => t.collisionGroupID === e }; } return this.collisionGroups[t] } } function Fe(e, i, r, o, n) { const { horizontalAlign: s, verticalAlign: a } = t.getAnchorAlignment(e), l = -(s - .5) * i, c = -(a - .5) * r, h = t.evaluateVariableOffset(e, o); return new t.pointGeometry(l + h[0] * n, c + h[1] * n) } function Oe(e, i, r, o, n) { const s = new t.pointGeometry(e, i); return r && s._rotate(o ? n : -n), s } class Be { constructor(t, e, i, r, o) { this.transform = t.clone(), this.collisionIndex = new Ie(this.transform, o), this.placements = {}, this.opacities = {}, this.variableOffsets = {}, this.stale = !1, this.commitTime = 0, this.fadeDuration = e, this.retainedQueryData = {}, this.collisionGroups = new Re(i), this.collisionCircleArrays = {}, this.prevPlacement = r, r && (r.prevPlacement = void 0), this.placedOrientations = {}; } getBucketParts(e, i, r, o) { const n = r.getBucket(i), s = r.latestFeatureIndex; if (!n || !s || i.id !== n.layerIds[0]) return; const a = r.collisionBoxArray, l = n.layers[0].layout, c = Math.pow(2, this.transform.zoom - r.tileID.overscaledZ), h = r.tileSize / t.EXTENT, u = this.transform.calculateProjMatrix(r.tileID.toUnwrapped()), d = "map" === l.get("text-pitch-alignment"), p = "map" === l.get("text-rotation-alignment"), m = Y(r, 1, this.transform.zoom), _ = me(u, d, p, this.transform, m); let f = null; if (d) { const e = _e(u, d, p, this.transform, m); f = t.multiply([], this.transform.labelPlaneMatrix, e); } this.retainedQueryData[n.bucketInstanceId] = new ke(n.bucketInstanceId, s, n.sourceLayerIndex, n.index, r.tileID); const g = { bucket: n, layout: l, posMatrix: u, textLabelPlaneMatrix: _, labelToScreenMatrix: f, scale: c, textPixelRatio: h, holdingForFade: r.holdingForFade(), collisionBoxArray: a, partiallyEvaluatedTextSize: t.evaluateSizeForZoom(n.textSizeData, this.transform.zoom), partiallyEvaluatedIconSize: t.evaluateSizeForZoom(n.iconSizeData, this.transform.zoom), collisionGroup: this.collisionGroups.get(n.sourceID) }; if (o) for (const t of n.sortKeyRanges) { const { sortKey: i, symbolInstanceStart: r, symbolInstanceEnd: o } = t; e.push({ sortKey: i, symbolInstanceStart: r, symbolInstanceEnd: o, parameters: g }); } else e.push({ symbolInstanceStart: 0, symbolInstanceEnd: n.symbolInstances.length, parameters: g }); } attemptAnchorPlacement(t, e, i, r, o, n, s, a, l, c, h, u, d, p, m, _, f, g) { const v = [u.textOffset0, u.textOffset1], x = Fe(t, i, r, v, o), y = this.collisionIndex.placeCollisionBox(o, e, Oe(x.x, x.y, n, s, this.transform.angle), h, a, l, c.predicate); if ((!_ || 0 !== this.collisionIndex.placeCollisionBox(p.getSymbolInstanceIconSize(g, this.transform.zoom, d), _, Oe(x.x, x.y, n, s, this.transform.angle), h, a, l, c.predicate).box.length) && y.box.length > 0) { let e; return this.prevPlacement && this.prevPlacement.variableOffsets[u.crossTileID] && this.prevPlacement.placements[u.crossTileID] && this.prevPlacement.placements[u.crossTileID].text && (e = this.prevPlacement.variableOffsets[u.crossTileID].anchor), this.variableOffsets[u.crossTileID] = { textOffset: v, width: i, height: r, anchor: t, textScale: o, prevAnchor: e }, this.markUsedJustification(p, t, u, m), p.allowVerticalPlacement && (this.markUsedOrientation(p, m, u), this.placedOrientations[u.crossTileID] = m), { shift: x, placedGlyphBoxes: y } } } placeLayerBucketPart(e, i, r) { const { bucket: o, layout: n, posMatrix: s, textLabelPlaneMatrix: a, labelToScreenMatrix: l, textPixelRatio: c, holdingForFade: h, collisionBoxArray: u, partiallyEvaluatedTextSize: d, partiallyEvaluatedIconSize: p, collisionGroup: m } = e.parameters, _ = n.get("text-optional"), f = n.get("icon-optional"), g = n.get("text-allow-overlap"), v = n.get("icon-allow-overlap"), x = "map" === n.get("text-rotation-alignment"), y = "map" === n.get("text-pitch-alignment"), b = "none" !== n.get("icon-text-fit"), w = "viewport-y" === n.get("symbol-z-order"), E = g && (v || !o.hasIconData() || f), T = v && (g || !o.hasTextData() || _); !o.collisionArrays && u && o.deserializeCollisionBoxes(u), r && o.updateCollisionDebugBuffers(this.transform.zoom, u); const C = (e, u, w) => { if (i[e.crossTileID]) return; if (h) return void (this.placements[e.crossTileID] = new ze(!1, !1, !1)); let C = !1, S = !1, A = !0, L = null, I = { box: null, offscreen: null }, M = { box: null, offscreen: null }, P = null, z = null, D = null, k = 0, R = 0, F = 0; w.textFeatureIndex ? k = w.textFeatureIndex : e.useRuntimeCollisionCircles && (k = e.featureIndex), w.verticalTextFeatureIndex && (R = w.verticalTextFeatureIndex); const O = t => { t.tileID = this.retainedQueryData[o.bucketInstanceId].tileID, (this.transform.elevation || t.elevation) && (t.elevation = this.transform.elevation ? this.transform.elevation.getAtTileOffset(this.retainedQueryData[o.bucketInstanceId].tileID, t.anchorPointX, t.anchorPointY) : 0); }, B = w.textBox; if (B) { O(B); const i = i => { let r = t.WritingMode.horizontal; if (o.allowVerticalPlacement && !i && this.prevPlacement) { const t = this.prevPlacement.placedOrientations[e.crossTileID]; t && (this.placedOrientations[e.crossTileID] = t, r = t, this.markUsedOrientation(o, r, e)); } return r }, r = (i, r) => { if (o.allowVerticalPlacement && e.numVerticalGlyphVertices > 0 && w.verticalTextBox) { for (const e of o.writingModes) if (e === t.WritingMode.vertical ? (I = r(), M = I) : I = i(), I && I.box && I.box.length) break } else I = i(); }; if (n.get("text-variable-anchor")) { let a = n.get("text-variable-anchor"); if (this.prevPlacement && this.prevPlacement.variableOffsets[e.crossTileID]) { const t = this.prevPlacement.variableOffsets[e.crossTileID]; a.indexOf(t.anchor) > 0 && (a = a.filter((e => e !== t.anchor)), a.unshift(t.anchor)); } const l = (t, i, r) => { const n = o.getSymbolInstanceTextSize(d, e, this.transform.zoom, u), l = (t.x2 - t.x1) * n + 2 * t.padding, h = (t.y2 - t.y1) * n + 2 * t.padding, _ = b && !v ? i : null; _ && O(_); let f = { box: [], offscreen: !1 }; const w = g ? 2 * a.length : a.length; for (let i = 0; i < w; ++i) { const g = this.attemptAnchorPlacement(a[i % a.length], t, l, h, n, x, y, c, s, m, i >= a.length, e, u, o, r, _, d, p); if (g && (f = g.placedGlyphBoxes, f && f.box && f.box.length)) { C = !0, L = g.shift; break } } return f }; r((() => l(B, w.iconBox, t.WritingMode.horizontal)), (() => { const i = w.verticalTextBox; return i && O(i), o.allowVerticalPlacement && !(I && I.box && I.box.length) && e.numVerticalGlyphVertices > 0 && i ? l(i, w.verticalIconBox, t.WritingMode.vertical) : { box: null, offscreen: null } })), I && (C = I.box, A = I.offscreen); const h = i(I && I.box); if (!C && this.prevPlacement) { const t = this.prevPlacement.variableOffsets[e.crossTileID]; t && (this.variableOffsets[e.crossTileID] = t, this.markUsedJustification(o, t.anchor, e, h)); } } else { const n = (i, r) => { const n = o.getSymbolInstanceTextSize(d, e, this.transform.zoom, u), a = this.collisionIndex.placeCollisionBox(n, i, new t.pointGeometry(0, 0), g, c, s, m.predicate); return a && a.box && a.box.length && (this.markUsedOrientation(o, r, e), this.placedOrientations[e.crossTileID] = r), a }; r((() => n(B, t.WritingMode.horizontal)), (() => { const i = w.verticalTextBox; return o.allowVerticalPlacement && e.numVerticalGlyphVertices > 0 && i ? (O(i), n(i, t.WritingMode.vertical)) : { box: null, offscreen: null } })), i(I && I.box && I.box.length); } } if (P = I, C = P && P.box && P.box.length > 0, A = P && P.offscreen, e.useRuntimeCollisionCircles) { const i = o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex), c = t.evaluateSizeForFeature(o.textSizeData, d, i), h = n.get("text-padding"); z = this.collisionIndex.placeCollisionCircles(g, i, o.lineVertexArray, o.glyphOffsetArray, c, s, a, l, r, y, m.predicate, e.collisionCircleDiameter, h, this.retainedQueryData[o.bucketInstanceId].tileID), C = g || z.circles.length > 0 && !z.collisionDetected, A = A && z.offscreen; } if (w.iconFeatureIndex && (F = w.iconFeatureIndex), w.iconBox) { const e = e => { O(e); const i = b && L ? Oe(L.x, L.y, x, y, this.transform.angle) : new t.pointGeometry(0, 0), r = o.getSymbolInstanceIconSize(p, this.transform.zoom, u); return this.collisionIndex.placeCollisionBox(r, e, i, v, c, s, m.predicate) }; M && M.box && M.box.length && w.verticalIconBox ? (D = e(w.verticalIconBox), S = D.box.length > 0) : (D = e(w.iconBox), S = D.box.length > 0), A = A && D.offscreen; } const U = _ || 0 === e.numHorizontalGlyphVertices && 0 === e.numVerticalGlyphVertices, N = f || 0 === e.numIconVertices; if (U || N ? N ? U || (S = S && C) : C = S && C : S = C = S && C, C && P && P.box && this.collisionIndex.insertCollisionBox(P.box, n.get("text-ignore-placement"), o.bucketInstanceId, M && M.box && R ? R : k, m.ID), S && D && this.collisionIndex.insertCollisionBox(D.box, n.get("icon-ignore-placement"), o.bucketInstanceId, F, m.ID), z && (C && this.collisionIndex.insertCollisionCircles(z.circles, n.get("text-ignore-placement"), o.bucketInstanceId, k, m.ID), r)) { const t = o.bucketInstanceId; let e = this.collisionCircleArrays[t]; void 0 === e && (e = this.collisionCircleArrays[t] = new De); for (let t = 0; t < z.circles.length; t += 4)e.circles.push(z.circles[t + 0]), e.circles.push(z.circles[t + 1]), e.circles.push(z.circles[t + 2]), e.circles.push(z.collisionDetected ? 1 : 0); } this.placements[e.crossTileID] = new ze(C || E, S || T, A || o.justReloaded), i[e.crossTileID] = !0; }; if (w) { const t = o.getSortedSymbolIndexes(this.transform.angle); for (let e = t.length - 1; e >= 0; --e) { const i = t[e]; C(o.symbolInstances.get(i), i, o.collisionArrays[i]); } } else for (let t = e.symbolInstanceStart; t < e.symbolInstanceEnd; t++)C(o.symbolInstances.get(t), t, o.collisionArrays[t]); if (r && o.bucketInstanceId in this.collisionCircleArrays) { const e = this.collisionCircleArrays[o.bucketInstanceId]; t.invert(e.invProjMatrix, s), e.viewportMatrix = this.collisionIndex.getViewportMatrix(); } o.justReloaded = !1; } markUsedJustification(e, i, r, o) { let n; n = o === t.WritingMode.vertical ? r.verticalPlacedTextSymbolIndex : { left: r.leftJustifiedTextSymbolIndex, center: r.centerJustifiedTextSymbolIndex, right: r.rightJustifiedTextSymbolIndex }[t.getAnchorJustification(i)]; const s = [r.leftJustifiedTextSymbolIndex, r.centerJustifiedTextSymbolIndex, r.rightJustifiedTextSymbolIndex, r.verticalPlacedTextSymbolIndex]; for (const t of s) t >= 0 && (e.text.placedSymbolArray.get(t).crossTileID = n >= 0 && t !== n ? 0 : r.crossTileID); } markUsedOrientation(e, i, r) { const o = i === t.WritingMode.horizontal || i === t.WritingMode.horizontalOnly ? i : 0, n = i === t.WritingMode.vertical ? i : 0, s = [r.leftJustifiedTextSymbolIndex, r.centerJustifiedTextSymbolIndex, r.rightJustifiedTextSymbolIndex]; for (const t of s) e.text.placedSymbolArray.get(t).placedOrientation = o; r.verticalPlacedTextSymbolIndex && (e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation = n); } commit(t) { this.commitTime = t, this.zoomAtLastRecencyCheck = this.transform.zoom; const e = this.prevPlacement; let i = !1; this.prevZoomAdjustment = e ? e.zoomAdjustment(this.transform.zoom) : 0; const r = e ? e.symbolFadeChange(t) : 1, o = e ? e.opacities : {}, n = e ? e.variableOffsets : {}, s = e ? e.placedOrientations : {}; for (const t in this.placements) { const e = this.placements[t], n = o[t]; n ? (this.opacities[t] = new Pe(n, r, e.text, e.icon), i = i || e.text !== n.text.placed || e.icon !== n.icon.placed) : (this.opacities[t] = new Pe(null, r, e.text, e.icon, e.skipFade), i = i || e.text || e.icon); } for (const t in o) { const e = o[t]; if (!this.opacities[t]) { const o = new Pe(e, r, !1, !1); o.isHidden() || (this.opacities[t] = o, i = i || e.text.placed || e.icon.placed); } } for (const t in n) this.variableOffsets[t] || !this.opacities[t] || this.opacities[t].isHidden() || (this.variableOffsets[t] = n[t]); for (const t in s) this.placedOrientations[t] || !this.opacities[t] || this.opacities[t].isHidden() || (this.placedOrientations[t] = s[t]); i ? this.lastPlacementChangeTime = t : "number" != typeof this.lastPlacementChangeTime && (this.lastPlacementChangeTime = e ? e.lastPlacementChangeTime : t); } updateLayerOpacities(t, e) { const i = {}; for (const r of e) { const e = r.getBucket(t); e && r.latestFeatureIndex && t.id === e.layerIds[0] && this.updateBucketOpacities(e, i, r.collisionBoxArray); } } updateBucketOpacities(e, i, r) { e.hasTextData() && e.text.opacityVertexArray.clear(), e.hasIconData() && e.icon.opacityVertexArray.clear(), e.hasIconCollisionBoxData() && e.iconCollisionBox.collisionVertexArray.clear(), e.hasTextCollisionBoxData() && e.textCollisionBox.collisionVertexArray.clear(); const o = e.layers[0].layout, n = new Pe(null, 0, !1, !1, !0), s = o.get("text-allow-overlap"), a = o.get("icon-allow-overlap"), l = o.get("text-variable-anchor"), c = "map" === o.get("text-rotation-alignment"), h = "map" === o.get("text-pitch-alignment"), u = "none" !== o.get("icon-text-fit"), d = new Pe(null, 0, s && (a || !e.hasIconData() || o.get("icon-optional")), a && (s || !e.hasTextData() || o.get("text-optional")), !0); !e.collisionArrays && r && (e.hasIconCollisionBoxData() || e.hasTextCollisionBoxData()) && e.deserializeCollisionBoxes(r); const p = (t, e, i) => { for (let r = 0; r < e / 4; r++)t.opacityVertexArray.emplaceBack(i); }; for (let r = 0; r < e.symbolInstances.length; r++) { const o = e.symbolInstances.get(r), { numHorizontalGlyphVertices: s, numVerticalGlyphVertices: a, crossTileID: m } = o; let _ = this.opacities[m]; i[m] ? _ = n : _ || (_ = d, this.opacities[m] = _), i[m] = !0; const f = o.numIconVertices > 0, g = this.placedOrientations[o.crossTileID], v = g === t.WritingMode.vertical, x = g === t.WritingMode.horizontal || g === t.WritingMode.horizontalOnly; if (s > 0 || a > 0) { const t = Ye(_.text); p(e.text, s, v ? qe : t), p(e.text, a, x ? qe : t); const i = _.text.isHidden();[o.rightJustifiedTextSymbolIndex, o.centerJustifiedTextSymbolIndex, o.leftJustifiedTextSymbolIndex].forEach((t => { t >= 0 && (e.text.placedSymbolArray.get(t).hidden = i || v ? 1 : 0); })), o.verticalPlacedTextSymbolIndex >= 0 && (e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden = i || x ? 1 : 0); const r = this.variableOffsets[o.crossTileID]; r && this.markUsedJustification(e, r.anchor, o, g); const n = this.placedOrientations[o.crossTileID]; n && (this.markUsedJustification(e, "left", o, n), this.markUsedOrientation(e, n, o)); } if (f) { const t = Ye(_.icon), i = !(u && o.verticalPlacedIconSymbolIndex && v); o.placedIconSymbolIndex >= 0 && (p(e.icon, o.numIconVertices, i ? t : qe), e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden = _.icon.isHidden()), o.verticalPlacedIconSymbolIndex >= 0 && (p(e.icon, o.numVerticalIconVertices, i ? qe : t), e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden = _.icon.isHidden()); } if (e.hasIconCollisionBoxData() || e.hasTextCollisionBoxData()) { const i = e.collisionArrays[r]; if (i) { let r = new t.pointGeometry(0, 0); if (i.textBox || i.verticalTextBox) { let t = !0; if (l) { const e = this.variableOffsets[m]; e ? (r = Fe(e.anchor, e.width, e.height, e.textOffset, e.textScale), c && r._rotate(h ? this.transform.angle : -this.transform.angle)) : t = !1; } i.textBox && Ue(e.textCollisionBox.collisionVertexArray, _.text.placed, !t || v, r.x, r.y), i.verticalTextBox && Ue(e.textCollisionBox.collisionVertexArray, _.text.placed, !t || x, r.x, r.y); } const o = Boolean(!x && i.verticalIconBox); i.iconBox && Ue(e.iconCollisionBox.collisionVertexArray, _.icon.placed, o, u ? r.x : 0, u ? r.y : 0), i.verticalIconBox && Ue(e.iconCollisionBox.collisionVertexArray, _.icon.placed, !o, u ? r.x : 0, u ? r.y : 0); } } } if (e.sortFeatures(this.transform.angle), this.retainedQueryData[e.bucketInstanceId] && (this.retainedQueryData[e.bucketInstanceId].featureSortOrder = e.featureSortOrder), e.hasTextData() && e.text.opacityVertexBuffer && e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray), e.hasIconData() && e.icon.opacityVertexBuffer && e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray), e.hasIconCollisionBoxData() && e.iconCollisionBox.collisionVertexBuffer && e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray), e.hasTextCollisionBoxData() && e.textCollisionBox.collisionVertexBuffer && e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray), e.bucketInstanceId in this.collisionCircleArrays) { const t = this.collisionCircleArrays[e.bucketInstanceId]; e.placementInvProjMatrix = t.invProjMatrix, e.placementViewportMatrix = t.viewportMatrix, e.collisionCircleArray = t.circles, delete this.collisionCircleArrays[e.bucketInstanceId]; } } symbolFadeChange(t) { return 0 === this.fadeDuration ? 1 : (t - this.commitTime) / this.fadeDuration + this.prevZoomAdjustment } zoomAdjustment(t) { return Math.max(0, (this.transform.zoom - t) / 1.5) } hasTransitions(t) { return this.stale || t - this.lastPlacementChangeTime < this.fadeDuration } stillRecent(t, e) { const i = this.zoomAtLastRecencyCheck === e ? 1 - this.zoomAdjustment(e) : 1; return this.zoomAtLastRecencyCheck = e, this.commitTime + this.fadeDuration * i > t } setStale() { this.stale = !0; } } function Ue(t, e, i, r, o) { t.emplaceBack(e ? 1 : 0, i ? 1 : 0, r || 0, o || 0), t.emplaceBack(e ? 1 : 0, i ? 1 : 0, r || 0, o || 0), t.emplaceBack(e ? 1 : 0, i ? 1 : 0, r || 0, o || 0), t.emplaceBack(e ? 1 : 0, i ? 1 : 0, r || 0, o || 0); } const Ne = Math.pow(2, 25), Ge = Math.pow(2, 24), je = Math.pow(2, 17), He = Math.pow(2, 16), Ve = Math.pow(2, 9), We = Math.pow(2, 8), Ze = Math.pow(2, 1); function Ye(t) { if (0 === t.opacity && !t.placed) return 0; if (1 === t.opacity && t.placed) return 4294967295; const e = t.placed ? 1 : 0, i = Math.floor(127 * t.opacity); return i * Ne + e * Ge + i * je + e * He + i * Ve + e * We + i * Ze + e } const qe = 0; class Xe { constructor(t) { this._sortAcrossTiles = "viewport-y" !== t.layout.get("symbol-z-order") && void 0 !== t.layout.get("symbol-sort-key").constantOr(1), this._currentTileIndex = 0, this._currentPartIndex = 0, this._seenCrossTileIDs = {}, this._bucketParts = []; } continuePlacement(t, e, i, r, o) { const n = this._bucketParts; for (; this._currentTileIndex < t.length;)if (e.getBucketParts(n, r, t[this._currentTileIndex], this._sortAcrossTiles), this._currentTileIndex++, o()) return !0; for (this._sortAcrossTiles && (this._sortAcrossTiles = !1, n.sort(((t, e) => t.sortKey - e.sortKey))); this._currentPartIndex < n.length;)if (e.placeLayerBucketPart(n[this._currentPartIndex], this._seenCrossTileIDs, i), this._currentPartIndex++, o()) return !0; return !1 } } class Qe { constructor(t, e, i, r, o, n, s, a) { this.placement = new Be(t, o, n, s, a), this._currentPlacementIndex = e.length - 1, this._forceFullPlacement = i, this._showCollisionBoxes = r, this._done = !1; } isDone() { return this._done } continuePlacement(e, i, r) { const o = t.exported.now(), n = () => { const e = t.exported.now() - o; return !this._forceFullPlacement && e > 2 }; for (; this._currentPlacementIndex >= 0;) { const t = i[e[this._currentPlacementIndex]], o = this.placement.collisionIndex.transform.zoom; if ("symbol" === t.type && (!t.minzoom || t.minzoom <= o) && (!t.maxzoom || t.maxzoom > o)) { if (this._inProgressLayer || (this._inProgressLayer = new Xe(t)), this._inProgressLayer.continuePlacement(r[t.source], this.placement, this._showCollisionBoxes, t, n)) return; delete this._inProgressLayer; } this._currentPlacementIndex--; } this._done = !0; } commit(t) { return this.placement.commit(t), this.placement } } const Ke = 512 / t.EXTENT / 2; class Je { constructor(t, e, i) { this.tileID = t, this.indexedSymbolInstances = {}, this.bucketInstanceId = i; for (let i = 0; i < e.length; i++) { const r = e.get(i), o = r.key; this.indexedSymbolInstances[o] || (this.indexedSymbolInstances[o] = []), this.indexedSymbolInstances[o].push({ crossTileID: r.crossTileID, coord: this.getScaledCoordinates(r, t) }); } } getScaledCoordinates(e, i) { const r = Ke / Math.pow(2, i.canonical.z - this.tileID.canonical.z); return { x: Math.floor((i.canonical.x * t.EXTENT + e.anchorX) * r), y: Math.floor((i.canonical.y * t.EXTENT + e.anchorY) * r) } } findMatches(t, e, i) { const r = this.tileID.canonical.z < e.canonical.z ? 1 : Math.pow(2, this.tileID.canonical.z - e.canonical.z); for (let o = 0; o < t.length; o++) { const n = t.get(o); if (n.crossTileID) continue; const s = this.indexedSymbolInstances[n.key]; if (!s) continue; const a = this.getScaledCoordinates(n, e); for (const t of s) if (Math.abs(t.coord.x - a.x) <= r && Math.abs(t.coord.y - a.y) <= r && !i[t.crossTileID]) { i[t.crossTileID] = !0, n.crossTileID = t.crossTileID; break } } } } class $e { constructor() { this.maxCrossTileID = 0; } generate() { return ++this.maxCrossTileID } } class ti { constructor() { this.indexes = {}, this.usedCrossTileIDs = {}, this.lng = 0; } handleWrapJump(t) { const e = Math.round((t - this.lng) / 360); if (0 !== e) for (const t in this.indexes) { const i = this.indexes[t], r = {}; for (const t in i) { const o = i[t]; o.tileID = o.tileID.unwrapTo(o.tileID.wrap + e), r[o.tileID.key] = o; } this.indexes[t] = r; } this.lng = t; } addBucket(t, e, i) { if (this.indexes[t.overscaledZ] && this.indexes[t.overscaledZ][t.key]) { if (this.indexes[t.overscaledZ][t.key].bucketInstanceId === e.bucketInstanceId) return !1; this.removeBucketCrossTileIDs(t.overscaledZ, this.indexes[t.overscaledZ][t.key]); } for (let t = 0; t < e.symbolInstances.length; t++)e.symbolInstances.get(t).crossTileID = 0; this.usedCrossTileIDs[t.overscaledZ] || (this.usedCrossTileIDs[t.overscaledZ] = {}); const r = this.usedCrossTileIDs[t.overscaledZ]; for (const i in this.indexes) { const o = this.indexes[i]; if (Number(i) > t.overscaledZ) for (const i in o) { const n = o[i]; n.tileID.isChildOf(t) && n.findMatches(e.symbolInstances, t, r); } else { const n = o[t.scaledTo(Number(i)).key]; n && n.findMatches(e.symbolInstances, t, r); } } for (let t = 0; t < e.symbolInstances.length; t++) { const o = e.symbolInstances.get(t); o.crossTileID || (o.crossTileID = i.generate(), r[o.crossTileID] = !0); } return void 0 === this.indexes[t.overscaledZ] && (this.indexes[t.overscaledZ] = {}), this.indexes[t.overscaledZ][t.key] = new Je(t, e.symbolInstances, e.bucketInstanceId), !0 } removeBucketCrossTileIDs(t, e) { for (const i in e.indexedSymbolInstances) for (const r of e.indexedSymbolInstances[i]) delete this.usedCrossTileIDs[t][r.crossTileID]; } removeStaleBuckets(t) { let e = !1; for (const i in this.indexes) { const r = this.indexes[i]; for (const o in r) t[r[o].bucketInstanceId] || (this.removeBucketCrossTileIDs(i, r[o]), delete r[o], e = !0); } return e } } class ei { constructor() { this.layerIndexes = {}, this.crossTileIDs = new $e, this.maxBucketInstanceId = 0, this.bucketsInCurrentPlacement = {}; } addLayer(t, e, i) { let r = this.layerIndexes[t.id]; void 0 === r && (r = this.layerIndexes[t.id] = new ti); let o = !1; const n = {}; r.handleWrapJump(i); for (const i of e) { const e = i.getBucket(t); e && t.id === e.layerIds[0] && (e.bucketInstanceId || (e.bucketInstanceId = ++this.maxBucketInstanceId), r.addBucket(i.tileID, e, this.crossTileIDs) && (o = !0), n[e.bucketInstanceId] = !0); } return r.removeStaleBuckets(n) && (o = !0), o } pruneUnusedLayers(t) { const e = {}; t.forEach((t => { e[t] = !0; })); for (const t in this.layerIndexes) e[t] || delete this.layerIndexes[t]; } } const ii = (e, i) => t.emitValidationErrors(e, i && i.filter((t => "source.canvas" !== t.identifier))), ri = t.pick(re, ["addLayer", "removeLayer", "setPaintProperty", "setLayoutProperty", "setFilter", "addSource", "removeSource", "setLayerZoomRange", "setLight", "setTransition", "setGeoJSONSourceData", "setTerrain", "setFog"]), oi = t.pick(re, ["setCenter", "setZoom", "setBearing", "setPitch"]), ni = function () { const e = {}, i = t.spec.$version; for (const r in t.spec.$root) { const o = t.spec.$root[r]; if (o.required) { let t = null; t = "version" === r ? i : "array" === o.type ? [] : {}, null != t && (e[r] = t); } } return e }(), si = { fill: !0, line: !0, background: !0, hillshade: !0, raster: !0 }; class ai extends t.Evented { constructor(e, i = {}) { super(), this.map = e, this.dispatcher = new Z(te(), this), this.imageManager = new k, this.imageManager.setEventedParent(this), this.glyphManager = new t.GlyphManager(e._requestManager, i.localFontFamily ? t.LocalGlyphMode.all : i.localIdeographFontFamily ? t.LocalGlyphMode.ideographs : t.LocalGlyphMode.none, i.localFontFamily || i.localIdeographFontFamily, i.localIdeographFontWeight), this.lineAtlas = new t.LineAtlas(256, 512), this.crossTileSymbolIndex = new ei, this._layers = {}, this._num3DLayers = 0, this._numSymbolLayers = 0, this._numCircleLayers = 0, this._serializedLayers = {}, this._sourceCaches = {}, this._otherSourceCaches = {}, this._symbolSourceCaches = {}, this.zoomHistory = new t.ZoomHistory, this._loaded = !1, this._availableImages = [], this._order = [], this._drapedFirstOrder = [], this._markersNeedUpdate = !1, this._resetUpdates(), this.dispatcher.broadcast("setReferrer", t.getReferrer()); const r = this; this._rtlTextPluginCallback = ai.registerForPluginStateChange((e => { r.dispatcher.broadcast("syncRTLPluginState", { pluginStatus: e.pluginStatus, pluginURL: e.pluginURL }, ((e, i) => { if (t.triggerPluginCompletionEvent(e), i && i.every((t => t))) for (const t in r._sourceCaches) { const e = r._sourceCaches[t], i = e.getSource().type; "vector" !== i && "geojson" !== i || e.reload(); } })); })), this.on("data", (t => { if ("source" !== t.dataType || "metadata" !== t.sourceDataType) return; const e = this.getSource(t.sourceId); if (e && e.vectorLayerIds) for (const t in this._layers) { const i = this._layers[t]; i.source === e.id && this._validateLayer(i); } })); } loadURL(e, i = {}) { this.fire(new t.Event("dataloading", { dataType: "style" })); const r = "boolean" == typeof i.validate ? i.validate : !t.isMapboxURL(e); e = this.map._requestManager.normalizeStyleURL(e, i.accessToken); const o = this.map._requestManager.transformRequest(e, t.ResourceType.Style); this._request = t.getJSON(o, ((e, i) => { this._request = null, e ? this.fire(new t.ErrorEvent(e)) : i && this._load(i, r); })); } loadJSON(e, i = {}) { this.fire(new t.Event("dataloading", { dataType: "style" })), this._request = t.exported.frame((() => { this._request = null, this._load(e, !1 !== i.validate); })); } loadEmpty() { this.fire(new t.Event("dataloading", { dataType: "style" })), this._load(ni, !1); } _updateLayerCount(t, e) { const i = e ? 1 : -1; t.is3D() && (this._num3DLayers += i), "circle" === t.type && (this._numCircleLayers += i), "symbol" === t.type && (this._numSymbolLayers += i); } _load(e, i) { if (i && ii(this, t.validateStyle(e))) return; this._loaded = !0, this.stylesheet = e; for (const t in e.sources) this.addSource(t, e.sources[t], { validate: !1 }); this._changed = !1, e.sprite ? this._loadSprite(e.sprite) : (this.imageManager.setLoaded(!0), this.dispatcher.broadcast("spriteLoaded", !0)), this.glyphManager.setURL(e.glyphs); const r = ie(this.stylesheet.layers); this._order = r.map((t => t.id)), this._sortOrder = []; const o = []; r.forEach((t => { "symbol" !== t.type ? this._sortOrder.push(t.id) : o.push(t.id); })), this._sortOrder = this._sortOrder.concat(o), this._layers = {}, this._serializedLayers = {}; for (let e of r) e = t.createStyleLayer(e), e.setEventedParent(this, { layer: { id: e.id } }), this._layers[e.id] = e, this._serializedLayers[e.id] = e.serialize(), this._updateLayerCount(e, !0); this.dispatcher.broadcast("setLayers", this._serializeLayers(this._order)), this.light = new O(this.stylesheet.light), this.stylesheet.terrain && this._createTerrain(this.stylesheet.terrain), this.stylesheet.fog && this._createFog(this.stylesheet.fog), this._updateDrapeFirstLayers(), this.fire(new t.Event("data", { dataType: "style" })), this.fire(new t.Event("style.load")); } _loadSprite(e) { this._spriteRequest = function (e, i, r) { let o, n, s; const a = t.exported.devicePixelRatio > 1 ? "@2x" : ""; let l = t.getJSON(i.transformRequest(i.normalizeSpriteURL(e, a, ".json"), t.ResourceType.SpriteJSON), ((t, e) => { l = null, s || (s = t, o = e, h()); })), c = t.getImage(i.transformRequest(i.normalizeSpriteURL(e, a, ".png"), t.ResourceType.SpriteImage), ((t, e) => { c = null, s || (s = t, n = e, h()); })); function h() { if (s) r(s); else if (o && n) { const e = t.exported.getImageData(n), i = {}; for (const r in o) { const { width: n, height: s, x: a, y: l, sdf: c, pixelRatio: h, stretchX: u, stretchY: d, content: p } = o[r], m = new t.RGBAImage({ width: n, height: s }); t.RGBAImage.copy(e, m, { x: a, y: l }, { x: 0, y: 0 }, { width: n, height: s }), i[r] = { data: m, pixelRatio: h, sdf: c, stretchX: u, stretchY: d, content: p }; } r(null, i); } } return { cancel() { l && (l.cancel(), l = null), c && (c.cancel(), c = null); } } }(e, this.map._requestManager, ((e, i) => { if (this._spriteRequest = null, e) this.fire(new t.ErrorEvent(e)); else if (i) for (const t in i) this.imageManager.addImage(t, i[t]); this.imageManager.setLoaded(!0), this._availableImages = this.imageManager.listImages(), this.dispatcher.broadcast("setImages", this._availableImages), this.dispatcher.broadcast("spriteLoaded", !0), this.fire(new t.Event("data", { dataType: "style" })); })); } _validateLayer(e) { const i = this.getSource(e.source); if (!i) return; const r = e.sourceLayer; r && ("geojson" === i.type || i.vectorLayerIds && -1 === i.vectorLayerIds.indexOf(r)) && this.fire(new t.ErrorEvent(new Error(`Source layer "${r}" does not exist on source "${i.id}" as specified by style layer "${e.id}"`))); } loaded() { if (!this._loaded) return !1; if (Object.keys(this._updatedSources).length) return !1; for (const t in this._sourceCaches) if (!this._sourceCaches[t].loaded()) return !1; return !!this.imageManager.isLoaded() } _serializeLayers(t) { const e = []; for (const i of t) { const t = this._layers[i]; "custom" !== t.type && e.push(t.serialize()); } return e } hasTransitions() { if (this.light && this.light.hasTransition()) return !0; if (this.fog && this.fog.hasTransition()) return !0; for (const t in this._sourceCaches) if (this._sourceCaches[t].hasTransition()) return !0; for (const t in this._layers) if (this._layers[t].hasTransition()) return !0; return !1 } get order() { return this.map._optimizeForTerrain && this.terrain ? this._drapedFirstOrder : this._order } isLayerDraped(t) { return !!this.terrain && si[t.type] } _checkLoaded() { if (!this._loaded) throw new Error("Style is not done loading") } update(e) { if (!this._loaded) return; const i = this._changed; if (this._changed) { const t = Object.keys(this._updatedLayers), i = Object.keys(this._removedLayers); (t.length || i.length) && this._updateWorkerLayers(t, i); for (const t in this._updatedSources) { const e = this._updatedSources[t]; "reload" === e ? this._reloadSource(t) : "clear" === e && this._clearSource(t); } this._updateTilesForChangedImages(); for (const t in this._updatedPaintProps) this._layers[t].updateTransitions(e); this.light.updateTransitions(e), this.fog && this.fog.updateTransitions(e), this._resetUpdates(); } const r = {}; for (const t in this._sourceCaches) { const e = this._sourceCaches[t]; r[t] = e.used, e.used = !1; } for (const t of this._order) { const i = this._layers[t]; if (i.recalculate(e, this._availableImages), !i.isHidden(e.zoom)) { const t = this._getLayerSourceCache(i); t && (t.used = !0); } const r = this.map.painter; if (r) { const t = i.getProgramIds(); if (!t) continue; const o = i.getProgramConfiguration(e.zoom); for (const e of t) r.useProgram(e, o); } } for (const e in r) { const i = this._sourceCaches[e]; r[e] !== i.used && i.getSource().fire(new t.Event("data", { sourceDataType: "visibility", dataType: "source", sourceId: i.getSource().id })); } this.light.recalculate(e), this.terrain && this.terrain.recalculate(e), this.fog && this.fog.recalculate(e), this.z = e.zoom, this._markersNeedUpdate && (this._updateMarkersOpacity(), this._markersNeedUpdate = !1), i && this.fire(new t.Event("data", { dataType: "style" })); } _updateTilesForChangedImages() { const t = Object.keys(this._changedImages); if (t.length) { for (const e in this._sourceCaches) this._sourceCaches[e].reloadTilesForDependencies(["icons", "patterns"], t); this._changedImages = {}; } } _updateWorkerLayers(t, e) { this.dispatcher.broadcast("updateLayers", { layers: this._serializeLayers(t), removedIds: e }); } _resetUpdates() { this._changed = !1, this._updatedLayers = {}, this._removedLayers = {}, this._updatedSources = {}, this._updatedPaintProps = {}, this._changedImages = {}; } setState(e) { if (this._checkLoaded(), ii(this, t.validateStyle(e))) return !1; (e = t.clone$1(e)).layers = ie(e.layers); const i = function (t, e) { if (!t) return [{ command: re.setStyle, args: [e] }]; let i = []; try { if (!d(t.version, e.version)) return [{ command: re.setStyle, args: [e] }]; d(t.center, e.center) || i.push({ command: re.setCenter, args: [e.center] }), d(t.zoom, e.zoom) || i.push({ command: re.setZoom, args: [e.zoom] }), d(t.bearing, e.bearing) || i.push({ command: re.setBearing, args: [e.bearing] }), d(t.pitch, e.pitch) || i.push({ command: re.setPitch, args: [e.pitch] }), d(t.sprite, e.sprite) || i.push({ command: re.setSprite, args: [e.sprite] }), d(t.glyphs, e.glyphs) || i.push({ command: re.setGlyphs, args: [e.glyphs] }), d(t.transition, e.transition) || i.push({ command: re.setTransition, args: [e.transition] }), d(t.light, e.light) || i.push({ command: re.setLight, args: [e.light] }), d(t.fog, e.fog) || i.push({ command: re.setFog, args: [e.fog] }); const r = {}, o = []; !function (t, e, i, r) { let o; for (o in e = e || {}, t = t || {}) t.hasOwnProperty(o) && (e.hasOwnProperty(o) || ne(o, i, r)); for (o in e) e.hasOwnProperty(o) && (t.hasOwnProperty(o) ? d(t[o], e[o]) || ("geojson" === t[o].type && "geojson" === e[o].type && ae(t, e, o) ? i.push({ command: re.setGeoJSONSourceData, args: [o, e[o].data] }) : se(o, e, i, r)) : oe(o, e, i)); }(t.sources, e.sources, o, r); const n = []; t.layers && t.layers.forEach((t => { r[t.source] ? i.push({ command: re.removeLayer, args: [t.id] }) : n.push(t); })); let s = t.terrain; s && r[s.source] && (i.push({ command: re.setTerrain, args: [void 0] }), s = void 0), i = i.concat(o), d(s, e.terrain) || i.push({ command: re.setTerrain, args: [e.terrain] }), function (t, e, i) { e = e || []; const r = (t = t || []).map(ce), o = e.map(ce), n = t.reduce(he, {}), s = e.reduce(he, {}), a = r.slice(), l = Object.create(null); let c, h, u, p, m, _, f; for (c = 0, h = 0; c < r.length; c++)u = r[c], s.hasOwnProperty(u) ? h++ : (i.push({ command: re.removeLayer, args: [u] }), a.splice(a.indexOf(u, h), 1)); for (c = 0, h = 0; c < o.length; c++)u = o[o.length - 1 - c], a[a.length - 1 - c] !== u && (n.hasOwnProperty(u) ? (i.push({ command: re.removeLayer, args: [u] }), a.splice(a.lastIndexOf(u, a.length - h), 1)) : h++, _ = a[a.length - c], i.push({ command: re.addLayer, args: [s[u], _] }), a.splice(a.length - c, 0, u), l[u] = !0); for (c = 0; c < o.length; c++)if (u = o[c], p = n[u], m = s[u], !l[u] && !d(p, m)) if (d(p.source, m.source) && d(p["source-layer"], m["source-layer"]) && d(p.type, m.type)) { for (f in le(p.layout, m.layout, i, u, null, re.setLayoutProperty), le(p.paint, m.paint, i, u, null, re.setPaintProperty), d(p.filter, m.filter) || i.push({ command: re.setFilter, args: [u, m.filter] }), d(p.minzoom, m.minzoom) && d(p.maxzoom, m.maxzoom) || i.push({ command: re.setLayerZoomRange, args: [u, m.minzoom, m.maxzoom] }), p) p.hasOwnProperty(f) && "layout" !== f && "paint" !== f && "filter" !== f && "metadata" !== f && "minzoom" !== f && "maxzoom" !== f && (0 === f.indexOf("paint.") ? le(p[f], m[f], i, u, f.slice(6), re.setPaintProperty) : d(p[f], m[f]) || i.push({ command: re.setLayerProperty, args: [u, f, m[f]] })); for (f in m) m.hasOwnProperty(f) && !p.hasOwnProperty(f) && "layout" !== f && "paint" !== f && "filter" !== f && "metadata" !== f && "minzoom" !== f && "maxzoom" !== f && (0 === f.indexOf("paint.") ? le(p[f], m[f], i, u, f.slice(6), re.setPaintProperty) : d(p[f], m[f]) || i.push({ command: re.setLayerProperty, args: [u, f, m[f]] })); } else i.push({ command: re.removeLayer, args: [u] }), _ = a[a.lastIndexOf(u) + 1], i.push({ command: re.addLayer, args: [m, _] }); }(n, e.layers, i); } catch (t) { console.warn("Unable to compute style diff:", t), i = [{ command: re.setStyle, args: [e] }]; } return i }(this.serialize(), e).filter((t => !(t.command in oi))); if (0 === i.length) return !1; const r = i.filter((t => !(t.command in ri))); if (r.length > 0) throw new Error(`Unimplemented: ${r.map((t => t.command)).join(", ")}.`); return i.forEach((t => { "setTransition" !== t.command && this[t.command].apply(this, t.args); })), this.stylesheet = e, !0 } addImage(e, i) { if (this.getImage(e)) return this.fire(new t.ErrorEvent(new Error("An image with this name already exists."))); this.imageManager.addImage(e, i), this._afterImageUpdated(e); } updateImage(t, e) { this.imageManager.updateImage(t, e); } getImage(t) { return this.imageManager.getImage(t) } removeImage(e) { if (!this.getImage(e)) return this.fire(new t.ErrorEvent(new Error("No image with this name exists."))); this.imageManager.removeImage(e), this._afterImageUpdated(e); } _afterImageUpdated(e) { this._availableImages = this.imageManager.listImages(), this._changedImages[e] = !0, this._changed = !0, this.dispatcher.broadcast("setImages", this._availableImages), this.fire(new t.Event("data", { dataType: "style" })); } listImages() { return this._checkLoaded(), this.imageManager.listImages() } addSource(e, i, r = {}) { if (this._checkLoaded(), void 0 !== this.getSource(e)) throw new Error("There is already a source with this ID"); if (!i.type) throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`); if (["vector", "raster", "geojson", "video", "image"].indexOf(i.type) >= 0 && this._validate(t.validateStyle.source, `sources.${e}`, i, null, r)) return; this.map && this.map._collectResourceTiming && (i.collectResourceTiming = !0); const o = Vt(e, i, this.dispatcher, this); o.setEventedParent(this, (() => ({ isSourceLoaded: this.loaded(), source: o.serialize(), sourceId: e }))); const n = i => { const r = (i ? "symbol:" : "other:") + e, n = this._sourceCaches[r] = new t.SourceCache(r, o, i); (i ? this._symbolSourceCaches : this._otherSourceCaches)[e] = n, n.style = this, n.onAdd(this.map); }; n(!1), "vector" !== i.type && "geojson" !== i.type || n(!0), o.onAdd && o.onAdd(this.map), this._changed = !0; } removeSource(e) { this._checkLoaded(); const i = this.getSource(e); if (void 0 === i) throw new Error("There is no source with this ID"); for (const i in this._layers) if (this._layers[i].source === e) return this.fire(new t.ErrorEvent(new Error(`Source "${e}" cannot be removed while layer "${i}" is using it.`))); if (this.terrain && this.terrain.get().source === e) return this.fire(new t.ErrorEvent(new Error(`Source "${e}" cannot be removed while terrain is using it.`))); const r = this._getSourceCaches(e); for (const e of r) delete this._sourceCaches[e.id], delete this._updatedSources[e.id], e.fire(new t.Event("data", { sourceDataType: "metadata", dataType: "source", sourceId: e.getSource().id })), e.setEventedParent(null), e.clearTiles(); delete this._otherSourceCaches[e], delete this._symbolSourceCaches[e], i.setEventedParent(null), i.onRemove && i.onRemove(this.map), this._changed = !0; } setGeoJSONSourceData(t, e) { this._checkLoaded(), this.getSource(t).setData(e), this._changed = !0; } getSource(t) { const e = this._getSourceCache(t); return e && e.getSource() } addLayer(e, i, r = {}) { this._checkLoaded(); const o = e.id; if (this.getLayer(o)) return void this.fire(new t.ErrorEvent(new Error(`Layer with id "${o}" already exists on this map`))); let n; if ("custom" === e.type) { if (ii(this, t.validateCustomStyleLayer(e))) return; n = t.createStyleLayer(e); } else { if ("object" == typeof e.source && (this.addSource(o, e.source), e = t.clone$1(e), e = t.extend(e, { source: o })), this._validate(t.validateStyle.layer, `layers.${o}`, e, { arrayIndex: -1 }, r)) return; n = t.createStyleLayer(e), this._validateLayer(n), n.setEventedParent(this, { layer: { id: o } }), this._serializedLayers[n.id] = n.serialize(), this._updateLayerCount(n, !0); } const s = i ? this._order.indexOf(i) : this._order.length; if (i && -1 === s) return void this.fire(new t.ErrorEvent(new Error(`Layer with id "${i}" does not exist on this map.`))); this._order.splice(s, 0, o), this._layerOrderChanged = !0, this._layers[o] = n; const a = this._getLayerSourceCache(n); if (this._removedLayers[o] && n.source && a && "custom" !== n.type) { const t = this._removedLayers[o]; delete this._removedLayers[o], t.type !== n.type ? this._updatedSources[n.source] = "clear" : (this._updatedSources[n.source] = "reload", a.pause()); } this._updateLayer(n), n.onAdd && n.onAdd(this.map), this._updateDrapeFirstLayers(); } moveLayer(e, i) { if (this._checkLoaded(), this._changed = !0, !this._layers[e]) return void this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`))); if (e === i) return; const r = this._order.indexOf(e); this._order.splice(r, 1); const o = i ? this._order.indexOf(i) : this._order.length; i && -1 === o ? this.fire(new t.ErrorEvent(new Error(`Layer with id "${i}" does not exist on this map.`))) : (this._order.splice(o, 0, e), this._layerOrderChanged = !0, this._updateDrapeFirstLayers()); } removeLayer(e) { this._checkLoaded(); const i = this._layers[e]; if (!i) return void this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be removed.`))); i.setEventedParent(null), this._updateLayerCount(i, !1); const r = this._order.indexOf(e); this._order.splice(r, 1), this._layerOrderChanged = !0, this._changed = !0, this._removedLayers[e] = i, delete this._layers[e], delete this._serializedLayers[e], delete this._updatedLayers[e], delete this._updatedPaintProps[e], i.onRemove && i.onRemove(this.map), this._updateDrapeFirstLayers(); } getLayer(t) { return this._layers[t] } hasLayer(t) { return t in this._layers } hasLayerType(t) { for (const e in this._layers) if (this._layers[e].type === t) return !0; return !1 } setLayerZoomRange(e, i, r) { this._checkLoaded(); const o = this.getLayer(e); o ? o.minzoom === i && o.maxzoom === r || (null != i && (o.minzoom = i), null != r && (o.maxzoom = r), this._updateLayer(o)) : this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot have zoom extent.`))); } setFilter(e, i, r = {}) { this._checkLoaded(); const o = this.getLayer(e); if (o) { if (!d(o.filter, i)) return null == i ? (o.filter = void 0, void this._updateLayer(o)) : void (this._validate(t.validateStyle.filter, `layers.${o.id}.filter`, i, null, r) || (o.filter = t.clone$1(i), this._updateLayer(o))) } else this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be filtered.`))); } getFilter(e) { return t.clone$1(this.getLayer(e).filter) } setLayoutProperty(e, i, r, o = {}) { this._checkLoaded(); const n = this.getLayer(e); n ? d(n.getLayoutProperty(i), r) || (n.setLayoutProperty(i, r, o), this._updateLayer(n)) : this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be styled.`))); } getLayoutProperty(e, i) { const r = this.getLayer(e); if (r) return r.getLayoutProperty(i); this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style.`))); } setPaintProperty(e, i, r, o = {}) { this._checkLoaded(); const n = this.getLayer(e); n ? d(n.getPaintProperty(i), r) || (n.setPaintProperty(i, r, o) && this._updateLayer(n), this._changed = !0, this._updatedPaintProps[e] = !0) : this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be styled.`))); } getPaintProperty(t, e) { return this.getLayer(t).getPaintProperty(e) } setFeatureState(e, i) { this._checkLoaded(); const r = e.source, o = e.sourceLayer, n = this.getSource(r); if (void 0 === n) return void this.fire(new t.ErrorEvent(new Error(`The source '${r}' does not exist in the map's style.`))); const s = n.type; if ("geojson" === s && o) return void this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))); if ("vector" === s && !o) return void this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))); void 0 === e.id && this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))); const a = this._getSourceCaches(r); for (const t of a) t.setFeatureState(o, e.id, i); } removeFeatureState(e, i) { this._checkLoaded(); const r = e.source, o = this.getSource(r); if (void 0 === o) return void this.fire(new t.ErrorEvent(new Error(`The source '${r}' does not exist in the map's style.`))); const n = o.type, s = "vector" === n ? e.sourceLayer : void 0; if ("vector" === n && !s) return void this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))); if (i && "string" != typeof e.id && "number" != typeof e.id) return void this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))); const a = this._getSourceCaches(r); for (const t of a) t.removeFeatureState(s, e.id, i); } getFeatureState(e) { this._checkLoaded(); const i = e.source, r = e.sourceLayer, o = this.getSource(i); if (void 0 !== o) { if ("vector" !== o.type || r) return void 0 === e.id && this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))), this._getSourceCaches(i)[0].getFeatureState(r, e.id); this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))); } else this.fire(new t.ErrorEvent(new Error(`The source '${i}' does not exist in the map's style.`))); } getTransition() { return t.extend({ duration: 300, delay: 0 }, this.stylesheet && this.stylesheet.transition) } serialize() { const e = {}; for (const t in this._sourceCaches) { const i = this._sourceCaches[t].getSource(); e[i.id] || (e[i.id] = i.serialize()); } return t.filterObject({ version: this.stylesheet.version, name: this.stylesheet.name, metadata: this.stylesheet.metadata, light: this.stylesheet.light, terrain: this.stylesheet.terrain, fog: this.stylesheet.fog, center: this.stylesheet.center, zoom: this.stylesheet.zoom, bearing: this.stylesheet.bearing, pitch: this.stylesheet.pitch, sprite: this.stylesheet.sprite, glyphs: this.stylesheet.glyphs, transition: this.stylesheet.transition, sources: e, layers: this._serializeLayers(this._order) }, (t => void 0 !== t)) } _updateLayer(t) { this._updatedLayers[t.id] = !0; const e = this._getLayerSourceCache(t); t.source && !this._updatedSources[t.source] && e && "raster" !== e.getSource().type && (this._updatedSources[t.source] = "reload", e.pause()), this._changed = !0; } _flattenAndSortRenderedFeatures(t) { const e = t => "fill-extrusion" === this._layers[t].type, i = {}, r = []; for (let o = this._order.length - 1; o >= 0; o--) { const n = this._order[o]; if (e(n)) { i[n] = o; for (const e of t) { const t = e[n]; if (t) for (const e of t) r.push(e); } } } r.sort(((t, e) => e.intersectionZ - t.intersectionZ)); const o = []; for (let n = this._order.length - 1; n >= 0; n--) { const s = this._order[n]; if (e(s)) for (let t = r.length - 1; t >= 0; t--) { const e = r[t].feature; if (i[e.layer.id] < n) break; o.push(e), r.pop(); } else for (const e of t) { const t = e[s]; if (t) for (const e of t) o.push(e.feature); } } return o } queryRenderedFeatures(e, i, r) { i && i.filter && this._validate(t.validateStyle.filter, "queryRenderedFeatures.filter", i.filter, null, i); const o = {}; if (i && i.layers) { if (!Array.isArray(i.layers)) return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))), []; for (const e of i.layers) { const i = this._layers[e]; if (!i) return this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))), []; o[i.source] = !0; } } const n = []; i.availableImages = this._availableImages; const s = i && i.layers ? i.layers.some((t => { const e = this.getLayer(t); return e && e.is3D() })) : this.has3DLayers(), a = q.createFromScreenPoints(e, r); for (const t in this._sourceCaches) { const e = this._sourceCaches[t].getSource().id; i.layers && !o[e] || n.push(Zt(this._sourceCaches[t], this._layers, this._serializedLayers, a, i, r, s, !!this.map._showQueryGeometry)); } return this.placement && n.push(function (t, e, i, r, o, n, s) { const a = {}, l = n.queryRenderedSymbols(r), c = []; for (const t of Object.keys(l).map(Number)) c.push(s[t]); c.sort(qt); for (const i of c) { const r = i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId], e, i.bucketIndex, i.sourceLayerIndex, o.filter, o.layers, o.availableImages, t); for (const t in r) { const e = a[t] = a[t] || [], o = r[t]; o.sort(((t, e) => { const r = i.featureSortOrder; if (r) { const i = r.indexOf(t.featureIndex); return r.indexOf(e.featureIndex) - i } return e.featureIndex - t.featureIndex })); for (const t of o) e.push(t); } } for (const e in a) a[e].forEach((r => { const o = r.feature, n = i(t[e]).getFeatureState(o.layer["source-layer"], o.id); o.source = o.layer.source, o.layer["source-layer"] && (o.sourceLayer = o.layer["source-layer"]), o.state = n; })); return a }(this._layers, this._serializedLayers, this._getLayerSourceCache.bind(this), a.screenGeometry, i, this.placement.collisionIndex, this.placement.retainedQueryData)), this._flattenAndSortRenderedFeatures(n) } querySourceFeatures(e, i) { i && i.filter && this._validate(t.validateStyle.filter, "querySourceFeatures.filter", i.filter, null, i); const r = this._getSourceCaches(e); let o = []; for (const t of r) o = o.concat(Yt(t, i)); return o } addSourceType(t, e, i) { return ai.getSourceType(t) ? i(new Error(`A source type called "${t}" already exists.`)) : (ai.setSourceType(t, e), e.workerSourceURL ? void this.dispatcher.broadcast("loadWorkerSource", { name: t, url: e.workerSourceURL }, i) : i(null, null)) } getLight() { return this.light.getLight() } setLight(e, i = {}) { this._checkLoaded(); const r = this.light.getLight(); let o = !1; for (const t in e) if (!d(e[t], r[t])) { o = !0; break } if (!o) return; const n = { now: t.exported.now(), transition: t.extend({ duration: 300, delay: 0 }, this.stylesheet.transition) }; this.light.setLight(e, i), this.light.updateTransitions(n); } getTerrain() { return this.terrain ? this.terrain.get() : null } setTerrain(e) { if (this._checkLoaded(), !e) return delete this.terrain, delete this.stylesheet.terrain, this.dispatcher.broadcast("enableTerrain", !1), this._force3DLayerUpdate(), void (this._markersNeedUpdate = !0); if ("object" == typeof e.source) { const i = "terrain-dem-src"; this.addSource(i, e.source), e = t.clone$1(e), e = t.extend(e, { source: i }); } if (!this._validate(t.validateStyle.terrain, "terrain", e)) { if (this.terrain) { const i = this.terrain, r = i.get(); for (const o in e) if (!d(e[o], r[o])) { i.set(e), this.stylesheet.terrain = e; const r = { now: t.exported.now(), transition: t.extend({ duration: 0 }, this.stylesheet.transition) }; i.updateTransitions(r); break } } else this._createTerrain(e); this._updateDrapeFirstLayers(), this._markersNeedUpdate = !0; } } _createFog(e) { const i = this.fog = new W(e); this.stylesheet.fog = e; const r = { now: t.exported.now(), transition: t.extend({ duration: 0 }, this.stylesheet.transition) }; i.updateTransitions(r); } _updateMarkersOpacity() { 0 !== this.map._markers.length && this.map._requestDomTask((() => { for (const t of this.map._markers) t._evaluateOpacity(); })); } getFog() { return this.fog ? this.fog.get() : null } setFog(e) { if (this._checkLoaded(), !e) return delete this.fog, delete this.stylesheet.fog, void (this._markersNeedUpdate = !0); if (this.fog) { const i = this.fog, r = i.get(); for (const o in e) if (!d(e[o], r[o])) { i.set(e), this.stylesheet.fog = e; const r = { now: t.exported.now(), transition: t.extend({ duration: 0 }, this.stylesheet.transition) }; i.updateTransitions(r); break } } else this._createFog(e); this._markersNeedUpdate = !0; } _updateDrapeFirstLayers() { if (!this.map._optimizeForTerrain || !this.terrain) return; const t = this._order.filter((t => this.isLayerDraped(this._layers[t]))), e = this._order.filter((t => !this.isLayerDraped(this._layers[t]))); this._drapedFirstOrder = [], this._drapedFirstOrder.push(...t), this._drapedFirstOrder.push(...e); } _createTerrain(e) { const i = this.terrain = new N(e); this.stylesheet.terrain = e, this.dispatcher.broadcast("enableTerrain", !0), this._force3DLayerUpdate(); const r = { now: t.exported.now(), transition: t.extend({ duration: 0 }, this.stylesheet.transition) }; i.updateTransitions(r); } _force3DLayerUpdate() { for (const t in this._layers) { const e = this._layers[t]; "fill-extrusion" === e.type && this._updateLayer(e); } } _validate(e, i, r, o, n = {}) { return (!n || !1 !== n.validate) && ii(this, e.call(t.validateStyle, t.extend({ key: i, style: this.serialize(), value: r, styleSpec: t.spec }, o))) } _remove() { this._request && (this._request.cancel(), this._request = null), this._spriteRequest && (this._spriteRequest.cancel(), this._spriteRequest = null), t.evented.off("pluginStateChange", this._rtlTextPluginCallback); for (const t in this._layers) this._layers[t].setEventedParent(null); for (const t in this._sourceCaches) this._sourceCaches[t].clearTiles(), this._sourceCaches[t].setEventedParent(null); this.imageManager.setEventedParent(null), this.setEventedParent(null), this.dispatcher.remove(); } _clearSource(t) { const e = this._getSourceCaches(t); for (const t of e) t.clearTiles(); } _reloadSource(t) { const e = this._getSourceCaches(t); for (const t of e) t.resume(), t.reload(); } _updateSources(t) { for (const e in this._sourceCaches) this._sourceCaches[e].update(t); } _generateCollisionBoxes() { for (const t in this._sourceCaches) { const e = this._sourceCaches[t]; e.resume(), e.reload(); } } _updatePlacement(e, i, r, o, n = !1) { let s = !1, a = !1; const l = {}; for (const t of this._order) { const i = this._layers[t]; if ("symbol" !== i.type) continue; if (!l[i.source]) { const t = this._getLayerSourceCache(i); if (!t) continue; l[i.source] = t.getRenderableIds(!0).map((e => t.getTileByID(e))).sort(((t, e) => e.tileID.overscaledZ - t.tileID.overscaledZ || (t.tileID.isLessThan(e.tileID) ? -1 : 1))); } const r = this.crossTileSymbolIndex.addLayer(i, l[i.source], e.center.lng); s = s || r; } if (this.crossTileSymbolIndex.pruneUnusedLayers(this._order), n = n || this._layerOrderChanged || 0 === r, this._layerOrderChanged && this.fire(new t.Event("neworder")), (n || !this.pauseablePlacement || this.pauseablePlacement.isDone() && !this.placement.stillRecent(t.exported.now(), e.zoom)) && (this.pauseablePlacement = new Qe(e, this._order, n, i, r, o, this.placement, this.fog ? this.fog.state : null), this._layerOrderChanged = !1), this.pauseablePlacement.isDone() ? this.placement.setStale() : (this.pauseablePlacement.continuePlacement(this._order, this._layers, l), this.pauseablePlacement.isDone() && (this.placement = this.pauseablePlacement.commit(t.exported.now()), a = !0), s && this.pauseablePlacement.placement.setStale()), a || s) for (const t of this._order) { const e = this._layers[t]; "symbol" === e.type && this.placement.updateLayerOpacities(e, l[e.source]); } return !this.pauseablePlacement.isDone() || this.placement.hasTransitions(t.exported.now()) } _releaseSymbolFadeTiles() { for (const t in this._sourceCaches) this._sourceCaches[t].releaseSymbolFadeTiles(); } getImages(t, e, i) { this.imageManager.getImages(e.icons, i), this._updateTilesForChangedImages(); const r = t => { t && t.setDependencies(e.tileID.key, e.type, e.icons); }; r(this._otherSourceCaches[e.source]), r(this._symbolSourceCaches[e.source]); } getGlyphs(t, e, i) { this.glyphManager.getGlyphs(e.stacks, i); } getResource(e, i, r) { return t.makeRequest(i, r) } _getSourceCache(t) { return this._otherSourceCaches[t] } _getLayerSourceCache(t) { return "symbol" === t.type ? this._symbolSourceCaches[t.source] : this._otherSourceCaches[t.source] } _getSourceCaches(t) { const e = []; return this._otherSourceCaches[t] && e.push(this._otherSourceCaches[t]), this._symbolSourceCaches[t] && e.push(this._symbolSourceCaches[t]), e } has3DLayers() { return this._num3DLayers > 0 } hasSymbolLayers() { return this._numSymbolLayers > 0 } hasCircleLayers() { return this._numCircleLayers > 0 } } ai.getSourceType = function (t) { return Ht[t] }, ai.setSourceType = function (t, e) { Ht[t] = e; }, ai.registerForPluginStateChange = t.registerForPluginStateChange; class li extends t.Evented { constructor(e, i) { if (super(), (e instanceof t.window.HTMLElement || i) && (e = t.extend({ element: e }, i)), t.bindAll(["_update", "_onMove", "_onUp", "_addDragHandler", "_onMapClick", "_onKeyPress", "_clearFadeTimer"], this), this._anchor = e && e.anchor || "center", this._color = e && e.color || "#3FB1CE", this._scale = e && e.scale || 1, this._draggable = e && e.draggable || !1, this._clickTolerance = e && e.clickTolerance || 0, this._isDragging = !1, this._state = "inactive", this._rotation = e && e.rotation || 0, this._rotationAlignment = e && e.rotationAlignment || "auto", this._pitchAlignment = e && e.pitchAlignment && "auto" !== e.pitchAlignment ? e.pitchAlignment : this._rotationAlignment, e && e.element) this._element = e.element, this._offset = t.pointGeometry.convert(e && e.offset || [0, 0]); else { this._defaultMarker = !0, this._element = n.create("div"), this._element.setAttribute("aria-label", "Map marker"); const i = n.createNS("http://www.w3.org/2000/svg", "svg"), r = 41, o = 27; i.setAttributeNS(null, "display", "block"), i.setAttributeNS(null, "height", `${r}px`), i.setAttributeNS(null, "width", `${o}px`), i.setAttributeNS(null, "viewBox", `0 0 ${o} ${r}`); const s = n.createNS("http://www.w3.org/2000/svg", "g"); s.setAttributeNS(null, "stroke", "none"), s.setAttributeNS(null, "stroke-width", "1"), s.setAttributeNS(null, "fill", "none"), s.setAttributeNS(null, "fill-rule", "evenodd"); const a = n.createNS("http://www.w3.org/2000/svg", "g"); a.setAttributeNS(null, "fill-rule", "nonzero"); const l = n.createNS("http://www.w3.org/2000/svg", "g"); l.setAttributeNS(null, "transform", "translate(3.0, 29.0)"), l.setAttributeNS(null, "fill", "#000000"); const c = [{ rx: "10.5", ry: "5.25002273" }, { rx: "10.5", ry: "5.25002273" }, { rx: "9.5", ry: "4.77275007" }, { rx: "8.5", ry: "4.29549936" }, { rx: "7.5", ry: "3.81822308" }, { rx: "6.5", ry: "3.34094679" }, { rx: "5.5", ry: "2.86367051" }, { rx: "4.5", ry: "2.38636864" }]; for (const t of c) { const e = n.createNS("http://www.w3.org/2000/svg", "ellipse"); e.setAttributeNS(null, "opacity", "0.04"), e.setAttributeNS(null, "cx", "10.5"), e.setAttributeNS(null, "cy", "5.80029008"), e.setAttributeNS(null, "rx", t.rx), e.setAttributeNS(null, "ry", t.ry), l.appendChild(e); } const h = n.createNS("http://www.w3.org/2000/svg", "g"); h.setAttributeNS(null, "fill", this._color); const u = n.createNS("http://www.w3.org/2000/svg", "path"); u.setAttributeNS(null, "d", "M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"), h.appendChild(u); const d = n.createNS("http://www.w3.org/2000/svg", "g"); d.setAttributeNS(null, "opacity", "0.25"), d.setAttributeNS(null, "fill", "#000000"); const p = n.createNS("http://www.w3.org/2000/svg", "path"); p.setAttributeNS(null, "d", "M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"), d.appendChild(p); const m = n.createNS("http://www.w3.org/2000/svg", "g"); m.setAttributeNS(null, "transform", "translate(6.0, 7.0)"), m.setAttributeNS(null, "fill", "#FFFFFF"); const _ = n.createNS("http://www.w3.org/2000/svg", "g"); _.setAttributeNS(null, "transform", "translate(8.0, 8.0)"); const f = n.createNS("http://www.w3.org/2000/svg", "circle"); f.setAttributeNS(null, "fill", "#000000"), f.setAttributeNS(null, "opacity", "0.25"), f.setAttributeNS(null, "cx", "5.5"), f.setAttributeNS(null, "cy", "5.5"), f.setAttributeNS(null, "r", "5.4999962"); const g = n.createNS("http://www.w3.org/2000/svg", "circle"); g.setAttributeNS(null, "fill", "#FFFFFF"), g.setAttributeNS(null, "cx", "5.5"), g.setAttributeNS(null, "cy", "5.5"), g.setAttributeNS(null, "r", "5.4999962"), _.appendChild(f), _.appendChild(g), a.appendChild(l), a.appendChild(h), a.appendChild(d), a.appendChild(m), a.appendChild(_), i.appendChild(a), i.setAttributeNS(null, "height", r * this._scale + "px"), i.setAttributeNS(null, "width", o * this._scale + "px"), this._element.appendChild(i), this._offset = t.pointGeometry.convert(e && e.offset || [0, -14]); } this._element.classList.add("mapboxgl-marker"), this._element.addEventListener("dragstart", (t => { t.preventDefault(); })), this._element.addEventListener("mousedown", (t => { t.preventDefault(); })), L(this._element, this._anchor, "marker"), this._popup = null; } addTo(t) { return this.remove(), this._map = t, t.getCanvasContainer().appendChild(this._element), t.on("move", this._update), t.on("moveend", this._update), t.on("remove", this._clearFadeTimer), t._addMarker(this), this.setDraggable(this._draggable), this._update(), this._map.on("click", this._onMapClick), this } remove() { return this._map && (this._map.off("click", this._onMapClick), this._map.off("move", this._update), this._map.off("moveend", this._update), this._map.off("mousedown", this._addDragHandler), this._map.off("touchstart", this._addDragHandler), this._map.off("mouseup", this._onUp), this._map.off("touchend", this._onUp), this._map.off("mousemove", this._onMove), this._map.off("touchmove", this._onMove), this._map.off("remove", this._clearFadeTimer), this._map._removeMarker(this), delete this._map), this._clearFadeTimer(), n.remove(this._element), this._popup && this._popup.remove(), this } getLngLat() { return this._lngLat } setLngLat(e) { return this._lngLat = t.LngLat.convert(e), this._pos = null, this._popup && this._popup.setLngLat(this._lngLat), this._update(), this } getElement() { return this._element } setPopup(t) { if (this._popup && (this._popup.remove(), this._popup = null, this._element.removeEventListener("keypress", this._onKeyPress), this._originalTabIndex || this._element.removeAttribute("tabindex")), t) { if (!("offset" in t.options)) { const e = 38.1, i = 13.5, r = Math.sqrt(Math.pow(i, 2) / 2); t.options.offset = this._defaultMarker ? { top: [0, 0], "top-left": [0, 0], "top-right": [0, 0], bottom: [0, -e], "bottom-left": [r, -1 * (e - i + r)], "bottom-right": [-r, -1 * (e - i + r)], left: [i, -1 * (e - i)], right: [-i, -1 * (e - i)] } : this._offset; } this._popup = t, this._lngLat && this._popup.setLngLat(this._lngLat), this._originalTabIndex = this._element.getAttribute("tabindex"), this._originalTabIndex || this._element.setAttribute("tabindex", "0"), this._element.addEventListener("keypress", this._onKeyPress); } return this } _onKeyPress(t) { const e = t.code, i = t.charCode || t.keyCode; "Space" !== e && "Enter" !== e && 32 !== i && 13 !== i || this.togglePopup(); } _onMapClick(t) { const e = t.originalEvent.target, i = this._element; this._popup && (e === i || i.contains(e)) && this.togglePopup(); } getPopup() { return this._popup } togglePopup() { const t = this._popup; return t ? (t.isOpen() ? t.remove() : t.addTo(this._map), this) : this } _evaluateOpacity() { const t = this._pos ? this._pos.sub(this._transformedOffset()) : null; if (!this._withinScreenBounds(t)) return void this._clearFadeTimer(); const e = this._map.unproject(t); let i = !1; if (this._map.getTerrain()) { const t = this._map.getFreeCameraOptions(); if (t.position) { const r = t.position.toLngLat(); i = r.distanceTo(e) < .9 * r.distanceTo(this._lngLat); } } const r = (1 - this._map._queryFogOpacity(e)) * (i ? .2 : 1); this._element.style.opacity = `${r}`, this._popup && this._popup._setOpacity(`${r}`), this._fadeTimer = null; } _clearFadeTimer() { this._fadeTimer && (clearTimeout(this._fadeTimer), this._fadeTimer = null); } _withinScreenBounds(t) { const e = this._map.transform; return !!t && t.x >= 0 && t.x < e.width && t.y >= 0 && t.y < e.height } _update(t) { if (!this._map) return; this._map.transform.renderWorldCopies && (this._lngLat = S(this._lngLat, this._pos, this._map.transform)), this._pos = this._map.project(this._lngLat)._add(this._transformedOffset()); let e = ""; "viewport" === this._rotationAlignment || "auto" === this._rotationAlignment ? e = `rotateZ(${this._rotation}deg)` : "map" === this._rotationAlignment && (e = `rotateZ(${this._rotation - this._map.getBearing()}deg)`); let i = ""; "viewport" === this._pitchAlignment || "auto" === this._pitchAlignment ? i = "rotateX(0deg)" : "map" === this._pitchAlignment && (i = `rotateX(${this._map.getPitch()}deg)`), t && "moveend" !== t.type || (this._pos = this._pos.round()), this._map._requestDomTask((() => { this._map && (this._element && this._pos && this._anchor && n.setTransform(this._element, `${A[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${e}`), !this._map.getTerrain() && !this._map.getFog() || this._fadeTimer || (this._fadeTimer = setTimeout(this._evaluateOpacity.bind(this), 60))); })); } _transformedOffset() { if (!this._defaultMarker) return this._offset; const t = this._map.transform, e = this._offset.mult(this._scale); return "map" === this._rotationAlignment && e._rotate(t.angle), "map" === this._pitchAlignment && (e.y *= Math.cos(t._pitch)), e } getOffset() { return this._offset } setOffset(e) { return this._offset = t.pointGeometry.convert(e), this._update(), this } _onMove(e) { if (!this._isDragging) { const t = this._clickTolerance || this._map._clickTolerance; this._isDragging = e.point.dist(this._pointerdownPos) >= t; } this._isDragging && (this._pos = e.point.sub(this._positionDelta), this._lngLat = this._map.unproject(this._pos), this.setLngLat(this._lngLat), this._element.style.pointerEvents = "none", "pending" === this._state && (this._state = "active", this.fire(new t.Event("dragstart"))), this.fire(new t.Event("drag"))); } _onUp() { this._element.style.pointerEvents = "auto", this._positionDelta = null, this._pointerdownPos = null, this._isDragging = !1, this._map.off("mousemove", this._onMove), this._map.off("touchmove", this._onMove), "active" === this._state && this.fire(new t.Event("dragend")), this._state = "inactive"; } _addDragHandler(t) { this._element.contains(t.originalEvent.target) && (t.preventDefault(), this._positionDelta = t.point.sub(this._pos).add(this._transformedOffset()), this._pointerdownPos = t.point, this._state = "pending", this._map.on("mousemove", this._onMove), this._map.on("touchmove", this._onMove), this._map.once("mouseup", this._onUp), this._map.once("touchend", this._onUp)); } setDraggable(t) { return this._draggable = !!t, this._map && (t ? (this._map.on("mousedown", this._addDragHandler), this._map.on("touchstart", this._addDragHandler)) : (this._map.off("mousedown", this._addDragHandler), this._map.off("touchstart", this._addDragHandler))), this } isDraggable() { return this._draggable } setRotation(t) { return this._rotation = t || 0, this._update(), this } getRotation() { return this._rotation } setRotationAlignment(t) { return this._rotationAlignment = t || "auto", this._update(), this } getRotationAlignment() { return this._rotationAlignment } setPitchAlignment(t) { return this._pitchAlignment = t && "auto" !== t ? t : this._rotationAlignment, this._update(), this } getPitchAlignment() { return this._pitchAlignment } } var ci = 6371008.8, hi = { centimeters: 637100880, centimetres: 637100880, degrees: 57.22891354143274, feet: 20902260.511392, inches: 39.37 * ci, kilometers: 6371.0088, kilometres: 6371.0088, meters: ci, metres: ci, miles: 3958.761333810546, millimeters: 6371008800, millimetres: 6371008800, nauticalmiles: ci / 1852, radians: 1, yards: 6967335.223679999 }; function ui(t, e, i) { void 0 === i && (i = {}); var r = { type: "Feature" }; return (0 === i.id || i.id) && (r.id = i.id), i.bbox && (r.bbox = i.bbox), r.properties = e || {}, r.geometry = t, r } function di(t, e, i) { if (void 0 === i && (i = {}), !t) throw new Error("coordinates is required"); if (!Array.isArray(t)) throw new Error("coordinates must be an Array"); if (t.length < 2) throw new Error("coordinates must be at least 2 numbers long"); if (!gi(t[0]) || !gi(t[1])) throw new Error("coordinates must contain numbers"); return ui({ type: "Point", coordinates: t }, e, i) } function pi(t, e, i) { void 0 === i && (i = {}); for (var r = 0, o = t; r < o.length; r++) { var n = o[r]; if (n.length < 4) throw new Error("Each LinearRing of a Polygon must have 4 or more Positions."); for (var s = 0; s < n[n.length - 1].length; s++)if (n[n.length - 1][s] !== n[0][s]) throw new Error("First and last Position are not equivalent.") } return ui({ type: "Polygon", coordinates: t }, e, i) } function mi(t, e, i) { if (void 0 === i && (i = {}), t.length < 2) throw new Error("coordinates must be an array of two or more positions"); return ui({ type: "LineString", coordinates: t }, e, i) } function _i(t) { return t % (2 * Math.PI) * 180 / Math.PI } function fi(t) { return t % 360 * Math.PI / 180 } function gi(t) { return !isNaN(t) && null !== t && !Array.isArray(t) } function vi(t) { if (!t) throw new Error("coord is required"); if (!Array.isArray(t)) { if ("Feature" === t.type && null !== t.geometry && "Point" === t.geometry.type) return t.geometry.coordinates; if ("Point" === t.type) return t.coordinates } if (Array.isArray(t) && t.length >= 2 && !Array.isArray(t[0]) && !Array.isArray(t[1])) return t; throw new Error("coord must be GeoJSON Point or an Array of numbers") } function xi(t, e, i) { void 0 === i && (i = {}); var r = vi(t), o = vi(e), n = fi(o[1] - r[1]), s = fi(o[0] - r[0]), a = fi(r[1]), l = fi(o[1]), c = Math.pow(Math.sin(n / 2), 2) + Math.pow(Math.sin(s / 2), 2) * Math.cos(a) * Math.cos(l); return function (t, e) { void 0 === e && (e = "kilometers"); var i = hi[e]; if (!i) throw new Error(e + " units is invalid"); return t * i }(2 * Math.atan2(Math.sqrt(c), Math.sqrt(1 - c)), i.units) } function yi(t = []) { return { type: "Feature", properties: {}, geometry: { type: "LineString", coordinates: t } } } function bi(t = [], e = []) { return { type: "FeatureCollection", features: t.map(((t, i) => ({ type: "Feature", properties: { text: 0 === Number(e[i].distance) ? "" : e[i].text }, geometry: { type: "Point", coordinates: t } }))) } } function wi(t, e, i) { if (null !== t) for (var r, o, n, s, a, l, c, h, u = 0, d = 0, p = t.type, m = "FeatureCollection" === p, _ = "Feature" === p, f = m ? t.features.length : 1, g = 0; g < f; g++) { a = (h = !!(c = m ? t.features[g].geometry : _ ? t.geometry : t) && "GeometryCollection" === c.type) ? c.geometries.length : 1; for (var v = 0; v < a; v++) { var x = 0, y = 0; if (null !== (s = h ? c.geometries[v] : c)) { l = s.coordinates; var b = s.type; switch (u = !i || "Polygon" !== b && "MultiPolygon" !== b ? 0 : 1, b) { case null: break; case "Point": if (!1 === e(l, d, g, x, y)) return !1; d++, x++; break; case "LineString": case "MultiPoint": for (r = 0; r < l.length; r++) { if (!1 === e(l[r], d, g, x, y)) return !1; d++, "MultiPoint" === b && x++; } "LineString" === b && x++; break; case "Polygon": case "MultiLineString": for (r = 0; r < l.length; r++) { for (o = 0; o < l[r].length - u; o++) { if (!1 === e(l[r][o], d, g, x, y)) return !1; d++; } "MultiLineString" === b && x++, "Polygon" === b && y++; } "Polygon" === b && x++; break; case "MultiPolygon": for (r = 0; r < l.length; r++) { for (y = 0, o = 0; o < l[r].length; o++) { for (n = 0; n < l[r][o].length - u; n++) { if (!1 === e(l[r][o][n], d, g, x, y)) return !1; d++; } y++; } x++; } break; case "GeometryCollection": for (r = 0; r < s.geometries.length; r++)if (!1 === wi(s.geometries[r], e, i)) return !1; break; default: throw new Error("Unknown Geometry Type") } } } } } function Ei(t, e) { var i, r, o, n, s, a, l, c, h, u, d = 0, p = "FeatureCollection" === t.type, m = "Feature" === t.type, _ = p ? t.features.length : 1; for (i = 0; i < _; i++) { for (c = p ? t.features[i].properties : m ? t.properties : {}, h = p ? t.features[i].bbox : m ? t.bbox : void 0, u = p ? t.features[i].id : m ? t.id : void 0, s = (l = !!(a = p ? t.features[i].geometry : m ? t.geometry : t) && "GeometryCollection" === a.type) ? a.geometries.length : 1, o = 0; o < s; o++)if (null !== (n = l ? a.geometries[o] : a)) switch (n.type) { case "Point": case "LineString": case "MultiPoint": case "Polygon": case "MultiLineString": case "MultiPolygon": if (!1 === e(n, d, c, h, u)) return !1; break; case "GeometryCollection": for (r = 0; r < n.geometries.length; r++)if (!1 === e(n.geometries[r], d, c, h, u)) return !1; break; default: throw new Error("Unknown Geometry Type") } else if (!1 === e(null, d, c, h, u)) return !1; d++; } } function Ti(t) { var e = [1 / 0, 1 / 0, -1 / 0, -1 / 0]; return wi(t, (function (t) { e[0] > t[0] && (e[0] = t[0]), e[1] > t[1] && (e[1] = t[1]), e[2] < t[0] && (e[2] = t[0]), e[3] < t[1] && (e[3] = t[1]); })), e } function Ci(t, e) { void 0 === e && (e = {}); var i = Ti(t); return di([(i[0] + i[2]) / 2, (i[1] + i[3]) / 2], e.properties, e) } Ti.default = Ti; var Si = 6378137; function Ai(t) { return function (t, e, i) { var r = 0; return Ei(t, (function (t, e, i, o, n) { r += function (t) { var e, i = 0; switch (t.type) { case "Polygon": return Li(t.coordinates); case "MultiPolygon": for (e = 0; e < t.coordinates.length; e++)i += Li(t.coordinates[e]); return i; case "Point": case "MultiPoint": case "LineString": case "MultiLineString": return 0 }return 0 }(t); })), r }(t) } function Li(t) { var e = 0; if (t && t.length > 0) { e += Math.abs(Ii(t[0])); for (var i = 1; i < t.length; i++)e -= Math.abs(Ii(t[i])); } return e } function Ii(t) { var e, i, r, o, n, s, a = 0, l = t.length; if (l > 2) { for (s = 0; s < l; s++)s === l - 2 ? (r = l - 2, o = l - 1, n = 0) : s === l - 1 ? (r = l - 1, o = 0, n = 1) : (r = s, o = s + 1, n = s + 2), e = t[r], i = t[o], a += (Mi(t[n][0]) - Mi(e[0])) * Math.sin(Mi(i[1])); a = a * Si * Si / 2; } return a } function Mi(t) { return t * Math.PI / 180 } function Pi(t = []) { return { type: "Feature", properties: {}, geometry: { type: "LineString", coordinates: t } } } function zi(t = []) { return { id: (new Date).getTime(), type: "Feature", properties: {}, geometry: { type: "Polygon", coordinates: [t] } } } function Di(t = []) { return { type: "FeatureCollection", features: t.map((t => ({ type: "Feature", geometry: { type: "Point", coordinates: t } }))) } } const ki = "raster-normal", Ri = "mixed-normal", Fi = "mixed-dark", Oi = "vector-normal", Bi = "vector-dark", Ui = "<<<SFMAP_V3.0_DEFAULT_STYLE_URL>>>", Ni = "https://webmap-vs5.sf-express.com/MapVTService/vmapx/mapstyle/day", Gi = "https://webmap-vs5.sf-express.com/MapVTService/vmapx/mapstyle/night", ji = "https://webmap-vs5.sf-express.com/MapVTService/vmapx/mapstyle/day", Hi = "https://webmap-vs5.sf-express.com/MapVTService/vmapx/mapstyle/allvector_night", Vi = "https://webmap-vs5.sf-express.com/MapVTService/vmapx/mapstyle/allvector_day"; var Wi = Object.freeze({ __proto__: null, RASTER_NORMAL: ki, MIXED_NORMAL: Ri, MIXED_DARK: Fi, VECTOR_NORMAL: Oi, VECTOR_DARK: Bi, URL_DEFAULT: Ui, URL_RASTER_NORMAL: Ni, URL_MIXED_DARK: Gi, URL_MIXED_NORMAL: ji, URL_VECTOR_DARK: Hi, URL_VECTOR_NORMAL: Vi }); const Zi = { anchor: "bottom", closeOnClick: !1, focusAfterOpen: !1, closeButton: !1 }; var Yi = "\n#define EPSILON 0.0000001\r\n#define PI 3.141592653589793\r\n#ifdef FOG\r\nuniform mediump vec4 u_fog_color;\r\nuniform mediump vec2 u_fog_range;\r\nuniform mediump float u_fog_horizon_blend;\r\nvarying vec3 v_fog_pos;\r\nfloat fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);\r\n}float fog_horizon_blending(vec3 camera_dir) {\r\nfloat t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);\r\n}float fog_opacity(float t) {\r\nconst float decay=6.0;\r\nfloat falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);\r\n}\r\n#endif", qi = "attribute highp vec3 a_pos_3f;\r\nuniform lowp mat4 u_matrix;\r\nvarying highp vec3 v_uv;\r\nvoid main() {\r\nconst mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);\r\nv_uv=half_neg_pi_around_x*a_pos_3f;\r\nvec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;\r\n}"; let Xi = {}, Qi = {}; Xi = tr("", "\n#define ELEVATION_SCALE 7.0\r\n#define ELEVATION_OFFSET 450.0\r\n#ifdef TERRAIN\r\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\r\nuniform highp sampler2D u_dem;\r\nuniform highp sampler2D u_dem_prev;\r\n#else\r\nuniform sampler2D u_dem;\r\nuniform sampler2D u_dem_prev;\r\n#endif\r\nuniform vec4 u_dem_unpack;\r\nuniform vec2 u_dem_tl;\r\nuniform vec2 u_dem_tl_prev;\r\nuniform float u_dem_scale;\r\nuniform float u_dem_scale_prev;\r\nuniform float u_dem_size;\r\nuniform float u_dem_lerp;\r\nuniform float u_exaggeration;\r\nuniform float u_meter_to_dem;\r\nuniform mat4 u_label_plane_matrix_inv;\r\nuniform sampler2D u_depth;\r\nuniform vec2 u_depth_size_inv;\r\nvec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {\r\nvec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;\r\nvec2 f=fract(pos);\r\nreturn vec4((pos-f+0.5)/(dem_size+2.0),f);\r\n}\r\nfloat decodeElevation(vec4 v) {\r\nreturn dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);\r\n}\r\nfloat currentElevation(vec2 apos) {\r\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\r\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);\r\nreturn u_exaggeration*texture2D(u_dem,pos).a;\r\n#else\r\nfloat dd=1.0/(u_dem_size+2.0);\r\nvec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);\r\nvec2 pos=r.xy;\r\nvec2 f=r.zw;\r\nfloat tl=decodeElevation(texture2D(u_dem,pos));\r\n#ifdef TERRAIN_DEM_NEAREST_FILTER\r\nreturn u_exaggeration*tl;\r\n#endif\r\nfloat tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));\r\nfloat bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));\r\nfloat br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));\r\nreturn u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\r\n#endif\r\n}\r\nfloat prevElevation(vec2 apos) {\r\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\r\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);\r\nreturn u_exaggeration*texture2D(u_dem_prev,pos).a;\r\n#else\r\nfloat dd=1.0/(u_dem_size+2.0);\r\nvec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);\r\nvec2 pos=r.xy;\r\nvec2 f=r.zw;\r\nfloat tl=decodeElevation(texture2D(u_dem_prev,pos));\r\nfloat tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));\r\nfloat bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));\r\nfloat br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));\r\nreturn u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\r\n#endif\r\n}\r\n#ifdef TERRAIN_VERTEX_MORPHING\r\nfloat elevation(vec2 apos) {\r\nfloat nextElevation=currentElevation(apos);\r\nfloat prevElevation=prevElevation(apos);\r\nreturn mix(prevElevation,nextElevation,u_dem_lerp);\r\n}\r\n#else\r\nfloat elevation(vec2 apos) {\r\nreturn currentElevation(apos);\r\n}\r\n#endif\nfloat unpack_depth(vec4 rgba_depth)\r\n{\r\nconst vec4 bit_shift=vec4(1.0/(256.0*256.0*256.0),1.0/(256.0*256.0),1.0/256.0,1.0);\r\nreturn dot(rgba_depth,bit_shift)*2.0-1.0;\r\n}\r\nbool isOccluded(vec4 frag) {\r\nvec3 coord=frag.xyz/frag.w;\r\nfloat depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));\r\nreturn coord.z > depth+0.0005;\r\n}\r\nfloat occlusionFade(vec4 frag) {\r\nvec3 coord=frag.xyz/frag.w;\r\nvec3 df=vec3(5.0*u_depth_size_inv,0.0);\r\nvec2 uv=0.5*coord.xy+0.5;\r\nvec4 depth=vec4(\r\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\r\n);\r\nreturn dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));\r\n}vec4 fourSample(vec2 pos,vec2 off) {\r\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\r\nfloat tl=texture2D(u_dem,pos).a;\r\nfloat tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;\r\nfloat bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;\r\nfloat br=texture2D(u_dem,pos+off).a;\r\n#else\r\nvec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);\r\nfloat tl=dot(demtl,u_dem_unpack);\r\nvec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);\r\nfloat tr=dot(demtr,u_dem_unpack);\r\nvec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);\r\nfloat bl=dot(dembl,u_dem_unpack);\r\nvec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);\r\nfloat br=dot(dembr,u_dem_unpack);\r\n#endif\r\nreturn vec4(tl,tr,bl,br);\r\n}\r\nfloat flatElevation(vec2 pack) {\r\nvec2 apos=floor(pack/8.0);\r\nvec2 span=10.0*(pack-apos*8.0);\r\nvec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;\r\nfloat size=u_dem_size+2.0;\r\nfloat dd=1.0/size;\r\nvec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;\r\nvec2 f=fract(pos);\r\npos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));\r\nfloat z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);\r\nvec2 w=floor(0.5*(span*u_meter_to_dem-1.0));\r\nvec2 d=dd*w;\r\nvec4 bounds=vec4(d,vec2(1.0)-d);h=fourSample(pos-d,2.0*d+vec2(dd));\r\nvec4 diff=abs(h.xzxy-h.ywzw);\r\nvec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));\r\nvec2 fix=slope*span;\r\nfloat base=z+max(fix.x,fix.y);\r\nreturn u_exaggeration*base;\r\n}\r\nfloat elevationFromUint16(float word) {\r\nreturn u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);\r\n}\n#else\r\nfloat elevation(vec2 pos) { return 0.0; }\r\nbool isOccluded(vec4 frag) { return false; }\r\nfloat occlusionFade(vec4 frag) { return 1.0; }\r\n#endif", !0), Qi = tr("#ifdef FOG\r\nuniform float u_fog_temporal_offset;float fog_opacity(vec3 pos) {\r\nfloat depth=length(pos);\r\nreturn fog_opacity(fog_range(depth));\r\n}\r\nvec3 fog_apply(vec3 color,vec3 pos) {\r\nfloat depth=length(pos);\r\nfloat opacity=fog_opacity(fog_range(depth));\r\nopacity*=fog_horizon_blending(pos/depth);\r\nreturn mix(color,u_fog_color.rgb,opacity);\r\n}vec3 fog_apply_from_vert(vec3 color,float fog_opac) {\r\nreturn mix(color,u_fog_color.rgb,fog_opac);\r\n}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {\r\nfloat horizon_blend=fog_horizon_blending(normalize(camera_ray));\r\nreturn mix(sky_color,u_fog_color.rgb,horizon_blend);\r\n}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {\r\nfloat alpha=EPSILON+color.a;\r\ncolor.rgb/=alpha;\r\ncolor.rgb=fog_apply(color.rgb,pos);\r\ncolor.rgb*=alpha;\r\nreturn color;\r\n}\r\nvec3 fog_dither(vec3 color) {\r\nvec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;\r\nreturn dither(color,dither_seed);\r\n}\r\nvec4 fog_dither(vec4 color) {\r\nreturn vec4(fog_dither(color.rgb),color.a);\r\n}\r\n#endif", "#ifdef FOG\r\nuniform mat4 u_fog_matrix;\r\nvec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;\r\n}\r\nvec3 fog_position(vec2 pos) {\r\nreturn fog_position(vec3(pos,0.0));\r\n}\r\nfloat fog(vec3 pos) {\r\nfloat depth=length(pos);\r\nfloat opacity=fog_opacity(fog_range(depth));\r\nreturn opacity*fog_horizon_blending(pos/depth);\r\n}\r\n#endif", !0); const Ki = tr("#ifdef GL_ES\r\nprecision mediump float;\r\n#else\r\n#if !defined(lowp)\r\n#define lowp\r\n#endif\r\n#if !defined(mediump)\r\n#define mediump\r\n#endif\r\n#if !defined(highp)\r\n#define highp\r\n#endif\r\n#endif\r\nhighp vec3 hash(highp vec2 p) {\r\nhighp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));\r\np3+=dot(p3,p3.yxz+19.19);\r\nreturn fract((p3.xxy+p3.yzz)*p3.zyx);\r\n}\r\nvec3 dither(vec3 color,highp vec2 seed) {\r\nvec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;\r\nreturn color+rnd/255.0;\r\n}", "#ifdef GL_ES\r\nprecision highp float;\r\n#else\r\n#if !defined(lowp)\r\n#define lowp\r\n#endif\r\n#if !defined(mediump)\r\n#define mediump\r\n#endif\r\n#if !defined(highp)\r\n#define highp\r\n#endif\r\n#endif\nvec2 unpack_float(const float packedValue) {\r\nint packedIntValue=int(packedValue);\r\nint v0=packedIntValue/256;\r\nreturn vec2(v0,packedIntValue-v0*256);\r\n}\r\nvec2 unpack_opacity(const float packedOpacity) {\r\nint intOpacity=int(packedOpacity)/2;\r\nreturn vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));\r\n}vec4 decode_color(const vec2 encodedColor) {\r\nreturn vec4(\r\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\r\n);\r\n}float unpack_mix_vec2(const vec2 packedValue,const float t) {\r\nreturn mix(packedValue[0],packedValue[1],t);\r\n}vec4 unpack_mix_color(const vec4 packedColors,const float t) {\r\nvec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));\r\nvec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));\r\nreturn mix(minColor,maxColor,t);\r\n}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {\r\nvec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);\r\nreturn (tile_units_to_pixels*pos+offset)/pattern_size;\r\n}\r\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered."), Ji = Yi; var $i = { background: tr("uniform vec4 u_color;\r\nuniform float u_opacity;\r\nvoid main() {\r\nvec4 out_color=u_color;\r\n#ifdef FOG\r\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\r\n#endif\r\ngl_FragColor=out_color*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n#ifdef FOG\r\nv_fog_pos=fog_position(a_pos);\r\n#endif\r\n}"), backgroundPattern: tr("uniform vec2 u_pattern_tl_a;\r\nuniform vec2 u_pattern_br_a;\r\nuniform vec2 u_pattern_tl_b;\r\nuniform vec2 u_pattern_br_b;\r\nuniform vec2 u_texsize;\r\nuniform float u_mix;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvoid main() {\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\nvec4 out_color=mix(color1,color2,u_mix);\r\n#ifdef FOG\r\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\r\n#endif\r\ngl_FragColor=out_color*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "uniform mat4 u_matrix;\r\nuniform vec2 u_pattern_size_a;\r\nuniform vec2 u_pattern_size_b;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_scale_a;\r\nuniform float u_scale_b;\r\nuniform float u_tile_units_to_pixels;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);\r\n#ifdef FOG\r\nv_fog_pos=fog_position(a_pos);\r\n#endif\r\n}"), circle: tr("varying vec3 v_data;\r\nvarying float v_visibility;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define mediump float radius\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define highp vec4 stroke_color\r\n#pragma mapbox: define mediump float stroke_width\r\n#pragma mapbox: define lowp float stroke_opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize mediump float radius\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize highp vec4 stroke_color\r\n#pragma mapbox: initialize mediump float stroke_width\r\n#pragma mapbox: initialize lowp float stroke_opacity\r\nvec2 extrude=v_data.xy;\r\nfloat extrude_length=length(extrude);\r\nlowp float antialiasblur=v_data.z;\r\nfloat antialiased_blur=-max(blur,antialiasblur);\r\nfloat opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);\r\nfloat color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\r\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\r\n);\r\nvec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\r\n#ifdef FOG\r\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\r\n#endif\r\ngl_FragColor=out_color*(v_visibility*opacity_t);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "#define NUM_VISIBILITY_RINGS 2\r\n#define INV_SQRT2 0.70710678\r\n#define ELEVATION_BIAS 0.0001\r\n#define NUM_SAMPLES_PER_RING 16\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nattribute vec2 a_pos;\r\nvarying vec3 v_data;\r\nvarying float v_visibility;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define mediump float radius\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define highp vec4 stroke_color\r\n#pragma mapbox: define mediump float stroke_width\r\n#pragma mapbox: define lowp float stroke_opacity\r\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {\r\nreturn extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;\r\n}\r\nfloat cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {\r\nvec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);\r\nvec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);\r\nvec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);\r\nvec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);\r\nfloat h1=elevation(c1)+ELEVATION_BIAS;\r\nfloat h2=elevation(c2)+ELEVATION_BIAS;\r\nfloat h3=elevation(c3)+ELEVATION_BIAS;\r\nfloat h4=elevation(c4)+ELEVATION_BIAS;\r\nreturn max(h4,max(h3,max(h1,h2)));\r\n}\r\nfloat circle_elevation(vec2 pos) {\r\n#if defined(TERRAIN)\r\nreturn elevation(pos)+ELEVATION_BIAS;\r\n#else\r\nreturn 0.0;\r\n#endif\r\n}\r\nvec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale) {\r\nvec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\r\n#ifdef PITCH_WITH_MAP\r\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\r\n#else\r\nreturn projected_center+vec4(sample_offset,0,0);\r\n#endif\r\n}\r\nfloat get_sample_step() {\r\n#ifdef PITCH_WITH_MAP\r\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\r\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\r\n#endif\r\n}\r\nvoid main(void) {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize mediump float radius\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize highp vec4 stroke_color\r\n#pragma mapbox: initialize mediump float stroke_width\r\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float height=circle_elevation(circle_center);\r\nvec4 world_center=vec4(circle_center,height,1);\r\nvec4 projected_center=u_matrix*world_center;\r\nfloat view_scale=0.0;\r\n#ifdef PITCH_WITH_MAP\r\n#ifdef SCALE_WITH_MAP\r\nview_scale=1.0;\r\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\r\n#endif\r\n#else\r\n#ifdef SCALE_WITH_MAP\r\nview_scale=u_camera_to_center_distance;\r\n#else\r\nview_scale=projected_center.w;\r\n#endif\r\n#endif\r\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale);\r\nfloat visibility=0.0;\r\n#ifdef TERRAIN\r\nfloat step=get_sample_step();\r\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);\r\nvec4 occlusion_world_center=vec4(circle_center,cantilevered_height,1);\r\nvec4 occlusion_projected_center=u_matrix*occlusion_world_center;\r\n#else\r\nvec4 occlusion_world_center=world_center;\r\nvec4 occlusion_projected_center=projected_center;\r\n#endif\r\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {\r\nfloat scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);\r\nfor(int i=0; i < NUM_SAMPLES_PER_RING; i++) {\r\nvec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;\r\nvec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale);\r\nvisibility+=float(!isOccluded(frag_pos));\r\n}\r\n}\r\nvisibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\r\n#else\r\nvisibility=1.0;\r\n#endif\r\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);\r\nv_data=vec3(extrude.x,extrude.y,antialiasblur);\r\n#ifdef FOG\r\nv_fog_pos=fog_position(world_center.xyz);\r\n#endif\r\n}"), clippingMask: tr("void main() {\r\ngl_FragColor=vec4(1.0);\r\n}", "attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"), heatmap: tr("uniform highp float u_intensity;\r\nvarying vec2 v_extrude;\r\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\r\nvoid main() {\r\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);\r\nfloat val=weight*u_intensity*GAUSS_COEF*exp(d);\r\ngl_FragColor=vec4(val,1.0,1.0,1.0);\r\n#ifdef FOG\ngl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);\r\n#endif\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "uniform mat4 u_matrix;\r\nuniform float u_extrude_scale;\r\nuniform float u_opacity;\r\nuniform float u_intensity;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_extrude;\r\n#pragma mapbox: define highp float weight\r\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\r\nvoid main(void) {\r\n#pragma mapbox: initialize highp float weight\r\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec3 pos=vec3(floor(a_pos*0.5)+extrude,elevation(floor(a_pos*0.5)));\r\ngl_Position=u_matrix*vec4(pos,1);\r\n#ifdef FOG\r\nv_fog_pos=fog_position(pos);\r\n#endif\r\n}"), heatmapTexture: tr("uniform sampler2D u_image;\r\nuniform sampler2D u_color_ramp;\r\nuniform float u_opacity;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\nfloat t=texture2D(u_image,v_pos).r;\r\nvec4 color=texture2D(u_color_ramp,vec2(t,0.5));\r\ngl_FragColor=color*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(0.0);\r\n#endif\r\n}", "uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos*u_world,0,1);\r\nv_pos.x=a_pos.x;\r\nv_pos.y=1.0-a_pos.y;\r\n}"), collisionBox: tr("varying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nvec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;\r\ngl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));\r\n}", "attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nattribute vec2 a_shift;\r\nattribute float a_size_scale;\r\nattribute vec2 a_padding;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,elevation(a_anchor_pos),1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);\r\ngl_Position=u_matrix*vec4(a_pos,elevation(a_pos),1.0);\r\ngl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\n}"), collisionCircle: tr("varying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying float v_perspective_ratio;\r\nvarying float v_collision;\r\nvoid main() {\r\nfloat alpha=0.5*min(v_perspective_ratio,1.0);\r\nfloat stroke_radius=0.9*max(v_perspective_ratio,1.0);\r\nfloat distance_to_center=length(v_extrude);\r\nfloat distance_to_edge=abs(distance_to_center-v_radius);\r\nfloat opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);\r\nvec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);\r\ngl_FragColor=color*alpha*opacity_t;\r\n}", "attribute vec2 a_pos_2f;\r\nattribute float a_radius;\r\nattribute vec2 a_flags;\r\nuniform mat4 u_matrix;\r\nuniform mat4 u_inv_matrix;\r\nuniform vec2 u_viewport_size;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying float v_perspective_ratio;\r\nvarying float v_collision;\r\nvec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);\r\nvec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);\r\nrayStart.xyz/=rayStart.w;\r\nrayEnd.xyz /=rayEnd.w;\r\nhighp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);\r\nreturn mix(rayStart.xyz,rayEnd.xyz,t);\r\n}\r\nvoid main() {\r\nvec2 quadCenterPos=a_pos_2f;\r\nfloat radius=a_radius;\r\nfloat collision=a_flags.x;\r\nfloat vertexIdx=a_flags.y;\r\nvec2 quadVertexOffset=vec2(\r\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));\r\nvec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);\r\nvec4 clipPos=u_matrix*vec4(tilePos,1.0);\r\nhighp float camera_to_anchor_distance=clipPos.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;\r\nv_radius=radius;\r\nv_extrude=quadVertexExtent*padding_factor;\r\nv_perspective_ratio=collision_perspective_ratio;\r\nv_collision=collision;\r\ngl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);\r\n}"), debug: tr("uniform highp vec4 u_color;\r\nuniform sampler2D u_overlay;\r\nvarying vec2 v_uv;\r\nvoid main() {\r\nvec4 overlay_color=texture2D(u_overlay,v_uv);\r\ngl_FragColor=mix(u_color,overlay_color,overlay_color.a);\r\n}", "attribute vec2 a_pos;\r\nvarying vec2 v_uv;\r\nuniform mat4 u_matrix;\r\nuniform float u_overlay_scale;\r\nvoid main() {float h=elevation(a_pos);\r\nv_uv=a_pos/8192.0;\r\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\r\n}"), fill: tr("#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\nvec4 out_color=color;\r\n#ifdef FOG\r\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\r\n#endif\r\ngl_FragColor=out_color*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n#ifdef FOG\r\nv_fog_pos=fog_position(a_pos);\r\n#endif\r\n}"), fillOutline: tr("varying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\nfloat dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\nvec4 out_color=outline_color;\r\n#ifdef FOG\r\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\r\n#endif\r\ngl_FragColor=out_color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n#ifdef FOG\r\nv_fog_pos=fog_position(a_pos);\r\n#endif\r\n}"), fillOutlinePattern: tr("uniform vec2 u_texsize;\r\nuniform sampler2D u_image;\r\nuniform float u_fade;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\nvec4 out_color=mix(color1,color2,u_fade);\r\n#ifdef FOG\r\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\r\n#endif\r\ngl_FragColor=out_color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n#ifdef FOG\r\nv_fog_pos=fog_position(a_pos);\r\n#endif\r\n}"), fillPattern: tr("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\nvec4 out_color=mix(color1,color2,u_fade);\r\n#ifdef FOG\r\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\r\n#endif\r\ngl_FragColor=out_color*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);\r\n#ifdef FOG\r\nv_fog_pos=fog_position(a_pos);\r\n#endif\r\n}"), fillExtrusion: tr("varying vec4 v_color;\r\nvoid main() {\r\nvec4 color=v_color;\r\n#ifdef FOG\r\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\r\n#endif\r\ngl_FragColor=color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "uniform mat4 u_matrix;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nattribute vec4 a_pos_normal_ed;\r\nattribute vec2 a_centroid_pos;\r\nvarying vec4 v_color;\r\n#pragma mapbox: define highp float base\r\n#pragma mapbox: define highp float height\r\n#pragma mapbox: define highp vec4 color\r\nvoid main() {\r\n#pragma mapbox: initialize highp float base\r\n#pragma mapbox: initialize highp float height\r\n#pragma mapbox: initialize highp vec4 color\r\nvec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;\r\nfloat x_normal=pos_nx.z/8192.0;\r\nvec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=top_up_ny.x;\r\n#ifdef TERRAIN\r\nvec2 centroid_pos=a_centroid_pos;\r\nbool flat_roof=centroid_pos.x !=0.0;\r\nfloat ele=elevation(pos_nx.xy);\r\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);\r\nfloat c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);\r\nvec3 pos=vec3(pos_nx.xy,h);\r\ngl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);\r\n#else\r\nvec3 pos=vec3(pos_nx.xy,t > 0.0 ? height : base);\r\ngl_Position=u_matrix*vec4(pos,1);\r\n#endif\nfloat colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;\r\nv_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);\r\ncolor+=ambientlight;float directional=clamp(dot(normal,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}v_color.rgb+=clamp(color.rgb*directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\r\nv_color*=u_opacity;\r\n#ifdef FOG\r\nv_fog_pos=fog_position(pos);\r\n#endif\r\n}"), fillExtrusionPattern: tr("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform vec4 u_pattern_topColor;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\nvarying vec3 v_normal_ed;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\nvec4 out_color=mix(color1,color2,u_fade);\r\nout_color=out_color*v_lighting;\r\nout_color=v_normal_ed.y > 0.0 ? u_pattern_topColor : out_color;\r\n#ifdef FOG\r\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\r\n#endif\r\ngl_FragColor=out_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_height_factor;\r\nuniform vec3 u_scale;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nattribute vec4 a_pos_normal_ed;\r\nattribute vec2 a_centroid_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\nvarying vec3 v_normal_ed;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;\r\nfloat x_normal=pos_nx.z/8192.0;\r\nvec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\r\nfloat edgedistance=a_pos_normal_ed.w;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=top_up_ny.x;\r\nfloat z=t > 0.0 ? height : base;\r\nv_normal_ed=top_up_ny;\r\n#ifdef TERRAIN\r\nvec2 centroid_pos=a_centroid_pos;\r\nbool flat_roof=centroid_pos.x !=0.0;\r\nfloat ele=elevation(pos_nx.xy);\r\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);\r\nfloat c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);\r\nvec3 p=vec3(pos_nx.xy,h);\r\ngl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);\r\n#else\r\nvec3 p=vec3(pos_nx.xy,z);\r\ngl_Position=u_matrix*vec4(p,1);\r\n#endif\r\nvec2 pos=normal.z==1.0\r\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);\r\nv_lighting=vec4(0.0,0.0,0.0,1.0);\r\nfloat directional=clamp(dot(normal,u_lightpos),0.0,1.0);\r\ndirectional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);\r\nif (normal.y !=0.0) {directional*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}\r\nv_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\r\nv_lighting*=u_opacity;\r\n#ifdef FOG\r\nv_fog_pos=fog_position(p);\r\n#endif\r\n}"), hillshadePrepare: tr("#ifdef GL_ES\r\nprecision highp float;\r\n#endif\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_dimension;\r\nuniform float u_zoom;\r\nuniform vec4 u_unpack;\r\nfloat getElevation(vec2 coord) {\r\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\r\nreturn texture2D(u_image,coord).a/4.0;\r\n#else\nvec4 data=texture2D(u_image,coord)*255.0;\r\ndata.a=-1.0;\r\nreturn dot(data,u_unpack)/4.0;\r\n#endif\r\n}\r\nvoid main() {\r\nvec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));\r\nfloat b=getElevation(v_pos+vec2(0,-epsilon.y));\r\nfloat c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));\r\nfloat d=getElevation(v_pos+vec2(-epsilon.x,0));\r\nfloat e=getElevation(v_pos);\r\nfloat f=getElevation(v_pos+vec2(epsilon.x,0));\r\nfloat g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));\r\nfloat h=getElevation(v_pos+vec2(0,epsilon.y));\r\nfloat i=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\r\nfloat exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;\r\nvec2 deriv=vec2(\r\n(c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c)\r\n)/pow(2.0,exaggeration+(19.2562-u_zoom));\r\ngl_FragColor=clamp(vec4(\r\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "uniform mat4 u_matrix;\r\nuniform vec2 u_dimension;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nhighp vec2 epsilon=1.0/u_dimension;\r\nfloat scale=(u_dimension.x-2.0)/u_dimension.x;\r\nv_pos=(a_texture_pos/8192.0)*scale+epsilon;\r\n}"), hillshade: tr("uniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_latrange;\r\nuniform vec2 u_light;\r\nuniform vec4 u_shadow;\r\nuniform vec4 u_highlight;\r\nuniform vec4 u_accent;\r\nvoid main() {\r\nvec4 pixel=texture2D(u_image,v_pos);\r\nvec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);\r\nfloat aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);\r\nfloat intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;\r\nfloat maxValue=0.5*PI;\r\nfloat scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);\r\nfloat shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);\r\nvec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);\r\ngl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\r\n#ifdef FOG\r\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\r\n#endif\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "uniform mat4 u_matrix;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=a_texture_pos/8192.0;\r\n#ifdef FOG\r\nv_fog_pos=fog_position(a_pos);\r\n#endif\r\n}"), line: tr("uniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nvec4 out_color=color;\r\n#ifdef FOG\r\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\r\n#endif\r\ngl_FragColor=out_color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\r\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\n#else\r\nv_gamma_scale=1.0;\r\n#endif\r\nv_width2=vec2(outset,inset);\r\n#ifdef FOG\r\nv_fog_pos=fog_position(pos);\r\n#endif\r\n}"), lineGradient: tr("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\nvarying highp vec2 v_uv;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);\r\n#ifdef FOG\r\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\r\n#endif\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nattribute float a_uv_x;\r\nattribute float a_split_index;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform float u_image_height;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp vec2 v_uv;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nhighp float texel_height=1.0/u_image_height;\r\nhighp float half_texel_height=0.5*texel_height;\r\nv_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\r\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\n#else\r\nv_gamma_scale=1.0;\r\n#endif\r\nv_width2=vec2(outset,inset);\r\n#ifdef FOG\r\nv_fog_pos=fog_position(pos);\r\n#endif\r\n}"), linePattern: tr("uniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform mediump vec3 u_scale;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nvec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);\r\nvec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);\r\nfloat aspect_a=display_size_a.y/v_width;\r\nfloat aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);\r\nfloat x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);\r\nfloat y=0.5*v_normal.y+0.5;\r\nvec2 texel_size=1.0/u_texsize;\r\nvec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));\r\nvec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));\r\nvec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);\r\n#ifdef FOG\r\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\r\n#endif\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nattribute float a_linesofar;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_units_to_pixels;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\r\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\n#else\r\nv_gamma_scale=1.0;\r\n#endif\r\nv_linesofar=a_linesofar;\r\nv_width2=vec2(outset,inset);\r\nv_width=floorwidth;\r\n#ifdef FOG\r\nv_fog_pos=fog_position(pos);\r\n#endif\r\n}"), lineSDF: tr("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nuniform float u_mix;\r\nuniform vec3 u_scale;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\n#pragma mapbox: define lowp vec4 dash_from\r\n#pragma mapbox: define lowp vec4 dash_to\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\r\n#pragma mapbox: initialize mediump vec4 dash_from\r\n#pragma mapbox: initialize mediump vec4 dash_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat sdfdist_a=texture2D(u_image,v_tex_a).a;\r\nfloat sdfdist_b=texture2D(u_image,v_tex_b).a;\r\nfloat sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);\r\nfloat sdfwidth=min(dash_from.z*u_scale.y,dash_to.z*u_scale.z);\r\nfloat sdfgamma=1.0/(2.0*u_device_pixel_ratio)/sdfwidth;\r\nalpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\r\nvec4 out_color=color;\r\n#ifdef FOG\r\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\r\n#endif\r\ngl_FragColor=out_color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "\n#define EXTRUDE_SCALE 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nattribute float a_linesofar;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform vec2 u_texsize;\r\nuniform mediump vec3 u_scale;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\n#pragma mapbox: define lowp vec4 dash_from\r\n#pragma mapbox: define lowp vec4 dash_to\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\r\n#pragma mapbox: initialize mediump vec4 dash_from\r\n#pragma mapbox: initialize mediump vec4 dash_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\r\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\n#else\r\nv_gamma_scale=1.0;\r\n#endif\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nfloat scaleA=dash_from.z==0.0 ? 0.0 : tileZoomRatio/(dash_from.z*fromScale);\r\nfloat scaleB=dash_to.z==0.0 ? 0.0 : tileZoomRatio/(dash_to.z*toScale);\r\nfloat heightA=dash_from.y;\r\nfloat heightB=dash_to.y;\r\nv_tex_a=vec2(a_linesofar*scaleA/floorwidth,(-normal.y*heightA+dash_from.x+0.5)/u_texsize.y);\r\nv_tex_b=vec2(a_linesofar*scaleB/floorwidth,(-normal.y*heightB+dash_to.x+0.5)/u_texsize.y);\r\nv_width2=vec2(outset,inset);\r\n#ifdef FOG\r\nv_fog_pos=fog_position(pos);\r\n#endif\r\n}"), raster: tr("uniform float u_fade_t;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image0;\r\nuniform sampler2D u_image1;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nuniform float u_brightness_low;\r\nuniform float u_brightness_high;\r\nuniform float u_saturation_factor;\r\nuniform float u_contrast_factor;\r\nuniform vec3 u_spin_weights;\r\nvoid main() {vec4 color0=texture2D(u_image0,v_pos0);\r\nvec4 color1=texture2D(u_image1,v_pos1);\r\nif (color0.a > 0.0) {\r\ncolor0.rgb=color0.rgb/color0.a;\r\n}\r\nif (color1.a > 0.0) {\r\ncolor1.rgb=color1.rgb/color1.a;\r\n}\r\nvec4 color=mix(color0,color1,u_fade_t);\r\ncolor.a*=u_opacity;\r\nvec3 rgb=color.rgb;rgb=vec3(\r\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;\r\nrgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);\r\nvec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);\r\nvec3 out_color=mix(u_high_vec,u_low_vec,rgb);\r\n#ifdef FOG\r\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\r\n#endif\r\ngl_FragColor=vec4(out_color*color.a,color.a);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "uniform mat4 u_matrix;\r\nuniform vec2 u_tl_parent;\r\nuniform float u_scale_parent;\r\nuniform float u_buffer_scale;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;\r\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\r\n#ifdef FOG\r\nv_fog_pos=fog_position(a_pos);\r\n#endif\r\n}"), symbolIcon: tr("uniform sampler2D u_texture;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nlowp float alpha=opacity*v_fade_opacity;\r\ngl_FragColor=texture2D(u_texture,v_tex)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "attribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;\r\nuniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform float u_fade_change;\r\nuniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nvec2 a_minFontScale=a_pixeloffset.zw/256.0;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nfloat h=elevation(a_pos);\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,h,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,1.5);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),h,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h,1.0);\r\nfloat z=0.0;\r\nvec2 offset=rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0);\r\n#ifdef PITCH_WITH_MAP_TERRAIN\r\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);\r\nz=elevation(tile_pos.xy);\r\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);\r\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));\r\nv_tex=a_tex/u_texsize;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nv_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));\r\n}"), symbolSDF: tr("#define SDF_PX 8.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform bool u_is_text;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nvec2 tex=v_data0.xy;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fade_opacity=v_data1[2];\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "attribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nfloat h=elevation(a_pos);\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,h,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,1.5);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),h,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h,1.0);\r\nfloat z=0.0;\r\nvec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\r\n#ifdef PITCH_WITH_MAP_TERRAIN\r\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);\r\nz=elevation(tile_pos.xy);\r\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);\r\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));\r\nv_data0=a_tex/u_texsize;\r\nv_data1=vec3(gamma_scale,size,interpolated_fade_opacity);\r\n}"), symbolTextAndIcon: tr("#define SDF_PX 8.0\r\n#define SDF 1.0\r\n#define ICON 0.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform sampler2D u_texture_icon;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat fade_opacity=v_data1[2];\r\nif (v_data1.w==ICON) {\r\nvec2 tex_icon=v_data0.zw;\r\nlowp float alpha=opacity*fade_opacity;\r\ngl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\nreturn;\r\n}\r\nvec2 tex=v_data0.xy;\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fontScale=size/24.0;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "attribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nuniform vec2 u_texsize_icon;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nfloat is_sdf=a_size[0]-2.0*a_size_min;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nfloat h=elevation(a_pos);\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,h,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,1.5);\r\nsize*=perspective_ratio;\r\nfloat fontScale=size/24.0;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),h,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h,1.0);\r\nfloat z=0.0;\r\nvec2 offset=rotation_matrix*(a_offset/32.0*fontScale);\r\n#ifdef PITCH_WITH_MAP_TERRAIN\r\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);\r\nz=elevation(tile_pos.xy);\r\n#endif\r\nfloat occlusion_fade=occlusionFade(projectedPoint);\r\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));\r\nv_data0.xy=a_tex/u_texsize;\r\nv_data0.zw=a_tex/u_texsize_icon;\r\nv_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);\r\n}"), terrainRaster: tr("uniform sampler2D u_image0;\r\nvarying vec2 v_pos0;\r\n#ifdef FOG\r\nvarying float v_fog_opacity;\r\n#endif\r\nvoid main() {\r\nvec4 color=texture2D(u_image0,v_pos0);\r\n#ifdef FOG\r\ncolor.rgb=fog_dither(fog_apply_from_vert(color.rgb,v_fog_opacity));\r\n#endif\r\ngl_FragColor=color;\r\n#ifdef TERRAIN_WIREFRAME\r\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\r\n#endif\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", "uniform mat4 u_matrix;\r\nuniform float u_skirt_height;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos0;\r\n#ifdef FOG\r\nvarying float v_fog_opacity;\r\n#endif\r\nconst float skirtOffset=24575.0;\r\nconst float wireframeOffset=0.00015;\r\nvoid main() {\r\nv_pos0=a_texture_pos/8192.0;\r\nfloat skirt=float(a_pos.x >=skirtOffset);\r\nfloat elevation=elevation(a_texture_pos)-skirt*u_skirt_height;\r\n#ifdef TERRAIN_WIREFRAME\r\nelevation+=u_skirt_height*u_skirt_height*wireframeOffset;\r\n#endif\r\nvec2 decodedPos=a_pos-vec2(skirt*skirtOffset,0.0);\r\ngl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\r\n#ifdef FOG\r\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\r\n#endif\r\n}"), terrainDepth: tr("#ifdef GL_ES\r\nprecision highp float;\r\n#endif\nvec4 pack_depth(float ndc_z) {\r\nfloat depth=ndc_z*0.5+0.5;\r\nconst vec4 bit_shift=vec4(256.0*256.0*256.0,256.0*256.0,256.0,1.0);\r\nconst vec4 bit_mask =vec4(0.0,1.0/256.0,1.0/256.0,1.0/256.0);\r\nvec4 res=fract(depth*bit_shift);\r\nres-=res.xxyz*bit_mask;\r\nreturn res;\r\n}\r\nvarying float v_depth;\r\nvoid main() {\r\ngl_FragColor=pack_depth(v_depth);\r\n}", "uniform mat4 u_matrix;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying float v_depth;\r\nvoid main() {\r\nfloat elevation=elevation(a_texture_pos);\r\ngl_Position=u_matrix*vec4(a_pos,elevation,1.0);\r\nv_depth=gl_Position.z/gl_Position.w;\r\n}"), skybox: tr("\nvarying lowp vec3 v_uv;\r\nuniform lowp samplerCube u_cubemap;\r\nuniform lowp float u_opacity;\r\nuniform highp float u_temporal_offset;\r\nuniform highp vec3 u_sun_direction;\r\nfloat sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {\r\nhighp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;\r\nconst highp float smoothstep_delta=1e-5;\r\nreturn smoothstep(\r\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);\r\n}\r\nfloat map(float value,float start,float end,float new_start,float new_end) {\r\nreturn ((value-start)*(new_end-new_start))/(end-start)+new_start;\r\n}\r\nvoid main() {\r\nvec3 uv=v_uv;const float y_bias=0.015;\r\nuv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);\r\nvec3 sky_color=textureCube(u_cubemap,uv).rgb;\r\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\r\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);\r\ngl_FragColor=vec4(sky_color*u_opacity,u_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", qi), skyboxGradient: tr("varying highp vec3 v_uv;\r\nuniform lowp sampler2D u_color_ramp;\r\nuniform highp vec3 u_center_direction;\r\nuniform lowp float u_radius;\r\nuniform lowp float u_opacity;\r\nuniform highp float u_temporal_offset;\r\nvoid main() {\r\nfloat progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;\r\nvec4 color=texture2D(u_color_ramp,vec2(progress,0.5));\r\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\r\n#endif\r\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);\r\ngl_FragColor=color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}", qi), skyboxCapture: tr("\nvarying highp vec3 v_position;\r\nuniform highp float u_sun_intensity;\r\nuniform highp float u_luminance;\r\nuniform lowp vec3 u_sun_direction;\r\nuniform highp vec4 u_color_tint_r;\r\nuniform highp vec4 u_color_tint_m;\r\n#ifdef GL_ES\r\nprecision highp float;\r\n#endif\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\r\n#define MIE_G 0.76\r\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\r\n#define DENSITY_STEPS 4\r\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {\r\nfloat a=dot(dir,dir);\r\nfloat b=2.0*dot(dir,orig);\r\nfloat c=dot(orig,orig)-radius*radius;\r\nfloat d=sqrt(b*b-4.0*a*c);\r\nreturn (-b+d)/(2.0*a);\r\n}\r\nvec3 extinction(vec2 density) {\r\nreturn exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));\r\n}\r\nvec2 local_density(vec3 point) {\r\nfloat height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);\r\nfloat exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);\r\nreturn vec2(exp_r,exp_m);\r\n}\r\nfloat phase_ray(float cos_angle) {\r\nreturn (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);\r\n}\r\nfloat phase_mie(float cos_angle) {\r\nreturn (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/\n((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));\r\n}\r\nvec2 density_to_atmosphere(vec3 point,vec3 light_dir) {\r\nfloat ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);\r\nfloat step_len=ray_len/float(DENSITY_STEPS);\r\nvec2 density_point_to_atmosphere=vec2(0.0);\r\nfor (int i=0; i < DENSITY_STEPS;++i) {\r\nvec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);\r\ndensity_point_to_atmosphere+=local_density(point_on_ray)*step_len;;\r\n}\r\nreturn density_point_to_atmosphere;\r\n}\r\nvec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {\r\nvec2 density_orig_to_point=vec2(0.0);\r\nvec3 scatter_r=vec3(0.0);\r\nvec3 scatter_m=vec3(0.0);\r\nvec3 origin=vec3(0.0,PLANET_RADIUS,0.0);\r\nfloat ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);\r\nfloat step_len=ray_len/float(SAMPLE_STEPS);\r\nfor (int i=0; i < SAMPLE_STEPS;++i) {\r\nvec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;\r\ndensity_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;\r\nvec3 extinction=extinction(density_orig_to_atmosphere);\r\nscatter_r+=density.x*extinction;\r\nscatter_m+=density.y*extinction;\r\n}float cos_angle=dot(ray_dir,sun_direction);\r\nfloat phase_r=phase_ray(cos_angle);\r\nfloat phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;\r\nvec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;\r\nreturn (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;\r\n}\r\nconst float A=0.15;\r\nconst float B=0.50;\r\nconst float C=0.10;\r\nconst float D=0.20;\r\nconst float E=0.02;\r\nconst float F=0.30;\r\nvec3 uncharted2_tonemap(vec3 x) {\r\nreturn ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\r\n}\r\nvoid main() {\r\nvec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;\r\nray_direction.y+=y_bias;\r\nvec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;\r\ngl_FragColor=vec4(color,1.0);\r\n}", "attribute highp vec3 a_pos_3f;\r\nuniform mat3 u_matrix_3f;\r\nvarying highp vec3 v_position;\r\nfloat map(float value,float start,float end,float new_start,float new_end) {\r\nreturn ((value-start)*(new_end-new_start))/(end-start)+new_start;\r\n}\r\nvoid main() {\r\nvec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);\r\nv_position=pos.xyz;\r\nv_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);\r\ngl_Position=vec4(a_pos_3f.xy,0.0,1.0);\r\n}") }; function tr(t, e, i) { const r = /#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g, o = /uniform (highp |mediump |lowp )?([\w]+) ([\w]+)([\s]*)([\w]*)/g, n = e.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g), s = t.match(o), a = e.match(o), l = Yi.match(o); let c = a ? a.concat(s) : s; i || (Xi.staticUniforms && (c = Xi.staticUniforms.concat(c)), Qi.staticUniforms && (c = Qi.staticUniforms.concat(c))), c && (c = c.concat(l)); const h = {}; return { fragmentSource: t = t.replace(r, ((t, e, i, r, o) => (h[o] = !0, "define" === e ? `\n#ifndef HAS_UNIFORM_u_${o}\nvarying ${i} ${r} ${o};\n#else\nuniform ${i} ${r} u_${o};\n#endif\n` : `\n#ifdef HAS_UNIFORM_u_${o}\n ${i} ${r} ${o} = u_${o};\n#endif\n`))), vertexSource: e = e.replace(r, ((t, e, i, r, o) => { const n = "float" === r ? "vec2" : "vec4", s = o.match(/color/) ? "color" : n; return h[o] ? "define" === e ? `\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\nattribute ${i} ${n} a_${o};\nvarying ${i} ${r} ${o};\n#else\nuniform ${i} ${r} u_${o};\n#endif\n` : "vec4" === s ? `\n#ifndef HAS_UNIFORM_u_${o}\n ${o} = a_${o};\n#else\n ${i} ${r} ${o} = u_${o};\n#endif\n` : `\n#ifndef HAS_UNIFORM_u_${o}\n ${o} = unpack_mix_${s}(a_${o}, u_${o}_t);\n#else\n ${i} ${r} ${o} = u_${o};\n#endif\n` : "define" === e ? `\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\nattribute ${i} ${n} a_${o};\n#else\nuniform ${i} ${r} u_${o};\n#endif\n` : "vec4" === s ? `\n#ifndef HAS_UNIFORM_u_${o}\n ${i} ${r} ${o} = a_${o};\n#else\n ${i} ${r} ${o} = u_${o};\n#endif\n` : `\n#ifndef HAS_UNIFORM_u_${o}\n ${i} ${r} ${o} = unpack_mix_${s}(a_${o}, u_${o}_t);\n#else\n ${i} ${r} ${o} = u_${o};\n#endif\n` })), staticAttributes: n, staticUniforms: c } } class er { constructor() { this.boundProgram = null, this.boundLayoutVertexBuffer = null, this.boundPaintVertexBuffers = [], this.boundIndexBuffer = null, this.boundVertexOffset = null, this.boundDynamicVertexBuffer = null, this.vao = null; } bind(t, e, i, r, o, n, s, a) { this.context = t; let l = this.boundPaintVertexBuffers.length !== r.length; for (let t = 0; !l && t < r.length; t++)this.boundPaintVertexBuffers[t] !== r[t] && (l = !0); t.extVertexArrayObject && this.vao && this.boundProgram === e && this.boundLayoutVertexBuffer === i && !l && this.boundIndexBuffer === o && this.boundVertexOffset === n && this.boundDynamicVertexBuffer === s && this.boundDynamicVertexBuffer2 === a ? (t.bindVertexArrayOES.set(this.vao), s && s.bind(), o && o.dynamicDraw && o.bind(), a && a.bind()) : this.freshBind(e, i, r, o, n, s, a); } freshBind(t, e, i, r, o, n, s) { let a; const l = t.numAttributes, c = this.context, h = c.gl; if (c.extVertexArrayObject) this.vao && this.destroy(), this.vao = c.extVertexArrayObject.createVertexArrayOES(), c.bindVertexArrayOES.set(this.vao), a = 0, this.boundProgram = t, this.boundLayoutVertexBuffer = e, this.boundPaintVertexBuffers = i, this.boundIndexBuffer = r, this.boundVertexOffset = o, this.boundDynamicVertexBuffer = n, this.boundDynamicVertexBuffer2 = s; else { a = c.currentNumAttributes || 0; for (let t = l; t < a; t++)h.disableVertexAttribArray(t); } e.enableAttributes(h, t); for (const e of i) e.enableAttributes(h, t); n && n.enableAttributes(h, t), s && s.enableAttributes(h, t), e.bind(), e.setVertexAttribPointers(h, t, o); for (const e of i) e.bind(), e.setVertexAttribPointers(h, t, o); n && (n.bind(), n.setVertexAttribPointers(h, t, o)), r && r.bind(), s && (s.bind(), s.setVertexAttribPointers(h, t, o)), c.currentNumAttributes = l; } destroy() { this.vao && (this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao), this.vao = null); } } function ir(e, i) { const r = Math.pow(2, i.canonical.z), o = i.canonical.y; return [new t.MercatorCoordinate(0, o / r).toLngLat().lat, new t.MercatorCoordinate(0, (o + 1) / r).toLngLat().lat] } function rr(e, i, r, o, n, s, a) { const l = e.context, c = l.gl, h = r.fbo; if (!h) return; e.prepareDrawTile(i); const u = e.useProgram("hillshade"); l.activeTexture.set(c.TEXTURE0), c.bindTexture(c.TEXTURE_2D, h.colorAttachment.get()); const d = ((t, e, i, r) => { const o = i.paint.get("hillshade-shadow-color"), n = i.paint.get("hillshade-highlight-color"), s = i.paint.get("hillshade-accent-color"); let a = i.paint.get("hillshade-illumination-direction") * (Math.PI / 180); "viewport" === i.paint.get("hillshade-illumination-anchor") && (a -= t.transform.angle); const l = !t.options.moving; return { u_matrix: r || t.transform.calculateProjMatrix(e.tileID.toUnwrapped(), l), u_image: 0, u_latrange: ir(0, e.tileID), u_light: [i.paint.get("hillshade-exaggeration"), a], u_shadow: o, u_highlight: n, u_accent: s } })(e, r, o, e.terrain ? i.projMatrix : null); e.prepareDrawProgram(l, u, i.toUnwrapped()), u.draw(l, c.TRIANGLES, n, s, a, t.CullFaceMode.disabled, d, o.id, e.rasterBoundsBuffer, e.quadTriangleIndexBuffer, e.rasterBoundsSegments); } function or(e, i, r) { if (!i.needsDEMTextureUpload) return; const o = e.context, n = o.gl; o.pixelStoreUnpackPremultiplyAlpha.set(!1), i.demTexture = i.demTexture || e.getTileTexture(r.stride); const s = r.getPixels(); i.demTexture ? i.demTexture.update(s, { premultiply: !1 }) : i.demTexture = new t.Texture(o, s, n.RGBA, { premultiply: !1 }), i.needsDEMTextureUpload = !1; } function nr(e, i, r, o, n, s) { const a = e.context, l = a.gl; if (!i.dem) return; const c = i.dem; if (a.activeTexture.set(l.TEXTURE1), or(e, i, c), !i.demTexture) return; i.demTexture.bind(l.NEAREST, l.CLAMP_TO_EDGE); const h = c.dim; a.activeTexture.set(l.TEXTURE0); let u = i.fbo; if (!u) { const e = new t.Texture(a, { width: h, height: h, data: null }, l.RGBA); e.bind(l.LINEAR, l.CLAMP_TO_EDGE), u = i.fbo = a.createFramebuffer(h, h, !0), u.colorAttachment.set(e.texture); } a.bindFramebuffer.set(u.framebuffer), a.viewport.set([0, 0, h, h]), e.useProgram("hillshadePrepare").draw(a, l.TRIANGLES, o, n, s, t.CullFaceMode.disabled, ((e, i) => { const r = i.stride, o = t.create(); return t.ortho(o, 0, t.EXTENT, -t.EXTENT, 0, 0, 1), t.translate(o, o, [0, -t.EXTENT, 0]), { u_matrix: o, u_image: 1, u_dimension: [r, r], u_zoom: e.overscaledZ, u_unpack: i.unpackVector } })(i.tileID, c), r.id, e.rasterBoundsBuffer, e.quadTriangleIndexBuffer, e.rasterBoundsSegments), i.needsHillshadePrepare = !1; } const sr = (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_image0: new t.Uniform1i(e, i.u_image0), u_skirt_height: new t.Uniform1f(e, i.u_skirt_height) }), ar = (t, e) => ({ u_matrix: t, u_image0: 0, u_skirt_height: e }), lr = new class { constructor() { this.operations = {}; } newMorphing(t, e, i, r, o) { if (t in this.operations) { const e = this.operations[t]; e.to.tileID.key !== i.tileID.key && (e.queued = i); } else this.operations[t] = { startTime: r, phase: 0, duration: o, from: e, to: i, queued: null }; } getMorphValuesForProxy(t) { if (!(t in this.operations)) return null; const e = this.operations[t]; return { from: e.from, to: e.to, phase: e.phase } } update(t) { for (const e in this.operations) { const i = this.operations[e]; for (i.phase = (t - i.startTime) / i.duration; i.phase >= 1 || !this._validOp(i);)if (!this._nextOp(i, t)) { delete this.operations[e]; break } } } _nextOp(t, e) { return !!t.queued && (t.from = t.to, t.to = t.queued, t.queued = null, t.phase = 0, t.startTime = e, !0) } _validOp(t) { return t.from.hasData() && t.to.hasData() } }, cr = { 0: null, 1: "TERRAIN_VERTEX_MORPHING", 2: "TERRAIN_WIREFRAME" }; function hr(t, e) { const i = 1 << t.z; return !e && (0 === t.x || t.x === i - 1) || 0 === t.y || t.y === i - 1 } const ur = t => ({ u_matrix: t }); function dr(e, i, r, o, n) { if (n > 0) { const s = t.exported.now(), a = (s - e.timeAdded) / n, l = i ? (s - i.timeAdded) / n : -1, c = r.getSource(), h = o.coveringZoomLevel({ tileSize: c.tileSize, roundZoom: c.roundZoom }), u = !i || Math.abs(i.tileID.overscaledZ - h) > Math.abs(e.tileID.overscaledZ - h), d = u && e.refreshedUponExpiration ? 1 : t.clamp(u ? a : 1 - l, 0, 1); return e.refreshedUponExpiration && a >= 1 && (e.refreshedUponExpiration = !1), i ? { opacity: 1, mix: 1 - d } : { opacity: d, mix: 0 } } return { opacity: 1, mix: 0 } } class pr extends t.SourceCache { constructor(t) { const e = Vt("proxy", { type: "geojson", maxzoom: t.transform.maxZoom }, new Z(te(), null), t.style); super("proxy", e, !1), e.setEventedParent(this), this.map = this.getSource().map = t, this.used = this._sourceLoaded = !0, this.renderCache = [], this.renderCachePool = [], this.proxyCachedFBO = {}; } update(e, i, r) { if (e.freezeTileCoverage) return; this.transform = e; const o = e.coveringTiles({ tileSize: this._source.tileSize, minzoom: this._source.minzoom, maxzoom: this._source.maxzoom, roundZoom: this._source.roundZoom, reparseOverscaled: this._source.reparseOverscaled }).reduce(((i, r) => { if (i[r.key] = "", !this._tiles[r.key]) { const i = new t.Tile(r, this._source.tileSize * r.overscaleFactor(), e.tileZoom); i.state = "loaded", this._tiles[r.key] = i; } return i }), {}); for (const t in this._tiles) t in o || (this.freeFBO(t), this._tiles[t].state = "unloaded", delete this._tiles[t]); } freeFBO(t) { const e = this.proxyCachedFBO[t]; if (void 0 !== e) { const i = Object.values(e); this.renderCachePool.push(...i), delete this.proxyCachedFBO[t]; } } deallocRenderCache() { this.renderCache.forEach((t => t.fb.destroy())), this.renderCache = [], this.renderCachePool = [], this.proxyCachedFBO = {}; } } class mr extends t.OverscaledTileID { constructor(t, e, i) { super(t.overscaledZ, t.wrap, t.canonical.z, t.canonical.x, t.canonical.y), this.proxyTileKey = e, this.projMatrix = i; } } class _r extends t.Elevation { constructor(e, i) { super(), this.painter = e, this.terrainTileForTile = {}, this.prevTerrainTileForTile = {}; const [r, o, n] = function (e) { const i = new t.StructArrayLayout4i8, r = new t.StructArrayLayout3ui6, o = 131; i.reserve(17161), r.reserve(33800); const n = t.EXTENT / 128, s = t.EXTENT + n / 2, a = s + n; for (let e = -n; e < a; e += n)for (let r = -n; r < a; r += n) { const o = r < 0 || r > s || e < 0 || e > s ? 24575 : 0, n = t.clamp(Math.round(r), 0, t.EXTENT), a = t.clamp(Math.round(e), 0, t.EXTENT); i.emplaceBack(n + o, a, n, a); } const l = (t, e) => { const i = e * o + t; r.emplaceBack(i + 1, i, i + o), r.emplaceBack(i + o, i + o + 1, i + 1); }; for (let t = 1; t < 129; t++)for (let e = 1; e < 129; e++)l(e, t); return [0, 129].forEach((t => { for (let e = 0; e < 130; e++)l(e, t), l(t, e); })), [i, r, 32768] }(), s = e.context; this.gridBuffer = s.createVertexBuffer(r, Gt.members), this.gridIndexBuffer = s.createIndexBuffer(o), this.gridSegments = t.SegmentVector.simpleSegment(0, 0, r.length, o.length), this.gridNoSkirtSegments = t.SegmentVector.simpleSegment(0, 0, r.length, n), this.proxyCoords = [], this.proxiedCoords = {}, this._visibleDemTiles = [], this._drapedRenderBatches = [], this._sourceTilesOverlap = {}, this.proxySourceCache = new pr(i.map), this.orthoMatrix = t.create(), t.ortho(this.orthoMatrix, 0, t.EXTENT, 0, t.EXTENT, 0, 1); const a = s.gl; this._overlapStencilMode = new t.StencilMode({ func: a.GEQUAL, mask: 255 }, 0, 255, a.KEEP, a.KEEP, a.REPLACE), this._previousZoom = e.transform.zoom, this.pool = [], this._findCoveringTileCache = {}, this._tilesDirty = {}, this.style = i, this._useVertexMorphing = !0, this._exaggeration = 1; } set style(t) { t.on("data", this._onStyleDataEvent.bind(this)), t.on("neworder", this._checkRenderCacheEfficiency.bind(this)), this._style = t, this._checkRenderCacheEfficiency(); } update(e, i, r) { if (e && e.terrain) { this._style !== e && (this.style = e), this.enabled = !0; const o = e.terrain.properties; this.sourceCache = e._getSourceCache(o.get("source")), this._exaggeration = o.get("exaggeration"); const n = () => { this.sourceCache.used && t.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`); const e = this.sourceCache.getSource().tileSize / 128, r = this.proxySourceCache.getSource().tileSize; this.sourceCache.update(i, e * r, !0), this._findCoveringTileCache[this.sourceCache.id] = {}; }; this.sourceCache.usedForTerrain || (this._findCoveringTileCache[this.sourceCache.id] = {}, this.sourceCache.usedForTerrain = !0, n(), this._initializing = !0), n(), i.updateElevation(!r), this._findCoveringTileCache[this.proxySourceCache.id] = {}, this.proxySourceCache.update(i), this._emptyDEMTextureDirty = !0; } else this._disable(); } _checkRenderCacheEfficiency() { const e = this.renderCacheEfficiency(this._style); this._style.map._optimizeForTerrain || 100 !== e.efficiency && t.warnOnce(`Terrain render cache efficiency is not optimal (${e.efficiency}%) and performance\n may be affected negatively, consider placing all background, fill and line layers before layer\n with id '${e.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`); } _onStyleDataEvent(t) { t.coord && "source" === t.dataType ? this._clearRenderCacheForTile(t.sourceCacheId, t.coord) : "style" === t.dataType && (this._invalidateRenderCache = !0); } _disable() { if (this.enabled && (this.enabled = !1, this._sharedDepthStencil = void 0, this.proxySourceCache.deallocRenderCache(), this._style)) for (const t in this._style._sourceCaches) this._style._sourceCaches[t].usedForTerrain = !1; } destroy() { this._disable(), this._emptyDEMTexture && this._emptyDEMTexture.destroy(), this.pool.forEach((t => t.fb.destroy())), this.pool = [], this._depthFBO && (this._depthFBO.destroy(), delete this._depthFBO, delete this._depthTexture); } _source() { return this.enabled ? this.sourceCache : null } exaggeration() { return this._exaggeration } get visibleDemTiles() { return this._visibleDemTiles } get drapeBufferSize() { const t = 2 * this.proxySourceCache.getSource().tileSize; return [t, t] } set useVertexMorphing(t) { this._useVertexMorphing = t; } updateTileBinding(e) { if (!this.enabled) return; this.prevTerrainTileForTile = this.terrainTileForTile; const i = this.proxySourceCache, r = this.painter.transform; this._initializing && (this._initializing = 0 === r._centerAltitude && -1 === this.getAtPointOrZero(t.MercatorCoordinate.fromLngLat(r.center), -1), this._emptyDEMTextureDirty = !this._initializing); const o = this.painter.options; this.renderCached = (o.zooming || o.moving || o.rotating || !!this.forceRenderCached) && !this._invalidateRenderCache, this._invalidateRenderCache = !1; const n = this.proxyCoords = i.getIds().map((t => { const e = i.getTileByID(t).tileID; return e.projMatrix = r.calculateProjMatrix(e.toUnwrapped()), e })); !function (e, i) { const r = i.transform.pointCoordinate(i.transform.getCameraPoint()), o = new t.pointGeometry(r.x, r.y); e.sort(((e, i) => { if (i.overscaledZ - e.overscaledZ) return i.overscaledZ - e.overscaledZ; const r = new t.pointGeometry(e.canonical.x + (1 << e.canonical.z) * e.wrap, e.canonical.y), n = new t.pointGeometry(i.canonical.x + (1 << i.canonical.z) * i.wrap, i.canonical.y), s = o.mult(1 << e.canonical.z); return s.x -= .5, s.y -= .5, s.distSqr(r) - s.distSqr(n) })); }(n, this.painter), this._previousZoom = r.zoom; const s = this.proxyToSource || {}; this.proxyToSource = {}, n.forEach((t => { this.proxyToSource[t.key] = {}; })), this.terrainTileForTile = {}; const a = this._style._sourceCaches; for (const t in a) { const i = a[t]; if (!i.used) continue; if (i !== this.sourceCache && (this._findCoveringTileCache[i.id] = {}), this._setupProxiedCoordsForOrtho(i, e[t], s), i.usedForTerrain) continue; const r = e[t]; i.getSource().reparseOverscaled && this._assignTerrainTiles(r); } this.proxiedCoords[i.id] = n.map((t => new mr(t, t.key, this.orthoMatrix))), this._assignTerrainTiles(n), this._prepareDEMTextures(), this._setupDrapedRenderBatches(), this._initFBOPool(), this._setupRenderCache(s), this.renderingToTexture = !1, this._updateTimestamp = t.exported.now(); const l = {}; this._visibleDemTiles = []; for (const t of this.proxyCoords) { const e = this.terrainTileForTile[t.key]; if (!e) continue; const i = e.tileID.key; i in l || (this._visibleDemTiles.push(e), l[i] = i); } } _assignTerrainTiles(t) { this._initializing || t.forEach((t => { if (this.terrainTileForTile[t.key]) return; const e = this._findTileCoveringTileID(t, this.sourceCache); e && (this.terrainTileForTile[t.key] = e); })); } _prepareDEMTextures() { const t = this.painter.context, e = t.gl; for (const i in this.terrainTileForTile) { const r = this.terrainTileForTile[i], o = r.dem; !o || r.demTexture && !r.needsDEMTextureUpload || (t.activeTexture.set(e.TEXTURE1), or(this.painter, r, o)); } } _prepareDemTileUniforms(t, e, i, r) { if (!e || null == e.demTexture) return !1; const o = t.tileID.canonical, n = Math.pow(2, e.tileID.canonical.z - o.z), s = r || ""; return i[`u_dem_tl${s}`] = [o.x * n % 1, o.y * n % 1], i[`u_dem_scale${s}`] = n, !0 } get emptyDEMTexture() { return !this._emptyDEMTextureDirty && this._emptyDEMTexture ? this._emptyDEMTexture : this._updateEmptyDEMTexture() } _getLoadedAreaMinimum() { let t = 0; const e = this._visibleDemTiles.reduce(((e, i) => { if (!i.dem) return e; const r = i.dem.tree.minimums[0]; return r > 0 && t++, e + r }), 0); return t ? e / t : 0 } _updateEmptyDEMTexture() { const e = this.painter.context, i = e.gl; e.activeTexture.set(i.TEXTURE2); const r = this._getLoadedAreaMinimum(), o = { width: 1, height: 1, data: new Uint8Array(t.DEMData.pack(r, this.sourceCache.getSource().encoding)) }; this._emptyDEMTextureDirty = !1; let n = this._emptyDEMTexture; return n ? n.update(o, { premultiply: !1 }) : n = this._emptyDEMTexture = new t.Texture(e, o, i.RGBA, { premultiply: !1 }), n } setupElevationDraw(e, i, r) { const o = this.painter.context, n = o.gl, s = (a = this.sourceCache.getSource().encoding, { u_dem: 2, u_dem_prev: 4, u_dem_unpack: t.DEMData.getUnpackVector(a), u_dem_tl: [0, 0], u_dem_tl_prev: [0, 0], u_dem_scale: 0, u_dem_scale_prev: 0, u_dem_size: 0, u_dem_lerp: 1, u_depth: 3, u_depth_size_inv: [0, 0], u_exaggeration: 0 }); var a; s.u_dem_size = this.sourceCache.getSource().tileSize, s.u_exaggeration = this.exaggeration(); let l = null, c = null, h = 1; if (r && r.morphing && this._useVertexMorphing) { const t = r.morphing.srcDemTile, i = r.morphing.dstDemTile; h = r.morphing.phase, t && i && (this._prepareDemTileUniforms(e, t, s, "_prev") && (c = t), this._prepareDemTileUniforms(e, i, s) && (l = i)); } if (c && l ? (o.activeTexture.set(n.TEXTURE2), l.demTexture.bind(n.NEAREST, n.CLAMP_TO_EDGE, n.NEAREST), o.activeTexture.set(n.TEXTURE4), c.demTexture.bind(n.NEAREST, n.CLAMP_TO_EDGE, n.NEAREST), s.u_dem_lerp = h) : (l = this.terrainTileForTile[e.tileID.key], o.activeTexture.set(n.TEXTURE2), (this._prepareDemTileUniforms(e, l, s) ? l.demTexture : this.emptyDEMTexture).bind(n.NEAREST, n.CLAMP_TO_EDGE, n.NEAREST)), r && r.useDepthForOcclusion && (o.activeTexture.set(n.TEXTURE3), this._depthTexture.bind(n.NEAREST, n.CLAMP_TO_EDGE, n.NEAREST), s.u_depth_size_inv = [1 / this._depthFBO.width, 1 / this._depthFBO.height]), r && r.useMeterToDem && l) { const e = (1 << l.tileID.canonical.z) * t.mercatorZfromAltitude(1, this.painter.transform.center.lat) * this.sourceCache.getSource().tileSize; s.u_meter_to_dem = e; } r && r.labelPlaneMatrixInv && (s.u_label_plane_matrix_inv = r.labelPlaneMatrixInv), i.setTerrainUniformValues(o, s); } renderToBackBuffer(e) { const i = this.painter, r = this.painter.context; 0 !== e.length && (r.bindFramebuffer.set(null), r.viewport.set([0, 0, i.width, i.height]), this.renderingToTexture = !1, function (e, i, r, o, n) { const s = e.context, a = s.gl; let l, c; const h = e.options.showTerrainWireframe ? 2 : 0, u = (t, i) => { if (c === t) return; const r = [cr[t]]; i && r.push(cr[h]), l = e.useProgram("terrainRaster", null, r), c = t; }, d = e.colorModeForRenderPass(), p = new t.DepthMode(a.LEQUAL, t.DepthMode.ReadWrite, e.depthRangeFor3D); lr.update(n); const m = e.transform, _ = 6 * Math.pow(1.5, 22 - m.zoom) * i.exaggeration(); (h ? [!1, !0] : [!1]).forEach((h => { c = -1; const f = h ? a.LINES : a.TRIANGLES, [g, v] = h ? i.getWirefameBuffer() : [i.gridIndexBuffer, i.gridSegments]; for (const c of o) { const o = r.getTile(c), b = t.StencilMode.disabled, w = i.prevTerrainTileForTile[c.key], E = i.terrainTileForTile[c.key]; y = E, null != (x = w) && null != y && x.hasData() && y.hasData() && null != x.demTexture && null != y.demTexture && x.tileID.key !== y.tileID.key && lr.newMorphing(c.key, w, E, n, 250), s.activeTexture.set(a.TEXTURE0), o.texture.bind(a.LINEAR, a.CLAMP_TO_EDGE, a.LINEAR_MIPMAP_NEAREST); const T = lr.getMorphValuesForProxy(c.key), C = T ? 1 : 0; let S; T && (S = { morphing: { srcDemTile: T.from, dstDemTile: T.to, phase: t.easeCubicInOut(T.phase) } }); const A = ar(c.projMatrix, hr(c.canonical, m.renderWorldCopies) ? _ / 10 : _); u(C, h), i.setupElevationDraw(o, l, S), e.prepareDrawProgram(s, l, c.toUnwrapped()), l.draw(s, f, p, b, d, t.CullFaceMode.backCCW, A, "terrain_raster", i.gridBuffer, g, v); } var x, y; })); }(i, this, this.proxySourceCache, e, this._updateTimestamp), this.renderingToTexture = !0, e.splice(0, e.length)); } renderBatch(e) { if (0 === this._drapedRenderBatches.length) return e + 1; this.renderingToTexture = !0; const i = this.painter, r = this.painter.context, o = this.proxySourceCache, n = this.proxiedCoords[o.id], s = this._drapedRenderBatches.shift(), a = [], l = i.style.order; let c = 0; for (const h of n) { const n = o.getTileByID(h.proxyTileKey), u = o.proxyCachedFBO[h.key] ? o.proxyCachedFBO[h.key][e] : void 0, d = void 0 !== u ? o.renderCache[u] : this.pool[c++], p = void 0 !== u; if (n.texture = d.tex, p && !d.dirty) { a.push(n.tileID); continue } let m; r.bindFramebuffer.set(d.fb.framebuffer), this.renderedToTile = !1, d.dirty && (r.clear({ color: t.Color.transparent }), d.dirty = !1); for (let t = s.start; t <= s.end; ++t) { const e = i.style._layers[l[t]]; if (e.isHidden(i.transform.zoom)) continue; const o = i.style._getLayerSourceCache(e), n = o ? this.proxyToSource[h.key][o.id] : [h]; if (!n) continue; const s = n; r.viewport.set([0, 0, d.fb.width, d.fb.height]), m !== (o ? o.id : null) && (this._setupStencil(d, n, e, o), m = o ? o.id : null), i.renderLayer(i, o, e, s); } this.renderedToTile ? (d.dirty = !0, a.push(n.tileID)) : p || --c, 5 === c && (c = 0, this.renderToBackBuffer(a)); } return this.renderToBackBuffer(a), this.renderingToTexture = !1, r.bindFramebuffer.set(null), r.viewport.set([0, 0, i.width, i.height]), s.end + 1 } postRender() { } renderCacheEfficiency(t) { const e = t.order.length; if (0 === e) return { efficiency: 100 }; let i, r = 0, o = 0, n = !1; for (let s = 0; s < e; ++s) { const e = t._layers[t.order[s]]; this._style.isLayerDraped(e) ? (n && ++r, ++o) : n || (n = !0, i = e.id); } return 0 === o ? { efficiency: 100 } : { efficiency: 100 * (1 - r / o), firstUndrapedLayer: i } } getMinElevationBelowMSL() { let t = 0; return this._visibleDemTiles.filter((t => t.dem)).forEach((e => { t = Math.min(t, e.dem.tree.minimums[0]); })), 0 === t ? t : (t - 30) * this._exaggeration } raycast(t, e, i) { if (!this._visibleDemTiles) return null; const r = this._visibleDemTiles.filter((t => t.dem)).map((r => { const o = r.tileID, n = Math.pow(2, o.overscaledZ), { x: s, y: a } = o.canonical, l = s / n, c = (s + 1) / n, h = a / n, u = (a + 1) / n; return { minx: l, miny: h, maxx: c, maxy: u, t: r.dem.tree.raycastRoot(l, h, c, u, t, e, i), tile: r } })); r.sort(((t, e) => (null !== t.t ? t.t : Number.MAX_VALUE) - (null !== e.t ? e.t : Number.MAX_VALUE))); for (const o of r) { if (null == o.t) return null; const r = o.tile.dem.tree.raycast(o.minx, o.miny, o.maxx, o.maxy, t, e, i); if (null != r) return r } return null } _createFBO() { const e = this.painter.context, i = e.gl, r = this.drapeBufferSize; e.activeTexture.set(i.TEXTURE0); const o = new t.Texture(e, { width: r[0], height: r[1], data: null }, i.RGBA); o.bind(i.LINEAR, i.CLAMP_TO_EDGE); const n = e.createFramebuffer(r[0], r[1], !1); return n.colorAttachment.set(o.texture), n.depthAttachment = new Ft(e, n.framebuffer), void 0 === this._sharedDepthStencil ? (this._sharedDepthStencil = e.createRenderbuffer(e.gl.DEPTH_STENCIL, r[0], r[1]), this._stencilRef = 0, n.depthAttachment.set(this._sharedDepthStencil), e.clear({ stencil: 0 })) : n.depthAttachment.set(this._sharedDepthStencil), e.extTextureFilterAnisotropic && !e.extTextureFilterAnisotropicForceOff && i.texParameterf(i.TEXTURE_2D, e.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, e.extTextureFilterAnisotropicMax), { fb: n, tex: o, dirty: !1 } } _initFBOPool() { for (; this.pool.length < Math.min(5, this.proxyCoords.length);)this.pool.push(this._createFBO()); } _shouldDisableRenderCache() { if (!this.renderCached) return !0; if (this._style.light && this._style.light.hasTransition()) return !0; for (const t in this._style._sourceCaches) if (this._style._sourceCaches[t].hasTransition()) return !0; return this._style.order.some((t => { const e = this._style._layers[t], i = e.isHidden(this.painter.transform.zoom), r = e.getCrossfadeParameters(), o = !!r && 1 !== r.t, n = e.hasTransition(); return "custom" !== e.type && !i && (o || n) })) } _clearRasterFadeFromRenderCache() { let t = !1; for (const e in this._style._sourceCaches) if (this._style._sourceCaches[e]._source instanceof Ut) { t = !0; break } if (t) for (let t = 0; t < this._style.order.length; ++t) { const e = this._style._layers[this._style.order[t]], i = e.isHidden(this.painter.transform.zoom), r = this._style._getLayerSourceCache(e); if ("raster" !== e.type || i || !r) continue; const o = e.paint.get("raster-fade-duration"); for (const t of this.proxyCoords) { const e = this.proxyToSource[t.key][r.id]; if (e) for (const t of e) { const e = dr(r.getTile(t), r.findLoadedParent(t, 0), r, this.painter.transform, o); (1 !== e.opacity || 0 !== e.mix) && this._clearRenderCacheForTile(r.id, t); } } } } _setupDrapedRenderBatches() { const t = this._style.order, e = t.length; if (0 === e) return; const i = []; let r, o = 0, n = this._style._layers[t[o]]; for (; !this._style.isLayerDraped(n) && n.isHidden(this.painter.transform.zoom) && ++o < e;)n = this._style._layers[t[o]]; for (; o < e; ++o) { const e = this._style._layers[t[o]]; e.isHidden(this.painter.transform.zoom) || (this._style.isLayerDraped(e) ? void 0 === r && (r = o) : void 0 !== r && (i.push({ start: r, end: o - 1 }), r = void 0)); } void 0 !== r && i.push({ start: r, end: o - 1 }), this._drapedRenderBatches = i; } _setupRenderCache(t) { const e = this.proxySourceCache; if (this._shouldDisableRenderCache()) { if (e.renderCache.length > e.renderCachePool.length) { const t = Object.values(e.proxyCachedFBO); e.proxyCachedFBO = {}; for (let i = 0; i < t.length; ++i) { const r = Object.values(t[i]); e.renderCachePool.push(...r); } } return } this._clearRasterFadeFromRenderCache(); const i = this.proxyCoords, r = this._tilesDirty; for (let o = i.length - 1; o >= 0; o--) { const n = i[o]; if (e.getTileByID(n.key), void 0 !== e.proxyCachedFBO[n.key]) { const i = t[n.key], o = this.proxyToSource[n.key]; let s = 0; for (const t in o) { const e = o[t], n = i[t]; if (!n || n.length !== e.length || e.some(((e, i) => e !== n[i] || r[t] && r[t].hasOwnProperty(e.key)))) { s = -1; break } ++s; } for (const t in e.proxyCachedFBO[n.key]) e.renderCache[e.proxyCachedFBO[n.key][t]].dirty = s < 0 || s !== Object.values(i).length; } } const o = [...this._drapedRenderBatches]; o.sort(((t, e) => e.end - e.start - (t.end - t.start))); for (const t of o) for (const r of i) { if (e.proxyCachedFBO[r.key]) continue; let i = e.renderCachePool.pop(); void 0 === i && e.renderCache.length < 50 && (i = e.renderCache.length, e.renderCache.push(this._createFBO())), void 0 !== i && (e.proxyCachedFBO[r.key] = {}, e.proxyCachedFBO[r.key][t.start] = i, e.renderCache[i].dirty = !0); } this._tilesDirty = {}; } _setupStencil(t, e, i, r) { if (!r || !this._sourceTilesOverlap[r.id]) return void (this._overlapStencilType && (this._overlapStencilType = !1)); const o = this.painter.context, n = o.gl; if (e.length <= 1) return void (this._overlapStencilType = !1); let s; if (i.isTileClipped()) s = e.length, this._overlapStencilMode.test = { func: n.EQUAL, mask: 255 }, this._overlapStencilType = "Clip"; else { if (!(e[0].overscaledZ > e[e.length - 1].overscaledZ)) return void (this._overlapStencilType = !1); s = 1, this._overlapStencilMode.test = { func: n.GREATER, mask: 255 }, this._overlapStencilType = "Mask"; } this._stencilRef + s > 255 && (o.clear({ stencil: 0 }), this._stencilRef = 0), this._stencilRef += s, this._overlapStencilMode.ref = this._stencilRef, i.isTileClipped() && this._renderTileClippingMasks(e, this._overlapStencilMode.ref); } stencilModeForRTTOverlap(e) { return this.renderingToTexture && this._overlapStencilType ? ("Clip" === this._overlapStencilType && (this._overlapStencilMode.ref = this.painter._tileClippingMaskIDs[e.key]), this._overlapStencilMode) : t.StencilMode.disabled } _renderTileClippingMasks(e, i) { const r = this.painter, o = this.painter.context, n = o.gl; r._tileClippingMaskIDs = {}, o.setColorMode(t.ColorMode.disabled), o.setDepthMode(t.DepthMode.disabled); const s = r.useProgram("clippingMask"); for (const a of e) { const e = r._tileClippingMaskIDs[a.key] = --i; s.draw(o, n.TRIANGLES, t.DepthMode.disabled, new t.StencilMode({ func: n.ALWAYS, mask: 0 }, e, 255, n.KEEP, n.KEEP, n.REPLACE), t.ColorMode.disabled, t.CullFaceMode.disabled, ur(a.projMatrix), "$clipping", r.tileExtentBuffer, r.quadTriangleIndexBuffer, r.tileExtentSegments); } } pointCoordinate(e) { const i = this.painter.transform; if (e.x < 0 || e.x > i.width || e.y < 0 || e.y > i.height) return null; const r = [e.x, e.y, 1, 1]; t.transformMat4$1(r, r, i.pixelMatrixInverse), t.scale$1(r, r, 1 / r[3]), r[0] /= i.worldSize, r[1] /= i.worldSize; const o = i._camera.position, n = t.mercatorZfromAltitude(1, i.center.lat), s = [o[0], o[1], o[2] / n, 0], a = t.subtract([], r.slice(0, 3), s); t.normalize(a, a); const l = this.raycast(s, a, this._exaggeration); return null !== l && l ? (t.scaleAndAdd(s, s, a, l), s[3] = s[2], s[2] *= n, s) : null } drawDepth() { const e = this.painter, i = e.context, r = this.proxySourceCache, o = Math.ceil(e.width), n = Math.ceil(e.height); if (!this._depthFBO || this._depthFBO.width === o && this._depthFBO.height === n || (this._depthFBO.destroy(), delete this._depthFBO, delete this._depthTexture), !this._depthFBO) { const e = i.gl, r = i.createFramebuffer(o, n, !0); i.activeTexture.set(e.TEXTURE0); const s = new t.Texture(i, { width: o, height: n, data: null }, e.RGBA); s.bind(e.NEAREST, e.CLAMP_TO_EDGE), r.colorAttachment.set(s.texture); const a = i.createRenderbuffer(i.gl.DEPTH_COMPONENT16, o, n); r.depthAttachment.set(a), this._depthFBO = r, this._depthTexture = s; } i.bindFramebuffer.set(this._depthFBO.framebuffer), i.viewport.set([0, 0, o, n]), function (e, i, r, o) { const n = e.context, s = n.gl; n.clear({ depth: 1 }); const a = e.useProgram("terrainDepth"), l = new t.DepthMode(s.LESS, t.DepthMode.ReadWrite, e.depthRangeFor3D); for (const e of o) { const o = r.getTile(e), c = ar(e.projMatrix, 0); i.setupElevationDraw(o, a), a.draw(n, s.TRIANGLES, l, t.StencilMode.disabled, t.ColorMode.unblended, t.CullFaceMode.backCCW, c, "terrain_depth", i.gridBuffer, i.gridIndexBuffer, i.gridNoSkirtSegments); } }(e, this, r, this.proxyCoords); } _setupProxiedCoordsForOrtho(t, e, i) { if (t.getSource() instanceof jt) return this._setupProxiedCoordsForImageSource(t, e, i); this._findCoveringTileCache[t.id] = this._findCoveringTileCache[t.id] || {}; const r = this.proxiedCoords[t.id] = [], o = this.proxyCoords; for (let e = 0; e < o.length; e++) { const n = o[e], s = this._findTileCoveringTileID(n, t); if (s) { const e = this._createProxiedId(n, s, i[n.key] && i[n.key][t.id]); r.push(e), this.proxyToSource[n.key][t.id] = [e]; } } let n = !1; for (let o = 0; o < e.length; o++) { const s = t.getTile(e[o]); if (!s || !s.hasData()) continue; const a = this._findTileCoveringTileID(s.tileID, this.proxySourceCache); if (a && a.tileID.canonical.z !== s.tileID.canonical.z) { const e = this.proxyToSource[a.tileID.key][t.id], o = this._createProxiedId(a.tileID, s, i[a.tileID.key] && i[a.tileID.key][t.id]); e ? e.splice(e.length - 1, 0, o) : this.proxyToSource[a.tileID.key][t.id] = [o], r.push(o), n = !0; } } this._sourceTilesOverlap[t.id] = n; } _setupProxiedCoordsForImageSource(e, i, r) { if (!e.getSource().loaded()) return; const o = this.proxiedCoords[e.id] = [], n = this.proxyCoords, s = e.getSource(), a = new t.pointGeometry(s.tileID.x, s.tileID.y)._div(1 << s.tileID.z), l = s.coordinates.map(t.MercatorCoordinate.fromLngLat).reduce(((t, e) => (t.min.x = Math.min(t.min.x, e.x - a.x), t.min.y = Math.min(t.min.y, e.y - a.y), t.max.x = Math.max(t.max.x, e.x - a.x), t.max.y = Math.max(t.max.y, e.y - a.y), t)), { min: new t.pointGeometry(Number.MAX_VALUE, Number.MAX_VALUE), max: new t.pointGeometry(-Number.MAX_VALUE, -Number.MAX_VALUE) }), c = (e, i) => { const r = e.wrap + e.canonical.x / (1 << e.canonical.z), o = e.canonical.y / (1 << e.canonical.z), n = t.EXTENT / (1 << e.canonical.z), s = i.wrap + i.canonical.x / (1 << i.canonical.z), a = i.canonical.y / (1 << i.canonical.z); return r + n < s + l.min.x || r > s + l.max.x || o + n < a + l.min.y || o > a + l.max.y }; for (let t = 0; t < n.length; t++) { const s = n[t]; for (let t = 0; t < i.length; t++) { const n = e.getTile(i[t]); if (!n || !n.hasData()) continue; if (c(s, n.tileID)) continue; const a = this._createProxiedId(s, n, r[s.key] && r[s.key][e.id]), l = this.proxyToSource[s.key][e.id]; l ? l.push(a) : this.proxyToSource[s.key][e.id] = [a], o.push(a); } } } _createProxiedId(e, i, r) { let o = this.orthoMatrix; if (r) { const t = r.find((t => t.key === i.tileID.key)); if (t) return t } if (i.tileID.key !== e.key) { const r = e.canonical.z - i.tileID.canonical.z; let n, s, a; o = t.create(); const l = i.tileID.wrap - e.wrap << e.overscaledZ; r > 0 ? (n = t.EXTENT >> r, s = n * ((i.tileID.canonical.x << r) - e.canonical.x + l), a = n * ((i.tileID.canonical.y << r) - e.canonical.y)) : (n = t.EXTENT << -r, s = t.EXTENT * (i.tileID.canonical.x - (e.canonical.x + l << -r)), a = t.EXTENT * (i.tileID.canonical.y - (e.canonical.y << -r))), t.ortho(o, 0, n, 0, n, 0, 1), t.translate(o, o, [s, a, 0]); } return new mr(i.tileID, e.key, o) } _findTileCoveringTileID(e, i) { let r = i.getTile(e); if (r && r.hasData()) return r; const o = this._findCoveringTileCache[i.id], n = o[e.key]; if (r = n ? i.getTileByID(n) : null, r && r.hasData() || null === n) return r; let s = r ? r.tileID : e, a = s.overscaledZ; const l = i.getSource().minzoom, c = []; if (!n) { const o = i.getSource().maxzoom; if (e.canonical.z >= o) { const r = e.canonical.z - o; i.getSource().reparseOverscaled ? (a = Math.max(e.canonical.z + 2, i.transform.tileZoom), s = new t.OverscaledTileID(a, e.wrap, o, e.canonical.x >> r, e.canonical.y >> r)) : 0 !== r && (a = o, s = new t.OverscaledTileID(a, e.wrap, o, e.canonical.x >> r, e.canonical.y >> r)); } s.key !== e.key && (c.push(s.key), r = i.getTile(s)); } const h = t => { c.forEach((e => { o[e] = t; })), c.length = 0; }; for (a -= 1; a >= l && (!r || !r.hasData()); a--) { r && h(r.tileID.key); const t = s.calculateScaledKey(a); if (r = i.getTileByID(t), r && r.hasData()) break; const e = o[t]; if (null === e) break; void 0 === e ? c.push(t) : r = i.getTileByID(e); } return h(r ? r.tileID.key : null), r && r.hasData() ? r : null } findDEMTileFor(t) { return this.enabled ? this._findTileCoveringTileID(t, this.sourceCache) : null } prepareDrawTile(t) { this.renderedToTile = !0; } _clearRenderCacheForTile(t, e) { let i = this._tilesDirty[t]; i || (i = this._tilesDirty[t] = {}), i[e.key] = !0; } getWirefameBuffer() { if (!this.wireframeSegments) { const e = function (e) { let i, r, o; const n = new t.StructArrayLayout2ui4, s = 131; for (r = 1; r < 129; r++) { for (i = 1; i < 129; i++)o = r * s + i, n.emplaceBack(o, o + 1), n.emplaceBack(o, o + s), n.emplaceBack(o + 1, o + s), 128 === r && n.emplaceBack(o + s, o + s + 1); n.emplaceBack(o + 1, o + 1 + s); } return n }(); this.wireframeIndexBuffer = this.painter.context.createIndexBuffer(e), this.wireframeSegments = t.SegmentVector.simpleSegment(0, 0, this.gridBuffer.length, e.length); } return [this.wireframeIndexBuffer, this.wireframeSegments] } } function fr(t) { const e = []; for (let i = 0; i < t.length; i++) { if (null === t[i]) continue; const r = t[i].split(" "); e.push(r.pop()); } return e } class gr { static cacheKey(t, e, i) { let r = `${t}${i ? i.cacheKey : ""}`; for (const t of e) r += `/${t}`; return r } constructor(e, i, r, o, n, s) { const a = e.gl; this.program = a.createProgram(); const l = fr(r.staticAttributes), c = o ? o.getBinderAttributes() : [], h = l.concat(c), u = r.staticUniforms ? fr(r.staticUniforms) : [], d = o ? o.getBinderUniforms() : [], p = u.concat(d), m = []; for (const t of p) m.indexOf(t) < 0 && m.push(t); let _ = o ? o.defines() : []; _ = _.concat(s.map((t => `#define ${t}`))); const f = _.concat(Ki.fragmentSource, Ji, Qi.fragmentSource, r.fragmentSource).join("\n"), g = _.concat(Ki.vertexSource, Ji, Qi.vertexSource, Xi.vertexSource, r.vertexSource).join("\n"), v = a.createShader(a.FRAGMENT_SHADER); if (a.isContextLost()) return void (this.failedToCreate = !0); a.shaderSource(v, f), a.compileShader(v), a.attachShader(this.program, v); const x = a.createShader(a.VERTEX_SHADER); if (a.isContextLost()) return void (this.failedToCreate = !0); a.shaderSource(x, g), a.compileShader(x), a.attachShader(this.program, x), this.attributes = {}; const y = {}; this.numAttributes = h.length; for (let t = 0; t < this.numAttributes; t++)h[t] && (a.bindAttribLocation(this.program, t, h[t]), this.attributes[h[t]] = t); a.linkProgram(this.program), a.deleteShader(x), a.deleteShader(v); for (let t = 0; t < m.length; t++) { const e = m[t]; if (e && !y[e]) { const t = a.getUniformLocation(this.program, e); t && (y[e] = t); } } this.fixedUniforms = n(e, y), this.binderUniforms = o ? o.getUniforms(e, y) : [], -1 !== s.indexOf("TERRAIN") && (this.terrainUniforms = ((e, i) => ({ u_dem: new t.Uniform1i(e, i.u_dem), u_dem_prev: new t.Uniform1i(e, i.u_dem_prev), u_dem_unpack: new t.Uniform4f(e, i.u_dem_unpack), u_dem_tl: new t.Uniform2f(e, i.u_dem_tl), u_dem_scale: new t.Uniform1f(e, i.u_dem_scale), u_dem_tl_prev: new t.Uniform2f(e, i.u_dem_tl_prev), u_dem_scale_prev: new t.Uniform1f(e, i.u_dem_scale_prev), u_dem_size: new t.Uniform1f(e, i.u_dem_size), u_dem_lerp: new t.Uniform1f(e, i.u_dem_lerp), u_exaggeration: new t.Uniform1f(e, i.u_exaggeration), u_depth: new t.Uniform1i(e, i.u_depth), u_depth_size_inv: new t.Uniform2f(e, i.u_depth_size_inv), u_meter_to_dem: new t.Uniform1f(e, i.u_meter_to_dem), u_label_plane_matrix_inv: new t.UniformMatrix4f(e, i.u_label_plane_matrix_inv) }))(e, y)), -1 !== s.indexOf("FOG") && (this.fogUniforms = ((e, i) => ({ u_fog_matrix: new t.UniformMatrix4f(e, i.u_fog_matrix), u_fog_range: new t.Uniform2f(e, i.u_fog_range), u_fog_color: new t.Uniform4f(e, i.u_fog_color), u_fog_horizon_blend: new t.Uniform1f(e, i.u_fog_horizon_blend), u_fog_temporal_offset: new t.Uniform1f(e, i.u_fog_temporal_offset) }))(e, y)); } setTerrainUniformValues(t, e) { if (!this.terrainUniforms) return; const i = this.terrainUniforms; if (!this.failedToCreate) { t.program.set(this.program); for (const t in e) i[t].set(e[t]); } } setFogUniformValues(t, e) { if (!this.fogUniforms) return; const i = this.fogUniforms; if (!this.failedToCreate) { t.program.set(this.program); for (const t in e) i[t].location && i[t].set(e[t]); } } draw(t, e, i, r, o, n, s, a, l, c, h, u, d, p, m, _) { const f = t.gl; if (this.failedToCreate) return; t.program.set(this.program), t.setDepthMode(i), t.setStencilMode(r), t.setColorMode(o), t.setCullFace(n); for (const t in this.fixedUniforms) this.fixedUniforms[t].set(s[t]); p && p.setUniforms(t, this.binderUniforms, u, { zoom: d }); const g = { [f.LINES]: 2, [f.TRIANGLES]: 3, [f.LINE_STRIP]: 1 }[e]; for (const i of h.get()) { const r = i.vaos || (i.vaos = {}); (r[a] || (r[a] = new er)).bind(t, this, l, p ? p.getPaintVertexBuffers() : [], c, i.vertexOffset, m, _), f.drawElements(e, i.primitiveLength * g, f.UNSIGNED_SHORT, i.primitiveOffset * g * 2); } } } function vr(t, e, i) { const r = 1 / Y(i, 1, e.transform.tileZoom), o = Math.pow(2, i.tileID.overscaledZ), n = i.tileSize * Math.pow(2, e.transform.tileZoom) / o, s = n * (i.tileID.canonical.x + i.tileID.wrap * o), a = n * i.tileID.canonical.y; return { u_image: 0, u_texsize: i.imageAtlasTexture.size, u_scale: [r, t.fromScale, t.toScale], u_fade: t.t, u_pixel_coord_upper: [s >> 16, a >> 16], u_pixel_coord_lower: [65535 & s, 65535 & a] } } const xr = (e, i, r, o) => { const n = i.style.light, s = n.properties.get("position"), a = [s.x, s.y, s.z], l = t.create$1(); "viewport" === n.properties.get("anchor") && (t.fromRotation(l, -i.transform.angle), t.transformMat3(a, a, l)); const c = n.properties.get("color"); return { u_matrix: e, u_lightpos: a, u_lightintensity: n.properties.get("intensity"), u_lightcolor: [c.r, c.g, c.b], u_vertical_gradient: +r, u_opacity: o } }, yr = (e, i, r, o, n, s, a, l) => t.extend(xr(e, i, r, o), vr(s, i, a), { u_pattern_topColor: [l.r, l.g, l.b, l.a], u_height_factor: -Math.pow(2, n.overscaledZ) / a.tileSize / 8 }), br = t => ({ u_matrix: t }), wr = (e, i, r, o) => t.extend(br(e), vr(r, i, o)), Er = (t, e) => ({ u_matrix: t, u_world: e }), Tr = (e, i, r, o, n) => t.extend(wr(e, i, r, o), { u_world: n }), Cr = (e, i, r, o) => { const n = e.transform; let s; if ("map" === o.paint.get("circle-pitch-alignment")) { const t = Y(r, 1, n.zoom); s = [t, t]; } else s = n.pixelsToGLUnits; return { u_camera_to_center_distance: n.cameraToCenterDistance, u_matrix: e.translatePosMatrix(i.projMatrix, r, o.paint.get("circle-translate"), o.paint.get("circle-translate-anchor")), u_device_pixel_ratio: t.exported.devicePixelRatio, u_extrude_scale: s } }, Sr = t => { const e = []; return "map" === t.paint.get("circle-pitch-alignment") && e.push("PITCH_WITH_MAP"), "map" === t.paint.get("circle-pitch-scale") && e.push("SCALE_WITH_MAP"), e }, Ar = (e, i, r) => { const o = t.EXTENT / r.tileSize; return { u_matrix: e, u_camera_to_center_distance: i.cameraToCenterDistance, u_extrude_scale: [i.pixelsToGLUnits[0] / o, i.pixelsToGLUnits[1] / o] } }, Lr = (t, e, i = 1) => ({ u_matrix: t, u_color: e, u_overlay: 0, u_overlay_scale: i }), Ir = (t, e, i, r) => ({ u_matrix: t, u_extrude_scale: Y(e, 1, i), u_intensity: r }), Mr = (e, i, r, o) => { const n = e.transform; return { u_matrix: Rr(e, i, r, o), u_ratio: 1 / Y(i, 1, n.zoom), u_device_pixel_ratio: t.exported.devicePixelRatio, u_units_to_pixels: [1 / n.pixelsToGLUnits[0], 1 / n.pixelsToGLUnits[1]] } }, Pr = (e, i, r, o, n) => t.extend(Mr(e, i, r, o), { u_image: 0, u_image_height: n }), zr = (e, i, r, o, n) => { const s = e.transform, a = kr(i, s); return { u_matrix: Rr(e, i, r, n), u_texsize: i.imageAtlasTexture.size, u_ratio: 1 / Y(i, 1, s.zoom), u_device_pixel_ratio: t.exported.devicePixelRatio, u_image: 0, u_scale: [a, o.fromScale, o.toScale], u_fade: o.t, u_units_to_pixels: [1 / s.pixelsToGLUnits[0], 1 / s.pixelsToGLUnits[1]] } }, Dr = (e, i, r, o, n) => { const s = kr(i, e.transform); return t.extend(Mr(e, i, r, n), { u_texsize: i.lineAtlasTexture.size, u_scale: [s, o.fromScale, o.toScale], u_image: 0, u_mix: o.t }) }; function kr(t, e) { return 1 / Y(t, 1, e.tileZoom) } function Rr(t, e, i, r) { return t.translatePosMatrix(r || e.tileID.projMatrix, e, i.paint.get("line-translate"), i.paint.get("line-translate-anchor")) } const Fr = (t, e, i, r, o) => { return { u_matrix: t, u_tl_parent: e, u_scale_parent: i, u_buffer_scale: 1, u_fade_t: r.mix, u_opacity: r.opacity * o.paint.get("raster-opacity"), u_image0: 0, u_image1: 1, u_brightness_low: o.paint.get("raster-brightness-min"), u_brightness_high: o.paint.get("raster-brightness-max"), u_saturation_factor: (s = o.paint.get("raster-saturation"), s > 0 ? 1 - 1 / (1.001 - s) : -s), u_contrast_factor: (n = o.paint.get("raster-contrast"), n > 0 ? 1 / (1 - n) : 1 + n), u_spin_weights: Or(o.paint.get("raster-hue-rotate")) }; var n, s; }; function Or(t) { t *= Math.PI / 180; const e = Math.sin(t), i = Math.cos(t); return [(2 * i + 1) / 3, (-Math.sqrt(3) * e - i + 1) / 3, (Math.sqrt(3) * e - i + 1) / 3] } const Br = (t, e, i, r, o, n, s, a, l, c) => { const h = o.transform; return { u_is_size_zoom_constant: +("constant" === t || "source" === t), u_is_size_feature_constant: +("constant" === t || "camera" === t), u_size_t: e ? e.uSizeT : 0, u_size: e ? e.uSize : 0, u_camera_to_center_distance: h.cameraToCenterDistance, u_pitch: h.pitch / 360 * 2 * Math.PI, u_rotate_symbol: +i, u_aspect_ratio: h.width / h.height, u_fade_change: o.options.fadeDuration ? o.symbolFadeChange : 1, u_matrix: n, u_label_plane_matrix: s, u_coord_matrix: a, u_is_text: +l, u_pitch_with_map: +r, u_texsize: c, u_texture: 0 } }, Ur = (e, i, r, o, n, s, a, l, c, h, u) => { const { cameraToCenterDistance: d, _pitch: p } = n.transform; return t.extend(Br(e, i, r, o, n, s, a, l, c, h), { u_gamma_scale: o ? d * Math.cos(n.terrain ? 0 : p) : 1, u_device_pixel_ratio: t.exported.devicePixelRatio, u_is_halo: +u }) }, Nr = (e, i, r, o, n, s, a, l, c, h) => t.extend(Ur(e, i, r, o, n, s, a, l, !0, c, !0), { u_texsize_icon: h, u_texture_icon: 1 }), Gr = (t, e, i) => ({ u_matrix: t, u_opacity: e, u_color: i }), jr = (e, i, r, o, n, s) => t.extend(function (t, e, i, r) { const o = i.imageManager.getPattern(t.from.toString()), n = i.imageManager.getPattern(t.to.toString()), { width: s, height: a } = i.imageManager.getPixelSize(), l = Math.pow(2, r.tileID.overscaledZ), c = r.tileSize * Math.pow(2, i.transform.tileZoom) / l, h = c * (r.tileID.canonical.x + r.tileID.wrap * l), u = c * r.tileID.canonical.y; return { u_image: 0, u_pattern_tl_a: o.tl, u_pattern_br_a: o.br, u_pattern_tl_b: n.tl, u_pattern_br_b: n.br, u_texsize: [s, a], u_mix: e.t, u_pattern_size_a: o.displaySize, u_pattern_size_b: n.displaySize, u_scale_a: e.fromScale, u_scale_b: e.toScale, u_tile_units_to_pixels: 1 / Y(r, 1, i.transform.tileZoom), u_pixel_coord_upper: [h >> 16, u >> 16], u_pixel_coord_lower: [65535 & h, 65535 & u] } }(o, s, r, n), { u_matrix: e, u_opacity: i }), Hr = { fillExtrusion: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_lightpos: new t.Uniform3f(e, i.u_lightpos), u_lightintensity: new t.Uniform1f(e, i.u_lightintensity), u_lightcolor: new t.Uniform3f(e, i.u_lightcolor), u_vertical_gradient: new t.Uniform1f(e, i.u_vertical_gradient), u_opacity: new t.Uniform1f(e, i.u_opacity) }), fillExtrusionPattern: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_lightpos: new t.Uniform3f(e, i.u_lightpos), u_lightintensity: new t.Uniform1f(e, i.u_lightintensity), u_lightcolor: new t.Uniform3f(e, i.u_lightcolor), u_vertical_gradient: new t.Uniform1f(e, i.u_vertical_gradient), u_height_factor: new t.Uniform1f(e, i.u_height_factor), u_image: new t.Uniform1i(e, i.u_image), u_texsize: new t.Uniform2f(e, i.u_texsize), u_pixel_coord_upper: new t.Uniform2f(e, i.u_pixel_coord_upper), u_pixel_coord_lower: new t.Uniform2f(e, i.u_pixel_coord_lower), u_scale: new t.Uniform3f(e, i.u_scale), u_fade: new t.Uniform1f(e, i.u_fade), u_opacity: new t.Uniform1f(e, i.u_opacity) }), fill: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix) }), fillPattern: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_image: new t.Uniform1i(e, i.u_image), u_texsize: new t.Uniform2f(e, i.u_texsize), u_pixel_coord_upper: new t.Uniform2f(e, i.u_pixel_coord_upper), u_pixel_coord_lower: new t.Uniform2f(e, i.u_pixel_coord_lower), u_scale: new t.Uniform3f(e, i.u_scale), u_fade: new t.Uniform1f(e, i.u_fade) }), fillOutline: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_world: new t.Uniform2f(e, i.u_world) }), fillOutlinePattern: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_world: new t.Uniform2f(e, i.u_world), u_image: new t.Uniform1i(e, i.u_image), u_texsize: new t.Uniform2f(e, i.u_texsize), u_pixel_coord_upper: new t.Uniform2f(e, i.u_pixel_coord_upper), u_pixel_coord_lower: new t.Uniform2f(e, i.u_pixel_coord_lower), u_scale: new t.Uniform3f(e, i.u_scale), u_fade: new t.Uniform1f(e, i.u_fade) }), circle: (e, i) => ({ u_camera_to_center_distance: new t.Uniform1f(e, i.u_camera_to_center_distance), u_extrude_scale: new t.Uniform2f(e, i.u_extrude_scale), u_device_pixel_ratio: new t.Uniform1f(e, i.u_device_pixel_ratio), u_matrix: new t.UniformMatrix4f(e, i.u_matrix) }), collisionBox: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_camera_to_center_distance: new t.Uniform1f(e, i.u_camera_to_center_distance), u_extrude_scale: new t.Uniform2f(e, i.u_extrude_scale) }), collisionCircle: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_inv_matrix: new t.UniformMatrix4f(e, i.u_inv_matrix), u_camera_to_center_distance: new t.Uniform1f(e, i.u_camera_to_center_distance), u_viewport_size: new t.Uniform2f(e, i.u_viewport_size) }), debug: (e, i) => ({ u_color: new t.UniformColor(e, i.u_color), u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_overlay: new t.Uniform1i(e, i.u_overlay), u_overlay_scale: new t.Uniform1f(e, i.u_overlay_scale) }), clippingMask: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix) }), heatmap: (e, i) => ({ u_extrude_scale: new t.Uniform1f(e, i.u_extrude_scale), u_intensity: new t.Uniform1f(e, i.u_intensity), u_matrix: new t.UniformMatrix4f(e, i.u_matrix) }), heatmapTexture: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_world: new t.Uniform2f(e, i.u_world), u_image: new t.Uniform1i(e, i.u_image), u_color_ramp: new t.Uniform1i(e, i.u_color_ramp), u_opacity: new t.Uniform1f(e, i.u_opacity) }), hillshade: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_image: new t.Uniform1i(e, i.u_image), u_latrange: new t.Uniform2f(e, i.u_latrange), u_light: new t.Uniform2f(e, i.u_light), u_shadow: new t.UniformColor(e, i.u_shadow), u_highlight: new t.UniformColor(e, i.u_highlight), u_accent: new t.UniformColor(e, i.u_accent) }), hillshadePrepare: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_image: new t.Uniform1i(e, i.u_image), u_dimension: new t.Uniform2f(e, i.u_dimension), u_zoom: new t.Uniform1f(e, i.u_zoom), u_unpack: new t.Uniform4f(e, i.u_unpack) }), line: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_ratio: new t.Uniform1f(e, i.u_ratio), u_device_pixel_ratio: new t.Uniform1f(e, i.u_device_pixel_ratio), u_units_to_pixels: new t.Uniform2f(e, i.u_units_to_pixels) }), lineGradient: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_ratio: new t.Uniform1f(e, i.u_ratio), u_device_pixel_ratio: new t.Uniform1f(e, i.u_device_pixel_ratio), u_units_to_pixels: new t.Uniform2f(e, i.u_units_to_pixels), u_image: new t.Uniform1i(e, i.u_image), u_image_height: new t.Uniform1f(e, i.u_image_height) }), linePattern: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_texsize: new t.Uniform2f(e, i.u_texsize), u_ratio: new t.Uniform1f(e, i.u_ratio), u_device_pixel_ratio: new t.Uniform1f(e, i.u_device_pixel_ratio), u_image: new t.Uniform1i(e, i.u_image), u_units_to_pixels: new t.Uniform2f(e, i.u_units_to_pixels), u_scale: new t.Uniform3f(e, i.u_scale), u_fade: new t.Uniform1f(e, i.u_fade) }), lineSDF: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_texsize: new t.Uniform2f(e, i.u_texsize), u_ratio: new t.Uniform1f(e, i.u_ratio), u_device_pixel_ratio: new t.Uniform1f(e, i.u_device_pixel_ratio), u_units_to_pixels: new t.Uniform2f(e, i.u_units_to_pixels), u_image: new t.Uniform1i(e, i.u_image), u_scale: new t.Uniform3f(e, i.u_scale), u_mix: new t.Uniform1f(e, i.u_mix) }), raster: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_tl_parent: new t.Uniform2f(e, i.u_tl_parent), u_scale_parent: new t.Uniform1f(e, i.u_scale_parent), u_buffer_scale: new t.Uniform1f(e, i.u_buffer_scale), u_fade_t: new t.Uniform1f(e, i.u_fade_t), u_opacity: new t.Uniform1f(e, i.u_opacity), u_image0: new t.Uniform1i(e, i.u_image0), u_image1: new t.Uniform1i(e, i.u_image1), u_brightness_low: new t.Uniform1f(e, i.u_brightness_low), u_brightness_high: new t.Uniform1f(e, i.u_brightness_high), u_saturation_factor: new t.Uniform1f(e, i.u_saturation_factor), u_contrast_factor: new t.Uniform1f(e, i.u_contrast_factor), u_spin_weights: new t.Uniform3f(e, i.u_spin_weights) }), symbolIcon: (e, i) => ({ u_is_size_zoom_constant: new t.Uniform1i(e, i.u_is_size_zoom_constant), u_is_size_feature_constant: new t.Uniform1i(e, i.u_is_size_feature_constant), u_size_t: new t.Uniform1f(e, i.u_size_t), u_size: new t.Uniform1f(e, i.u_size), u_camera_to_center_distance: new t.Uniform1f(e, i.u_camera_to_center_distance), u_pitch: new t.Uniform1f(e, i.u_pitch), u_rotate_symbol: new t.Uniform1i(e, i.u_rotate_symbol), u_aspect_ratio: new t.Uniform1f(e, i.u_aspect_ratio), u_fade_change: new t.Uniform1f(e, i.u_fade_change), u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_label_plane_matrix: new t.UniformMatrix4f(e, i.u_label_plane_matrix), u_coord_matrix: new t.UniformMatrix4f(e, i.u_coord_matrix), u_is_text: new t.Uniform1i(e, i.u_is_text), u_pitch_with_map: new t.Uniform1i(e, i.u_pitch_with_map), u_texsize: new t.Uniform2f(e, i.u_texsize), u_texture: new t.Uniform1i(e, i.u_texture) }), symbolSDF: (e, i) => ({ u_is_size_zoom_constant: new t.Uniform1i(e, i.u_is_size_zoom_constant), u_is_size_feature_constant: new t.Uniform1i(e, i.u_is_size_feature_constant), u_size_t: new t.Uniform1f(e, i.u_size_t), u_size: new t.Uniform1f(e, i.u_size), u_camera_to_center_distance: new t.Uniform1f(e, i.u_camera_to_center_distance), u_pitch: new t.Uniform1f(e, i.u_pitch), u_rotate_symbol: new t.Uniform1i(e, i.u_rotate_symbol), u_aspect_ratio: new t.Uniform1f(e, i.u_aspect_ratio), u_fade_change: new t.Uniform1f(e, i.u_fade_change), u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_label_plane_matrix: new t.UniformMatrix4f(e, i.u_label_plane_matrix), u_coord_matrix: new t.UniformMatrix4f(e, i.u_coord_matrix), u_is_text: new t.Uniform1i(e, i.u_is_text), u_pitch_with_map: new t.Uniform1i(e, i.u_pitch_with_map), u_texsize: new t.Uniform2f(e, i.u_texsize), u_texture: new t.Uniform1i(e, i.u_texture), u_gamma_scale: new t.Uniform1f(e, i.u_gamma_scale), u_device_pixel_ratio: new t.Uniform1f(e, i.u_device_pixel_ratio), u_is_halo: new t.Uniform1i(e, i.u_is_halo) }), symbolTextAndIcon: (e, i) => ({ u_is_size_zoom_constant: new t.Uniform1i(e, i.u_is_size_zoom_constant), u_is_size_feature_constant: new t.Uniform1i(e, i.u_is_size_feature_constant), u_size_t: new t.Uniform1f(e, i.u_size_t), u_size: new t.Uniform1f(e, i.u_size), u_camera_to_center_distance: new t.Uniform1f(e, i.u_camera_to_center_distance), u_pitch: new t.Uniform1f(e, i.u_pitch), u_rotate_symbol: new t.Uniform1i(e, i.u_rotate_symbol), u_aspect_ratio: new t.Uniform1f(e, i.u_aspect_ratio), u_fade_change: new t.Uniform1f(e, i.u_fade_change), u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_label_plane_matrix: new t.UniformMatrix4f(e, i.u_label_plane_matrix), u_coord_matrix: new t.UniformMatrix4f(e, i.u_coord_matrix), u_is_text: new t.Uniform1i(e, i.u_is_text), u_pitch_with_map: new t.Uniform1i(e, i.u_pitch_with_map), u_texsize: new t.Uniform2f(e, i.u_texsize), u_texsize_icon: new t.Uniform2f(e, i.u_texsize_icon), u_texture: new t.Uniform1i(e, i.u_texture), u_texture_icon: new t.Uniform1i(e, i.u_texture_icon), u_gamma_scale: new t.Uniform1f(e, i.u_gamma_scale), u_device_pixel_ratio: new t.Uniform1f(e, i.u_device_pixel_ratio), u_is_halo: new t.Uniform1i(e, i.u_is_halo) }), background: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_opacity: new t.Uniform1f(e, i.u_opacity), u_color: new t.UniformColor(e, i.u_color) }), backgroundPattern: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_opacity: new t.Uniform1f(e, i.u_opacity), u_image: new t.Uniform1i(e, i.u_image), u_pattern_tl_a: new t.Uniform2f(e, i.u_pattern_tl_a), u_pattern_br_a: new t.Uniform2f(e, i.u_pattern_br_a), u_pattern_tl_b: new t.Uniform2f(e, i.u_pattern_tl_b), u_pattern_br_b: new t.Uniform2f(e, i.u_pattern_br_b), u_texsize: new t.Uniform2f(e, i.u_texsize), u_mix: new t.Uniform1f(e, i.u_mix), u_pattern_size_a: new t.Uniform2f(e, i.u_pattern_size_a), u_pattern_size_b: new t.Uniform2f(e, i.u_pattern_size_b), u_scale_a: new t.Uniform1f(e, i.u_scale_a), u_scale_b: new t.Uniform1f(e, i.u_scale_b), u_pixel_coord_upper: new t.Uniform2f(e, i.u_pixel_coord_upper), u_pixel_coord_lower: new t.Uniform2f(e, i.u_pixel_coord_lower), u_tile_units_to_pixels: new t.Uniform1f(e, i.u_tile_units_to_pixels) }), terrainRaster: sr, terrainDepth: sr, skybox: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_sun_direction: new t.Uniform3f(e, i.u_sun_direction), u_cubemap: new t.Uniform1i(e, i.u_cubemap), u_opacity: new t.Uniform1f(e, i.u_opacity), u_temporal_offset: new t.Uniform1f(e, i.u_temporal_offset) }), skyboxGradient: (e, i) => ({ u_matrix: new t.UniformMatrix4f(e, i.u_matrix), u_color_ramp: new t.Uniform1i(e, i.u_color_ramp), u_center_direction: new t.Uniform3f(e, i.u_center_direction), u_radius: new t.Uniform1f(e, i.u_radius), u_opacity: new t.Uniform1f(e, i.u_opacity), u_temporal_offset: new t.Uniform1f(e, i.u_temporal_offset) }), skyboxCapture: (e, i) => ({ u_matrix_3f: new t.UniformMatrix3f(e, i.u_matrix_3f), u_sun_direction: new t.Uniform3f(e, i.u_sun_direction), u_sun_intensity: new t.Uniform1f(e, i.u_sun_intensity), u_color_tint_r: new t.Uniform4f(e, i.u_color_tint_r), u_color_tint_m: new t.Uniform4f(e, i.u_color_tint_m), u_luminance: new t.Uniform1f(e, i.u_luminance) }) }; let Vr; function Wr(e, i, r, o, n, s, a) { const l = e.context, c = l.gl, h = e.useProgram("collisionBox"), u = []; let d = 0, p = 0; for (let m = 0; m < o.length; m++) { const _ = o[m], f = i.getTile(_), g = f.getBucket(r); if (!g) continue; let v = _.projMatrix; 0 === n[0] && 0 === n[1] || (v = e.translatePosMatrix(_.projMatrix, f, n, s)); const x = a ? g.textCollisionBox : g.iconCollisionBox, y = g.collisionCircleArray; if (y.length > 0) { const i = t.create(), r = v; t.mul(i, g.placementInvProjMatrix, e.transform.glCoordMatrix), t.mul(i, i, g.placementViewportMatrix), u.push({ circleArray: y, circleOffset: p, transform: r, invTransform: i }), d += y.length / 4, p = d; } x && (e.terrain && e.terrain.setupElevationDraw(f, h), h.draw(l, c.LINES, t.DepthMode.disabled, t.StencilMode.disabled, e.colorModeForRenderPass(), t.CullFaceMode.disabled, Ar(v, e.transform, f), r.id, x.layoutVertexBuffer, x.indexBuffer, x.segments, null, e.transform.zoom, null, x.collisionVertexBuffer, x.collisionVertexBufferExt)); } if (!a || !u.length) return; const m = e.useProgram("collisionCircle"), _ = new t.StructArrayLayout2f1f2i16; _.resize(4 * d), _._trim(); let f = 0; for (const t of u) for (let e = 0; e < t.circleArray.length / 4; e++) { const i = 4 * e, r = t.circleArray[i + 0], o = t.circleArray[i + 1], n = t.circleArray[i + 2], s = t.circleArray[i + 3]; _.emplace(f++, r, o, n, s, 0), _.emplace(f++, r, o, n, s, 1), _.emplace(f++, r, o, n, s, 2), _.emplace(f++, r, o, n, s, 3); } (!Vr || Vr.length < 2 * d) && (Vr = function (e) { const i = 2 * e, r = new t.StructArrayLayout3ui6; r.resize(i), r._trim(); for (let t = 0; t < i; t++) { const e = 6 * t; r.uint16[e + 0] = 4 * t + 0, r.uint16[e + 1] = 4 * t + 1, r.uint16[e + 2] = 4 * t + 2, r.uint16[e + 3] = 4 * t + 2, r.uint16[e + 4] = 4 * t + 3, r.uint16[e + 5] = 4 * t + 0; } return r }(d)); const g = l.createIndexBuffer(Vr, !0), v = l.createVertexBuffer(_, t.collisionCircleLayout.members, !0); for (const i of u) { const o = { u_matrix: i.transform, u_inv_matrix: i.invTransform, u_camera_to_center_distance: (x = e.transform).cameraToCenterDistance, u_viewport_size: [x.width, x.height] }; m.draw(l, c.TRIANGLES, t.DepthMode.disabled, t.StencilMode.disabled, e.colorModeForRenderPass(), t.CullFaceMode.disabled, o, r.id, v, g, t.SegmentVector.simpleSegment(0, 2 * i.circleOffset, i.circleArray.length, i.circleArray.length / 2), null, e.transform.zoom, null, null, null); } var x; v.destroy(), g.destroy(); } const Zr = t.identity(new Float32Array(16)); function Yr(e, i, r, o, n, s) { const { horizontalAlign: a, verticalAlign: l } = t.getAnchorAlignment(e), c = -(a - .5) * i, h = -(l - .5) * r, u = t.evaluateVariableOffset(e, o); return new t.pointGeometry((c / n + u[0]) * s, (h / n + u[1]) * s) } function qr(e, i, r, o, n, s, a, l, c, h, u, d) { const p = e.text.placedSymbolArray, m = e.text.dynamicLayoutVertexArray, _ = e.icon.dynamicLayoutVertexArray, f = {}; m.clear(); for (let _ = 0; _ < p.length; _++) { const g = p.get(_), v = e.allowVerticalPlacement && !g.placedOrientation, x = g.hidden || !g.crossTileID || v ? null : o[g.crossTileID]; if (x) { const o = new t.pointGeometry(g.anchorX, g.anchorY), p = d(o), _ = fe(o, r ? l : a, p), v = ge(s.cameraToCenterDistance, _.signedDistanceFromCamera); let y = n.evaluateSizeForFeature(e.textSizeData, h, g) * v / t.ONE_EM; r && (y *= e.tilePixelRatio / c); const { width: b, height: w, anchor: E, textOffset: T, textScale: C } = x, S = Yr(E, b, w, T, C, y), A = r ? fe(o.add(S), a, p).point : _.point.add(i ? S.rotate(-s.angle) : S), L = e.allowVerticalPlacement && g.placedOrientation === t.WritingMode.vertical ? Math.PI / 2 : 0; for (let e = 0; e < g.numGlyphs; e++)t.addDynamicAttributes(m, A, L); u && g.associatedIconIndex >= 0 && (f[g.associatedIconIndex] = { shiftedAnchor: A, angle: L }); } else Se(g.numGlyphs, m); } if (u) { _.clear(); const i = e.icon.placedSymbolArray; for (let e = 0; e < i.length; e++) { const r = i.get(e); if (r.hidden) Se(r.numGlyphs, _); else { const i = f[e]; if (i) for (let e = 0; e < r.numGlyphs; e++)t.addDynamicAttributes(_, i.shiftedAnchor, i.angle); else Se(r.numGlyphs, _); } } e.icon.dynamicLayoutVertexBuffer.updateData(_); } e.text.dynamicLayoutVertexBuffer.updateData(m); } function Xr(t, e, i) { return i.iconsInText && e ? "symbolTextAndIcon" : t ? "symbolSDF" : "symbolIcon" } function Qr(e, i, r, o, n, s, a, l, c, h, u, d) { const p = e.context, m = p.gl, _ = e.transform, f = "map" === l, g = "map" === c, v = f && "point" !== r.layout.get("symbol-placement"), x = f && !g && !v, y = void 0 !== r.layout.get("symbol-sort-key").constantOr(1); let b = !1; const w = e.depthModeForSublayer(0, t.DepthMode.ReadOnly), E = r.layout.get("text-variable-anchor"), T = [], C = e.terrain && g ? ["PITCH_WITH_MAP_TERRAIN"] : null; for (const l of o) { const o = i.getTile(l), c = o.getBucket(r); if (!c) continue; const u = n ? c.text : c.icon; if (!u || !u.segments.get().length) continue; const d = u.programConfigurations.get(r.id), p = n || c.sdfIcons, w = n ? c.textSizeData : c.iconSizeData, S = g || 0 !== _.pitch, A = e.useProgram(Xr(p, n, c), d, C), L = t.evaluateSizeForZoom(w, _.zoom); let I, M, P, z, D = [0, 0], k = null; if (n) { if (M = o.glyphAtlasTexture, P = m.LINEAR, I = o.glyphAtlasTexture.size, c.iconsInText) { D = o.imageAtlasTexture.size, k = o.imageAtlasTexture; const t = "composite" === w.kind || "camera" === w.kind; z = S || e.options.rotating || e.options.zooming || t ? m.LINEAR : m.NEAREST; } } else { const t = 1 !== r.layout.get("icon-size").constantOr(0) || c.iconsNeedLinear; M = o.imageAtlasTexture, P = p || e.options.rotating || e.options.zooming || t || S ? m.LINEAR : m.NEAREST, I = o.imageAtlasTexture.size; } const R = Y(o, 1, e.transform.zoom), F = me(l.projMatrix, g, f, e.transform, R), O = e.terrain && g && v ? t.invert(new Float32Array(16), F) : Zr, B = _e(l.projMatrix, g, f, e.transform, R), U = E && c.hasTextData(), N = "none" !== r.layout.get("icon-text-fit") && U && c.hasIconData(); if (v) { const t = _.elevation; xe(c, l.projMatrix, e, n, F, B, g, h, t ? e => t.getAtTileOffset(l, e.x, e.y) : null); } const G = e.translatePosMatrix(l.projMatrix, o, s, a), j = v || n && E || N ? Zr : F, H = e.translatePosMatrix(B, o, s, a, !0), V = p && 0 !== r.paint.get(n ? "text-halo-width" : "icon-halo-width").constantOr(1); let W; W = p ? c.iconsInText ? Nr(w.kind, L, x, g, e, G, j, H, I, D) : Ur(w.kind, L, x, g, e, G, j, H, n, I, !0) : Br(w.kind, L, x, g, e, G, j, H, n, I); const Z = { program: A, buffers: u, uniformValues: W, atlasTexture: M, atlasTextureIcon: k, atlasInterpolation: P, atlasInterpolationIcon: z, isSDF: p, hasHalo: V, tile: o, labelPlaneMatrixInv: O }; if (y && c.canOverlap) { b = !0; const e = u.segments.get(); for (const i of e) T.push({ segments: new t.SegmentVector([i]), sortKey: i.sortKey, state: Z }); } else T.push({ segments: u.segments, sortKey: 0, state: Z }); } b && T.sort(((t, e) => t.sortKey - e.sortKey)); for (const t of T) { const i = t.state; if (e.terrain && e.terrain.setupElevationDraw(i.tile, i.program, { useDepthForOcclusion: !0, labelPlaneMatrixInv: i.labelPlaneMatrixInv }), p.activeTexture.set(m.TEXTURE0), i.atlasTexture.bind(i.atlasInterpolation, m.CLAMP_TO_EDGE), i.atlasTextureIcon && (p.activeTexture.set(m.TEXTURE1), i.atlasTextureIcon && i.atlasTextureIcon.bind(i.atlasInterpolationIcon, m.CLAMP_TO_EDGE)), i.isSDF) { const o = i.uniformValues; i.hasHalo && (o.u_is_halo = 1, Kr(i.buffers, t.segments, r, e, i.program, w, u, d, o)), o.u_is_halo = 0; } Kr(i.buffers, t.segments, r, e, i.program, w, u, d, i.uniformValues); } } function Kr(e, i, r, o, n, s, a, l, c) { const h = o.context; n.draw(h, h.gl.TRIANGLES, s, a, l, t.CullFaceMode.disabled, c, r.id, e.layoutVertexBuffer, e.indexBuffer, i, r.paint, o.transform.zoom, e.programConfigurations.get(r.id), e.dynamicLayoutVertexBuffer, e.opacityVertexBuffer); } function Jr(e, i, r, o, n, s, a) { const l = e.context.gl, c = r.paint.get("fill-pattern"), h = c && c.constantOr(1), u = r.getCrossfadeParameters(); let d, p, m, _, f; a ? (p = h && !r.getPaintProperty("fill-outline-color") ? "fillOutlinePattern" : "fillOutline", d = l.LINES) : (p = h ? "fillPattern" : "fill", d = l.TRIANGLES); for (const g of o) { const o = i.getTile(g); if (h && !o.patternsLoaded()) continue; const v = o.getBucket(r); if (!v) continue; e.prepareDrawTile(g); const x = v.programConfigurations.get(r.id), y = e.useProgram(p, x); h && (e.context.activeTexture.set(l.TEXTURE0), o.imageAtlasTexture.bind(l.LINEAR, l.CLAMP_TO_EDGE), x.updatePaintBuffers(u)); const b = c.constantOr(null); if (b && o.imageAtlas) { const t = o.imageAtlas, e = t.patternPositions[b.to.toString()], i = t.patternPositions[b.from.toString()]; e && i && x.setConstantPatternPositions(e, i); } const w = e.translatePosMatrix(g.projMatrix, o, r.paint.get("fill-translate"), r.paint.get("fill-translate-anchor")); if (a) { _ = v.indexBuffer2, f = v.segments2; const t = e.terrain && e.terrain.renderingToTexture ? e.terrain.drapeBufferSize : [l.drawingBufferWidth, l.drawingBufferHeight]; m = "fillOutlinePattern" === p && h ? Tr(w, e, u, o, t) : Er(w, t); } else _ = v.indexBuffer, f = v.segments, m = h ? wr(w, e, u, o) : br(w); e.prepareDrawProgram(e.context, y, g.toUnwrapped()), y.draw(e.context, d, n, e.stencilModeForClipping(g), s, t.CullFaceMode.disabled, m, r.id, v.layoutVertexBuffer, _, f, r.paint, e.transform.zoom, x); } } function $r(e, i, r, o, n, s, a) { const l = e.context, c = l.gl, h = r.paint.get("fill-extrusion-pattern"), u = h.constantOr(1), d = r.getCrossfadeParameters(), p = r.paint.get("fill-extrusion-opacity"); for (const m of o) { const o = i.getTile(m), _ = o.getBucket(r); if (!_) continue; const f = _.programConfigurations.get(r.id), g = e.useProgram(u ? "fillExtrusionPattern" : "fillExtrusion", f); if (e.terrain) { const t = e.terrain; if (!_.enableTerrain) continue; if (t.setupElevationDraw(o, g, { useMeterToDem: !0 }), to(l, i, m, _, r, t), !_.centroidVertexBuffer) { const t = g.attributes.a_centroid_pos; void 0 !== t && c.vertexAttrib2f(t, 0, 0); } } u && (e.context.activeTexture.set(c.TEXTURE0), o.imageAtlasTexture.bind(c.LINEAR, c.CLAMP_TO_EDGE), f.updatePaintBuffers(d)); const v = h.constantOr(null); if (v && o.imageAtlas) { const t = o.imageAtlas, e = t.patternPositions[v.to.toString()], i = t.patternPositions[v.from.toString()]; e && i && f.setConstantPatternPositions(e, i); } const x = r.paint.get("fill-extrusion-pattern-topColor").value.value, y = e.translatePosMatrix(m.projMatrix, o, r.paint.get("fill-extrusion-translate"), r.paint.get("fill-extrusion-translate-anchor")), b = r.paint.get("fill-extrusion-vertical-gradient"), w = u ? yr(y, e, b, p, m, d, o, x) : xr(y, e, b, p); e.prepareDrawProgram(l, g, m.toUnwrapped()), g.draw(l, l.gl.TRIANGLES, n, s, a, t.CullFaceMode.backCCW, w, r.id, _.layoutVertexBuffer, _.indexBuffer, _.segments, r.paint, e.transform.zoom, f, e.terrain ? _.centroidVertexBuffer : null); } } function to(e, i, r, o, n, s) { const a = [e => { let i = e.canonical.x - 1, r = e.wrap; return i < 0 && (i = (1 << e.canonical.z) - 1, r--), new t.OverscaledTileID(e.overscaledZ, r, e.canonical.z, i, e.canonical.y) }, e => { let i = e.canonical.x + 1, r = e.wrap; return i === 1 << e.canonical.z && (i = 0, r++), new t.OverscaledTileID(e.overscaledZ, r, e.canonical.z, i, e.canonical.y) }, e => new t.OverscaledTileID(e.overscaledZ, e.wrap, e.canonical.z, e.canonical.x, (0 === e.canonical.y ? 1 << e.canonical.z : e.canonical.y) - 1), e => new t.OverscaledTileID(e.overscaledZ, e.wrap, e.canonical.z, e.canonical.x, e.canonical.y === (1 << e.canonical.z) - 1 ? 0 : e.canonical.y + 1)], l = t => { const e = i.getSource().maxzoom, r = t => { const e = i.getTileByID(t); if (e && e.hasData()) return e.getBucket(n) }; let o, s, a; return (t.overscaledZ === t.canonical.z || t.overscaledZ >= e) && (o = r(t.key)), t.overscaledZ >= e && (s = r(t.calculateScaledKey(t.overscaledZ + 1))), t.overscaledZ > e && (a = r(t.calculateScaledKey(t.overscaledZ - 1))), o || s || a }, c = [0, 0, 0], h = (e, i) => (c[0] = Math.min(e.min.y, i.min.y), c[1] = Math.max(e.max.y, i.max.y), c[2] = t.EXTENT - i.min.x > e.max.x ? i.min.x - t.EXTENT : e.max.x, c), u = (e, i) => (c[0] = Math.min(e.min.x, i.min.x), c[1] = Math.max(e.max.x, i.max.x), c[2] = t.EXTENT - i.min.y > e.max.y ? i.min.y - t.EXTENT : e.max.y, c), d = [(t, e) => h(t, e), (t, e) => h(e, t), (t, e) => u(t, e), (t, e) => u(e, t)], p = new t.pointGeometry(0, 0); let m, _, f; const g = (e, i, o, n, a) => { const l = [[n ? o : e, n ? e : o, 0], [n ? o : i, n ? i : o, 0]], c = a < 0 ? t.EXTENT + a : a, h = [n ? c : (e + i) / 2, n ? (e + i) / 2 : c, 0]; return 0 === o && a < 0 || 0 !== o && a > 0 ? s.getForTilePoints(f, [h], !0, _) : l.push(h), s.getForTilePoints(r, l, !0, m), Math.max(l[0][2], l[1][2], h[2]) / s.exaggeration() }; for (let e = 0; e < 4; e++) { const i = o.borders[e]; if (0 === i.length && (o.borderDone[e] = !0), o.borderDone[e]) continue; const n = f = a[e](r), c = l(n); if (!c || !c.enableTerrain) continue; if (_ = s.findDEMTileFor(n), !_ || !_.dem) continue; if (!m) { const t = s.findDEMTileFor(r); if (!t || !t.dem) return; m = t; } const h = (e < 2 ? 1 : 5) - e, u = c.borders[h]; let v = 0; for (let r = 0; r < i.length; r++) { const n = o.featuresOnBorder[i[r]], s = n.borders[e]; let a; for (; v < u.length && (a = c.featuresOnBorder[u[v]], !(a.borders[h][1] > s[0] + 3));)c.borderDone[h] || c.encodeCentroid(void 0, a, !1), v++; if (a && v < u.length) { const i = v; let r = 0; for (; !(a.borders[h][0] > s[1] - 3) && (r++, ++v !== u.length);)a = c.featuresOnBorder[u[v]]; if (a = c.featuresOnBorder[u[i]], n.intersectsCount() > 1 || a.intersectsCount() > 1 || 1 !== r) { 1 !== r && (v = i), o.encodeCentroid(void 0, n, !1), c.borderDone[h] || c.encodeCentroid(void 0, a, !1); continue } const l = d[e](n, a), m = e % 2 ? t.EXTENT - 1 : 0; p.x = g(l[0], Math.min(t.EXTENT - 1, l[1]), m, e < 2, l[2]), p.y = 0, o.encodeCentroid(p, n, !1), c.borderDone[h] || c.encodeCentroid(p, a, !1); } else o.encodeCentroid(void 0, n, !1); } o.borderDone[e] = o.needsCentroidUpdate = !0, c.borderDone[h] || (c.borderDone[h] = c.needsCentroidUpdate = !0); } (o.needsCentroidUpdate || !o.centroidVertexBuffer && 0 !== o.centroidVertexArray.length) && o.uploadCentroid(e); } const eo = new t.Color(1, 0, 0, 1), io = new t.Color(0, 1, 0, 1), ro = new t.Color(0, 0, 1, 1), oo = new t.Color(1, 0, 1, 1), no = new t.Color(0, 1, 1, 1); function so(t, e, i, r) { lo(t, 0, e + i / 2, t.transform.width, i, r); } function ao(t, e, i, r) { lo(t, e - i / 2, 0, i, t.transform.height, r); } function lo(e, i, r, o, n, s) { const a = e.context, l = a.gl; l.enable(l.SCISSOR_TEST), l.scissor(i * t.exported.devicePixelRatio, r * t.exported.devicePixelRatio, o * t.exported.devicePixelRatio, n * t.exported.devicePixelRatio), a.clear({ color: s }), l.disable(l.SCISSOR_TEST); } function co(e, i, r) { const o = e.context, n = o.gl, s = r.projMatrix, a = e.useProgram("debug"), l = i.getTileByID(r.key); e.terrain && e.terrain.setupElevationDraw(l, a); const c = t.DepthMode.disabled, h = t.StencilMode.disabled, u = e.colorModeForRenderPass(), d = "$debug"; o.activeTexture.set(n.TEXTURE0), e.emptyTexture.bind(n.LINEAR, n.CLAMP_TO_EDGE), a.draw(o, n.LINE_STRIP, c, h, u, t.CullFaceMode.disabled, Lr(s, t.Color.red), d, e.debugBuffer, e.tileBorderIndexBuffer, e.debugSegments); const p = l.latestRawTileData, m = Math.floor((p && p.byteLength || 0) / 1024), _ = i.getTile(r).tileSize, f = 512 / Math.min(_, 512) * (r.overscaledZ / e.transform.zoom) * .5; let g = r.canonical.toString(); r.overscaledZ !== r.canonical.z && (g += ` => ${r.overscaledZ}`), function (t, e) { t.initDebugOverlayCanvas(); const i = t.debugOverlayCanvas, r = t.context.gl, o = t.debugOverlayCanvas.getContext("2d"); o.clearRect(0, 0, i.width, i.height), o.shadowColor = "white", o.shadowBlur = 2, o.lineWidth = 1.5, o.strokeStyle = "white", o.textBaseline = "top", o.font = "bold 36px Open Sans, sans-serif", o.fillText(e, 5, 5), o.strokeText(e, 5, 5), t.debugOverlayTexture.update(i), t.debugOverlayTexture.bind(r.LINEAR, r.CLAMP_TO_EDGE); }(e, `${g} ${m}kb`), a.draw(o, n.TRIANGLES, c, h, t.ColorMode.alphaBlended, t.CullFaceMode.disabled, Lr(s, t.Color.transparent, f), d, e.debugBuffer, e.quadTriangleIndexBuffer, e.debugSegments); } const ho = t.createLayout([{ name: "a_pos_3f", components: 3, type: "Float32" }]), { members: uo } = ho; function po(t, e, i, r) { t.emplaceBack(e, i, r); } class mo { constructor(e) { this.vertexArray = new t.StructArrayLayout3f12, this.indices = new t.StructArrayLayout3ui6, po(this.vertexArray, -1, -1, 1), po(this.vertexArray, 1, -1, 1), po(this.vertexArray, -1, 1, 1), po(this.vertexArray, 1, 1, 1), po(this.vertexArray, -1, -1, -1), po(this.vertexArray, 1, -1, -1), po(this.vertexArray, -1, 1, -1), po(this.vertexArray, 1, 1, -1), this.indices.emplaceBack(5, 1, 3), this.indices.emplaceBack(3, 7, 5), this.indices.emplaceBack(6, 2, 0), this.indices.emplaceBack(0, 4, 6), this.indices.emplaceBack(2, 6, 7), this.indices.emplaceBack(7, 3, 2), this.indices.emplaceBack(5, 4, 0), this.indices.emplaceBack(0, 1, 5), this.indices.emplaceBack(0, 2, 3), this.indices.emplaceBack(3, 1, 0), this.indices.emplaceBack(7, 6, 4), this.indices.emplaceBack(4, 5, 7), this.vertexBuffer = e.createVertexBuffer(this.vertexArray, uo), this.indexBuffer = e.createIndexBuffer(this.indices), this.segment = t.SegmentVector.simpleSegment(0, 0, 36, 12); } } function _o(e, i, r, o, n, s) { const a = e.gl, l = i.paint.get("sky-atmosphere-color"), c = i.paint.get("sky-atmosphere-halo-color"), h = i.paint.get("sky-atmosphere-sun-intensity"), u = ((t, e, i, r, o) => ({ u_matrix_3f: t, u_sun_direction: e, u_sun_intensity: i, u_color_tint_r: [r.r, r.g, r.b, r.a], u_color_tint_m: [o.r, o.g, o.b, o.a], u_luminance: 5e-5 }))(t.fromMat4([], o), n, h, l, c); a.framebufferTexture2D(a.FRAMEBUFFER, a.COLOR_ATTACHMENT0, a.TEXTURE_CUBE_MAP_POSITIVE_X + s, i.skyboxTexture, 0), r.draw(e, a.TRIANGLES, t.DepthMode.disabled, t.StencilMode.disabled, t.ColorMode.unblended, t.CullFaceMode.frontCW, u, "skyboxCapture", i.skyboxGeometry.vertexBuffer, i.skyboxGeometry.indexBuffer, i.skyboxGeometry.segment); } const fo = { symbol: function (e, i, r, o, n) { if ("translucent" !== e.renderPass) return; const s = t.StencilMode.disabled, a = e.colorModeForRenderPass(); r.layout.get("text-variable-anchor") && function (e, i, r, o, n, s, a) { const l = i.transform, c = "map" === n, h = "map" === s; for (const n of e) { const e = o.getTile(n), s = e.getBucket(r); if (!s || !s.text || !s.text.segments.get().length) continue; const u = t.evaluateSizeForZoom(s.textSizeData, l.zoom), d = Y(e, 1, i.transform.zoom), p = me(n.projMatrix, h, c, i.transform, d), m = "none" !== r.layout.get("icon-text-fit") && s.hasIconData(); if (u) { const i = Math.pow(2, l.zoom - e.tileID.overscaledZ), r = l.elevation; qr(s, c, h, a, t.symbolSize, l, p, n.projMatrix, i, u, m, r ? t => r.getAtTileOffset(n, t.x, t.y) : t => 0); } } }(o, e, r, i, r.layout.get("text-rotation-alignment"), r.layout.get("text-pitch-alignment"), n), 0 !== r.paint.get("icon-opacity").constantOr(1) && Qr(e, i, r, o, !1, r.paint.get("icon-translate"), r.paint.get("icon-translate-anchor"), r.layout.get("icon-rotation-alignment"), r.layout.get("icon-pitch-alignment"), r.layout.get("icon-keep-upright"), s, a), 0 !== r.paint.get("text-opacity").constantOr(1) && Qr(e, i, r, o, !0, r.paint.get("text-translate"), r.paint.get("text-translate-anchor"), r.layout.get("text-rotation-alignment"), r.layout.get("text-pitch-alignment"), r.layout.get("text-keep-upright"), s, a), i.map.showCollisionBoxes && (Wr(e, i, r, o, r.paint.get("text-translate"), r.paint.get("text-translate-anchor"), !0), Wr(e, i, r, o, r.paint.get("icon-translate"), r.paint.get("icon-translate-anchor"), !1)); }, circle: function (e, i, r, o) { if ("translucent" !== e.renderPass) return; const n = r.paint.get("circle-opacity"), s = r.paint.get("circle-stroke-width"), a = r.paint.get("circle-stroke-opacity"), l = void 0 !== r.layout.get("circle-sort-key").constantOr(1); if (0 === n.constantOr(1) && (0 === s.constantOr(1) || 0 === a.constantOr(1))) return; const c = e.context, h = c.gl, u = e.depthModeForSublayer(0, t.DepthMode.ReadOnly), d = t.StencilMode.disabled, p = e.colorModeForRenderPass(), m = []; for (let n = 0; n < o.length; n++) { const s = o[n], a = i.getTile(s), c = a.getBucket(r); if (!c) continue; const h = c.programConfigurations.get(r.id), u = Sr(r), d = { programConfiguration: h, program: e.useProgram("circle", h, u), layoutVertexBuffer: c.layoutVertexBuffer, indexBuffer: c.indexBuffer, uniformValues: Cr(e, s, a, r), tile: a }; if (l) { const e = c.segments.get(); for (const i of e) m.push({ segments: new t.SegmentVector([i]), sortKey: i.sortKey, state: d }); } else m.push({ segments: c.segments, sortKey: 0, state: d }); } l && m.sort(((t, e) => t.sortKey - e.sortKey)); for (const i of m) { const { programConfiguration: o, program: n, layoutVertexBuffer: s, indexBuffer: a, uniformValues: l, tile: m } = i.state, _ = i.segments; e.terrain && e.terrain.setupElevationDraw(m, n, { useDepthForOcclusion: !0 }), e.prepareDrawProgram(c, n, m.tileID.toUnwrapped()), n.draw(c, h.TRIANGLES, u, d, p, t.CullFaceMode.disabled, l, r.id, s, a, _, r.paint, e.transform.zoom, o); } }, heatmap: function (e, i, r, o) { if (0 !== r.paint.get("heatmap-opacity")) if ("offscreen" === e.renderPass) { const n = e.context, s = n.gl, a = t.StencilMode.disabled, l = new t.ColorMode([s.ONE, s.ONE], t.Color.transparent, [!0, !0, !0, !0]); !function (t, e, i) { const r = t.gl; t.activeTexture.set(r.TEXTURE1), t.viewport.set([0, 0, e.width / 4, e.height / 4]); let o = i.heatmapFbo; if (o) r.bindTexture(r.TEXTURE_2D, o.colorAttachment.get()), t.bindFramebuffer.set(o.framebuffer); else { const n = r.createTexture(); r.bindTexture(r.TEXTURE_2D, n), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR), o = i.heatmapFbo = t.createFramebuffer(e.width / 4, e.height / 4, !1), function (t, e, i, r) { const o = t.gl; o.texImage2D(o.TEXTURE_2D, 0, o.RGBA, e.width / 4, e.height / 4, 0, o.RGBA, t.extRenderToTextureHalfFloat ? t.extTextureHalfFloat.HALF_FLOAT_OES : o.UNSIGNED_BYTE, null), r.colorAttachment.set(i); }(t, e, n, o); } }(n, e, r), n.clear({ color: t.Color.transparent }); for (let c = 0; c < o.length; c++) { const h = o[c]; if (i.hasRenderableParent(h)) continue; const u = i.getTile(h), d = u.getBucket(r); if (!d) continue; const p = d.programConfigurations.get(r.id), m = e.useProgram("heatmap", p), { zoom: _ } = e.transform; e.terrain && e.terrain.setupElevationDraw(u, m), e.prepareDrawProgram(n, m, h.toUnwrapped()), m.draw(n, s.TRIANGLES, t.DepthMode.disabled, a, l, t.CullFaceMode.disabled, Ir(h.projMatrix, u, _, r.paint.get("heatmap-intensity")), r.id, d.layoutVertexBuffer, d.indexBuffer, d.segments, r.paint, e.transform.zoom, p); } n.viewport.set([0, 0, e.width, e.height]); } else "translucent" === e.renderPass && (e.context.setColorMode(e.colorModeForRenderPass()), function (e, i) { const r = e.context, o = r.gl, n = i.heatmapFbo; if (!n) return; r.activeTexture.set(o.TEXTURE0), o.bindTexture(o.TEXTURE_2D, n.colorAttachment.get()), r.activeTexture.set(o.TEXTURE1); let s = i.colorRampTexture; s || (s = i.colorRampTexture = new t.Texture(r, i.colorRamp, o.RGBA)), s.bind(o.LINEAR, o.CLAMP_TO_EDGE), e.useProgram("heatmapTexture").draw(r, o.TRIANGLES, t.DepthMode.disabled, t.StencilMode.disabled, e.colorModeForRenderPass(), t.CullFaceMode.disabled, ((e, i, r, o) => { const n = t.create(); t.ortho(n, 0, e.width, e.height, 0, 0, 1); const s = e.context.gl; return { u_matrix: n, u_world: [s.drawingBufferWidth, s.drawingBufferHeight], u_image: 0, u_color_ramp: 1, u_opacity: i.paint.get("heatmap-opacity") } })(e, i), i.id, e.viewportBuffer, e.quadTriangleIndexBuffer, e.viewportSegments, i.paint, e.transform.zoom); }(e, r)); }, line: function (e, i, r, o) { if ("translucent" !== e.renderPass) return; const n = r.paint.get("line-opacity"), s = r.paint.get("line-width"); if (0 === n.constantOr(1) || 0 === s.constantOr(1)) return; const a = e.depthModeForSublayer(0, t.DepthMode.ReadOnly), l = e.colorModeForRenderPass(), c = r.paint.get("line-dasharray"), h = c.constantOr(1), u = r.layout.get("line-cap"), d = r.paint.get("line-pattern"), p = d.constantOr(1), m = r.paint.get("line-gradient"), _ = r.getCrossfadeParameters(), f = p ? "linePattern" : h ? "lineSDF" : m ? "lineGradient" : "line", g = e.context, v = g.gl; for (const n of o) { const o = i.getTile(n); if (p && !o.patternsLoaded()) continue; const s = o.getBucket(r); if (!s) continue; e.prepareDrawTile(n); const x = s.programConfigurations.get(r.id), y = e.useProgram(f, x), b = d.constantOr(null); if (b && o.imageAtlas) { const t = o.imageAtlas, e = t.patternPositions[b.to.toString()], i = t.patternPositions[b.from.toString()]; e && i && x.setConstantPatternPositions(e, i); } const w = c.constantOr(null), E = u.constantOr(null); if (!p && w && E && o.lineAtlas) { const t = o.lineAtlas, e = t.getDash(w.to, E), i = t.getDash(w.from, E); e && i && x.setConstantPatternPositions(e, i); } const T = e.terrain ? n.projMatrix : null, C = p ? zr(e, o, r, _, T) : h ? Dr(e, o, r, _, T) : m ? Pr(e, o, r, T, s.lineClipsArray.length) : Mr(e, o, r, T); if (p) g.activeTexture.set(v.TEXTURE0), o.imageAtlasTexture.bind(v.LINEAR, v.CLAMP_TO_EDGE), x.updatePaintBuffers(_); else if (h) g.activeTexture.set(v.TEXTURE0), o.lineAtlasTexture.bind(v.LINEAR, v.REPEAT), x.updatePaintBuffers(_); else if (m) { const o = s.gradients[r.id]; let a = o.texture; if (r.gradientVersion !== o.version) { let l = 256; if (r.stepInterpolant) { const r = i.getSource().maxzoom, o = n.canonical.z === r ? Math.ceil(1 << e.transform.maxZoom - n.canonical.z) : 1; l = t.clamp(t.nextPowerOfTwo(s.maxLineLength / t.EXTENT * 1024 * o), 256, g.maxTextureSize); } o.gradient = t.renderColorRamp({ expression: r.gradientExpression(), evaluationKey: "lineProgress", resolution: l, image: o.gradient || void 0, clips: s.lineClipsArray }), o.texture ? o.texture.update(o.gradient) : o.texture = new t.Texture(g, o.gradient, v.RGBA), o.version = r.gradientVersion, a = o.texture; } g.activeTexture.set(v.TEXTURE0), a.bind(r.stepInterpolant ? v.NEAREST : v.LINEAR, v.CLAMP_TO_EDGE); } e.prepareDrawProgram(g, y, n.toUnwrapped()), y.draw(g, v.TRIANGLES, a, e.stencilModeForClipping(n), l, t.CullFaceMode.disabled, C, r.id, s.layoutVertexBuffer, s.indexBuffer, s.segments, r.paint, e.transform.zoom, x, s.layoutVertexBuffer2); } }, fill: function (e, i, r, o) { const n = r.paint.get("fill-color"), s = r.paint.get("fill-opacity"); if (0 === s.constantOr(1)) return; const a = e.colorModeForRenderPass(), l = r.paint.get("fill-pattern"), c = e.opaquePassEnabledForLayer() && !l.constantOr(1) && 1 === n.constantOr(t.Color.transparent).a && 1 === s.constantOr(0) ? "opaque" : "translucent"; if (e.renderPass === c) { const n = e.depthModeForSublayer(1, "opaque" === e.renderPass ? t.DepthMode.ReadWrite : t.DepthMode.ReadOnly); Jr(e, i, r, o, n, a, !1); } if ("translucent" === e.renderPass && r.paint.get("fill-antialias")) { const n = e.depthModeForSublayer(r.getPaintProperty("fill-outline-color") ? 2 : 0, t.DepthMode.ReadOnly); Jr(e, i, r, o, n, a, !0); } }, "fill-extrusion": function (e, i, r, o) { const n = r.paint.get("fill-extrusion-opacity"); if (0 !== n && "translucent" === e.renderPass) { const s = new t.DepthMode(e.context.gl.LEQUAL, t.DepthMode.ReadWrite, e.depthRangeFor3D); if (1 !== n || r.paint.get("fill-extrusion-pattern").constantOr(1)) $r(e, i, r, o, s, t.StencilMode.disabled, t.ColorMode.disabled), $r(e, i, r, o, s, e.stencilModeFor3D(), e.colorModeForRenderPass()); else { const n = e.colorModeForRenderPass(); $r(e, i, r, o, s, t.StencilMode.disabled, n); } } }, hillshade: function (e, i, r, o) { if ("offscreen" !== e.renderPass && "translucent" !== e.renderPass) return; const n = e.context, s = e.depthModeForSublayer(0, t.DepthMode.ReadOnly), a = e.colorModeForRenderPass(), l = e.terrain && e.terrain.renderingToTexture, [c, h] = "translucent" !== e.renderPass || l ? [{}, o] : e.stencilConfigForOverlap(o); for (const o of h) { const n = i.getTile(o); if (n.needsHillshadePrepare && "offscreen" === e.renderPass) nr(e, n, r, s, t.StencilMode.disabled, a); else if ("translucent" === e.renderPass) { const t = l && e.terrain ? e.terrain.stencilModeForRTTOverlap(o) : c[o.overscaledZ]; rr(e, o, n, r, s, t, a); } } n.viewport.set([0, 0, e.width, e.height]); }, raster: function (e, i, r, o, n, s) { if ("translucent" !== e.renderPass) return; if (0 === r.paint.get("raster-opacity")) return; if (!o.length) return; const a = e.context, l = a.gl, c = i.getSource(), h = e.useProgram("raster"), u = e.colorModeForRenderPass(), d = e.terrain && e.terrain.renderingToTexture, [p, m] = c instanceof jt || d ? [{}, o] : e.stencilConfigForOverlap(o), _ = m[m.length - 1].overscaledZ, f = !e.options.moving; for (const o of m) { const n = d ? t.DepthMode.disabled : e.depthModeForSublayer(o.overscaledZ - _, 1 === r.paint.get("raster-opacity") ? t.DepthMode.ReadWrite : t.DepthMode.ReadOnly, l.LESS), m = o.toUnwrapped(), g = i.getTile(o); if (d && (!g || !g.hasData())) continue; const v = d ? o.projMatrix : e.transform.calculateProjMatrix(m, f), x = e.terrain && d ? e.terrain.stencilModeForRTTOverlap(o) : p[o.overscaledZ], y = s ? 0 : r.paint.get("raster-fade-duration"); g.registerFadeDuration(y); const b = i.findLoadedParent(o, 0), w = dr(g, b, i, e.transform, y); let E, T; e.terrain && e.terrain.prepareDrawTile(o); const C = "nearest" === r.paint.get("raster-resampling") ? l.NEAREST : l.LINEAR; a.activeTexture.set(l.TEXTURE0), g.texture.bind(C, l.CLAMP_TO_EDGE, l.LINEAR_MIPMAP_NEAREST), a.activeTexture.set(l.TEXTURE1), b ? (b.texture.bind(C, l.CLAMP_TO_EDGE, l.LINEAR_MIPMAP_NEAREST), E = Math.pow(2, b.tileID.overscaledZ - g.tileID.overscaledZ), T = [g.tileID.canonical.x * E % 1, g.tileID.canonical.y * E % 1]) : g.texture.bind(C, l.CLAMP_TO_EDGE, l.LINEAR_MIPMAP_NEAREST); const S = Fr(v, T || [0, 0], E || 1, w, r); e.prepareDrawProgram(a, h, m), c instanceof jt ? h.draw(a, l.TRIANGLES, n, t.StencilMode.disabled, u, t.CullFaceMode.disabled, S, r.id, c.boundsBuffer, e.quadTriangleIndexBuffer, c.boundsSegments) : h.draw(a, l.TRIANGLES, n, x, u, t.CullFaceMode.disabled, S, r.id, e.rasterBoundsBuffer, e.quadTriangleIndexBuffer, e.rasterBoundsSegments); } }, background: function (e, i, r, o) { const n = r.paint.get("background-color"), s = r.paint.get("background-opacity"); if (0 === s) return; const a = e.context, l = a.gl, c = e.transform, h = c.tileSize, u = r.paint.get("background-pattern"); if (e.isPatternMissing(u)) return; const d = !u && 1 === n.a && 1 === s && e.opaquePassEnabledForLayer() ? "opaque" : "translucent"; if (e.renderPass !== d) return; const p = t.StencilMode.disabled, m = e.depthModeForSublayer(0, "opaque" === d ? t.DepthMode.ReadWrite : t.DepthMode.ReadOnly), _ = e.colorModeForRenderPass(), f = e.useProgram(u ? "backgroundPattern" : "background"), g = o || c.coveringTiles({ tileSize: h }); u && (a.activeTexture.set(l.TEXTURE0), e.imageManager.bind(e.context)); const v = r.getCrossfadeParameters(); for (const i of g) { const c = i.toUnwrapped(), d = o ? i.projMatrix : e.transform.calculateProjMatrix(c); e.prepareDrawTile(i); const g = u ? jr(d, s, e, u, { tileID: i, tileSize: h }, v) : Gr(d, s, n); e.prepareDrawProgram(a, f, c), f.draw(a, l.TRIANGLES, m, p, _, t.CullFaceMode.disabled, g, r.id, e.tileExtentBuffer, e.quadTriangleIndexBuffer, e.tileExtentSegments); } }, sky: function (e, i, r) { const o = r.paint.get("sky-opacity"); if (0 === o) return; const n = e.context, s = r.paint.get("sky-type"), a = new t.DepthMode(n.gl.LEQUAL, t.DepthMode.ReadOnly, [0, 1]), l = e.frameCounter / 1e3 % 1; "atmosphere" === s ? "offscreen" === e.renderPass ? r.needsSkyboxCapture(e) && (function (e, i, r, o) { const n = e.context, s = n.gl; let a = i.skyboxFbo; if (!a) { a = i.skyboxFbo = n.createFramebuffer(32, 32, !1), i.skyboxGeometry = new mo(n), i.skyboxTexture = n.gl.createTexture(), s.bindTexture(s.TEXTURE_CUBE_MAP, i.skyboxTexture), s.texParameteri(s.TEXTURE_CUBE_MAP, s.TEXTURE_WRAP_S, s.CLAMP_TO_EDGE), s.texParameteri(s.TEXTURE_CUBE_MAP, s.TEXTURE_WRAP_T, s.CLAMP_TO_EDGE), s.texParameteri(s.TEXTURE_CUBE_MAP, s.TEXTURE_MIN_FILTER, s.LINEAR), s.texParameteri(s.TEXTURE_CUBE_MAP, s.TEXTURE_MAG_FILTER, s.LINEAR); for (let t = 0; t < 6; ++t)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, s.RGBA, 32, 32, 0, s.RGBA, s.UNSIGNED_BYTE, null); } n.bindFramebuffer.set(a.framebuffer), n.viewport.set([0, 0, 32, 32]); const l = i.getCenter(e, !0), c = e.useProgram("skyboxCapture"), h = new Float64Array(16); t.identity(h), t.rotateY(h, h, .5 * -Math.PI), _o(n, i, c, h, l, 0), t.identity(h), t.rotateY(h, h, .5 * Math.PI), _o(n, i, c, h, l, 1), t.identity(h), t.rotateX(h, h, .5 * -Math.PI), _o(n, i, c, h, l, 2), t.identity(h), t.rotateX(h, h, .5 * Math.PI), _o(n, i, c, h, l, 3), t.identity(h), _o(n, i, c, h, l, 4), t.identity(h), t.rotateY(h, h, Math.PI), _o(n, i, c, h, l, 5), n.viewport.set([0, 0, e.width, e.height]); }(e, r), r.markSkyboxValid(e)) : "sky" === e.renderPass && function (e, i, r, o, n) { const s = e.context, a = s.gl, l = e.transform, c = e.useProgram("skybox"); s.activeTexture.set(a.TEXTURE0), a.bindTexture(a.TEXTURE_CUBE_MAP, i.skyboxTexture); const h = ((t, e, i, r, o) => ({ u_matrix: t, u_sun_direction: e, u_cubemap: 0, u_opacity: r, u_temporal_offset: o }))(l.skyboxMatrix, i.getCenter(e, !1), 0, o, n); e.prepareDrawProgram(s, c), c.draw(s, a.TRIANGLES, r, t.StencilMode.disabled, e.colorModeForRenderPass(), t.CullFaceMode.backCW, h, "skybox", i.skyboxGeometry.vertexBuffer, i.skyboxGeometry.indexBuffer, i.skyboxGeometry.segment); }(e, r, a, o, l) : "gradient" === s && "sky" === e.renderPass && function (e, i, r, o, n) { const s = e.context, a = s.gl, l = e.transform, c = e.useProgram("skyboxGradient"); i.skyboxGeometry || (i.skyboxGeometry = new mo(s)), s.activeTexture.set(a.TEXTURE0); let h = i.colorRampTexture; h || (h = i.colorRampTexture = new t.Texture(s, i.colorRamp, a.RGBA)), h.bind(a.LINEAR, a.CLAMP_TO_EDGE); const u = ((e, i, r, o, n) => ({ u_matrix: e, u_color_ramp: 0, u_center_direction: i, u_radius: t.degToRad(r), u_opacity: o, u_temporal_offset: n }))(l.skyboxMatrix, i.getCenter(e, !1), i.paint.get("sky-gradient-radius"), o, n); e.prepareDrawProgram(s, c), c.draw(s, a.TRIANGLES, r, t.StencilMode.disabled, e.colorModeForRenderPass(), t.CullFaceMode.backCW, u, "skyboxGradient", i.skyboxGeometry.vertexBuffer, i.skyboxGeometry.indexBuffer, i.skyboxGeometry.segment); }(e, r, a, o, l); }, debug: function (t, e, i) { for (let r = 0; r < i.length; r++)co(t, e, i[r]); }, custom: function (e, i, r) { const o = e.context, n = r.implementation; if ("offscreen" === e.renderPass) { const t = n.prerender; t && (e.setCustomLayerDefaults(), o.setColorMode(e.colorModeForRenderPass()), t.call(n, o.gl, e.transform.customLayerMatrix()), o.setDirty(), e.setBaseState()); } else if ("translucent" === e.renderPass) { e.setCustomLayerDefaults(), o.setColorMode(e.colorModeForRenderPass()), o.setStencilMode(t.StencilMode.disabled); const i = "3d" === n.renderingMode ? new t.DepthMode(e.context.gl.LEQUAL, t.DepthMode.ReadWrite, e.depthRangeFor3D) : e.depthModeForSublayer(0, t.DepthMode.ReadOnly); o.setDepthMode(i), n.render(o.gl, e.transform.customLayerMatrix()), o.setDirty(), e.setBaseState(), o.bindFramebuffer.set(null); } } }; class go { constructor(e, i) { this.context = new Bt(e), this.transform = i, this._tileTextures = {}, this.frameCopies = [], this.loadTimeStamps = [], this.setup(), this.numSublayers = t.SourceCache.maxUnderzooming + t.SourceCache.maxOverzooming + 1, this.depthEpsilon = 1 / Math.pow(2, 16), this.crossTileSymbolIndex = new ei, this.gpuTimers = {}, this.frameCounter = 0; } updateTerrain(t, e) { const i = !!t && !!t.terrain; if (!(i || this._terrain && this._terrain.enabled)) return; this._terrain || (this._terrain = new _r(this, t)); const r = this._terrain; this.transform.elevation = i ? r : null, r.update(t, this.transform, e); } _updateFog(t) { const e = t.fog; if (!e || e.getOpacity(this.transform.pitch) < 1 || e.properties.get("horizon-blend") < .03) return void (this.transform.fogCullDistSq = null); const [i, r] = e.getFovAdjustedRange(this.transform._fov), o = i + .78 * (r - i); this.transform.fogCullDistSq = o * o; } get terrain() { return this._terrain && this._terrain.enabled ? this._terrain : null } resize(e, i) { if (this.width = e * t.exported.devicePixelRatio, this.height = i * t.exported.devicePixelRatio, this.context.viewport.set([0, 0, this.width, this.height]), this.style) for (const t of this.style.order) this.style._layers[t].resize(); } setup() { const e = this.context, i = new t.StructArrayLayout2i4; i.emplaceBack(0, 0), i.emplaceBack(t.EXTENT, 0), i.emplaceBack(0, t.EXTENT), i.emplaceBack(t.EXTENT, t.EXTENT), this.tileExtentBuffer = e.createVertexBuffer(i, t.posAttributes.members), this.tileExtentSegments = t.SegmentVector.simpleSegment(0, 0, 4, 2); const r = new t.StructArrayLayout2i4; r.emplaceBack(0, 0), r.emplaceBack(t.EXTENT, 0), r.emplaceBack(0, t.EXTENT), r.emplaceBack(t.EXTENT, t.EXTENT), this.debugBuffer = e.createVertexBuffer(r, t.posAttributes.members), this.debugSegments = t.SegmentVector.simpleSegment(0, 0, 4, 5); const o = new t.StructArrayLayout4i8; o.emplaceBack(0, 0, 0, 0), o.emplaceBack(t.EXTENT, 0, t.EXTENT, 0), o.emplaceBack(0, t.EXTENT, 0, t.EXTENT), o.emplaceBack(t.EXTENT, t.EXTENT, t.EXTENT, t.EXTENT), this.rasterBoundsBuffer = e.createVertexBuffer(o, Gt.members), this.rasterBoundsSegments = t.SegmentVector.simpleSegment(0, 0, 4, 2); const n = new t.StructArrayLayout2i4; n.emplaceBack(0, 0), n.emplaceBack(1, 0), n.emplaceBack(0, 1), n.emplaceBack(1, 1), this.viewportBuffer = e.createVertexBuffer(n, t.posAttributes.members), this.viewportSegments = t.SegmentVector.simpleSegment(0, 0, 4, 2); const s = new t.StructArrayLayout1ui2; s.emplaceBack(0), s.emplaceBack(1), s.emplaceBack(3), s.emplaceBack(2), s.emplaceBack(0), this.tileBorderIndexBuffer = e.createIndexBuffer(s); const a = new t.StructArrayLayout3ui6; a.emplaceBack(0, 1, 2), a.emplaceBack(2, 1, 3), this.quadTriangleIndexBuffer = e.createIndexBuffer(a), this.emptyTexture = new t.Texture(e, { width: 1, height: 1, data: new Uint8Array([0, 0, 0, 0]) }, e.gl.RGBA), this.identityMat = t.create(); const l = this.context.gl; this.stencilClearMode = new t.StencilMode({ func: l.ALWAYS, mask: 0 }, 0, 255, l.ZERO, l.ZERO, l.ZERO), this.loadTimeStamps.push(t.window.performance.now()); } clearStencil() { const e = this.context, i = e.gl; this.nextStencilID = 1, this.currentStencilSource = void 0; const r = t.create(); t.ortho(r, 0, this.width, this.height, 0, 0, 1), t.scale(r, r, [i.drawingBufferWidth, i.drawingBufferHeight, 0]), this.useProgram("clippingMask").draw(e, i.TRIANGLES, t.DepthMode.disabled, this.stencilClearMode, t.ColorMode.disabled, t.CullFaceMode.disabled, ur(r), "$clipping", this.viewportBuffer, this.quadTriangleIndexBuffer, this.viewportSegments); } _renderTileClippingMasks(e, i, r) { if (!(i && this.currentStencilSource !== i.id && e.isTileClipped() && r && r.length)) return; this.currentStencilSource = i.id; const o = this.context, n = o.gl; this.nextStencilID + r.length > 256 && this.clearStencil(), o.setColorMode(t.ColorMode.disabled), o.setDepthMode(t.DepthMode.disabled); const s = this.useProgram("clippingMask"); this._tileClippingMaskIDs = {}; for (const e of r) { const i = this._tileClippingMaskIDs[e.key] = this.nextStencilID++; s.draw(o, n.TRIANGLES, t.DepthMode.disabled, new t.StencilMode({ func: n.ALWAYS, mask: 0 }, i, 255, n.KEEP, n.KEEP, n.REPLACE), t.ColorMode.disabled, t.CullFaceMode.disabled, ur(e.projMatrix), "$clipping", this.tileExtentBuffer, this.quadTriangleIndexBuffer, this.tileExtentSegments); } } stencilModeFor3D() { this.currentStencilSource = void 0, this.nextStencilID + 1 > 256 && this.clearStencil(); const e = this.nextStencilID++, i = this.context.gl; return new t.StencilMode({ func: i.NOTEQUAL, mask: 255 }, e, 255, i.KEEP, i.KEEP, i.REPLACE) } stencilModeForClipping(e) { if (this.terrain) return this.terrain.stencilModeForRTTOverlap(e); const i = this.context.gl; return new t.StencilMode({ func: i.EQUAL, mask: 255 }, this._tileClippingMaskIDs[e.key], 0, i.KEEP, i.KEEP, i.REPLACE) } stencilConfigForOverlap(e) { const i = this.context.gl, r = e.sort(((t, e) => e.overscaledZ - t.overscaledZ)), o = r[r.length - 1].overscaledZ, n = r[0].overscaledZ - o + 1; if (n > 1) { this.currentStencilSource = void 0, this.nextStencilID + n > 256 && this.clearStencil(); const e = {}; for (let r = 0; r < n; r++)e[r + o] = new t.StencilMode({ func: i.GEQUAL, mask: 255 }, r + this.nextStencilID, 255, i.KEEP, i.KEEP, i.REPLACE); return this.nextStencilID += n, [e, r] } return [{ [o]: t.StencilMode.disabled }, r] } colorModeForRenderPass() { const e = this.context.gl; if (this._showOverdrawInspector) { const i = 1 / 8; return new t.ColorMode([e.CONSTANT_COLOR, e.ONE], new t.Color(i, i, i, 0), [!0, !0, !0, !0]) } return "opaque" === this.renderPass ? t.ColorMode.unblended : t.ColorMode.alphaBlended } depthModeForSublayer(e, i, r) { if (!this.opaquePassEnabledForLayer()) return t.DepthMode.disabled; const o = 1 - ((1 + this.currentLayer) * this.numSublayers + e) * this.depthEpsilon; return new t.DepthMode(r || this.context.gl.LEQUAL, i, [o, o]) } opaquePassEnabledForLayer() { return this.currentLayer < this.opaquePassCutoff } render(e, i) { this.style = e, this.options = i, this.lineAtlas = e.lineAtlas, this.imageManager = e.imageManager, this.glyphManager = e.glyphManager, this.symbolFadeChange = e.placement.symbolFadeChange(t.exported.now()), this.imageManager.beginFrame(); const r = this.style.order, o = this.style._sourceCaches; for (const t in o) { const e = o[t]; e.used && e.prepare(this.context); } const n = {}, s = {}, a = {}; for (const t in o) { const e = o[t]; n[t] = e.getVisibleCoordinates(), s[t] = n[t].slice().reverse(), a[t] = e.getVisibleCoordinates(!0).reverse(); } this.opaquePassCutoff = 1 / 0; for (let t = 0; t < r.length; t++)if (this.style._layers[r[t]].is3D()) { this.opaquePassCutoff = t; break } if (this.terrain && (this.terrain.updateTileBinding(a), this.opaquePassCutoff = 0), !t.isMapAuthenticated(this.context.gl)) return; this.renderPass = "offscreen"; for (const t of r) { const i = this.style._layers[t], r = e._getLayerSourceCache(i); if (!i.hasOffscreenPass() || i.isHidden(this.transform.zoom)) continue; const o = r ? s[r.id] : void 0; ("custom" === i.type || i.isSky() || o && o.length) && this.renderLayer(this, r, i, o); } this.depthRangeFor3D = [0, 1 - (e.order.length + 2) * this.numSublayers * this.depthEpsilon], this.terrain && (this.style.hasSymbolLayers() || this.style.hasCircleLayers()) && this.terrain.drawDepth(), this.context.bindFramebuffer.set(null), this.context.viewport.set([0, 0, this.width, this.height]); let l = t.Color.transparent; if (this.style.fog && (l = this.style.fog.properties.get("color")), this.context.clear({ color: i.showOverdrawInspector ? t.Color.black : l, depth: 1 }), this.clearStencil(), this._showOverdrawInspector = i.showOverdrawInspector, this.renderPass = "opaque", !this.terrain) for (this.currentLayer = r.length - 1; this.currentLayer >= 0; this.currentLayer--) { const t = this.style._layers[r[this.currentLayer]], i = e._getLayerSourceCache(t); if (t.isSky()) continue; const o = i ? s[i.id] : void 0; this._renderTileClippingMasks(t, i, o), this.renderLayer(this, i, t, o); } if (this.renderPass = "sky", this.transform.isHorizonVisible()) for (this.currentLayer = 0; this.currentLayer < r.length; this.currentLayer++) { const t = this.style._layers[r[this.currentLayer]], i = e._getLayerSourceCache(t); t.isSky() && this.renderLayer(this, i, t, i ? s[i.id] : void 0); } for (this.renderPass = "translucent", this.currentLayer = 0; this.currentLayer < r.length;) { const t = this.style._layers[r[this.currentLayer]], i = e._getLayerSourceCache(t); if (t.isSky()) { ++this.currentLayer; continue } if (this.terrain && this.style.isLayerDraped(t)) { if (t.isHidden(this.transform.zoom)) { ++this.currentLayer; continue } this.currentLayer = this.terrain.renderBatch(this.currentLayer); continue } const o = i ? ("symbol" === t.type ? a : s)[i.id] : void 0; this._renderTileClippingMasks(t, i, i ? n[i.id] : void 0), this.renderLayer(this, i, t, o), ++this.currentLayer; } if (this.terrain && this.terrain.postRender(), this.options.showTileBoundaries || this.options.showQueryGeometry) { let i = null; t.values(this.style._layers).forEach((t => { const r = e._getLayerSourceCache(t); r && !t.isHidden(this.transform.zoom) && (!i || i.getSource().maxzoom < r.getSource().maxzoom) && (i = r); })), i && this.options.showTileBoundaries && fo.debug(this, i, i.getVisibleCoordinates()); } this.options.showPadding && function (t) { const e = t.transform.padding; so(t, t.transform.height - (e.top || 0), 3, eo), so(t, e.bottom || 0, 3, io), ao(t, e.left || 0, 3, ro), ao(t, t.transform.width - (e.right || 0), 3, oo); const i = t.transform.centerPoint; !function (t, e, i, r) { lo(t, e - 1, i - 10, 2, 20, r), lo(t, e - 10, i - 1, 20, 2, r); }(t, i.x, t.transform.height - i.y, no); }(this), this.context.setDefault(), this.frameCounter = (this.frameCounter + 1) % t.MAX_SAFE_INTEGER, this.tileLoaded && this.options.speedIndexTiming && (this.loadTimeStamps.push(t.window.performance.now()), this.saveCanvasCopy()); } renderLayer(t, e, i, r) { i.isHidden(this.transform.zoom) || ("background" === i.type || "sky" === i.type || "custom" === i.type || r && r.length) && (this.id = i.id, this.gpuTimingStart(i), fo[i.type](t, e, i, r, this.style.placement.variableOffsets, this.options.isInitialLoad), this.gpuTimingEnd()); } gpuTimingStart(t) { if (!this.options.gpuTiming) return; const e = this.context.extTimerQuery; let i = this.gpuTimers[t.id]; i || (i = this.gpuTimers[t.id] = { calls: 0, cpuTime: 0, query: e.createQueryEXT() }), i.calls++, e.beginQueryEXT(e.TIME_ELAPSED_EXT, i.query); } gpuTimingEnd() { if (!this.options.gpuTiming) return; const t = this.context.extTimerQuery; t.endQueryEXT(t.TIME_ELAPSED_EXT); } collectGpuTimers() { const t = this.gpuTimers; return this.gpuTimers = {}, t } queryGpuTimers(t) { const e = {}; for (const i in t) { const r = t[i], o = this.context.extTimerQuery, n = o.getQueryObjectEXT(r.query, o.QUERY_RESULT_EXT) / 1e6; o.deleteQueryEXT(r.query), e[i] = n; } return e } translatePosMatrix(e, i, r, o, n) { if (!r[0] && !r[1]) return e; const s = n ? "map" === o ? this.transform.angle : 0 : "viewport" === o ? -this.transform.angle : 0; if (s) { const t = Math.sin(s), e = Math.cos(s); r = [r[0] * e - r[1] * t, r[0] * t + r[1] * e]; } const a = [n ? r[0] : Y(i, r[0], this.transform.zoom), n ? r[1] : Y(i, r[1], this.transform.zoom), 0], l = new Float32Array(16); return t.translate(l, e, a), l } saveTileTexture(t) { const e = this._tileTextures[t.size[0]]; e ? e.push(t) : this._tileTextures[t.size[0]] = [t]; } getTileTexture(t) { const e = this._tileTextures[t]; return e && e.length > 0 ? e.pop() : null } isPatternMissing(t) { if (!t) return !1; if (!t.from || !t.to) return !0; const e = this.imageManager.getPattern(t.from.toString()), i = this.imageManager.getPattern(t.to.toString()); return !e || !i } currentGlobalDefines() { const t = this.terrain && this.terrain.renderingToTexture, e = this.style && this.style.fog, i = []; return this.terrain && !this.terrain.renderingToTexture && i.push("TERRAIN"), e && !t && 0 !== e.getOpacity(this.transform.pitch) && i.push("FOG"), t && i.push("RENDER_TO_TEXTURE"), this._showOverdrawInspector && i.push("OVERDRAW_INSPECTOR"), i } useProgram(t, e, i) { this.cache = this.cache || {}; const r = i || [], o = this.currentGlobalDefines().concat(r), n = gr.cacheKey(t, o, e); return this.cache[n] || (this.cache[n] = new gr(this.context, t, $i[t], e, Hr[t], o)), this.cache[n] } setCustomLayerDefaults() { this.context.unbindVAO(), this.context.cullFace.setDefault(), this.context.frontFace.setDefault(), this.context.cullFaceSide.setDefault(), this.context.activeTexture.setDefault(), this.context.pixelStoreUnpack.setDefault(), this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(), this.context.pixelStoreUnpackFlipY.setDefault(); } setBaseState() { const t = this.context.gl; this.context.cullFace.set(!1), this.context.viewport.set([0, 0, this.width, this.height]), this.context.blendEquation.set(t.FUNC_ADD); } initDebugOverlayCanvas() { null == this.debugOverlayCanvas && (this.debugOverlayCanvas = t.window.document.createElement("canvas"), this.debugOverlayCanvas.width = 512, this.debugOverlayCanvas.height = 512, this.debugOverlayTexture = new t.Texture(this.context, this.debugOverlayCanvas, this.context.gl.RGBA)); } destroy() { this._terrain && this._terrain.destroy(), this.emptyTexture.destroy(), this.debugOverlayTexture && this.debugOverlayTexture.destroy(); } prepareDrawTile(t) { this.terrain && this.terrain.prepareDrawTile(t); } prepareDrawProgram(t, e, i) { if (this.terrain && this.terrain.renderingToTexture) return; const r = this.style.fog; if (r) { const o = r.getOpacity(this.transform.pitch); 0 !== o && e.setFogUniformValues(t, ((t, e, i, r) => { const o = e.properties.get("color"), n = t.frameCounter / 1e3 % 1, s = [o.r / o.a, o.g / o.a, o.b / o.a, r]; return { u_fog_matrix: i ? t.transform.calculateFogTileMatrix(i) : t.identityMat, u_fog_range: e.getFovAdjustedRange(t.transform._fov), u_fog_color: s, u_fog_horizon_blend: e.properties.get("horizon-blend"), u_fog_temporal_offset: n } })(this, r, i, o)); } } setTileLoadedFlag(t) { this.tileLoaded = t; } saveCanvasCopy() { this.frameCopies.push(this.canvasCopy()), this.tileLoaded = !1; } canvasCopy() { const t = this.context.gl, e = t.createTexture(); return t.bindTexture(t.TEXTURE_2D, e), t.copyTexImage2D(t.TEXTURE_2D, 0, t.RGBA, 0, 0, t.drawingBufferWidth, t.drawingBufferHeight, 0), e } getCanvasCopiesAndTimestamps() { return { canvasCopies: this.frameCopies, timeStamps: this.loadTimeStamps } } averageElevationNeedsEasing() { if (!this.transform._elevation) return !1; const t = this.style && this.style.fog; return !!t && 0 !== t.getOpacity(this.transform.pitch) } } class vo { constructor(e) { this._hashName = e && encodeURIComponent(e), t.bindAll(["_getCurrentHash", "_onHashChange", "_updateHash"], this), this._updateHash = function (t, e) { let i = !1, r = null; const o = () => { r = null, i && (t(), r = setTimeout(o, 300), i = !1); }; return () => (i = !0, r || o(), r) }(this._updateHashUnthrottled.bind(this)); } addTo(e) { return this._map = e, t.window.addEventListener("hashchange", this._onHashChange, !1), this._map.on("moveend", this._updateHash), this } remove() { return t.window.removeEventListener("hashchange", this._onHashChange, !1), this._map.off("moveend", this._updateHash), clearTimeout(this._updateHash()), delete this._map, this } getHashString(e) { const i = this._map.getCenter(), r = Math.round(100 * this._map.getZoom()) / 100, o = Math.ceil((r * Math.LN2 + Math.log(512 / 360 / .5)) / Math.LN10), n = Math.pow(10, o), s = Math.round(i.lng * n) / n, a = Math.round(i.lat * n) / n, l = this._map.getBearing(), c = this._map.getPitch(); let h = ""; if (h += e ? `/${s}/${a}/${r}` : `${r}/${a}/${s}`, (l || c) && (h += "/" + Math.round(10 * l) / 10), c && (h += `/${Math.round(c)}`), this._hashName) { const e = this._hashName; let i = !1; const r = t.window.location.hash.slice(1).split("&").map((t => { const r = t.split("=")[0]; return r === e ? (i = !0, `${r}=${h}`) : t })).filter((t => t)); return i || r.push(`${e}=${h}`), `#${r.join("&")}` } return `#${h}` } _getCurrentHash() { const e = t.window.location.hash.replace("#", ""); if (this._hashName) { let t; return e.split("&").map((t => t.split("="))).forEach((e => { e[0] === this._hashName && (t = e); })), (t && t[1] || "").split("/") } return e.split("/") } _onHashChange() { const t = this._getCurrentHash(); if (t.length >= 3 && !t.some((t => isNaN(t)))) { const e = this._map.dragRotate.isEnabled() && this._map.touchZoomRotate.isEnabled() ? +(t[3] || 0) : this._map.getBearing(); return this._map.jumpTo({ center: [+t[2], +t[1]], zoom: +t[0], bearing: e, pitch: +(t[4] || 0) }), !0 } return !1 } _updateHashUnthrottled() { const e = t.window.location.href.replace(/(#.+)?$/, this.getHashString()); t.window.history.replaceState(t.window.history.state, null, e); } } const xo = { linearity: .3, easing: t.bezier(0, 0, .3, 1) }, yo = t.extend({ deceleration: 2500, maxSpeed: 1400 }, xo), bo = t.extend({ deceleration: 20, maxSpeed: 1400 }, xo), wo = t.extend({ deceleration: 1e3, maxSpeed: 360 }, xo), Eo = t.extend({ deceleration: 1e3, maxSpeed: 90 }, xo); class To { constructor(t) { this._map = t, this.clear(); } clear() { this._inertiaBuffer = []; } record(e) { this._drainInertiaBuffer(), this._inertiaBuffer.push({ time: t.exported.now(), settings: e }); } _drainInertiaBuffer() { const e = this._inertiaBuffer, i = t.exported.now(); for (; e.length > 0 && i - e[0].time > 160;)e.shift(); } _onMoveEnd(e) { if (this._drainInertiaBuffer(), this._inertiaBuffer.length < 2) return; const i = { zoom: 0, bearing: 0, pitch: 0, pan: new t.pointGeometry(0, 0), pinchAround: void 0, around: void 0 }; for (const { settings: t } of this._inertiaBuffer) i.zoom += t.zoomDelta || 0, i.bearing += t.bearingDelta || 0, i.pitch += t.pitchDelta || 0, t.panDelta && i.pan._add(t.panDelta), t.around && (i.around = t.around), t.pinchAround && (i.pinchAround = t.pinchAround); const r = this._inertiaBuffer[this._inertiaBuffer.length - 1].time - this._inertiaBuffer[0].time, o = {}; if (i.pan.mag()) { const n = So(i.pan.mag(), r, t.extend({}, yo, e || {})); o.offset = i.pan.mult(n.amount / i.pan.mag()), o.center = this._map.transform.center, Co(o, n); } if (i.zoom) { const t = So(i.zoom, r, bo); o.zoom = this._map.transform.zoom + t.amount, Co(o, t); } if (i.bearing) { const e = So(i.bearing, r, wo); o.bearing = this._map.transform.bearing + t.clamp(e.amount, -179, 179), Co(o, e); } if (i.pitch) { const t = So(i.pitch, r, Eo); o.pitch = this._map.transform.pitch + t.amount, Co(o, t); } if (o.zoom || o.bearing) { const t = void 0 === i.pinchAround ? i.around : i.pinchAround; o.around = t ? this._map.unproject(t) : this._map.getCenter(); } return this.clear(), t.extend(o, { noMoveStart: !0 }) } } function Co(t, e) { (!t.duration || t.duration < e.duration) && (t.duration = e.duration, t.easing = e.easing); } function So(e, i, r) { const { maxSpeed: o, linearity: n, deceleration: s } = r, a = t.clamp(e * n / (i / 1e3), -o, o), l = Math.abs(a) / (s * n); return { easing: r.easing, duration: 1e3 * l, amount: a * (l / 2) } } class Ao { constructor(t, e) { this._map = t, this._clickTolerance = e.clickTolerance; } reset() { delete this._mousedownPos; } wheel(t) { return this._firePreventable(new C(t.type, this._map, t)) } mousedown(t, e) { return this._mousedownPos = e, this._firePreventable(new E(t.type, this._map, t)) } mouseup(t) { this._map.fire(new E(t.type, this._map, t)); } click(t, e) { this._mousedownPos && this._mousedownPos.dist(e) >= this._clickTolerance || this._map.fire(new E(t.type, this._map, t)); } dblclick(t) { return this._firePreventable(new E(t.type, this._map, t)) } mouseover(t) { this._map.fire(new E(t.type, this._map, t)); } mouseout(t) { this._map.fire(new E(t.type, this._map, t)); } touchstart(t) { return this._firePreventable(new T(t.type, this._map, t)) } touchmove(t) { this._map.fire(new T(t.type, this._map, t)); } touchend(t) { this._map.fire(new T(t.type, this._map, t)); } touchcancel(t) { this._map.fire(new T(t.type, this._map, t)); } _firePreventable(t) { if (this._map.fire(t), t.defaultPrevented) return {} } isEnabled() { return !0 } isActive() { return !1 } enable() { } disable() { } } class Lo { constructor(t) { this._map = t; } reset() { this._delayContextMenu = !1, delete this._contextMenuEvent; } mousemove(t) { this._map.fire(new E(t.type, this._map, t)); } mousedown() { this._delayContextMenu = !0; } mouseup() { this._delayContextMenu = !1, this._contextMenuEvent && (this._map.fire(new E("contextmenu", this._map, this._contextMenuEvent)), delete this._contextMenuEvent); } contextmenu(t) { this._delayContextMenu ? this._contextMenuEvent = t : this._map.fire(new E(t.type, this._map, t)), this._map.listens("contextmenu") && t.preventDefault(); } isEnabled() { return !0 } isActive() { return !1 } enable() { } disable() { } } class Io { constructor(t, e) { this._map = t, this._el = t.getCanvasContainer(), this._container = t.getContainer(), this._clickTolerance = e.clickTolerance || 1; } isEnabled() { return !!this._enabled } isActive() { return !!this._active } enable() { this.isEnabled() || (this._enabled = !0); } disable() { this.isEnabled() && (this._enabled = !1); } mousedown(t, e) { this.isEnabled() && t.shiftKey && 0 === t.button && (n.disableDrag(), this._startPos = this._lastPos = e, this._active = !0); } mousemoveWindow(t, e) { if (!this._active) return; const i = e; if (this._lastPos.equals(i) || !this._box && i.dist(this._startPos) < this._clickTolerance) return; const r = this._startPos; this._lastPos = i, this._box || (this._box = n.create("div", "mapboxgl-boxzoom", this._container), this._container.classList.add("mapboxgl-crosshair"), this._fireEvent("boxzoomstart", t)); const o = Math.min(r.x, i.x), s = Math.max(r.x, i.x), a = Math.min(r.y, i.y), l = Math.max(r.y, i.y); this._map._requestDomTask((() => { this._box && (n.setTransform(this._box, `translate(${o}px,${a}px)`), this._box.style.width = s - o + "px", this._box.style.height = l - a + "px"); })); } mouseupWindow(e, i) { if (!this._active) return; if (0 !== e.button) return; const r = this._startPos, o = i; if (this.reset(), n.suppressClick(), r.x !== o.x || r.y !== o.y) return this._map.fire(new t.Event("boxzoomend", { originalEvent: e })), { cameraAnimation: t => t.fitScreenCoordinates(r, o, this._map.getBearing(), { linear: !1 }) }; this._fireEvent("boxzoomcancel", e); } keydown(t) { this._active && 27 === t.keyCode && (this.reset(), this._fireEvent("boxzoomcancel", t)); } reset() { this._active = !1, this._container.classList.remove("mapboxgl-crosshair"), this._box && (n.remove(this._box), this._box = null), n.enableDrag(), delete this._startPos, delete this._lastPos; } _fireEvent(e, i) { return this._map.fire(new t.Event(e, { originalEvent: i })) } } function Mo(t, e) { const i = {}; for (let r = 0; r < t.length; r++)i[t[r].identifier] = e[r]; return i } class Po { constructor(t) { this.reset(), this.numTouches = t.numTouches; } reset() { delete this.centroid, delete this.startTime, delete this.touches, this.aborted = !1; } touchstart(e, i, r) { (this.centroid || r.length > this.numTouches) && (this.aborted = !0), this.aborted || (void 0 === this.startTime && (this.startTime = e.timeStamp), r.length === this.numTouches && (this.centroid = function (e) { const i = new t.pointGeometry(0, 0); for (const t of e) i._add(t); return i.div(e.length) }(i), this.touches = Mo(r, i))); } touchmove(t, e, i) { if (this.aborted || !this.centroid) return; const r = Mo(i, e); for (const t in this.touches) { const e = this.touches[t], i = r[t]; (!i || i.dist(e) > 30) && (this.aborted = !0); } } touchend(t, e, i) { if ((!this.centroid || t.timeStamp - this.startTime > 500) && (this.aborted = !0), 0 === i.length) { const t = !this.aborted && this.centroid; if (this.reset(), t) return t } } } class zo { constructor(t) { this.singleTap = new Po(t), this.numTaps = t.numTaps, this.reset(); } reset() { this.lastTime = 1 / 0, delete this.lastTap, this.count = 0, this.singleTap.reset(); } touchstart(t, e, i) { this.singleTap.touchstart(t, e, i); } touchmove(t, e, i) { this.singleTap.touchmove(t, e, i); } touchend(t, e, i) { const r = this.singleTap.touchend(t, e, i); if (r) { const e = t.timeStamp - this.lastTime < 500, i = !this.lastTap || this.lastTap.dist(r) < 30; if (e && i || this.reset(), this.count++, this.lastTime = t.timeStamp, this.lastTap = r, this.count === this.numTaps) return this.reset(), r } } } class Do { constructor() { this._zoomIn = new zo({ numTouches: 1, numTaps: 2 }), this._zoomOut = new zo({ numTouches: 2, numTaps: 1 }), this.reset(); } reset() { this._active = !1, this._zoomIn.reset(), this._zoomOut.reset(); } touchstart(t, e, i) { this._zoomIn.touchstart(t, e, i), this._zoomOut.touchstart(t, e, i); } touchmove(t, e, i) { this._zoomIn.touchmove(t, e, i), this._zoomOut.touchmove(t, e, i); } touchend(t, e, i) { const r = this._zoomIn.touchend(t, e, i), o = this._zoomOut.touchend(t, e, i); return r ? (this._active = !0, t.preventDefault(), setTimeout((() => this.reset()), 0), { cameraAnimation: e => e.easeTo({ duration: 300, zoom: e.getZoom() + 1, around: e.unproject(r) }, { originalEvent: t }) }) : o ? (this._active = !0, t.preventDefault(), setTimeout((() => this.reset()), 0), { cameraAnimation: e => e.easeTo({ duration: 300, zoom: e.getZoom() - 1, around: e.unproject(o) }, { originalEvent: t }) }) : void 0 } touchcancel() { this.reset(); } enable() { this._enabled = !0; } disable() { this._enabled = !1, this.reset(); } isEnabled() { return this._enabled } isActive() { return this._active } } class ko { constructor(t) { this._minTouches = 1, this._clickTolerance = t.clickTolerance || 1, this.reset(); } reset() { this._active = !1, this._touches = {}, this._sum = new t.pointGeometry(0, 0); } touchstart(t, e, i) { return this._calculateTransform(t, e, i) } touchmove(t, e, i) { if (this._active && !(i.length < this._minTouches)) return t.preventDefault(), this._calculateTransform(t, e, i) } touchend(t, e, i) { this._calculateTransform(t, e, i), this._active && i.length < this._minTouches && this.reset(); } touchcancel() { this.reset(); } _calculateTransform(e, i, r) { r.length > 0 && (this._active = !0); const o = Mo(r, i), n = new t.pointGeometry(0, 0), s = new t.pointGeometry(0, 0); let a = 0; for (const t in o) { const e = o[t], i = this._touches[t]; i && (n._add(e), s._add(e.sub(i)), a++, o[t] = e); } if (this._touches = o, a < this._minTouches || !s.mag()) return; const l = s.div(a); return this._sum._add(l), this._sum.mag() < this._clickTolerance ? void 0 : { around: n.div(a), panDelta: l } } enable() { this._enabled = !0; } disable() { this._enabled = !1, this.reset(); } isEnabled() { return this._enabled } isActive() { return this._active } } class Ro { constructor() { this.reset(); } reset() { this._active = !1, delete this._firstTwoTouches; } _start(t) { } _move(t, e, i) { return {} } touchstart(t, e, i) { this._firstTwoTouches || i.length < 2 || (this._firstTwoTouches = [i[0].identifier, i[1].identifier], this._start([e[0], e[1]])); } touchmove(t, e, i) { if (!this._firstTwoTouches) return; t.preventDefault(); const [r, o] = this._firstTwoTouches, n = Fo(i, e, r), s = Fo(i, e, o); if (!n || !s) return; const a = this._aroundCenter ? null : n.add(s).div(2); return this._move([n, s], a, t) } touchend(t, e, i) { if (!this._firstTwoTouches) return; const [r, o] = this._firstTwoTouches, s = Fo(i, e, r), a = Fo(i, e, o); s && a || (this._active && n.suppressClick(), this.reset()); } touchcancel() { this.reset(); } enable(t) { this._enabled = !0, this._aroundCenter = !!t && "center" === t.around; } disable() { this._enabled = !1, this.reset(); } isEnabled() { return this._enabled } isActive() { return this._active } } function Fo(t, e, i) { for (let r = 0; r < t.length; r++)if (t[r].identifier === i) return e[r] } function Oo(t, e) { return Math.log(t / e) / Math.LN2 } class Bo extends Ro { reset() { super.reset(), delete this._distance, delete this._startDistance; } _start(t) { this._startDistance = this._distance = t[0].dist(t[1]); } _move(t, e) { const i = this._distance; if (this._distance = t[0].dist(t[1]), this._active || !(Math.abs(Oo(this._distance, this._startDistance)) < .1)) return this._active = !0, { zoomDelta: Oo(this._distance, i), pinchAround: e } } } function Uo(t, e) { return 180 * t.angleWith(e) / Math.PI } class No extends Ro { reset() { super.reset(), delete this._minDiameter, delete this._startVector, delete this._vector; } _start(t) { this._startVector = this._vector = t[0].sub(t[1]), this._minDiameter = t[0].dist(t[1]); } _move(t, e) { const i = this._vector; if (this._vector = t[0].sub(t[1]), this._active || !this._isBelowThreshold(this._vector)) return this._active = !0, { bearingDelta: Uo(this._vector, i), pinchAround: e } } _isBelowThreshold(t) { this._minDiameter = Math.min(this._minDiameter, t.mag()); const e = 25 / (Math.PI * this._minDiameter) * 360, i = Uo(t, this._startVector); return Math.abs(i) < e } } function Go(t) { return Math.abs(t.y) > Math.abs(t.x) } class jo extends Ro { reset() { super.reset(), this._valid = void 0, delete this._firstMove, delete this._lastPoints; } _start(t) { this._lastPoints = t, Go(t[0].sub(t[1])) && (this._valid = !1); } _move(t, e, i) { const r = t[0].sub(this._lastPoints[0]), o = t[1].sub(this._lastPoints[1]); if (this._valid = this.gestureBeginsVertically(r, o, i.timeStamp), this._valid) return this._lastPoints = t, this._active = !0, { pitchDelta: (r.y + o.y) / 2 * -.5 } } gestureBeginsVertically(t, e, i) { if (void 0 !== this._valid) return this._valid; const r = t.mag() >= 2, o = e.mag() >= 2; if (!r && !o) return; if (!r || !o) return void 0 === this._firstMove && (this._firstMove = i), i - this._firstMove < 100 && void 0; const n = t.y > 0 == e.y > 0; return Go(t) && Go(e) && n } } const Ho = { panStep: 100, bearingStep: 15, pitchStep: 10 }; class Vo { constructor() { const t = Ho; this._panStep = t.panStep, this._bearingStep = t.bearingStep, this._pitchStep = t.pitchStep, this._rotationDisabled = !1; } reset() { this._active = !1; } keydown(t) { if (t.altKey || t.ctrlKey || t.metaKey) return; let e = 0, i = 0, r = 0, o = 0, n = 0; switch (t.keyCode) { case 61: case 107: case 171: case 187: e = 1; break; case 189: case 109: case 173: e = -1; break; case 37: t.shiftKey ? i = -1 : (t.preventDefault(), o = -1); break; case 39: t.shiftKey ? i = 1 : (t.preventDefault(), o = 1); break; case 38: t.shiftKey ? r = 1 : (t.preventDefault(), n = -1); break; case 40: t.shiftKey ? r = -1 : (t.preventDefault(), n = 1); break; default: return }return this._rotationDisabled && (i = 0, r = 0), { cameraAnimation: s => { const a = s.getZoom(); s.easeTo({ duration: 300, easeId: "keyboardHandler", easing: Wo, zoom: e ? Math.round(a) + e * (t.shiftKey ? 2 : 1) : a, bearing: s.getBearing() + i * this._bearingStep, pitch: s.getPitch() + r * this._pitchStep, offset: [-o * this._panStep, -n * this._panStep], center: s.getCenter() }, { originalEvent: t }); } } } enable() { this._enabled = !0; } disable() { this._enabled = !1, this.reset(); } isEnabled() { return this._enabled } isActive() { return this._active } disableRotation() { this._rotationDisabled = !0; } enableRotation() { this._rotationDisabled = !1; } } function Wo(t) { return t * (2 - t) } const Zo = 4.000244140625; class Yo { constructor(e, i) { this._map = e, this._el = e.getCanvasContainer(), this._handler = i, this._delta = 0, this._defaultZoomRate = .01, this._wheelZoomRate = .0022222222222222222, t.bindAll(["_onTimeout"], this); } setZoomRate(t) { this._defaultZoomRate = t; } setWheelZoomRate(t) { this._wheelZoomRate = t; } isEnabled() { return !!this._enabled } isActive() { return !!this._active || void 0 !== this._finishTimeout } isZooming() { return !!this._zooming } enable(t) { this.isEnabled() || (this._enabled = !0, this._aroundCenter = t && "center" === t.around); } disable() { this.isEnabled() && (this._enabled = !1); } wheel(e) { if (!this.isEnabled()) return; let i = e.deltaMode === t.window.WheelEvent.DOM_DELTA_LINE ? 40 * e.deltaY : e.deltaY; const r = t.exported.now(), o = r - (this._lastWheelEventTime || 0); this._lastWheelEventTime = r, 0 !== i && i % Zo == 0 ? this._type = "wheel" : 0 !== i && Math.abs(i) < 4 ? this._type = "trackpad" : o > 400 ? (this._type = null, this._lastValue = i, this._timeout = setTimeout(this._onTimeout, 40, e)) : this._type || (this._type = Math.abs(o * i) < 200 ? "trackpad" : "wheel", this._timeout && (clearTimeout(this._timeout), this._timeout = null, i += this._lastValue)), e.shiftKey && i && (i /= 4), this._type && (this._lastWheelEvent = e, this._delta -= i, this._active || this._start(e)), e.preventDefault(); } _onTimeout(t) { this._type = "wheel", this._delta -= this._lastValue, this._active || this._start(t); } _start(t) { if (!this._delta) return; this._frameId && (this._frameId = null), this._active = !0, this.isZooming() || (this._zooming = !0), this._finishTimeout && (clearTimeout(this._finishTimeout), delete this._finishTimeout); const e = n.mousePos(this._el, t); this._aroundPoint = this._aroundCenter ? this._map.transform.centerPoint : e, this._aroundCoord = this._map.transform.pointCoordinate3D(this._aroundPoint), this._targetZoom = void 0, this._frameId || (this._frameId = !0, this._handler._triggerRenderFrame()); } renderFrame() { if (!this._frameId) return; if (this._frameId = null, !this.isActive()) return; const e = this._map.transform, i = () => e._terrainEnabled() ? e.computeZoomRelativeTo(this._aroundCoord) : e.zoom; if (0 !== this._delta) { const t = "wheel" === this._type && Math.abs(this._delta) > Zo ? this._wheelZoomRate : this._defaultZoomRate; let r = 2 / (1 + Math.exp(-Math.abs(this._delta * t))); this._delta < 0 && 0 !== r && (r = 1 / r); const o = i(), n = Math.pow(2, o), s = "number" == typeof this._targetZoom ? e.zoomScale(this._targetZoom) : n; this._targetZoom = Math.min(e.maxZoom, Math.max(e.minZoom, e.scaleZoom(s * r))), "wheel" === this._type && (this._startZoom = i(), this._easing = this._smoothOutEasing(200)), this._delta = 0; } const r = "number" == typeof this._targetZoom ? this._targetZoom : i(), o = this._startZoom, n = this._easing; let s, a = !1; if ("wheel" === this._type && o && n) { const e = Math.min((t.exported.now() - this._lastWheelEventTime) / 200, 1), i = n(e); s = t.number(o, r, i), e < 1 ? this._frameId || (this._frameId = !0) : a = !0; } else s = r, a = !0; return this._active = !0, a && (this._active = !1, this._finishTimeout = setTimeout((() => { this._zooming = !1, this._handler._triggerRenderFrame(), delete this._targetZoom, delete this._finishTimeout; }), 200)), { noInertia: !0, needsRenderFrame: !a, zoomDelta: s - i(), around: this._aroundPoint, aroundCoord: this._aroundCoord, originalEvent: this._lastWheelEvent } } _smoothOutEasing(e) { let i = t.ease; if (this._prevEase) { const e = this._prevEase, r = (t.exported.now() - e.start) / e.duration, o = e.easing(r + .01) - e.easing(r), n = .27 / Math.sqrt(o * o + 1e-4) * .01, s = Math.sqrt(.0729 - n * n); i = t.bezier(n, s, .25, 1); } return this._prevEase = { start: t.exported.now(), duration: e, easing: i }, i } reset() { this._active = !1; } } class qo { constructor(t, e) { this._clickZoom = t, this._tapZoom = e; } enable() { this._clickZoom.enable(), this._tapZoom.enable(); } disable() { this._clickZoom.disable(), this._tapZoom.disable(); } isEnabled() { return this._clickZoom.isEnabled() && this._tapZoom.isEnabled() } isActive() { return this._clickZoom.isActive() || this._tapZoom.isActive() } } class Xo { constructor() { this.reset(); } reset() { this._active = !1; } dblclick(t, e) { return t.preventDefault(), { cameraAnimation: i => { i.easeTo({ duration: 300, zoom: i.getZoom() + (t.shiftKey ? -1 : 1), around: i.unproject(e) }, { originalEvent: t }); } } } enable() { this._enabled = !0; } disable() { this._enabled = !1, this.reset(); } isEnabled() { return this._enabled } isActive() { return this._active } } class Qo { constructor() { this._tap = new zo({ numTouches: 1, numTaps: 1 }), this.reset(); } reset() { this._active = !1, delete this._swipePoint, delete this._swipeTouch, delete this._tapTime, this._tap.reset(); } touchstart(t, e, i) { this._swipePoint || (this._tapTime && t.timeStamp - this._tapTime > 500 && this.reset(), this._tapTime ? i.length > 0 && (this._swipePoint = e[0], this._swipeTouch = i[0].identifier) : this._tap.touchstart(t, e, i)); } touchmove(t, e, i) { if (this._tapTime) { if (this._swipePoint) { if (i[0].identifier !== this._swipeTouch) return; const r = e[0], o = r.y - this._swipePoint.y; return this._swipePoint = r, t.preventDefault(), this._active = !0, { zoomDelta: o / 128 } } } else this._tap.touchmove(t, e, i); } touchend(t, e, i) { this._tapTime ? this._swipePoint && 0 === i.length && this.reset() : this._tap.touchend(t, e, i) && (this._tapTime = t.timeStamp); } touchcancel() { this.reset(); } enable() { this._enabled = !0; } disable() { this._enabled = !1, this.reset(); } isEnabled() { return this._enabled } isActive() { return this._active } } class Ko { constructor(t, e, i) { this._el = t, this._mousePan = e, this._touchPan = i; } enable(t) { this._inertiaOptions = t || {}, this._mousePan.enable(), this._touchPan.enable(), this._el.classList.add("mapboxgl-touch-drag-pan"); } disable() { this._mousePan.disable(), this._touchPan.disable(), this._el.classList.remove("mapboxgl-touch-drag-pan"); } isEnabled() { return this._mousePan.isEnabled() && this._touchPan.isEnabled() } isActive() { return this._mousePan.isActive() || this._touchPan.isActive() } } class Jo { constructor(t, e, i) { this._pitchWithRotate = t.pitchWithRotate, this._mouseRotate = e, this._mousePitch = i; } enable() { this._mouseRotate.enable(), this._pitchWithRotate && this._mousePitch.enable(); } disable() { this._mouseRotate.disable(), this._mousePitch.disable(); } isEnabled() { return this._mouseRotate.isEnabled() && (!this._pitchWithRotate || this._mousePitch.isEnabled()) } isActive() { return this._mouseRotate.isActive() || this._mousePitch.isActive() } } class $o { constructor(t, e, i, r) { this._el = t, this._touchZoom = e, this._touchRotate = i, this._tapDragZoom = r, this._rotationDisabled = !1, this._enabled = !0; } enable(t) { this._touchZoom.enable(t), this._rotationDisabled || this._touchRotate.enable(t), this._tapDragZoom.enable(), this._el.classList.add("mapboxgl-touch-zoom-rotate"); } disable() { this._touchZoom.disable(), this._touchRotate.disable(), this._tapDragZoom.disable(), this._el.classList.remove("mapboxgl-touch-zoom-rotate"); } isEnabled() { return this._touchZoom.isEnabled() && (this._rotationDisabled || this._touchRotate.isEnabled()) && this._tapDragZoom.isEnabled() } isActive() { return this._touchZoom.isActive() || this._touchRotate.isActive() || this._tapDragZoom.isActive() } disableRotation() { this._rotationDisabled = !0, this._touchRotate.disable(); } enableRotation() { this._rotationDisabled = !1, this._touchZoom.isEnabled() && this._touchRotate.enable(); } } const tn = t => t.zoom || t.drag || t.pitch || t.rotate; class en extends t.Event { } class rn { constructor() { this.constants = [1, 1, .01], this.radius = 0; } setup(e, i) { const r = t.sub([], i, e); this.radius = t.length(r[2] < 0 ? t.div([], r, this.constants) : [r[0], r[1], 0]); } projectRay(e) { t.div(e, e, this.constants), t.normalize(e, e), t.mul$1(e, e, this.constants); const i = t.scale$2([], e, this.radius); if (i[2] > 0) { const e = t.scale$2([], [0, 0, 1], t.dot(i, [0, 0, 1])), r = t.scale$2([], t.normalize([], [i[0], i[1], 0]), this.radius), o = t.add([], i, t.scale$2([], t.sub([], t.add([], r, e), i), 2)); i[0] = o[0], i[1] = o[1]; } return i } } function on(t) { return t.panDelta && t.panDelta.mag() || t.zoomDelta || t.bearingDelta || t.pitchDelta } class nn { constructor(e, i) { this._map = e, this._el = this._map.getCanvasContainer(), this._handlers = [], this._handlersById = {}, this._changes = [], this._inertia = new To(e), this._bearingSnap = i.bearingSnap, this._previousActiveHandlers = {}, this._trackingEllipsoid = new rn, this._dragOrigin = null, this._eventsInProgress = {}, this._addDefaultHandlers(i), t.bindAll(["handleEvent", "handleWindowEvent"], this); const r = this._el; this._listeners = [[r, "touchstart", { passive: !0 }], [r, "touchmove", { passive: !1 }], [r, "touchend", void 0], [r, "touchcancel", void 0], [r, "mousedown", void 0], [r, "mousemove", void 0], [r, "mouseup", void 0], [t.window.document, "mousemove", { capture: !0 }], [t.window.document, "mouseup", void 0], [r, "mouseover", void 0], [r, "mouseout", void 0], [r, "dblclick", void 0], [r, "click", void 0], [r, "keydown", { capture: !1 }], [r, "keyup", void 0], [r, "wheel", { passive: !1 }], [r, "contextmenu", void 0], [t.window, "blur", void 0]]; for (const [e, i, r] of this._listeners) n.addEventListener(e, i, e === t.window.document ? this.handleWindowEvent : this.handleEvent, r); } destroy() { for (const [e, i, r] of this._listeners) n.removeEventListener(e, i, e === t.window.document ? this.handleWindowEvent : this.handleEvent, r); } _addDefaultHandlers(t) { const e = this._map, i = e.getCanvasContainer(); this._add("mapEvent", new Ao(e, t)); const r = e.boxZoom = new Io(e, t); this._add("boxZoom", r); const o = new Do, n = new Xo; e.doubleClickZoom = new qo(n, o), this._add("tapZoom", o), this._add("clickZoom", n); const s = new Qo; this._add("tapDragZoom", s); const a = e.touchPitch = new jo; this._add("touchPitch", a); const l = new f(t), c = new g(t); e.dragRotate = new Jo(t, l, c), this._add("mouseRotate", l, ["mousePitch"]), this._add("mousePitch", c, ["mouseRotate"]); const h = new _(t), u = new ko(t); e.dragPan = new Ko(i, h, u), this._add("mousePan", h), this._add("touchPan", u, ["touchZoom", "touchRotate"]); const d = new No, p = new Bo; e.touchZoomRotate = new $o(i, p, d, s), this._add("touchRotate", d, ["touchPan", "touchZoom"]), this._add("touchZoom", p, ["touchPan", "touchRotate"]), this._add("blockableMapEvent", new Lo(e)); const m = e.scrollZoom = new Yo(e, this); this._add("scrollZoom", m, ["mousePan"]); const v = e.keyboard = new Vo; this._add("keyboard", v); for (const i of ["boxZoom", "doubleClickZoom", "tapDragZoom", "touchPitch", "dragRotate", "dragPan", "touchZoomRotate", "scrollZoom", "keyboard"]) t.interactive && t[i] && e[i].enable(t[i]); } _add(t, e, i) { this._handlers.push({ handlerName: t, handler: e, allowed: i }), this._handlersById[t] = e; } stop(t) { if (!this._updatingCamera) { for (const { handler: t } of this._handlers) t.reset(); this._inertia.clear(), this._fireEvents({}, {}, t), this._changes = []; } } isActive() { for (const { handler: t } of this._handlers) if (t.isActive()) return !0; return !1 } isZooming() { return !!this._eventsInProgress.zoom || this._map.scrollZoom.isZooming() } isRotating() { return !!this._eventsInProgress.rotate } isMoving() { return Boolean(tn(this._eventsInProgress)) || this.isZooming() } _blockedByActive(t, e, i) { for (const r in t) if (r !== i && (!e || e.indexOf(r) < 0)) return !0; return !1 } handleWindowEvent(t) { this.handleEvent(t, `${t.type}Window`); } _getMapTouches(t) { const e = []; for (const i of t) this._el.contains(i.target) && e.push(i); return e } handleEvent(t, e) { if ("blur" === t.type) return void this.stop(!0); this._updatingCamera = !0; const i = "renderFrame" === t.type, r = i ? void 0 : t, o = { needsRenderFrame: !1 }, s = {}, a = {}, l = t.touches ? this._getMapTouches(t.touches) : void 0, c = l ? n.touchPos(this._el, l) : i ? void 0 : n.mousePos(this._el, t); for (const { handlerName: i, handler: n, allowed: h } of this._handlers) { if (!n.isEnabled()) continue; let u; this._blockedByActive(a, h, i) ? n.reset() : n[e || t.type] && (u = n[e || t.type](t, c, l), this.mergeHandlerResult(o, s, u, i, r), u && u.needsRenderFrame && this._triggerRenderFrame()), (u || n.isActive()) && (a[i] = n); } const h = {}; for (const t in this._previousActiveHandlers) a[t] || (h[t] = r); this._previousActiveHandlers = a, (Object.keys(h).length || on(o)) && (this._changes.push([o, s, h]), this._triggerRenderFrame()), (Object.keys(a).length || on(o)) && this._map._stop(!0), this._updatingCamera = !1; const { cameraAnimation: u } = o; u && (this._inertia.clear(), this._fireEvents({}, {}, !0), this._changes = [], u(this._map)); } mergeHandlerResult(e, i, r, o, n) { if (!r) return; t.extend(e, r); const s = { handlerName: o, originalEvent: r.originalEvent || n }; void 0 !== r.zoomDelta && (i.zoom = s), void 0 !== r.panDelta && (i.drag = s), void 0 !== r.pitchDelta && (i.pitch = s), void 0 !== r.bearingDelta && (i.rotate = s); } _applyChanges() { const e = {}, i = {}, r = {}; for (const [o, n, s] of this._changes) o.panDelta && (e.panDelta = (e.panDelta || new t.pointGeometry(0, 0))._add(o.panDelta)), o.zoomDelta && (e.zoomDelta = (e.zoomDelta || 0) + o.zoomDelta), o.bearingDelta && (e.bearingDelta = (e.bearingDelta || 0) + o.bearingDelta), o.pitchDelta && (e.pitchDelta = (e.pitchDelta || 0) + o.pitchDelta), void 0 !== o.around && (e.around = o.around), void 0 !== o.aroundCoord && (e.aroundCoord = o.aroundCoord), void 0 !== o.pinchAround && (e.pinchAround = o.pinchAround), o.noInertia && (e.noInertia = o.noInertia), t.extend(i, n), t.extend(r, s); this._updateMapTransform(e, i, r), this._changes = []; } _updateMapTransform(e, i, r) { const o = this._map, n = o.transform, s = t => [t.x, t.y, t.z]; if ((t => { const e = this._eventsInProgress.drag; return e && !this._handlersById[e.handlerName].isActive() })() && !on(e)) { const t = n.zoom; n.cameraElevationReference = "sea", n.recenterOnTerrain(), n.cameraElevationReference = "ground", t !== n.zoom && this._map._update(!0); } if (!on(e)) return this._fireEvents(i, r, !0); let { panDelta: a, zoomDelta: l, bearingDelta: c, pitchDelta: h, around: u, aroundCoord: d, pinchAround: p } = e; void 0 !== p && (u = p), (t => i.drag && !this._eventsInProgress.drag)() && u && (this._dragOrigin = s(n.pointCoordinate3D(u)), this._trackingEllipsoid.setup(n._camera.position, this._dragOrigin)), n.cameraElevationReference = "sea", o._stop(!0), u = u || o.transform.centerPoint, c && (n.bearing += c), h && (n.pitch += h), n._updateCameraState(); const m = [0, 0, 0]; if (a) { const t = n.screenPointToMercatorRay(u), e = n.screenPointToMercatorRay(u.sub(a)), i = this._trackingEllipsoid.projectRay(t.dir), r = this._trackingEllipsoid.projectRay(e.dir); m[0] = r[0] - i[0], m[1] = r[1] - i[1]; } const _ = n.zoom, f = [0, 0, 0]; if (l) { const e = s(d || n.pointCoordinate3D(u)), i = { dir: t.normalize([], t.sub([], e, n._camera.position)) }, r = n.screenPointToMercatorRay(n.centerPoint); if (i.dir[2] < 0) { const o = t.altitudeFromMercatorZ(e[2], e[1]), a = n.rayIntersectionCoordinate(n.pointRayIntersection(n.centerPoint, o)), c = n.zoomDeltaToMovement(s(a), l) * (r.dir[2] / i.dir[2]); t.scale$2(f, i.dir, c); } else if (n._terrainEnabled()) { const r = n.zoomDeltaToMovement(e, l); t.scale$2(f, i.dir, r); } } const g = t.add(m, m, f); n._translateCameraConstrained(g), l && Math.abs(n.zoom - _) > 1e-4 && n.recenterOnTerrain(), n.cameraElevationReference = "ground", this._map._update(), e.noInertia || this._inertia.record(e), this._fireEvents(i, r, !0); } _fireEvents(e, i, r) { const o = tn(this._eventsInProgress), n = tn(e), s = {}; for (const t in e) { const { originalEvent: i } = e[t]; this._eventsInProgress[t] || (s[`${t}start`] = i), this._eventsInProgress[t] = e[t]; } !o && n && this._fireEvent("movestart", n.originalEvent); for (const t in s) this._fireEvent(t, s[t]); n && this._fireEvent("move", n.originalEvent); for (const t in e) { const { originalEvent: i } = e[t]; this._fireEvent(t, i); } const a = {}; let l; for (const t in this._eventsInProgress) { const { handlerName: e, originalEvent: r } = this._eventsInProgress[t]; this._handlersById[e].isActive() || (delete this._eventsInProgress[t], l = i[e] || r, a[`${t}end`] = l); } for (const t in a) this._fireEvent(t, a[t]); const c = tn(this._eventsInProgress); if (r && (o || n) && !c) { this._updatingCamera = !0; const e = this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions), i = t => 0 !== t && -this._bearingSnap < t && t < this._bearingSnap; e ? (i(e.bearing || this._map.getBearing()) && (e.bearing = 0), this._map.easeTo(e, { originalEvent: l })) : (this._map.fire(new t.Event("moveend", { originalEvent: l })), i(this._map.getBearing()) && this._map.resetNorth()), this._updatingCamera = !1; } } _fireEvent(e, i) { this._map.fire(new t.Event(e, i ? { originalEvent: i } : {})); } _requestFrame() { return this._map.triggerRepaint(), this._map._renderTaskQueue.add((t => { delete this._frameId, this.handleEvent(new en("renderFrame", { timeStamp: t })), this._applyChanges(); })) } _triggerRenderFrame() { void 0 === this._frameId && (this._frameId = this._requestFrame()); } } class sn extends t.Evented { constructor(e, i) { super(), this._moving = !1, this._zooming = !1, this.transform = e, this._bearingSnap = i.bearingSnap, t.bindAll(["_renderFrameCallback"], this); } getCenter() { return new t.LngLat(this.transform.center.lng, this.transform.center.lat) } setCenter(t, e) { return this.jumpTo({ center: t }, e) } panBy(e, i, r) { return e = t.pointGeometry.convert(e).mult(-1), this.panTo(this.transform.center, t.extend({ offset: e }, i), r) } panTo(e, i, r) { return this.easeTo(t.extend({ center: e }, i), r) } getZoom() { return this.transform.zoom } setZoom(t, e) { return this.jumpTo({ zoom: t }, e), this } zoomTo(e, i, r) { return this.easeTo(t.extend({ zoom: e }, i), r) } zoomIn(t, e) { return this.zoomTo(this.getZoom() + 1, t, e), this } zoomOut(t, e) { return this.zoomTo(this.getZoom() - 1, t, e), this } getBearing() { return this.transform.bearing } setBearing(t, e) { return this.jumpTo({ bearing: t }, e), this } getPadding() { return this.transform.padding } setPadding(t, e) { return this.jumpTo({ padding: t }, e), this } rotateTo(e, i, r) { return this.easeTo(t.extend({ bearing: e }, i), r) } resetNorth(e, i) { return this.rotateTo(0, t.extend({ duration: 1e3 }, e), i), this } resetNorthPitch(e, i) { return this.easeTo(t.extend({ bearing: 0, pitch: 0, duration: 1e3 }, e), i), this } snapToNorth(t, e) { return Math.abs(this.getBearing()) < this._bearingSnap ? this.resetNorth(t, e) : this } getPitch() { return this.transform.pitch } setPitch(t, e) { return this.jumpTo({ pitch: t }, e), this } cameraForBounds(e, i) { e = t.LngLatBounds.convert(e); const r = i && i.bearing || 0; return this._cameraForBoxAndBearing(e.getNorthWest(), e.getSouthEast(), r, i) } _extendCameraOptions(e) { const i = { top: 0, bottom: 0, right: 0, left: 0 }; if ("number" == typeof (e = t.extend({ padding: i, offset: [0, 0], maxZoom: this.transform.maxZoom }, e)).padding) { const t = e.padding; e.padding = { top: t, bottom: t, right: t, left: t }; } return e.padding = t.extend(i, e.padding), e } _cameraForBoxAndBearing(e, i, r, o) { const n = this._extendCameraOptions(o), s = this.transform, a = s.padding, l = s.project(t.LngLat.convert(e)), c = s.project(t.LngLat.convert(i)), h = l.rotate(-t.degToRad(r)), u = c.rotate(-t.degToRad(r)), d = new t.pointGeometry(Math.max(h.x, u.x), Math.max(h.y, u.y)), p = new t.pointGeometry(Math.min(h.x, u.x), Math.min(h.y, u.y)), m = d.sub(p), _ = (s.width - (a.left + a.right + n.padding.left + n.padding.right)) / m.x, f = (s.height - (a.top + a.bottom + n.padding.top + n.padding.bottom)) / m.y; if (f < 0 || _ < 0) return void t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."); const g = Math.min(s.scaleZoom(s.scale * Math.min(_, f)), n.maxZoom), v = "number" == typeof n.offset.x ? new t.pointGeometry(n.offset.x, n.offset.y) : t.pointGeometry.convert(n.offset), x = new t.pointGeometry((n.padding.left - n.padding.right) / 2, (n.padding.top - n.padding.bottom) / 2).rotate(r * Math.PI / 180), y = v.add(x).mult(s.scale / s.zoomScale(g)); return { center: s.unproject(l.add(c).div(2).sub(y)), zoom: g, bearing: r } } _cameraForBox(e, i, r, o, n) { const s = this._extendCameraOptions(n); r = r || 0, o = o || 0, e = t.LngLat.convert(e), i = t.LngLat.convert(i); const a = this.transform.clone(); a.padding = s.padding; const l = this.getFreeCameraOptions(), c = new t.LngLat(.5 * (e.lng + i.lng), .5 * (e.lat + i.lat)), h = .5 * (r + o); if (a._camera.position[2] < t.mercatorZfromAltitude(h, c.lat)) return void t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."); l.lookAtPoint(c), a.setFreeCameraOptions(l); const u = t.MercatorCoordinate.fromLngLat(e), d = t.MercatorCoordinate.fromLngLat(i), p = a.pointRayIntersection(a.centerPoint, h), m = [(_ = a.rayIntersectionCoordinate(p)).x, _.y, _.z]; var _; const f = a.screenPointToMercatorRay(a.centerPoint); let g, v = 0; do { const e = Math.floor(a.zoom), i = 1 << e, n = Math.min(i * u.x, i * d.x), s = Math.min(i * u.y, i * d.y), l = Math.max(i * u.x, i * d.x), c = Math.max(i * u.y, i * d.y), h = new t.Aabb([n, s, r], [l, c, o]), p = t.Frustum.fromInvProjectionMatrix(a.invProjMatrix, a.worldSize, e); if (2 !== h.intersects(p)) { g && (a._camera.position = t.scaleAndAdd([], a._camera.position, f.dir, -g), a._updateStateFromCamera()); break } const _ = t.sub([], a._camera.position, m); g = .5 * t.length(_), a._camera.position = t.scaleAndAdd([], a._camera.position, f.dir, g); try { a._updateStateFromCamera(); } catch (e) { return void t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.") } } while (++v < 10); return { center: a.center, zoom: a.zoom, bearing: a.bearing, pitch: a.pitch } } fitBounds(t, e, i) { return this._fitInternal(this.cameraForBounds(t, e), e, i) } _raycastElevationBox(e, i) { const r = this.transform.elevation; if (!r) return; const o = new t.pointGeometry(e.x, i.y), n = new t.pointGeometry(i.x, e.y), s = r.pointCoordinate(e); if (!s) return; const a = r.pointCoordinate(i); if (!a) return; const l = r.pointCoordinate(o); if (!l) return; const c = r.pointCoordinate(n); if (!c) return; const h = new t.MercatorCoordinate(s[0], s[1]).toLngLat(), u = new t.MercatorCoordinate(a[0], a[1]).toLngLat(), d = new t.MercatorCoordinate(l[0], l[1]).toLngLat(), p = new t.MercatorCoordinate(c[0], c[1]).toLngLat(), m = Math.min(h.lng, Math.min(u.lng, Math.min(d.lng, p.lng))), _ = Math.min(h.lat, Math.min(u.lat, Math.min(d.lat, p.lat))), f = Math.max(h.lng, Math.max(u.lng, Math.max(d.lng, p.lng))), g = Math.max(h.lat, Math.max(u.lat, Math.max(d.lat, p.lat))), v = Math.min(s[3], Math.min(a[3], Math.min(l[3], c[3]))), x = Math.max(s[3], Math.max(a[3], Math.max(l[3], c[3]))); return { minLngLat: new t.LngLat(m, _), maxLngLat: new t.LngLat(f, g), minAltitude: v, maxAltitude: x } } fitScreenCoordinates(e, i, r, o, n) { let s, a, l, c; const h = t.pointGeometry.convert(e), u = t.pointGeometry.convert(i), d = this._raycastElevationBox(h, u); if (d) s = d.minLngLat, a = d.maxLngLat, l = d.minAltitude, c = d.maxAltitude; else { if (this.transform.isHorizonVisibleForPoints(h, u)) return this; s = this.transform.pointLocation(h), a = this.transform.pointLocation(u); } return this._fitInternal(0 === this.transform.pitch ? this._cameraForBoxAndBearing(this.transform.pointLocation(t.pointGeometry.convert(e)), this.transform.pointLocation(t.pointGeometry.convert(i)), r, o) : this._cameraForBox(s, a, l, c, o), o, n) } _fitInternal(e, i, r) { return e ? (delete (i = t.extend(e, i)).padding, i.linear ? this.easeTo(i, r) : this.flyTo(i, r)) : this } jumpTo(e, i) { this.stop(); const r = this.transform; let o = !1, n = !1, s = !1; return "zoom" in e && r.zoom !== +e.zoom && (o = !0, r.zoom = +e.zoom), void 0 !== e.center && (r.center = t.LngLat.convert(e.center)), "bearing" in e && r.bearing !== +e.bearing && (n = !0, r.bearing = +e.bearing), "pitch" in e && r.pitch !== +e.pitch && (s = !0, r.pitch = +e.pitch), null == e.padding || r.isPaddingEqual(e.padding) || (r.padding = e.padding), this.fire(new t.Event("movestart", i)).fire(new t.Event("move", i)), o && this.fire(new t.Event("zoomstart", i)).fire(new t.Event("zoom", i)).fire(new t.Event("zoomend", i)), n && this.fire(new t.Event("rotatestart", i)).fire(new t.Event("rotate", i)).fire(new t.Event("rotateend", i)), s && this.fire(new t.Event("pitchstart", i)).fire(new t.Event("pitch", i)).fire(new t.Event("pitchend", i)), this.fire(new t.Event("moveend", i)) } getFreeCameraOptions() { return this.transform.getFreeCameraOptions() } setFreeCameraOptions(e, i) { this.stop(); const r = this.transform, o = r.zoom, n = r.pitch, s = r.bearing; r.setFreeCameraOptions(e); const a = o !== r.zoom, l = n !== r.pitch, c = s !== r.bearing; return this.fire(new t.Event("movestart", i)).fire(new t.Event("move", i)), a && this.fire(new t.Event("zoomstart", i)).fire(new t.Event("zoom", i)).fire(new t.Event("zoomend", i)), c && this.fire(new t.Event("rotatestart", i)).fire(new t.Event("rotate", i)).fire(new t.Event("rotateend", i)), l && this.fire(new t.Event("pitchstart", i)).fire(new t.Event("pitch", i)).fire(new t.Event("pitchend", i)), this.fire(new t.Event("moveend", i)), this } easeTo(e, i) { this._stop(!1, e.easeId), (!1 === (e = t.extend({ offset: [0, 0], duration: 500, easing: t.ease }, e)).animate || !e.essential && t.exported.prefersReducedMotion) && (e.duration = 0); const r = this.transform, o = this.getZoom(), n = this.getBearing(), s = this.getPitch(), a = this.getPadding(), l = "zoom" in e ? +e.zoom : o, c = "bearing" in e ? this._normalizeBearing(e.bearing, n) : n, h = "pitch" in e ? +e.pitch : s, u = "padding" in e ? e.padding : r.padding, d = t.pointGeometry.convert(e.offset); let p = r.centerPoint.add(d); const m = r.pointLocation(p), _ = t.LngLat.convert(e.center || m); this._normalizeCenter(_); const f = r.project(m), g = r.project(_).sub(f), v = r.zoomScale(l - o); let x, y; e.around && (x = t.LngLat.convert(e.around), y = r.locationPoint(x)); const b = { moving: this._moving, zooming: this._zooming, rotating: this._rotating, pitching: this._pitching }; return this._zooming = this._zooming || l !== o, this._rotating = this._rotating || n !== c, this._pitching = this._pitching || h !== s, this._padding = !r.isPaddingEqual(u), this._easeId = e.easeId, this._prepareEase(i, e.noMoveStart, b), this._ease((e => { if (this._zooming && (r.zoom = t.number(o, l, e)), this._rotating && (r.bearing = t.number(n, c, e)), this._pitching && (r.pitch = t.number(s, h, e)), this._padding && (r.interpolatePadding(a, u, e), p = r.centerPoint.add(d)), x) r.setLocationAtPoint(x, y); else { const t = r.zoomScale(r.zoom - o), i = l > o ? Math.min(2, v) : Math.max(.5, v), n = Math.pow(i, 1 - e), s = r.unproject(f.add(g.mult(e * n)).mult(t)); r.setLocationAtPoint(r.renderWorldCopies ? s.wrap() : s, p); } this._fireMoveEvents(i); }), (t => { r.recenterOnTerrain(), this._afterEase(i, t); }), e), this } _prepareEase(e, i, r = {}) { this._moving = !0, this.transform.cameraElevationReference = "sea", i || r.moving || this.fire(new t.Event("movestart", e)), this._zooming && !r.zooming && this.fire(new t.Event("zoomstart", e)), this._rotating && !r.rotating && this.fire(new t.Event("rotatestart", e)), this._pitching && !r.pitching && this.fire(new t.Event("pitchstart", e)); } _fireMoveEvents(e) { this.fire(new t.Event("move", e)), this._zooming && this.fire(new t.Event("zoom", e)), this._rotating && this.fire(new t.Event("rotate", e)), this._pitching && this.fire(new t.Event("pitch", e)); } _afterEase(e, i) { if (this._easeId && i && this._easeId === i) return; delete this._easeId, this.transform.cameraElevationReference = "ground"; const r = this._zooming, o = this._rotating, n = this._pitching; this._moving = !1, this._zooming = !1, this._rotating = !1, this._pitching = !1, this._padding = !1, r && this.fire(new t.Event("zoomend", e)), o && this.fire(new t.Event("rotateend", e)), n && this.fire(new t.Event("pitchend", e)), this.fire(new t.Event("moveend", e)); } flyTo(e, i) { if (!e.essential && t.exported.prefersReducedMotion) { const r = t.pick(e, ["center", "zoom", "bearing", "pitch", "around"]); return this.jumpTo(r, i) } this.stop(), e = t.extend({ offset: [0, 0], speed: 1.2, curve: 1.42, easing: t.ease }, e); const r = this.transform, o = this.getZoom(), n = this.getBearing(), s = this.getPitch(), a = this.getPadding(), l = "zoom" in e ? t.clamp(+e.zoom, r.minZoom, r.maxZoom) : o, c = "bearing" in e ? this._normalizeBearing(e.bearing, n) : n, h = "pitch" in e ? +e.pitch : s, u = "padding" in e ? e.padding : r.padding, d = r.zoomScale(l - o), p = t.pointGeometry.convert(e.offset); let m = r.centerPoint.add(p); const _ = r.pointLocation(m), f = t.LngLat.convert(e.center || _); this._normalizeCenter(f); const g = r.project(_), v = r.project(f).sub(g); let x = e.curve; const y = Math.max(r.width, r.height), b = y / d, w = v.mag(); if ("minZoom" in e) { const i = t.clamp(Math.min(e.minZoom, o, l), r.minZoom, r.maxZoom), n = y / r.zoomScale(i - o); x = Math.sqrt(n / w * 2); } const E = x * x; function T(t) { const e = (b * b - y * y + (t ? -1 : 1) * E * E * w * w) / (2 * (t ? b : y) * E * w); return Math.log(Math.sqrt(e * e + 1) - e) } function C(t) { return (Math.exp(t) - Math.exp(-t)) / 2 } function S(t) { return (Math.exp(t) + Math.exp(-t)) / 2 } const A = T(0); let L = function (t) { return S(A) / S(A + x * t) }, I = function (t) { return y * ((S(A) * (C(e = A + x * t) / S(e)) - C(A)) / E) / w; var e; }, M = (T(1) - A) / x; if (Math.abs(w) < 1e-6 || !isFinite(M)) { if (Math.abs(y - b) < 1e-6) return this.easeTo(e, i); const t = b < y ? -1 : 1; M = Math.abs(Math.log(b / y)) / x, I = function () { return 0 }, L = function (e) { return Math.exp(t * x * e) }; } return e.duration = "duration" in e ? +e.duration : 1e3 * M / ("screenSpeed" in e ? +e.screenSpeed / x : +e.speed), e.maxDuration && e.duration > e.maxDuration && (e.duration = 0), this._zooming = !0, this._rotating = n !== c, this._pitching = h !== s, this._padding = !r.isPaddingEqual(u), this._prepareEase(i, !1), this._ease((e => { const d = e * M, _ = 1 / L(d); r.zoom = 1 === e ? l : o + r.scaleZoom(_), this._rotating && (r.bearing = t.number(n, c, e)), this._pitching && (r.pitch = t.number(s, h, e)), this._padding && (r.interpolatePadding(a, u, e), m = r.centerPoint.add(p)); const x = 1 === e ? f : r.unproject(g.add(v.mult(I(d))).mult(_)); r.setLocationAtPoint(r.renderWorldCopies ? x.wrap() : x, m), r._updateCenterElevation(), this._fireMoveEvents(i); }), (() => this._afterEase(i)), e), this } isEasing() { return !!this._easeFrameId } stop() { return this._stop() } _stop(t, e) { if (this._easeFrameId && (this._cancelRenderFrame(this._easeFrameId), delete this._easeFrameId, delete this._onEaseFrame), this._onEaseEnd) { const t = this._onEaseEnd; delete this._onEaseEnd, t.call(this, e); } if (!t) { const t = this.handlers; t && t.stop(!1); } return this } _ease(e, i, r) { !1 === r.animate || 0 === r.duration ? (e(1), i()) : (this._easeStart = t.exported.now(), this._easeOptions = r, this._onEaseFrame = e, this._onEaseEnd = i, this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback)); } _renderFrameCallback() { const e = Math.min((t.exported.now() - this._easeStart) / this._easeOptions.duration, 1); this._onEaseFrame(this._easeOptions.easing(e)), e < 1 ? this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback) : this.stop(); } _normalizeBearing(e, i) { e = t.wrap(e, -180, 180); const r = Math.abs(e - i); return Math.abs(e - 360 - i) < r && (e -= 360), Math.abs(e + 360 - i) < r && (e += 360), e } _normalizeCenter(t) { const e = this.transform; if (!e.renderWorldCopies || e.lngRange) return; const i = t.lng - e.center.lng; t.lng += i > 180 ? -360 : i < -180 ? 360 : 0; } } e(".sfmap-ctrl-attribution{margin:5px 6px}.mapboxgl-control-container .mapboxgl-control-container .sfmap-ctrl-attribution{display:none;visibility:hidden;opacity:0;width:0;height:0}"); const an = { background: "rgba(0,0,0,0)", height: 30, width: 103, src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK0AAAAyCAMAAAAZQavnAAAC91BMVEUAAAAAAAAAAAAAAAAAAAAAAACBgoQAAAAAAAAAAAAAAACBgoRQgMQAAAAAAAAAAACBgoQAAACBgoQAAAAAAAAAAACBgoQAAAAAAAAAAACBgoSBgoSBgoQAAAAAAAAAAAAAAACBgoQAAAAAAACBgoSBgoQAAAAAAAAAAACBgoQAAACBgoSBgoQAAACBgoQAAACBgoQAAAAAAACBgoQSZP+BgoQAAACBgoSBgoSBgoSBgoQAAAAAAACBgoQAAAAPWv8AAACBgoQAAAAAAAAAAACBgoSBgoSBgoQAAAAAAACBgoSBgoQAAACBgoQZiP8AAAAAAAAAAACBgoQAAAAAAAAbj/+BgoQbjv+BgoSBgoQAAACBgoQUb/+BgoQAAAAHMf8AAAAirf8aiv8enf8dmP8hqf8HM/8hrP8AAAAEJv+BgoQDIP8PVP8NVP8hrf8RY/8MTf8FK/8hrf8Ta/8AAAAAAAAhqf+BgoQAAAAAAAAirf8aiv8en/8KPv8HNP8Zhv8Vdf8hrP8SaP+BgoSBgoSBgoQhqv8GLf8gpv8clf8Ta/8QXf8fn/8Zhv8Ucf8fof8irf8RZP8UcP8LQ/8PWP8ajv8en/8KPv8irf8NTv8Wdv8go/8GLf8PXv8aiv8aif8irf8HNP8cdP4BF/8Xfv8JRP8dlf8hqf8OUv8NT/8FNv8HR/8BGP8Wev8MSP+52e8PV/8LRv8ckv8QW/8KRv8ajP8ckv8Xe/8AAAAfof8Wdv8KQP8Taf8dmP8irf8WeP8ir/8fn/8aif8fo/8ck/8ajf8Xfv8ckf8AE//o/+vK5O0irP8AAAAAAACBgoQirf8CHP8NUv8gpf8enf8dmf8Tbv8GLf8EJf8fof8XfP8RYP8MTP8KR/8GOv8Vcv8SaP8MWv8Wdf8JQv8JP/8FM/8dlf8ckf8aiv8Zhv8Ygv8hqv8PVv8HN/8bjf8FYf+w0vDL5u4ATv+62e/V7e2UvfM7fftunvaiyPHa9Ozs++osY/xSjvh5qPTmhb/vAAAAzXRSTlMANQPkcdf1Yn69qyUEyV4j5+eU+sQbCN7YoJyNWEkmB8+lmYZlGwtDPQymgmhSLfDYubEz/vv28OvRwJKObSAaFxbs4dS6rnt5W+PetTwb24ltUU8tFRIMyXNoX084OCgSybW0ql02NDHGtHY88t2urIB8cFlVSCEUEPLy8da8rayeYkxEQD4wI/Pz8t7TxMO8t7a1tJeNioaFeHZtRkM1Hx739fLy7efi1czDvLSZlntwbmZlYFEvKSgk9+HdtJOLgoBsKvno4auQj44qwcIBwwAAC0NJREFUaN7UlUtoE2EQgCdJQ5rQNJQkNHuICRHSECjBEHKJpCHpoQExLVaEItqTRKxoUaEeFPEiKAg+QCr2oCL4wgd6EBW8qviDOaSFvK29tfTt24Mz/+52d+MWUTzoR9v8f2aTfjs7Mz/8zNWX1+/uhv+EfdffIvvgf2D3XVQl37un4J9nH+V1tGff/5DePXunpqb2UlJP8dWfVq/Rhz/GZnx/ObFTyCiIjNLmCvyKZK8nAE20mAIQTpuaSVukewl4cj5Dzmw250LKDQZyGJZJbensUnYD5s06iZ2cnNy7R7s//qv0GhnrBS0OxraAmf1MK3C8uAx2McILMhYeltnIWBYIN/KEvm+MVimQGZ1EeKlq39JNr7uvVSJBX9Uu77YBEmIsDFsiHWrSTnRrAc5hZzxOts54NAgyrTwss5kx+qqk3cmc9EkBorQwyYm8PTMzoyRS910Fn4mpiEKHvPQDYmDMBsPuDWqSqcCajm9sbAzacXuUP+ZOa56qR2Pbx9gufgsSgvisnEC0XZqbm3uml8XROeSnwDDT2mbkZcuaLSRyHoVcvzZ5/MlnxUpCNpKfEg4lehmzCi3Q7SLsZLsRF9ZtPIXHqtXq8augxym9mK/dItNHleCVNl5QbJ1MzSbo19puY+yIqB3BcG74iBJOMZEO+b85sbLWuPQeeajse+4duzCiDT97vG6XkYkWbot1GTf7zb32qM0VxzfUtk/y+cFWzOhgnup2TECzYa8SNjCRIcVWAImrx6anpy+oavPhjffV6emDynAY4Ve0gS4b1rHF7usDItRqdVL+FVsUldkGhDfQrq7boNdro3sBhKZ2EnNrFIE7lcoNVeZO3alUZ268r1QqB3cr6cXt+O/YhiGcsQNEWxN+xgmrbJlCHmS4rXpnwJeu3g6c09jD8YyJFnYol2/1wBrj5fJM9eP9kdtl5N6a70S5fAF0OYpdppdbCHYNkSmR7ncAJdsijaewIAjYOnbBAvq2NG+78aWTaYnD/sJB5ZnfKkzPfP30+RXA45uFQrk8vgNECniVBp+Dk8T6dCUdEj5V3aKOTCSQfWKkga/XZcbB9W2jfnunjHlTnHWi7UUQ2XGvUKhWPi6uLNynqfYQfQv7H7Txxmu2NXQwHUKybUAcCaawIJ9pbhyw7XLTB3CMSEU7nGP+kJ5tHoIASfyVyXLbWcm25+Zspfph4fPywvJrINoe7J+dnb21g2Kzs1pbG9PjjWybAMb8/Txr7izVbtzXp9haGaOZIQCSZ0gi2GRLE0PYAnDYE5KfZYAhcKYh2T5qFErfVxYXFhZX7oPI9vEzjcYjsm00DoCaFruIC00iLmk9ALKtYLQYAIwDh3e5ARnsdkNCsc2wNFUCs2LQ6KXi7ARL08mLeHi9CGOAWNLikXamtGa7tPplGV1XP+y/MwEiO0ulB2RbKqGtHimaTloMUuO5xc4w+cNcQG2bgW5e0A7cUUXbYUhl20UzjzdliC4agqCNX50FtD0HnJOlxuri8sryt6WlRqx0bkTsu1LpENnG1rNN6s9bsZFkfBrbYIT1whG8qIN5gXDjC5b1Yc1ZZjMA4uIHYSf/m8L96ZhsG2usfln8GFuarz+PIecmKLexmGgbO/B7pwORCmVb+gWrf0Cb25STuSCLPXnUtUsWHMRCCVtSQOxizgzNW8KYkNrZMwTE6fp5ybY+/+nTtaX54vOTMHG2WK/XD4zAznqd2+IGdHGsZzsYSAx1e0MhA5au1pZukHI5AF1RwbbJlYk4NTPF0erGnutWxgMxAKJtUbYt1j7MzxdPX27jBXu2iGx/Wixy22LxxG+eDiYm05HOeRwq2zzF+ZNPMw2RYe285aMgwjjxwFFArtUk20O12nzx3YvtQHDfWq3naa1GtltrNbVt0maVwcJKWxW8a7a9TI1iy1snQLZewIAzYvL4XZvCdvxQCpptvRmGRMMMSbeT7Y9qzKW1iSgKwKeVjo+JOgw6amZEo0k1JMZoCHlghKBJNDE+grYJtWJtS6GLLgpasAWVqigoiqCIBduF6MqNoKLg+7UQT8F20S6z6BP8D55zkzhTm+7bb3En986dme+ee+7NJMXnZbtisXjvNVg4PQiDxeIjti0WrbZ7fi3EofJ7Ag+pZseuNSe2r9q7buuxQyRQseXtYB8s5+r5zTXr62uBOcyxtu63bHu88gPpsJiFI/XwZJxtmUeXT4MVEd/xcWE7Pm7actwWYMP+cmzpdcmkth5qLbE9xK/fy0UqVn1P2HK29riwPcm3XC2W29ltIsjCtjqPP3wfJ16XbC9ZN4KdNRVoJ9pa+XzmjHCs4U32Hwc2bKw7eGDZgd3/Xli3/Vq21vw2MG0PQYn6umXU+TBvDmYj7NhKyQBPZs5BFd5+vj3D3H4MbDszc2nBVbYSrHBeVqeyzNeeqQc4wfIWVljqIk03kyAFAkxoTqB3er7tqZfnppnb9zmwbDs9vYDt/rqtO2AuJ+uqs2oLmOw6uOosWFhzcFW9+R9FXd22WrLdB3Oo2QS9U//bDt7vnWLOvYIKR6emLsFioPfPHNuvL27/IXrvvzwFJke//VkctjcnTdvGl+cmmR+fX1C6Wm0nJ9tgMXBzorWyB7Q9nSButr2ywdOJp60DX03biYlFYjsqbG98ejfK3HnBGfBmVPDu/qvGku3o6OKw7Rtpg8b21hHm1oNBKHH9wa0RQV/rwBuqj1AvCwFPSuaD1+n0+sAHjE8TZ9xcXvN6DXe5q9N51XB6NTC4M/Ux7DEbaDIQDTLEgeHSqeaolMXNRNUARtb1QLl7jwFjY3ce9I0RfW0XbGDhxpfWW2OCWw/a+8ZawURHJYQeaAqmFSXd3IQBfjImqcyhTmUK0+kwXgXGoSgYVKLuzhB1jmo2PypBSfaGgPDbNYn7R5PgUlDBPICUBKaBq36NbxUOo0dDUnehCs9+C+58EXvAx5aHHWBy4dOd32Ustm70AtijEMkDE0UHlQXkWgTDVIqGRBDKoJMflQUmgi6wpR0eCQjJIyNSMGmgiuSGHjoG7cBkgm66JA85flQTulUECPpJaHZ2tqu7rNg4TLR0D1lD3H7l2SxhGYQmZfqFZgKYzmBIozgh1a5iltUklYOKVltZ2NqukRwRV0Vs055mJUKDCnviYn6cCBlh6+MqqdoyESihJAws6Vw3RbqfDTN32627ra3j4c83YEH2I6o26Ew4JMlvi9r9OuTCyQgpR0CVKDIOB6WKURkcxugSxR6SpH4DQaD67eGwgsa1sJsDm+oX7S7siQjbGJbm8GqGLi3k9WsQx7wL5mFrvyt8L16hMSxMwI5+cCSMVCoHmVgOwa83hen2qZgdXaA4YnbdB3NsQ4VUquD2VmzTTbquS94s0nz4Eh46Ej0YL9k2iWoDNqdj1DeBKkAiBFUZGmgRwl3dp6AqsiHi0KBGgcmogAUpXgiDrjj9eco8STxyri3KYrPAZpZp8oTElWRpgyRmUjZ08hgQwiownK7gQUj7gWDbzjTM5wYwHR+7RAZDVXyYjLtU1DojwEhRsGMUHBKgKpKvIdQ5Z7owxbYx2edrhij2uwoYSyEQQT2LGoCEOikbrhgWIJigbj6Xg6peau5HtSfr5VWbx/l50DLcMjAkPl24cnH4PVQnh5KEBjg8wEQLEAgaoOqBjAZEJJB0goV4PgDgkiTK2wjFCCX0gMcBRCJr8ICz4RyAXbRDlLtJCVCpqvM00DHpoPMOO/xPo3WNNXbYYCGyPKGW0w0AWnmn5/Y5aCXnHlmW3ZxCzVRq5nWEW3TgdnC7ZKKBq1QwARmYai7XzTW2JBjqLq8x+ppYEnQ87BLCLRdgaUBrjBMClgqN7e+7umGR8Reb1vrZaIq8OwAAAABJRU5ErkJggg==" }; class ln { constructor(e) { this.options = t.extend({}, e), this._options = t.extend({}, an, e); } onAdd() { const { width: t, height: e, background: i, src: r } = this._options, o = this._container = n.create("div", "sfmap-ctrl sfmap-ctrl-attribution"); o.style.width = `${t}px`, o.style.height = `${e}px`, o.style.background = i; const s = n.create("img", "", o); return s.src = r, s.style.width = `${t}px`, s.style.height = `${e}px`, o } onRemove() { n.remove(this._container); } getDefaultPosition() { return "bottom-left" } } class cn { constructor() { this._queue = [], this._id = 0, this._cleared = !1, this._currentlyRunning = !1; } add(t) { const e = ++this._id; return this._queue.push({ callback: t, id: e, cancelled: !1 }), e } remove(t) { const e = this._currentlyRunning, i = e ? this._queue.concat(e) : this._queue; for (const e of i) if (e.id === t) return void (e.cancelled = !0) } run(t = 0) { const e = this._currentlyRunning = this._queue; this._queue = []; for (const i of e) if (!i.cancelled && (i.callback(t), this._cleared)) break; this._cleared = !1, this._currentlyRunning = !1; } clear() { this._currentlyRunning && (this._cleared = !0), this._queue = []; } } class hn { constructor(t) { this.jumpTo(t); } getValue(e) { if (e <= this._startTime) return this._start; if (e >= this._endTime) return this._end; const i = t.easeCubicInOut((e - this._startTime) / (this._endTime - this._startTime)); return this._start * (1 - i) + this._end * i } isEasing(t) { return t >= this._startTime && t <= this._endTime } jumpTo(t) { this._startTime = -1 / 0, this._endTime = -1 / 0, this._start = t, this._end = t; } easeTo(t, e, i) { this._start = this.getValue(e), this._end = t, this._startTime = e, this._endTime = e + i; } } const un = { "AttributionControl.ToggleAttribution": "Toggle attribution", "AttributionControl.MapFeedback": "Map feedback", "FullscreenControl.Enter": "Enter fullscreen", "FullscreenControl.Exit": "Exit fullscreen", "GeolocateControl.FindMyLocation": "Find my location", "GeolocateControl.LocationNotAvailable": "Location not available", "LogoControl.Title": "Mapbox logo", "NavigationControl.ResetBearing": "Reset bearing to north", "NavigationControl.ZoomIn": "Zoom in", "NavigationControl.ZoomOut": "Zoom out", "ScaleControl.Feet": "ft", "ScaleControl.Meters": "m", "ScaleControl.Kilometers": "km", "ScaleControl.Miles": "mi", "ScaleControl.NauticalMiles": "nm" }, { HTMLImageElement: dn, HTMLElement: pn, ImageBitmap: mn } = t.window, _n = { center: [0, 0], zoom: 0, bearing: 0, pitch: 0, minZoom: -2, maxZoom: 22, minPitch: 0, maxPitch: 85, interactive: !0, scrollZoom: !0, boxZoom: !0, dragRotate: !0, dragPan: !0, keyboard: !0, doubleClickZoom: !0, touchZoomRotate: !0, touchPitch: !0, bearingSnap: 7, clickTolerance: 3, pitchWithRotate: !0, hash: !1, attributionControl: !0, failIfMajorPerformanceCaveat: !1, preserveDrawingBuffer: !1, trackResize: !0, optimizeForTerrain: !0, renderWorldCopies: !0, refreshExpiredTiles: !0, maxTileCacheSize: null, localIdeographFontFamily: "sans-serif", localIdeographFontWeight: "500", localFontFamily: null, transformRequest: null, accessToken: null, fadeDuration: 0, crossSourceCollisions: !0, antialias: !0 }; class fn extends sn { constructor(e) { if (null != (e = t.extend({}, _n, e)).minZoom && null != e.maxZoom && e.minZoom > e.maxZoom) throw new Error("maxZoom must be greater than or equal to minZoom"); if (null != e.minPitch && null != e.maxPitch && e.minPitch > e.maxPitch) throw new Error("maxPitch must be greater than or equal to minPitch"); if (null != e.minPitch && e.minPitch < 0) throw new Error("minPitch must be greater than or equal to 0"); if (null != e.maxPitch && e.maxPitch > 85) throw new Error("maxPitch must be less than or equal to 85"); if (super(e.createTransform(e) || new t.Transform(e.minZoom, e.maxZoom, e.minPitch, e.maxPitch, e.renderWorldCopies), e), this.options = e, this._interactive = e.interactive, this._maxTileCacheSize = e.maxTileCacheSize, this._failIfMajorPerformanceCaveat = e.failIfMajorPerformanceCaveat, this._preserveDrawingBuffer = e.preserveDrawingBuffer, this._antialias = e.antialias, this._trackResize = e.trackResize, this._bearingSnap = e.bearingSnap, this._refreshExpiredTiles = e.refreshExpiredTiles, this._fadeDuration = e.fadeDuration, this._isInitialLoad = !0, this._crossSourceCollisions = e.crossSourceCollisions, this._crossFadingFactor = 1, this._collectResourceTiming = e.collectResourceTiming, this._optimizeForTerrain = e.optimizeForTerrain, this._renderTaskQueue = new cn, this._domRenderTaskQueue = new cn, this._controls = [], this._markers = [], this._mapId = t.uniqueId(), this._locale = t.extend({}, un, e.locale), this._clickTolerance = e.clickTolerance, this._averageElevationLastSampledAt = -1 / 0, this._averageElevation = new hn(0), this._requestManager = new t.RequestManager(e.transformRequest, e.accessToken, e.testMode), this._silenceAuthErrors = !!e.testMode, "string" == typeof e.container) { if (this._container = t.window.document.getElementById(e.container), !this._container) throw new Error(`Container '${e.container}' not found.`) } else { if (!(e.container instanceof pn)) throw new Error("Invalid type: 'container' must be a String or HTMLElement."); this._container = e.container; } if (e.maxBounds && this.setMaxBounds(e.maxBounds), t.bindAll(["_onWindowOnline", "_onWindowResize", "_onMapScroll", "_contextLost", "_contextRestored"], this), this._setupContainer(), this._setupPainter(), void 0 === this.painter) throw new Error("Failed to initialize WebGL."); this.on("move", (() => this._update(!1))), this.on("moveend", (() => this._update(!1))), this.on("zoom", (() => this._update(!0))), void 0 !== t.window && (t.window.addEventListener("online", this._onWindowOnline, !1), t.window.addEventListener("resize", this._onWindowResize, !1), t.window.addEventListener("orientationchange", this._onWindowResize, !1)), this.handlers = new nn(this, e), this._hash = e.hash && new vo("string" == typeof e.hash && e.hash || void 0).addTo(this), this._hash && this._hash._onHashChange() || (this.jumpTo({ center: e.center, zoom: e.zoom, bearing: e.bearing, pitch: e.pitch }), e.bounds && (this.resize(), this.fitBounds(e.bounds, t.extend({}, e.fitBoundsOptions, { duration: 0 })))), this.resize(), this._localFontFamily = e.localFontFamily, this._localIdeographFontFamily = e.localIdeographFontFamily, this._localIdeographFontWeight = e.localIdeographFontWeight, e.style && this.setStyle(e.style, { localFontFamily: this._localFontFamily, localIdeographFontFamily: this._localIdeographFontFamily, localIdeographFontWeight: this._localIdeographFontWeight }); let i = e.attributionControl; i && (this.attributionControl = i.__proto__ && i.__proto__.onAdd ? e.attributionControl : new ln, this.addControl(this.attributionControl, e.logoPosition)), this.on("style.load", (() => { this.transform.unmodified && this.jumpTo(this.style.stylesheet); })), this.on("data", (e => { this._update("style" === e.dataType), this.fire(new t.Event(`${e.dataType}data`, e)); })), this.on("dataloading", (e => { this.fire(new t.Event(`${e.dataType}dataloading`, e)); })); } _getMapId() { return this._mapId } addControl(e, i) { if (void 0 === i && (i = e.getDefaultPosition ? e.getDefaultPosition() : "top-right"), !e || !e.onAdd) return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods."))); const r = e.onAdd(this); this._controls.push(e); const o = this._controlPositions[i]; return -1 !== i.indexOf("bottom") ? o.insertBefore(r, o.firstChild) : o.appendChild(r), this } removeControl(e) { if (!e || !e.onRemove) return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods."))); const i = this._controls.indexOf(e); return i > -1 && this._controls.splice(i, 1), e.onRemove(this), this } hasControl(t) { return this._controls.indexOf(t) > -1 } resize(e) { const i = this._containerDimensions(), r = i[0], o = i[1]; this._resizeCanvas(r, o), this.transform.resize(r, o), this.painter.resize(r, o); const n = !this._moving; return n && (this.stop(), this.fire(new t.Event("movestart", e)).fire(new t.Event("move", e))), this.fire(new t.Event("resize", e)), n && this.fire(new t.Event("moveend", e)), this } getBounds() { return this.transform.getBounds() } getMaxBounds() { return this.transform.getMaxBounds() } setMaxBounds(e) { return this.transform.setMaxBounds(t.LngLatBounds.convert(e)), this._update() } setMinZoom(t) { if ((t = null == t ? -2 : t) >= -2 && t <= this.transform.maxZoom) return this.transform.minZoom = t, this._update(), this.getZoom() < t && this.setZoom(t), this; throw new Error("minZoom must be between -2 and the current maxZoom, inclusive") } getMinZoom() { return this.transform.minZoom } setMaxZoom(t) { if ((t = null == t ? 22 : t) >= this.transform.minZoom) return this.transform.maxZoom = t, this._update(), this.getZoom() > t && this.setZoom(t), this; throw new Error("maxZoom must be greater than the current minZoom") } getMaxZoom() { return this.transform.maxZoom } setMinPitch(t) { if ((t = null == t ? 0 : t) < 0) throw new Error("minPitch must be greater than or equal to 0"); if (t >= 0 && t <= this.transform.maxPitch) return this.transform.minPitch = t, this._update(), this.getPitch() < t && this.setPitch(t), this; throw new Error("minPitch must be between 0 and the current maxPitch, inclusive") } getMinPitch() { return this.transform.minPitch } setMaxPitch(t) { if ((t = null == t ? 85 : t) > 85) throw new Error("maxPitch must be less than or equal to 85"); if (t >= this.transform.minPitch) return this.transform.maxPitch = t, this._update(), this.getPitch() > t && this.setPitch(t), this; throw new Error("maxPitch must be greater than the current minPitch") } getMaxPitch() { return this.transform.maxPitch } getRenderWorldCopies() { return this.transform.renderWorldCopies } setRenderWorldCopies(t) { return this.transform.renderWorldCopies = t, this._update() } project(e) { return this.transform.locationPoint3D(t.LngLat.convert(e)) } unproject(e) { return this.transform.pointLocation3D(t.pointGeometry.convert(e)) } isMoving() { return this._moving || this.handlers && this.handlers.isMoving() } isZooming() { return this._zooming || this.handlers && this.handlers.isZooming() } isRotating() { return this._rotating || this.handlers && this.handlers.isRotating() } _createDelegatedListener(t, e, i) { if ("mouseenter" === t || "mouseover" === t) { let r = !1; const o = o => { const n = this.getLayer(e) ? this.queryRenderedFeatures(o.point, { layers: [e] }) : []; n.length ? r || (r = !0, i.call(this, new E(t, this, o.originalEvent, { features: n }))) : r = !1; }; return { layer: e, listener: i, delegates: { mousemove: o, mouseout: () => { r = !1; } } } } if ("mouseleave" === t || "mouseout" === t) { let r = !1; const o = o => { (this.getLayer(e) ? this.queryRenderedFeatures(o.point, { layers: [e] }) : []).length ? r = !0 : r && (r = !1, i.call(this, new E(t, this, o.originalEvent))); }, n = e => { r && (r = !1, i.call(this, new E(t, this, e.originalEvent))); }; return { layer: e, listener: i, delegates: { mousemove: o, mouseout: n } } } { const r = t => { const r = this.getLayer(e) ? this.queryRenderedFeatures(t.point, { layers: [e] }) : []; r.length && (t.features = r, i.call(this, t), delete t.features); }; return { layer: e, listener: i, delegates: { [t]: r } } } } on(t, e, i) { if (void 0 === i) return super.on(t, e); const r = this._createDelegatedListener(t, e, i); this._delegatedListeners = this._delegatedListeners || {}, this._delegatedListeners[t] = this._delegatedListeners[t] || [], this._delegatedListeners[t].push(r); for (const t in r.delegates) this.on(t, r.delegates[t]); return this } once(t, e, i) { if (void 0 === i) return super.once(t, e); const r = this._createDelegatedListener(t, e, i); for (const t in r.delegates) this.once(t, r.delegates[t]); return this } off(t, e, i) { return void 0 === i ? super.off(t, e) : (this._delegatedListeners && this._delegatedListeners[t] && (r => { const o = this._delegatedListeners[t]; for (let t = 0; t < o.length; t++) { const r = o[t]; if (r.layer === e && r.listener === i) { for (const t in r.delegates) this.off(t, r.delegates[t]); return o.splice(t, 1), this } } })(), this) } queryRenderedFeatures(e, i) { return this.style ? (void 0 !== i || void 0 === e || e instanceof t.pointGeometry || Array.isArray(e) || (i = e, e = void 0), this.style.queryRenderedFeatures(e = e || [[0, 0], [this.transform.width, this.transform.height]], i = i || {}, this.transform)) : [] } querySourceFeatures(t, e) { return this.style.querySourceFeatures(t, e) } setStyle(e, i) { return !1 !== (i = t.extend({}, { localIdeographFontFamily: this._localIdeographFontFamily, localIdeographFontWeight: this._localIdeographFontWeight, localFontFamily: this._localFontFamily }, i)).diff && i.localIdeographFontFamily === this._localIdeographFontFamily && i.localIdeographFontWeight === this._localIdeographFontWeight && i.localFontFamily === this._localFontFamily && this.style && e ? (this._diffStyle(e, i), this) : (this._localIdeographFontFamily = i.localIdeographFontFamily, this._localIdeographFontWeight = i.localIdeographFontWeight, this._localFontFamily = i.localFontFamily, this._updateStyle(e, i)) } _getUIString(t) { const e = this._locale[t]; if (null == e) throw new Error(`Missing UI string '${t}'`); return e } _updateStyle(t, e) { return this.style && (this.style.setEventedParent(null), this.style._remove(), delete this.style), t && (this.style = new ai(this, e || {}), this.style.setEventedParent(this, { style: this.style }), "string" == typeof t ? this.style.loadURL(t) : this.style.loadJSON(t)), this._updateTerrain(), this } _lazyInitEmptyStyle() { this.style || (this.style = new ai(this, {}), this.style.setEventedParent(this, { style: this.style }), this.style.loadEmpty()); } _diffStyle(e, i) { if ("string" == typeof e) { const r = this._requestManager.normalizeStyleURL(e), o = this._requestManager.transformRequest(r, t.ResourceType.Style); t.getJSON(o, ((e, r) => { e ? this.fire(new t.ErrorEvent(e)) : r && this._updateDiff(r, i); })); } else "object" == typeof e && this._updateDiff(e, i); } _updateDiff(e, i) { try { this.style.setState(e) && this._update(!0); } catch (r) { t.warnOnce(`Unable to perform style diff: ${r.message || r.error || r}. Rebuilding the style from scratch.`), this._updateStyle(e, i); } } getStyle() { if (this.style) return this.style.serialize() } isStyleLoaded() { return this.style ? this.style.loaded() : t.warnOnce("There is no style added to the map.") } addSource(t, e) { return this._lazyInitEmptyStyle(), this.style.addSource(t, e), this._update(!0) } isSourceLoaded(e) { const i = this.style && this.style._getSourceCaches(e); if (0 !== i.length) return i.every((t => t.loaded())); this.fire(new t.ErrorEvent(new Error(`There is no source with ID '${e}'`))); } areTilesLoaded() { const t = this.style && this.style._sourceCaches; for (const e in t) { const i = t[e]._tiles; for (const t in i) { const e = i[t]; if ("loaded" !== e.state && "errored" !== e.state) return !1 } } return !0 } addSourceType(t, e, i) { return this._lazyInitEmptyStyle(), this.style.addSourceType(t, e, i) } removeSource(t) { return this.style.removeSource(t), this._updateTerrain(), this._update(!0) } getSource(t) { return this.style.getSource(t) } addImage(e, i, { pixelRatio: r = 1, sdf: o = !1, stretchX: n, stretchY: s, content: a } = {}) { if (this._lazyInitEmptyStyle(), i instanceof dn || mn && i instanceof mn) { const { width: l, height: c, data: h } = t.exported.getImageData(i); this.style.addImage(e, { data: new t.RGBAImage({ width: l, height: c }, h), pixelRatio: r, stretchX: n, stretchY: s, content: a, sdf: o, version: 0 }); } else { if (void 0 === i.width || void 0 === i.height) return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))); { const { width: l, height: c, data: h } = i, u = i; this.style.addImage(e, { data: new t.RGBAImage({ width: l, height: c }, new Uint8Array(h)), pixelRatio: r, stretchX: n, stretchY: s, content: a, sdf: o, version: 0, userImage: u }), u.onAdd && u.onAdd(this, e); } } } updateImage(e, i) { const r = this.style.getImage(e); if (!r) return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead."))); const o = i instanceof dn || mn && i instanceof mn ? t.exported.getImageData(i) : i, { width: n, height: s, data: a } = o; return void 0 === n || void 0 === s ? this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))) : n !== r.data.width || s !== r.data.height ? this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))) : (r.data.replace(a, !(i instanceof dn || mn && i instanceof mn)), void this.style.updateImage(e, r)) } hasImage(e) { return e ? !!this.style.getImage(e) : (this.fire(new t.ErrorEvent(new Error("Missing required image id"))), !1) } removeImage(t) { this.style.removeImage(t); } loadImage(e, i) { t.getImage(this._requestManager.transformRequest(e, t.ResourceType.Image), ((e, r) => { i(e, r instanceof dn ? t.exported.getImageData(r) : r); })); } listImages() { return this.style.listImages() } addLayer(t, e) { return this._lazyInitEmptyStyle(), this.style.addLayer(t, e), this._update(!0) } moveLayer(t, e) { return this.style.moveLayer(t, e), this._update(!0) } removeLayer(t) { return this.style.removeLayer(t), this._update(!0) } getLayer(t) { return this.style.getLayer(t) } setLayerZoomRange(t, e, i) { return this.style.setLayerZoomRange(t, e, i), this._update(!0) } setFilter(t, e, i = {}) { return this.style.setFilter(t, e, i), this._update(!0) } getFilter(t) { return this.style.getFilter(t) } setPaintProperty(t, e, i, r = {}) { return this.style.setPaintProperty(t, e, i, r), this._update(!0) } getPaintProperty(t, e) { return this.style.getPaintProperty(t, e) } setLayoutProperty(t, e, i, r = {}) { return this.style.setLayoutProperty(t, e, i, r), this._update(!0) } getLayoutProperty(t, e) { return this.style.getLayoutProperty(t, e) } setLight(t, e = {}) { return this._lazyInitEmptyStyle(), this.style.setLight(t, e), this._update(!0) } getLight() { return this.style.getLight() } setTerrain(t) { return this._lazyInitEmptyStyle(), this.style.setTerrain(t), this._averageElevationLastSampledAt = -1 / 0, this._update(!0) } getTerrain() { return this.style ? this.style.getTerrain() : null } setFog(t) { return this._lazyInitEmptyStyle(), this.style.setFog(t), this._update(!0) } getFog() { return this.style ? this.style.getFog() : null } _queryFogOpacity(e) { return this.style && this.style.fog ? this.style.fog.getOpacityAtLatLng(t.LngLat.convert(e), this.transform) : 0 } queryTerrainElevation(e, i) { const r = this.transform.elevation; return r ? (i = t.extend({}, { exaggerated: !0 }, i), r.getAtPoint(t.MercatorCoordinate.fromLngLat(e), null, i.exaggerated)) : null } setFeatureState(t, e) { return this.style.setFeatureState(t, e), this._update() } removeFeatureState(t, e) { return this.style.removeFeatureState(t, e), this._update() } getFeatureState(t) { return this.style.getFeatureState(t) } getContainer() { return this._container } getCanvasContainer() { return this._canvasContainer } getCanvas() { return this._canvas } _containerDimensions() { let t = 0, e = 0; return this._container && (t = this._container.clientWidth || 400, e = this._container.clientHeight || 300), [t, e] } _detectMissingCSS() { "rgb(250, 128, 114)" !== t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color") && t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/."); } _setupContainer() { const t = this._container; t.classList.add("mapboxgl-map"), (this._missingCSSCanary = n.create("div", "mapboxgl-canary", t)).style.visibility = "hidden", this._detectMissingCSS(); const e = this._canvasContainer = n.create("div", "mapboxgl-canvas-container", t); this._interactive && e.classList.add("mapboxgl-interactive"), this._canvas = n.create("canvas", "mapboxgl-canvas", e), this._canvas.addEventListener("webglcontextlost", this._contextLost, !1), this._canvas.addEventListener("webglcontextrestored", this._contextRestored, !1), this._canvas.setAttribute("tabindex", "0"), this._canvas.setAttribute("aria-label", "Map"), this._canvas.setAttribute("role", "region"); const i = this._containerDimensions(); this._resizeCanvas(i[0], i[1]); const r = this._controlContainer = n.create("div", "mapboxgl-control-container", t), o = this._controlPositions = {};["top-left", "top-right", "bottom-left", "bottom-right"].forEach((t => { o[t] = n.create("div", `mapboxgl-ctrl-${t}`, r); })), this._container.addEventListener("scroll", this._onMapScroll, !1); } _resizeCanvas(e, i) { const r = t.exported.devicePixelRatio || 1; this._canvas.width = r * e, this._canvas.height = r * i, this._canvas.style.width = `${e}px`, this._canvas.style.height = `${i}px`; } _addMarker(t) { this._markers.push(t); } _removeMarker(t) { const e = this._markers.indexOf(t); -1 !== e && this._markers.splice(e, 1); } _setupPainter() { const e = t.extend({}, i.webGLContextAttributes, { failIfMajorPerformanceCaveat: this._failIfMajorPerformanceCaveat, preserveDrawingBuffer: this._preserveDrawingBuffer, antialias: this._antialias || !1 }), r = this._canvas.getContext("webgl", e) || this._canvas.getContext("experimental-webgl", e); r ? (t.storeAuthState(r, !0), this.painter = new go(r, this.transform), this.on("data", (t => { "source" === t.dataType && this.painter.setTileLoadedFlag(!0); })), t.exported$1.testSupport(r)) : this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL"))); } _contextLost(e) { e.preventDefault(), this._frame && (this._frame.cancel(), this._frame = null), this.fire(new t.Event("webglcontextlost", { originalEvent: e })); } _contextRestored(e) { this._setupPainter(), this.resize(), this._update(), this.fire(new t.Event("webglcontextrestored", { originalEvent: e })); } _onMapScroll(t) { if (t.target === this._container) return this._container.scrollTop = 0, this._container.scrollLeft = 0, !1 } loaded() { return !this._styleDirty && !this._sourcesDirty && !!this.style && this.style.loaded() } _update(t) { return this.style ? (this._styleDirty = this._styleDirty || t, this._sourcesDirty = !0, this.triggerRepaint(), this) : this } _requestRenderFrame(t) { return this._update(), this._renderTaskQueue.add(t) } _cancelRenderFrame(t) { this._renderTaskQueue.remove(t); } _requestDomTask(t) { !this.isMoving() && this.loaded() ? t() : this._domRenderTaskQueue.add(t); } _render(e) { let i; const r = this.painter.context.extTimerQuery, o = t.exported.now(); this.listens("gpu-timing-frame") && (i = r.createQueryEXT(), r.beginQueryEXT(r.TIME_ELAPSED_EXT, i)); let n = this._updateAverageElevation(o); if (this.painter.context.setDirty(), this.painter.setBaseState(), this._renderTaskQueue.run(e), this._domRenderTaskQueue.run(e), this._removed) return; let s = !1; const a = this._isInitialLoad ? 0 : this._fadeDuration; if (this.style && this._styleDirty) { this._styleDirty = !1; const e = this.transform.zoom, i = t.exported.now(); this.style.zoomHistory.update(e, i); const r = new t.EvaluationParameters(e, { now: i, fadeDuration: a, zoomHistory: this.style.zoomHistory, transition: this.style.getTransition() }), o = r.crossFadingFactor(); 1 === o && o === this._crossFadingFactor || (s = !0, this._crossFadingFactor = o), this.style.update(r); } if (this.style && this.style.fog && this.style.fog.hasTransition() && (this.style._markersNeedUpdate = !0, this._sourcesDirty = !0), this.style && this._sourcesDirty && (this._sourcesDirty = !1, this.painter._updateFog(this.style), this._updateTerrain(), this.style._updateSources(this.transform)), this._placementDirty = this.style && this.style._updatePlacement(this.painter.transform, this.showCollisionBoxes, a, this._crossSourceCollisions), this.painter.render(this.style, { showTileBoundaries: this.showTileBoundaries, showTerrainWireframe: this.showTerrainWireframe, showOverdrawInspector: this._showOverdrawInspector, showQueryGeometry: !!this._showQueryGeometry, rotating: this.isRotating(), zooming: this.isZooming(), moving: this.isMoving(), fadeDuration: a, isInitialLoad: this._isInitialLoad, showPadding: this.showPadding, gpuTiming: !!this.listens("gpu-timing-layer"), speedIndexTiming: this.speedIndexTiming }), this.fire(new t.Event("render")), this.loaded() && !this._loaded && (this._loaded = !0, this.fire(new t.Event("load"))), this.style && (this.style.hasTransitions() || s) && (this._styleDirty = !0), this.style && !this._placementDirty && this.style._releaseSymbolFadeTiles(), this.listens("gpu-timing-frame")) { const e = t.exported.now() - o; r.endQueryEXT(r.TIME_ELAPSED_EXT, i), setTimeout((() => { const o = r.getQueryObjectEXT(i, r.QUERY_RESULT_EXT) / 1e6; r.deleteQueryEXT(i), this.fire(new t.Event("gpu-timing-frame", { cpuTime: e, gpuTime: o })); }), 50); } if (this.listens("gpu-timing-layer")) { const e = this.painter.collectGpuTimers(); setTimeout((() => { const i = this.painter.queryGpuTimers(e); this.fire(new t.Event("gpu-timing-layer", { layerTimes: i })); }), 50); } const l = this._sourcesDirty || this._styleDirty || this._placementDirty || n; if (l || this._repaint) this.triggerRepaint(); else { const e = !this.isMoving() && this.loaded(); if (e && (n = this._updateAverageElevation(o, !0)), n) this.triggerRepaint(); else if (this._triggerFrame(!1), e && (this.fire(new t.Event("idle")), this._isInitialLoad = !1, this.speedIndexTiming)) { const e = this._calculateSpeedIndex(); this.fire(new t.Event("speedindexcompleted", { speedIndex: e })), this.speedIndexTiming = !1; } } return !this._loaded || this._fullyLoaded || l || (this._fullyLoaded = !0, this._authenticate()), this } _updateAverageElevation(t, e = !1) { const i = t => (this.transform.averageElevation = t, this._update(!1), !0); if (!this.painter.averageElevationNeedsEasing()) return 0 !== this.transform.averageElevation && i(0); if ((e || t - this._averageElevationLastSampledAt > 500) && !this._averageElevation.isEasing(t)) { const e = this.transform.averageElevation; let r = this.transform.sampleAverageElevation(); isNaN(r) ? r = 0 : this._averageElevationLastSampledAt = t; const o = Math.abs(e - r); if (o > 1) this._averageElevation.easeTo(r, t, 300); else if (o > 1e-4) return this._averageElevation.jumpTo(r), i(r) } return !!this._averageElevation.isEasing(t) && i(this._averageElevation.getValue(t)) } _authenticate() { t.getMapSessionAPI(this._getMapId(), this._requestManager._skuToken, this._requestManager._customAccessToken, (e => { if (e && (e.message === t.AUTH_ERR_MSG || 401 === e.status)) { const e = this.painter.context.gl; t.storeAuthState(e, !1), this._logoControl instanceof class { constructor() { t.bindAll(["_updateLogo"], this), t.bindAll(["_updateCompact"], this); } onAdd(t) { this._map = t, this._container = n.create("div", "mapboxgl-ctrl"); const e = n.create("a", "mapboxgl-ctrl-logo"); return e.target = "_blank", e.rel = "noopener nofollow", e.href = "https://www.mapbox.com/", e.setAttribute("aria-label", this._map._getUIString("LogoControl.Title")), e.setAttribute("rel", "noopener nofollow"), this._container.appendChild(e), this._container.style.display = "none", this._map.on("sourcedata", this._updateLogo), this._updateLogo(), this._map.on("resize", this._updateCompact), this._updateCompact(), this._container } onRemove() { n.remove(this._container), this._map.off("sourcedata", this._updateLogo), this._map.off("resize", this._updateCompact); } getDefaultPosition() { return "bottom-left" } _updateLogo(t) { t && "metadata" !== t.sourceDataType || (this._container.style.display = this._logoRequired() ? "block" : "none"); } _logoRequired() { if (!this._map.style) return !0; const t = this._map.style._sourceCaches; if (0 === Object.entries(t).length) return !0; for (const e in t) { const i = t[e].getSource(); if (i.hasOwnProperty("mapbox_logo") && !i.mapbox_logo) return !1 } return !0 } _updateCompact() { const t = this._container.children; if (t.length) { const e = t[0]; this._map.getCanvasContainer().offsetWidth < 250 ? e.classList.add("mapboxgl-compact") : e.classList.remove("mapboxgl-compact"); } } } && this._logoControl._updateLogo(), e && e.clear(e.DEPTH_BUFFER_BIT | e.COLOR_BUFFER_BIT | e.STENCIL_BUFFER_BIT), this._silenceAuthErrors || this.fire(new t.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/"))); } })), t.postMapLoadEvent(this._getMapId(), this._requestManager._skuToken, this._requestManager._customAccessToken, (() => { })); } _updateTerrain() { this.painter.updateTerrain(this.style, this.isMoving() || this.isRotating() || this.isZooming()); } _calculateSpeedIndex() { const t = this.painter.canvasCopy(), e = this.painter.getCanvasCopiesAndTimestamps(); e.timeStamps.push(performance.now()); const i = this.painter.context.gl, r = i.createFramebuffer(); function o(t) { i.framebufferTexture2D(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, t, 0); const e = new Uint8Array(i.drawingBufferWidth * i.drawingBufferHeight * 4); return i.readPixels(0, 0, i.drawingBufferWidth, i.drawingBufferHeight, i.RGBA, i.UNSIGNED_BYTE, e), e } return i.bindFramebuffer(i.FRAMEBUFFER, r), this._canvasPixelComparison(o(t), e.canvasCopies.map(o), e.timeStamps) } _canvasPixelComparison(t, e, i) { let r = i[1] - i[0]; const o = t.length / 4; for (let n = 0; n < e.length; n++) { const s = e[n]; let a = 0; for (let e = 0; e < s.length; e += 4)s[e] === t[e] && s[e + 1] === t[e + 1] && s[e + 2] === t[e + 2] && s[e + 3] === t[e + 3] && (a += 1); r += (i[n + 2] - i[n + 1]) * (1 - a / o); } return r } remove() { this._hash && this._hash.remove(); for (const t of this._controls) t.onRemove(this); this._controls = [], this._frame && (this._frame.cancel(), this._frame = null), this._renderTaskQueue.clear(), this._domRenderTaskQueue.clear(), this.painter.destroy(), this.handlers.destroy(), delete this.handlers, this.setStyle(null), void 0 !== t.window && (t.window.removeEventListener("resize", this._onWindowResize, !1), t.window.removeEventListener("orientationchange", this._onWindowResize, !1), t.window.removeEventListener("online", this._onWindowOnline, !1)); const e = this.painter.context.gl.getExtension("WEBGL_lose_context"); e && e.loseContext(), gn(this._canvasContainer), gn(this._controlContainer), gn(this._missingCSSCanary), this._container.classList.remove("mapboxgl-map"), t.removeAuthState(this.painter.context.gl), this._removed = !0, this.fire(new t.Event("remove")); } triggerRepaint() { this._triggerFrame(!0); } _triggerFrame(e) { this._renderNextFrame = this._renderNextFrame || e, this.style && !this._frame && (this._frame = t.exported.frame((t => { const e = !!this._renderNextFrame; this._frame = null, this._renderNextFrame = null, e && this._render(t); }))); } _onWindowOnline() { this._update(); } _onWindowResize(t) { this._trackResize && this.resize({ originalEvent: t })._update(); } get showTileBoundaries() { return !!this._showTileBoundaries } set showTileBoundaries(t) { this._showTileBoundaries !== t && (this._showTileBoundaries = t, this._update()); } get showTerrainWireframe() { return !!this._showTerrainWireframe } set showTerrainWireframe(t) { this._showTerrainWireframe !== t && (this._showTerrainWireframe = t, this._update()); } get speedIndexTiming() { return !!this._speedIndexTiming } set speedIndexTiming(t) { this._speedIndexTiming !== t && (this._speedIndexTiming = t, this._update()); } get showPadding() { return !!this._showPadding } set showPadding(t) { this._showPadding !== t && (this._showPadding = t, this._update()); } get showCollisionBoxes() { return !!this._showCollisionBoxes } set showCollisionBoxes(t) { this._showCollisionBoxes !== t && (this._showCollisionBoxes = t, t ? this.style._generateCollisionBoxes() : this._update()); } get showOverdrawInspector() { return !!this._showOverdrawInspector } set showOverdrawInspector(t) { this._showOverdrawInspector !== t && (this._showOverdrawInspector = t, this._update()); } get repaint() { return !!this._repaint } set repaint(t) { this._repaint !== t && (this._repaint = t, this.triggerRepaint()); } get vertices() { return !!this._vertices } set vertices(t) { this._vertices = t, this._update(); } _setCacheLimits(e, i) { t.setCacheLimits(e, i); } get version() { return t.version } } function gn(t) { t.parentNode && t.parentNode.removeChild(t); } let vn = "http:"; function xn() { var t = document.createElement("div"); t.classList.add("mapbox-default-icon-path"), document.body.appendChild(t); var e = n.getStyle(t, "background-image") || n.getStyle(t, "backgroundImage"); return document.body.removeChild(t), null === e || 0 !== e.indexOf("url") ? "" : (e = e.replace(/^url\(["']?/, "").replace(/marker-icon\.png["']?\)$/, "")).replace(/^https?\:\/\//i, (vn || function () { let t = window.location.protocol; return ["http:", "https:"].indexOf(t) < 0 && (t = "http:"), t }()) + "//") } function yn(e, i) { if (e && i) { const r = { mapCrs: t.getCRSCode(), layers: [...i.layers || []], sources: { ...i.sources || {} } }; e.__base_style_ = JSON.parse(JSON.stringify(r)); } } const bn = { style: null, minZoom: 0, protocol: "http", attributionControl: !0, localIdeographFontFamily: "'Microsoft YaHei'", localIdeographFontWeight: 500, crs: t.CRS.EPSG3857 }; class wn extends li { constructor(e, i) { (e instanceof t.window.HTMLElement || i) && (e = t.extend({ element: e }, i)); const { iconIndex: r, hover: o = !1, iconUrl: s, iconSize: a, offset: l } = e; if (r) { const t = function (t, e) { let i, r; switch (t) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: r = [18, 27], i = [18 * (t - 1), e ? -161 : -134]; break; case "pass": r = [26, 40], i = [269, 210]; break; case "pass-1": case "pass-2": case "pass-3": case "pass-4": case "pass-5": r = [31, 42], i = [269, 42 * (parseInt(t.split("-")[1]) - 1)]; break; case "start": r = [25, 40], i = [200, -161]; break; case "end": r = [25, 40], i = [225, -161]; break; default: r = [18, 27], i = [181, -134]; }const o = n.create("div", "sfmap-default-div-icon"); return o.style.width = `${r[0]}px`, o.style.height = `${r[1]}px`, o.style.backgroundPosition = `${-i[0]}px ${-i[1]}px`, o.style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAACxMAAAsTAQCanBgAAG2aSURBVHja7b0JnFTFuT48LILBGBA1KgIqDGBE3L7rkoRoFoIajCKicfurV43oFY0at9wb0YiIaIgYEZUo7sEl4MLiEgUlihAVURYjiAsCwrAIDLMv9dXbXW9PneraT/V0z/Q583t+Pd19+ql6q956Tu1VUvGLo0oUOIJiDMX7FNsoCHt9n30O35cQQqxhw+nCZ8upsTGW7S7258t2Cw5v223tL1TbJfY7+5JrvFsb+v8pHhQ8v6T4F0UVxUaKKRT7wHcyh+1L8RrLLBPgvr4WTlEQnBZC1WpttyiwXunZkm3n7Pf2pUSwlGhL0Yvi5xSnUAyi6EfR3iBY51I0UhABqym6iQX2VIpyy4xDwP2nahyioDg1YtXqbdcU2KK0PYQvJYKVhWMpnmA1IyLBdoppFCdRtBF4vkexlb8fLu79w3yBPZmi3jHjEPC7kyXOUJCcErEqGtsTztxyFrFwHUgxRyFSKiyi+BEnWENEsRIEayMW2FKK7Z4Zh4Dfl3LOUNCcnFgVne0JZ244i1iszqGoEAXp8NsIGXwPIadPJuTkSen3EtGqp/gDE6wzxO8FwarGQjsrZsYhZnIOUdCcnGAVne0JZ244i1SsRvB9TgNuJeTq5wh55zNCautJ5KquI+StFYRc8TQhB2cL159ZH5dOsOZDxh1qkzFV144kDSs+Tb0a7h1g4qy+9f9I/eJFKT5Azd8mBeWsm/92kHgiKk8fkuKue/3V2Jw1f388Y7el/UbOyt+em7IZ+ar/Mi5WPMX48QiVR/AaN57ol6HyXebjEEcL/gFFKlYnshpSSlB+fjchH64mVtd7XxIyaEKWaI2kmKoQLBDFISBY42zEqrGyMq2S1OkM99+s44Tf4wVOgLwGMXDixAsKsi8nD3BY5I5jO4oBclkKlpYTbMQ0bFjzddPTTC8GWk6ZUMEF4cSJpyzf48QT/DLDSW1HToNoSTllPh7xK5a2cA88wETOIhSr3SnKUFig2VdWTpyujfT+X98XbfJRHEHxrCBk5RQX4bSGhboCVvvitGi1zixY7+o4sfCjo0Lmo6PE5mRxg1oMXBB3X06+RsQXtDi2AywKvhMnPPXhgnjyhQzSJK7tYhgGIdByoh9hPFFsDGnqZDuKt6vtKh8X/Uq0gecsQsGagIJy3HhCNu1QC9PqjYTMW0bv2Z793VebCTlmXEScZrL+rP4U51EMo9gNRyFBsDaZChg4BjqHhWBt0nHC70UhwaeXLyeIHsYL/s84sr7msslkOxaqTA3GLFhazkwhpfZCGgAMtUAjJ9YsMA0s8sfKdr5JZCH+Rk4UfsgbntcgLnrbWc1P/MzwQMjiVPk48DRu3pRVS5TEeVORiVVXikoUmdeWNwnQJ2sIuWd2VJSueyp933Pz5YI24+OIYDUysZLO7yqxfcri08WiQDS6dFqiIxsc14qTr8LzjubDmar5bd6UqQ1aCpaWEwRUdhmaRY02NTYUVbTdUBuyziPgUjSDnDn55rqmeWXNKdaA+GadD6fo47I8V/hBY5EJ1sUoMMMfjPryB5+lP4dXuEC8fnZnuoYFr7dNz65pNdDUOynaNByrCrvEdtKcg2CV23JCv5Wl41pxwhMQ4omObOgX03KKHJaCpeWEtEv1WQnNN4O4ajnxSnViUz6sJRjiapWeKLAWtSuz7Uz0wVbgQ/GKk0eq/lCDYCk5YwhWeZEJ1jMoLk8uzH4AX/JwujYFYgX3zF6UrnnBK4gWfAb38MJ179yIYL2nE6xlgQVrqYkTR92weWTRLFpqG0++ZmBwXCWnWBD4TmeDEDjHU9asceHENHRsYlvFE3ksaldGTsxvPq+x9hYnnvzII/honHyPIVhLi0ywPkVxWbFB3sybMictTsMnRkcCoXkItS2xebhodeS+Gop2KsF6NLBgParjBOfHggAZb1kYtJxYqxALg8FxlZw4vC0bJTMIlj6etDYh2mxRaLWcqT4soYYWx3Y+nyxrlXbxZGnI224hrFpO7A/FfMc+Jt88En1cFGysJUpqhY8WmWCVo7iUV0f7r/BzECQQJvgMP8eaFqCiOipYMMIojAzupRKsoYEFa6iOE5uB4AzYSWzRWazlxLghJz7NDf1iQ21td2gSWsUTm2+ZZifriA7JGdd2h85293hS7kye6dNUy4lNVsx3FBjDYIuSU/RxMc7IL/HVoUUmWClROWR0VHRAhFCcsC9LBbhP7McS7umpEqz2FF8EEqxVjE/JyfcziJcvZ6rWJnToppqa6tqbkdNDsPziqa9lWsUTa5ghbXd4QHnbbhgcsIonCjReBvHXcoo2860BDX+Ks8gEK7NAWZzNjhM9sRYFnewoXlDjgr4rmOYgXt9WZgnWHirBApxm06ENGWlowg3jlj6cpqrGq+DLyTflgMditvMwbmnOabYjkAbenMTTlhPzJxSnZX7nPZ58elr0hWo5VTYb+IcV4RysT1BYPl2vFizor4J+LBAo/AxHDUXRWvx1RKwqdH1YiAdirql6QLIaviA5Jbs1FI3tCWduOYtEsJ5GcXnsXblgQR8WCBPUrnAeFl/rEgXr/reiawZ1o4SIDhRveGYc/K6DxCEKklMiWEVje8KZW84iEawLUVyG3k+b9pzwQLMPPgexgtoUCBa8wqghdrhD5zs/Sgj9VyfeGxGsMTaCBehM8bFjxsH9nTUbpBUUp2YDv1Zvu2YDv6K0PYQvFalgdeFHCmctSQsPzKvCOVYoVDjvSgRMd8DrH4uyZrofZCtYgO4UKy0zDu7b12Jb24LgtNgiudXabrFFsld6tmTbOfu9famIt5UZjyIz8C5C1m9rEi2X67MyQo6+IyJYL+rCVRXcUou1ZptcNi/LN6fDARROnC3BdodDGJzTsyXbLtjv5UtFLFiwnnADCg1s0Lduq5tYwf1CUxB2azjQR7AAx2vWXcHngz1OzTFyepyeYhVPR1hzFrrtHqfmOKVnS7ZdYr+zLxX55n0n8Jv3wa4N81fZidW8len7habilaYwTQV3oiLzJvpmmI7TJ9Fs4+kBK8582h6CM47tjoJdcLYr7HfypWR7ZHKj2D814ilCZi6JzoKHa1sVIS99RMhFj0v7tSbZhGcqtF0oNgsZt5nvvPZwMiVnDMEyxtMDVpz5tD0EZxzbHQWr4GxX2O/kS8kBFCnRmqSa0Q79W7BJH+xGerB65vvrqnlXroIFGCVk3k1xM0zGGcNpreLpCSNnPm0PwRnHdg/BLijbNfZb+1IiWCnBaged5Y4n5iAWUHSyDcum0HajaGAZ18DexxWsfUXOAIKljacnjJwe8e0WyvYQnHFs9xCsgrJdY7+1LyVilUEninmOYrWSYk+X8GwL7tss894OlWE8Z0yHtYpnDGg582l7CM44tnsKdsHYbrDfypcSwYpgTyZCNmK1hcL5iDTbQnsHy7yx4ndwGQORXDyn7HtbTtt4xoCWM5+2h+CMY7vJ/kK33WC/lS8lgpWF/ux0Z51Y1bMj7EuCCha9dqLY9fOfHD4SMu+zgYeNpO+/R7EzRRtPwdJy+giWTTxdYcuZT9tDcMax3VGwCs52mf2uvpQIlhQXGARrNN4bRLDo1ZFiP4q+gL8P6HM2ZN5TA0rPws8oelN0dnCyvHI6CJUTZ0uw3VawfNKzJdvO2+/rS4lgKaE6tn4FRcfQgtWVy6S+323X7sDnDu37/+CV/5yip4OT5ZXTQbCcOFuC7Q6C5ZyeLdl2QbC8fCkRLCWOUQjWGfx9wZqE9NqFYi/21CllmdWH4gCKbhRdKNo6VuPzxunYHLTmbAm2uzQJXdOzJdsuEWxnX0oES4t3JKOCbWMJFhkdRabdP7rkCIrbKd6n2EZB2Ov77PMjXPsd8s45Wo9WbbuKL47to0tatu3M/li+lAiWDmcIgnWjeE9swaLoS/EayywTXkvdbwqoUDhHG0Wr9dpuECzv9GzJtjfZ7+9LiWDpsAt/4CpFn9CCdSpFuWXGIcpTv1M7RGFxqsWq9duuLrDFaXsIX0oEywTsfP9K9n0cwTqZot4x4xD1qd9nO0NhcmaLVfHYnnDmljMRLBF3MsGaLj163mEOHi9YpRTbPTMOsT3F0+QMhc05uohtTzhzw5kIFuhOezZv7fsU3UtHLr8BBKvv79fcz0Ztu7ER2U78XDlXwZoVM+MQMzmHKGzO0UVse8KZG84iFiw2IruPMAWkb89zZp4PgtX7ssU3id+xeW27ugrWoVYZ88hwQtYsTb/q7x1g5Jw6gpBVC9J8gFfGhuVc/nqYeCLGl6a5F70Qn/PNSU1229lv5px0XNpm5HvhxnjxFOPHI1QewWvceKJfhsp3mY9DHM38AxLBis5jQ7Rp37FfjzOnn9Oha2l/2fds2kgbF8EaZyVW1RXpXbjA6fT336zlhN/jBU6AvHoxcOPECwqyLycPcFjkjmM7igFy2QmWnhNsxDTc+EWT7Xox0HPKhCp1wmhFvHjK8j1OPMEv8QLbkVMvWnJOmY/zfoVpC/fAA0zkTASrPWvy9XUAzHXbDX5s0ReWDocm9kJtAXv3iei2gWbBelfLiYUfHRUyHx0lLifG7c30EeapuPty8jUivqDFsR1gLvhunPDUhwviyRcySJO4toth6IVAz4l+hPFEsdGnqZvtKN6utqt8XPQr0Qaes4ibhcL1HVbb2pdif9bs68PEqReblLsXWzbVDn/kIlibjAUMHAOdwyxYm7Sc8HtRSPDp5csJoofxgv8xrvqayyaj7VioUFDNgqXnRD6wF9IAoK8FmjmxZoFpYM4fO9v5JpFZ/M2cKPyQNzyvXlz0nFjzEz/TPxCyOVU+Djzby7Jridlx3pR0uvtBIVi/pHiboopiI8UUin1QsOyesvh0MReIRqdOS3RkvePacfJVeN7RfDhBAIADa4N2gqXnBAGVXfpmUaNVjQ1FFW3X14bs8wi45M0gd06+ua5uXtlzijUgvlnnwyn6uCzP5X7QmAhWFmAJTi+2jcwpFIMo+lG0l83D4j47lz/YgsNqim4l1pPm7AWr3JoT+q3sHNeOE56AEE90ZH2/mJ5T5LATLD0npB1wiM03vbjqOfGC+AIf1hL0cbVLTxRYc+3KzImiD7YCH4pXnDxS9YfqBUvN6S9Y5YlgZXAsxROsZiRb/Ax7ZU2jOImijcDzPYqtcN/kfxEybVHWIasPg2AtCyxYS42cOOqGzSNzs2ipdTz5moHecdWcYkHgO531QuAeT1mzxoUT09CtiW0XT+Qx167MnJjffF5j7S1OPPmRR/DROPnuL1hLkwmk5EDNljIqLKL4ESdYQ/C766elX//4YuT+jSBYjwYWrEe1nOD8WBAg4+0Kg54TaxViYdA7rpoTh7dlo2R6wdLHE2oTos3mQqvnhLQUa2hxbOfzya5WaceJacjbbhZWPSf2h2K+Yx+Tbx6JPi4KNtYSs2uFjxa5WJ1DUSEK0uG3ETL4HkJOn5w+aBXeK3Yf/YNssTT8bsbH0YNWQbCGBhasoVpObAaCM2AnsbmzWM+JcUNOfJrr+8WGWttu3yS0iyc23zCe2BEdkjOu7fad7e7xBG58r09TPSc2WTHfUWD0gy1qTtHHxTgjf7avDi1isRrB9zkNuJWQq58j5J3PCKmtF7os6wh5awUhVzwtPfLrz6yPK/X+wscJWb2FkLMfjtwzHwSrPcUXgQRrFeNTc/L9DOLlywlPQLFDF5xLXXszc7oLll889bVMu3hiDTOk7fYPKH/b9YMDdvFEgcZLL/56TtFmvjWg5k9zFqdYnchqSClBgbMHP1xtd/Lze18SMmhClmiNpJgK/y/+mpBvKwlZujbzHYjiEFyecppVhzZkpL4JN4xb+nCashqvgi8n35QDHvNs52Hc0pzTrEcg9by5iactJ+ZPKE67/M5/PPn0NPeF6jlVNuv5hxWpWO1OUcY338rKidO1sTx9yCrf5KM4guJZQcjKKS7CaQ2IB2KuqXpAshq+MDmzd2soHtsTztxyFo9gTUBBOW48IZt2qIVp9UZC5i2j92zP/u6rzYQcMy4iTjO503fOoxhGsRs/cRTRgeINz4x7I/X7bIcoTM5swSoe2xPO3HIWh1h15Tfme215kwB9soaQe2ZHRem6p9L3PTdfLmhCx3ojEyvlTHcenSk+dsy4j1O/U2+QVlic6g38Wr/t6g38itP2EL5UnIJ1MQrM8Aej4vPBZ+nP4RUuEK+f3ZmuYcHrbdOza1oNjYScFG0ajnXZIrk7xUrLjIP79rXY1rYwOM1bJLde281bJPulZ0u2vcl+f18qTsF6BsXlyYXZNaZLHk7XpkCs4J7Zi9I1L3gF0YLP4B5euO6dGxGs91wECzc3M6012+S0eVm+Oc1i5W67rcMWcnrGsd3G/kL3pTi2F69gfYrismKDvJk3ZU5anIZPjI4EQvMQalti83DR6sh9NRTtXAQLcLxm3RV8Ptg5w2w4XRPQNp5usOcsdNvtC6y77faCXZi2Z9vv7kvFKVjlKC7l1dH+K/wcBAmECT7Dz7GmBaiojgoWjDAKI4N7uQoWYKIi8yZ6Z5iO0ycBbePpDjvOfNoegjOO7W6CXXi2y+1386XiFKyUqBwyOio6IEIoTtiXpQLcJ/ZjCff09BGsLhSbhYzbHOm8dncyNae/YJnj6Q47znzaHoIzju1uglV4tsvtd/Ol4hSsrSgs4mx2uFCQQMCgkx3FC2pc0HcF0xzECyaJCoK1h49gAUYJmXdT7AyTcfo7rV08/WDmzKftITjj2O4u2IVlu9p+e18qTsH6BIXl0/VqwYL+KujHAoHCz3DUUBQtmNnOiVWFTx8WohtFA8u4BvY+rmDtm8UZX7D08fSDmdM9vt2C2R6CM47t7oJVWLar7bf3peIUrKdRXB57Vy5Y0IcFwgS1K5yHxde6RMG6/63omkHXUUIRb7PMeztYhvGc8RzWLp7+0HPm0/YQnHFs9xPswrFdb7+dLxWnYF2I4jL0fkIaOeGBZh98DmIFtSkQLHiFUUPscIfOd36UEPqvTrw3Ilhj4grWHSzzxorf2Zx2Ibt4Tun3lpy28YwBPWcebQ/CGcd2g/0Fb7vefjtfKk7B6sKPFM5akhYemFeFc6xQqHDelQiY7oCXsEkfzHQ/yEuw6LUTnBv2zQ0lIyHz1l5fMpIdkrgzHM3jKVhaTh/BsomnK6w582h7EM44trsJVuHZLrHf2ZeKdy3heBSZgXcRsn5bk2i5XJ+VEXL0HRHBetH2qHo+0zqy0y1Sx/FMO6vkbMi8f5xZcpZwCGJnByfLK6eDULlxtgDbbQXLKz1bsu2c/d6+VLyCBesJN6DQwAZ967a6iRXcLzQFYbeGA30EK3Io4q4dSw588ZySc+FVOFesp4OT5ZXTQbDcOFuA7Q6C5Z6eLdn2qGD5+VJx7zR6Ar95H+zaMH+VnVjNW5m+X2gqXmlzkKqq4O7Czg/bj50phqe0HkDRjaILO57apRqfN07H5qA9Zwuw3aVJ6JyeLdn2bMF296VkL/cbxf6pEU8RMnNJdBY8XNuqCHnpI0IuelzarzXJ6gxEzTlhsJHW7RTvU2xjpNvYe/j8CNd+h3xzOpyR1upstzi51ys9W7LtaL/AOUbBCZ8fLvpSsQsWS8NJqhnt0L8Fm/TBbqQHq2e+v66ad2UULIq+FK9ZnnoB9/W1MKggOC0Odmy1tlsc0+SVni3Zds5+F85/sr3HE8FqSsN20FnueGIOYgFFJ9uwxAJ7Kj9caQm4/1SNMQXFqRGrVm+7psAWpe0xOCvYTpiJWDWVn04U8xzTcSXFni7h8QGezG8o7wj43ckSYwqSUyJWRWN7wplbziI/SHVPJkI26beFotQ1PAyolJ3ISmJgOx+BQufkErnobE84U5y9A3CW+xS6Vn7yc3+LdK1nR9iX+ArWrJgZl9lAnjOkoDm5BC462xPOFOdLgThnJ4KVhQsMaTbatw8QfnSoTcaMeDi9DmjEw8Z7B5g4r/97euo+ri3668thOWE9U4h4Zs5buyvNPXtRfM5H5jbZbWm/kfP0idHN0sZMjxdPMX48QuURvMaNJ/qlR74fIvsO17edzu2SCXmOF8ziVsT50ESwsqA6tn4FRcc4gjXORqxwh0BwOsP9N+s44ff8DoXIaxADJ068Tp/oz8kDN9Q3FFgrToyfg2BpOcFGTEN+BbxBDLScMqHCDdrixFOW73HiCX7JHyWFnAbRknLyi3HFz0AIIZ7AD5D41bhEsLJwjCL9z+Dv8xGshboCJu69bCFY7+o4sfCjo0LtBR0tLifGDWoxcEHcfTn5GpFsC1hfTouC78QJhQmuR+ZGxduw46OV7WIYBiHQcqIfYTxRbAxp6mQ7ireF7Qv4z1DoRT+EGhUu6AXAg4UPj8O/E8GS4h3JqGDbuIK1yVTAwDHQOSwEa5OOE34vCgk6jC8niB7GC/7HuBpqLptMtmOhQke2ECwtJ/KBvZAGAEMt0MiJNQtMA4v8sbIdAQ8WC/E3cqLw4/YjyGsQFy0n1vzEzwwPhCxOuB98BUUV/UjMc/xMEudNiWBJcYaQTjeK9/gIltVTFjPTokA0unRaoiMbHNeKk28a8k9GH05wTlx5joXLQrC0nPiEFi9Ds6jRpsbGb+oP8TbUhqzzCLhQEOPmu7iPtwVvo01THX2S77owcDbqfJz3JVGoVX6QCJYUu/AHrlL0CSFY5YEFq9yWEzs0LRzXihNqKxBPdGRDv5iWU+SwFCwtJ6QdcIjNN4O4ajn5AyyBD2uXhrhapScKrEXtysiJog+2Ah+KV5w8UvWHGgRLyRlDsHYkgmXsfP9K9r2PYC0LLFhLTZw46obNI4tm0VLbePI1A4PjKjnFgsB3OhuEwDmesmaNCyemoWMT2yqeyGNRuzJyYn7zeY21tzjx5EcewUct832pSbBwkACbsAbBWpYIlhJ3sjSarlu/a7OOFAXr0cCC9aiOE5wfCwJkvGVh0HJirUIsDAbHVXLiFA7ZKJlBsLTxxHPZeJstCq2WE9JSrKHFsV3sr7GoVVpxYhrytlsIq5YT+0Mx31FkLPJoikmwZA8DVa2L4pFEsDIC1J5tePh9iu6lI5ffAGnU9/dr7mfb/XRjW/l04jdZdBGsoYEFa6iOE5uB4AjYSWzRWazlxLghJz7NDf1iQ21td2gSWsUTm28YT/EpHoIzru0One3O8QRufG9IUy0nNlkx31EADYMtSk5RsMQRbbHPjOcsdsFiW/nsI+wd1rfnOTPPhzTqfdnim8Tv2IaIu7oKVnuKLwIJ1irGp+QUT3wVT9vw4YSnttihC86rqb0ZOT0EyyuehlqmVTyxhhnSdocHlLfthsEBq3iiiIiHIFhwrjIJFt+Jr+GHuLVPBCu6ASKiTfuO/XqcOf2cDl1L+8u+Z/uNtXERLMBpNh3a4LyGJtwwzpDTVNV4FXw5eQcDHovZzsO4auxptiOQBt6cxNOWE/MnFKdlfuc9nnx6WvSF8pynqOImCi1OeVD46GnJ0pxMU7CnQpRUgE0Sd7PZqy4TDvfmgZhrqh6QGFOQnJKEKBrbE86gnJOT/bCyDgb5Dqtt7UuxP2v29WHi1Ivt5roX22+/ne3mmjLB6kDxhmfGwe86SByiIDklCVE0tiecueVMRgndoBCsX1K8TVFFsZENkuwjChagM8XHjhkH93fWGFRQnJrEa/W2axyuKG0P4UuJYCkBS3B6sW1koPk9iO3U2l42D4v77FzFxN7VFN1kAXV32IQL7tvXwqiC4LRQ/FZru4XDeaVnS7ads7+bI+c+yRbJSsE6luIJVjNS7Us2jeIkijYCz/cotsJ9k/9FyDPvE/LYu5HfPqwquKUWa802uWxelm9Oh2qqE2dLsN3B4ZzTsyXbLthfqilkiI2iLyV9WJl0PFCzpYwKiyh+xOXDkMwg1zRCjhhDyCffRNNfV3CP16zlgs8Hu2aYDadHQlnF0xHWnIVuu8cT0ik9W7LtEvtNnMfHXVrSSsXqHLbPfSTNDr+NkMH3EHL65PRBq/BesfvoH2SLpQ+j9z++IHrQqqngTlRk3kTfDNNxxqiSGuPpASvOfNoegjOO7Y6CXXC2K+x38qVErMgIXuQH3ErI1c8R8s5nhNTWR+ewVdcR8tYKQq54Wnrk159ZH1fq/Zufpo8HG//PyD3zTYW2C8VmgXgz33ntYaCSM4ZgGePpASvOfNoegjOO7Y6CVXC2K+yXcW5inyeCFU27E/lDPODswQ9X2538/N6XhAyakCVaIymmwv+nPkDIyrJ0PxZXwx1iU3BHCaQ3xc0wGWeATj9tPD1h5Myn7SE449juIdgFZbvG/psFzj+q0qmIxWp3irLMpFva7CsrJ07XxvJ0LYpv8vVPH2b7rGSHjYtk0xpkgBGUBvbDBvY+rmDtK3IGECxtPD1h5PSIb7dQtofgjGO7h2AVlO0a+/e19aUiFqwJKCjHjSdk0w61MMFSMVjShIvy+eurzYQcM056QAycvnMeW5Wym2ziqA5vM7K3Q2UYzxlwWFUZzxjQcubT9hCccWz3FOyCsd1gP27v+y9dGhWpWHXlN+Z7bXl0bew9s6OidN1T8u3W8ZrxcdbgRn+bme463MHIxspmqjpO3ceZrRlO2fe2nLbxjAEtZz5tD8EZx3aT/YVuu8F+PKji9kSwstLsYhSY4Q9GxQd3CcFF6SBeP7szXcOC19umZ9e0GhoJOSnaNBxre1S9KEY7wfYP/a77BjrDSL9r145ke93sDCusPQVLy+kjWDbx9FgyYMWZT9tDcMax3VGwCs52xX5OjHP9lYzzf3S+VKSC9QyKy5MLs2tMlzycrk2BWPH7wMEriBZ8BvfwwnVv9GCP95wEi14d2SLF1KrqHmdOOxuIevzmH2cJe9l0dnCyvHI6CJUTZ0uw3VawfNKzJdsu7Dag4HzuTJ0vFalgfYrismKDvJk3ZU5anIYLO2hA8xBqW2LzcNHqyH01FO1cBCuyt03bjrse2PPsF8+FV2F7iJ4OTubEablo0prTQbCCcvrYnov0tBQsZ9sLPd9tdwKg1+4yTtjPydeXmgN5EqzMnvjl1fJj8ECQ+MN9+ZqWuP8+XDDCKIwM7uXUJKTXLmwbiP3Y1hC42dYBbJvTLmyXQZdqvDWn7SpvW07H5mAwTh/bc5GeDk0iJ9sLPd+dti7JgS+1UsFKicoho7NPQUJxMux4m7WZI/RjCff0tBIsoTMTjpQezvbBXsoWLuICxqXsc/i+o2tHqU8YqniaLpcwShwvLk7BwtA4incYFk0ir/zwyXffPHfJ91zmOaZnHDscEKQMBhasrSgs4mx23LEVa1HQyY7iBTUu6LviTyjH69vKLMHaw6WGBVtA/I5iveUixvXs/vYORnuHYfuEaQl25DoMh2H9FpPnBiR25F6wPsFwP12vFizor4J+LDzIA6c84Gf8tfjriC0VLn1YB8DR256bmsHvDrAwOHYYJsFqKXbkO4yWmOcaJHZY2hFTsJ7G8GD7F5lgQR8WCBPUrnAeFl/rEgXr/reiawZtRwkPpvgm5rax8PuDNcYGC0MlWC3NjiQMtzxXILHD0o4AgnUhhjX0fkIaJYd0gFhBbQoEC15h1BA73KHznR8lhP6rE++NxH+MjWDBxmhfx0woBPB0V2y+loSRhBErDMXGi4kdFnYEEqwu/EjhrCXRE8yhnwqFCuddiRg+sUmw/rEoa6b7QSbBgglxbwZKKMSbwo6CSRhJGMHC4Ap5YoelHYFFazyGM/AuQtZvaxItl+uzMkKOviMS5xdtjvk6P3BCIc7nDEzCSMIIFgZX0BM7LO3IwXrCDRgObNC3bqubWMH9QlMQdms40CRYbW33s9Yc1a3b/7qtTRhw/hu0f/kJZVCttDhrzjsMeIX2tMXZe9Zh9FccT29xDp+THdgfIMIQjpMdj8yNPjEhP0LZAWf9qWzAfo5QdoC/8n4FPhAyz4EL4sv7lWUZMYahKnMONqXCyJFoncBv3ge7NsxfZSdW81am7xfieqXNQaq/sCl4/Cm4DoJF2KkZxjD4UQN+JiwUGAvn8gpDNkM3bhhigcfL8gRlqzDQiWWXRThWYfCdopBuofNDtXJfXEQb1w4QEplf4VB7iDB4X+LTysIGbRiqMifmjYUf/zyHHfA3ZsX7KUJmLonOgodrWxUhL31EyEWPS+M4yfbk5wkuzushWBNMYYyZ3vRkwhoVFAp8usPTOBdh8A5hUXOYYJNWvLM5Col1GJgfhmPZvcM4fWJ2vEPnh6qmggU+VH5g/vJ2hMxzPp+RD+2wzHdpGLoyh/EHn7b04wk5nuYwSWUf9G/BJn2wG+nB6jR4XTXvSiZY/7YpHJAgmAmOgrXQFAYUAGyeycK2CM8YBjgOPPEemSt/Olo4ljEMseB5CJZVGLh1h2M+WIeBNUNREMEGzZHtXmkls0vMozhh4MXXCh3EZKFt+RDTCnza13d1ZQ5r12INEWuSivAW5liw2kFnuWcf2wKKTtanTJuOS4KEh0SADHcQEPFopE0+xqCYWDiwcxhgDxZMcAyLZo51GOC82HxyKBzWYWBNh19cinkUIgyMP6QPv2A1ZBiqZq5l89w6DPQhEEMU3JB5rioTDvZkhaErc6qHCbYgFOFtbIZzCTtRzHMs49C/tqdLeCX8JvK2TRFHwapzCUN8yls6Vp2PHXhh1TpEGPhkxeq5Qw3OKgxIC91WtCHSCuMsrqh36PtxznMUYct0sg4DmrcyO0LlB/qpKBRY47EQLG0YYpnzFMi6ZjpIdU+HQaktLmdR8oJVlWPBqnQJQyz0Fv0lzmEAJzyhsPbD92vFCYMvHJhGjoJlDGME2/gMwsG0AW4s8Ba1UWMYvGDxYaBtIcJwqB3ECgPzGNIH8oS3LVSe8wMFfC3O0iZtGIEEq7IZT37uzy3QVqGeDTaU+AjWuhwLFvCvtb0fmyMOYoVhrPNpdmK/iUUHtjEMvnCAAwHwMyjkFp283nagyFsUEGMYqqZ4yDBkeeCQ31ZhYHzFkU0MzzB1wtoO/gGLFz5A4qZVIMFa14yCBbjAYPNo3+1xSlzanZ6CBfyv5VCsMAyjHSAY4lPVoa/BGIbpChFGgD4gYxhYoMVaYcgwZE1cy/4x6zAC9C9Z2wF+BeEAoMaITUULUdSGIdqA4qjq5Fc8eOc1s2ABVMfWr+C32/ERrLE5FizgH2MrVpZD2rIwxtrEXZwb41BrsApDBN9BbiHC1naIjqnqjPUJQ1XY8HOL+UVjbf3KszkYK61C5jn2U4phONQatWGIZQ6nUeC6PdlAiSyMPAjWMQqbzoizASH86OgcC9bRpjD4iZCQ4NicQlj0NRjD4OfLYKby/TIWjnW0S1p5TJtwtkPWv2QRjjEMvl8m12nl6VNB8tyiL84YBl9DRD7HASNtGLL04R+C/Gg3XIqycnQeBIs/Kk2c2R9LsACLcuRcizjDFpmaIKrLEJ5VGOKsZyLZEiNEGDEEyzoMvumcKztk/TK5SCtMH8uR2kwYnNN75bnFaGdsv7IQdqMdsjKHtVLxUjQ/F+V4DpYOZwhxuTHuFs/4wyG2/SSWEwcRQzjDhpjmeqlgCM8qDD4sEEgoKPBq2VfmFIbMNotaYsHZAenOz/XKRRgO6RMJg3P6ITbNTkwrgOXEVGc7kB/SzLKMGO1QlTmcCG2RN0PyKFi79OcOXKXoE0qwImeNBcIzEuOebYYwnknCaN1hSApGYoelHc0sWHzn+1f9Axyiwf+4s+tOBIYZrJ0lxiVhJGHEDkPi+IkdlnbkQbDuZPGZ3l9/CpKzYOGkr60xEwp+/wONgcHC0GyR3KLsSMJwy3MFEjss7cilYNGrPTsp+/sU3UtHLr8B4tT392vuZ+dEdmPnSnbiT+f2FawSNgO1xjOhamy2sggRRn/zIRQtwo58h9ES81yDxA5LO0ILFjsDch/h0Nm+Pc+ZmdqYsPdli28Sv2Mnae8aV7AAwz3W/8H9Qx0M9Q6jv/0xXwVvR67DcHhCtpg8NyCxo3kPVZWeGo6Ak7N7nDn9nA5dS/vLvmcH1baJK1iAkY6JdZmHsc5huHba5doO37Ry7XTMlR0tMc8tkNjR/ILVnjX5+joATtfezel0bsMND1gm1AMxDLYOw3eUIZd2+KSV7yhJLuyIk+f9/5SfPLdEwftuodgRF8L1HVbb2pdif9bs68PEqRfFfhR7UXSmaCc5QT2WYHWgeN+QUPB9hxiZbh1GDMHKmR0+aRVDsILbESfPYwhWrDy3RMH7bqHYkeNRQr0AyQXrlxRvs10sYL+wKRT72AgWjlrUKhIKPu8fwGBjGKr4OYSTEzv6Zx+C6WSHR3gHh7TDN8994++SH3ELQ659tzXZkQPBgiU4vdgAwikUgyj6UbSX+T/32bn9uYMtOKym6GabYKp9rScENHiCZs/rkriCxcIKbodLWoWYOBfaDp88jxt/GzsCFHIrOwL5b17tyJdYKfznWIonWM1IFl/YK2saxUn9o2c/Ar7HT+l44z+EvPdl5LcP2yZWT7YzorhTYs+ABivDCChYwe1wSauAghXMDp88DyhYXnnuCG0Ygfw3r3bkU7C4dDhQs6WMbi3lj7h0zCxPevRdQp55n5C5n0a3enZJsKeFwP4eMMO1YYQSLBZeVhg5qBJb2xEj3CB2+OR5KMFS2RGwkBvtCOi/ebGjQMTqHIoKUZAOv42QwfcQcvrk9EGr8F4xFeMP4mLpLzYRcsFj6XMOuXurXRJrkBDQoBwIljSMwIKVFUYOBMvajhjhBrHDJ88DC5ZznntAGUZA/82LHQUgViP4PqcBtxJy9XOEvPMZIbX10d0kqusIeWsFIVc8LT3y68+sjyv1ftm69MnQDY2Re+a7JNZO3F7N29n70IIlDSOwYGWFkQPBsrYjRrhB7PDJ88CC5ZznHlCGEdB/82JHnsXqRH5yK5w9+OFqu5OfoW9q0IQs0YJ5Z1P7s/MMr3wm0iQEURzimmCvsh+/Klu8aDtblZ+7YROGr2CpLj4M1T0BCryVHR7zXILa4ZPn4rC053wdPv+d8twT0jDi+K7Ef5vdjji+G1Osdqcoy2z6SJt9ZeXE6dpYnj5klW/yURwh2dWlnOIi22kNmZmsB42q/QsQ0Nfx9P1O4uLFuIKlCiOwYAW1wyWtAgtWEDt88jykYPnkucdcH2UYoQQrn3bkSbAyo5bHjSdk0w798XOwRxjulMpfX20m5JhxEXGayU3lOI9iGMVuVhNH6bULW10Ns1T7ll6+FE67IPDKrQPqQdHFZT2QkOlOYXgKVs7s8E0rT8EKbkdLzHPLwp3YkTux6spvzPfa8uhBK/fMjorSdU/JzwPFa8bHEcFq1M1d0yVUF3HtT/fTnhze/5aGbfsOe+I0ybqgnh6Z7hyGh2Dl1A7ftPIQrJzY0RLz3KKQJ3bkVrAuRoEZ/mBUfPCAEtz2HMTrZ3ema1jwetv07JoWdKyfdJ/doRkmZS91WMi4l0emO4fhIVg5tcM3rTwEKyd2hMjzil8cZYVQeW5ZKyl43823HTEEK7Mz6pMLs2tMlzycrk2BWOGe91DzglcQLfjskoejwnVvdNvq95Rpr3GsErY4cTdWJd2fS7w+bCFjd4o9KHaO0Q+QhJHHMELkuaNgFXV+XDgrinymVQzB+hTFZcUGeTNvypy0OA0X9uqH5iHUtsTm4aLVWXt6tbMWLIrBFA9RfE5Rx/A5+2xwieYSCoM3D3+ZeGw7eV3iYyjkzWpXrtJHFCxfu0L6T1y7fLl8BIsKTkeKX1E8SLGEYisFYa9L2OfwfUdfwaL/d6T4FcWDFEsotlIQ9rqEfQ7fd2xGwSpHcSmvlh8UDILEH2DC17QAFdVRwYIRRmFkcC8bwSqlmMsSRAe4pw/8RlEInHg0hSnhyTGPb74rUFD+E5oLQYVmJ4prKDYwgTKhjN3fwVawKHaiuIZig0XcAWXs/g7NIFgpUTlkdFR0QIRQnEyH7eLxbnw/lnBPT5NgDaTYbJk4hN07UOIgCU8R8EgKWEHZFZqLE6s+FIsshUoE/K4fx5VJPyHeIOaLHOLNA37XL8eClVmgLM5mhwsFCQTstulN4gU1Lui7gmkO4vVtZZZg7aETrD5cVdMFW/mnUsJTXDycWBWUXaG5OIE5kmIzL0JXv743eXLp5WRJ2ctkU+WXpKJ2C1m/YwVZtP4F8ujHvyX/8+quomjB749UCRb9/0hRZCtPP5HU/PVOUv/v+aRx/Tekcft20rhmNal/5y1SM/52Uvnrn8qE98gcCtYnKCyfrlcLFvRXQT8WHlqLUx7wM/5a/HVErCpMfVjzPNUcMI9L7ISniHg4wSoou0JzMXHpzZp2KeG55OWOZNZnt5PahirtbO4dtZvJE0suIxfNaiM2EUtFwaKvvVnTLh2PEwaS2r8/SkhNjTaMxu3bSM2EcaRi0NFiE7E0R4KVWYT92LtywYI+LBAmqF3hPCy+1iUK1v1vRdcM6kYJf6rLvJq/P55un+oz+DgVT/VfxpHGzZvSCVtZSepefzUIT83fJnnx8GhY8zVpWPGpd3zEq/rW//OKT9W1I1NxwUuTRur40LBll8I+JQ/EBdPZEBdrHt/8En0POIArxUm5JZzHsYL/0xhiFeFiYtWe4gMUnCv/uTtZ9e27TstQFq6dSkWuAy9awNeeE334/4NMrerUX5KG5Uucwqif8xqpOP7HvA3A1z4HgnUhisvQ+2lecHGAZh98DmIFtSkQLHiFUUPscIfOd36UEPqvTrw3IlhjdII1ySRWFoJ1n4yn8vQhKQeDwggFvH7xohSXxnmteKAQwlX523OdeHhAQdQUaCNP7YvTMiKFgHj6xAcKHwBsq5v/dpqX/u/CA2HzccG8U6S1kicSF5ZGrvmV4qH5BQAePq1seUTfi/gA5YFXeC+k+X1MsORpfeJAUvf8s6SxYkcKdc8/IxbwLC4mWFfwNatV3y4Q+l/KyOdblhoFZf6ax8Xm4VWcYF3B16wali8lPlfda7NFO67KgWB14UcKZzFdhXlVOMcKhQrnXYmA6Q54/WNR1kz3g3SCtUxXIPEpaRCspTKe1FOWOS1+Bhdwu/CAMIHYocNj7UZTAJaq7BJrIwbBUvJAfFIFmwmET/rwceHTCNJHwam1SxQeiKNrfPhaFYiBT36hTbzQgcCAGNvwyHxPzHNZugEPEyypbXXTn84u4NOeVsaJiRWM7K1DkXl51Z1ZHP/87Aky9u3TUv9X1VWkxIsHCBpeDy0+jxcs4O0AI3sU6zL2P/NEtMlH06Fy+ImZB37qYX3xOdT2O6SiVXPHLbwd63IxckhFZTyKDOyssH5bk2i5XJ/RpDn6johgvaidUqLqmMSCiM5j0VFp7OAEBzY8sbU8UICgMOGT1ic+qSc11CIYh0GwlDx8Ey4lfPS9poal5MH0xVqjoRlmlc7IqamBqu2i8cCmO8ZJI8hSHpmYGNI6wiPzPZkfSsR0KxMsqW1Qq5L1/6jixATrFBSYa+f0JHUNTf1JH6x9PSVWf114Cfm/uT9J/Q+fiaOD8HmmNla1VmwaDqVhnZLxz7NOpg5QGxWgyfelBAqbw/ggqvrT/6bsB/D+07hpo1hzHEpys55wAwoNbNAH+1e5XHC/0BSE3RoONAlWnY3zGwpJrYkHa1sGodHypPp6oEAxwYH3rjyZJhc0KyiXQbCUPBAHFCksoBqhUfJkBIs1d/G9olZjTGdsjmlqM1bpg00un3QWm/C8KLvweAhWLROsugCCVcsEazKKy4sr/hT57Yuf3JcRq9+91jv1/zfbv4jcA5/xggXXpA+G84I1mYY1OWPz4w9lPQjxQQICBT4Gr1DjSr1SIUN/jPSn/ulG3pbJOep8P4HfvA92bYAdQm2ueSvT9wtNxSuNk3apMWsDCNZaHQ8UaHRgTS3EyCPWkjRNHikPNisg87EfBKApkFbxQYfSFEglT6Y2xKWLpjZijA/WYjU2KXngN7wIoPC4pnNWpzvrF3NNHw/BWssES57WQlMr9fupjynjxATrQxSXL7a+Jy18WMvCi28OQlNRFKx/fT2FF6zFNKwPM3n/6fLIvVW/vzwtVOwBBO9BrPDhAv9j2kSaui/P4G1ZnMMpDjeK/VMjniJk5pLoLHi4tlUR8tJHhFz0uLRfa5LVKgNqzMwAgjVDxYMFyEKslDxYOxP7RDQFQMojy1jDk18ZHxQ9yz4jZfqgiPLNN41tM0z5BU4MaeWTzh5NOWV8+H447AvT1EC1+cWnEwoxiqvQhzWDCZY8jWgzCfqxGsu3p2pW8L+m030GE6wtKC419ZVZtSdZ80/XJEwJ2tZ/899voWFtyYhwdbSUQz8VCBYORECNCvwMhRq+k/r0f5bxtmzJ8UTSSaoZ7dC/BZv0wW6kB6tnvr+umnclE6xLAwjWpTIeKIQ4rA2OlRlNU/etyHnYkx5HrzBOkIEuPI61ImN8sMljMZqmjI8jl9Eug3A62WVonmrjg01KfnRYU+uT8vC+h6IHvJA22IcoPAQvZYJ1aUX8aQ2XMsFKCctlr3w3SxSgBrV8wwLy9pcvpO7BDnb8H/u5xBHEjRWfRwQtE+ZJx8lH/qhPgFDxD1h4D7UrAJQDvg8rVea+WSvWRnMpWO2gs9zxxBzEAopO1us4qTHfjUxWcxesMsaRxaOq0SgKgJJHNq9H87TW8jgIllN8NIXaGB/LeVhWdhkExskuQ63IKX00Ym70H+k8rGzOFA8TLGPeW6zL+y4TrHIQlYtntyONjQ1ZgpXq2/rkvkxNCjvdUaRAwEDU+Gtt+VJesCpoWOWpcH95DDUsGgaIPYgS1LSg8x37r3DwCdIIm4h8vjV8sYq3p6IZziXsRDHPUaxWUuzpEh7OATk3Ruaey80uTniKiIebQ1RQdoXkooKyCsUFakb8BUIEn6NIQRMRxQtqXSBaDy+6IdUhH1mGsuElXrC+pOGtytSQv1mbXbtiHewgTpkBJ2wmUhHDvtiI0M2fx9vzZTMdpLonEyEbsdpC4TwTn1+8OskjYydJFpwmPEXAI1n8XFB2heKigjINxeWdNY9ldbbD5yBI8Crr24LvQND469lPruMFC/rbpmX6IF+blT2SCc102hJAwYJaF7YOUMiyWjEP/pW3aWYznvzcnzvZR4V6doR9SRzBakfxikPGzoLfSJwk4SkCHolgFZRdHNdLcbjYtjApcRm/cHBEFGAEEGpU8Arfi00/fhY8Th5taKwj177Rgxesa9i2MOnBhRuuyJrSkGlmU3FKjWqz2lXqvdB3la5e1ZPKM3/N//aaZhQswAUGwRrte8ya6HSdKBZYZOwCdq9qDyInHs1eRglPjnl8812BgvKfEFxUUHpQ1KHAfLZlfkaI4D3Mu4L/p358u3ZrGRSzt1ZP5j8H3h403B783LGGZR9HmoRicw873vnRw0gzctbzvF3A26OZBatEc2z9CoqOoQQLsCfFV5qM/ZLdU6JyOOYoVjwWW/gmPDnk8c13DQrKf0JwUVGZiiLzx7f6k5r6ikyne2TOlGRZDgKuzZVfkSte68oL1lQu3aZmalL/fQYh1VV2awepoPFLdho3fEMqhw7ibZua4xFCFY5RCNYZcQ7iVTndoRQ1koytYd+VmByOOYqWxzaSCU/ueHzz3YCC8p+4XGwrmCoUmgnvDSF1DdVOy1C21Wwgo+YN4MUK+A4QdmutyjQN//dqQmprnMJo/HYLqbr4LN424DsgT4IFeEcyKtg2F4IFuEWSubeI91k4ipTHNaIJT254fPPdAgXlP3G5qLiM4Jt4t8//MdlQsdJugS9tRt44t1RsJo6Q7Ic1ItJndeVvSaOkOSidKEqbkZXnDRNtG9EM2yXrcIYgWDf6HCRsK1jfodjIGb+RfebqcFIeD2dLeHLA45vvFigo/wnBRQXmUV50YBHz08uvJut3ZHd8N9I/mNH+4IdniZv3AaZodhx9VJydXzPpbtL49VeSKlVjakZ79Zg/ipv3AaY00wnQOuzCH7hK0SeXgiU+kUbJ7vF4so3yTZyEJzyPb7571LLy7j9xudhWM2/IOtVh5O+uBT8n931wGrnj3WPJlf/cQ9UBD7/voBEs2GrmDemqiDN/Taqv/R9SfcsNpOrqEaRy2GBVn9wbzXEYhYVg8Z3vX8m+Dy1YA7hEGBDD4SI8MZwt4QnM45vvligo/wnBRUWmM8VCz0Mo4HedLQ6h6Eyx0HPSK/yuc3OIlaVg3ckEa7risNgSl+PJbJxuHVv9XuLrcNwK+rVxEwjjU0A8LdouTb6v1eW7AwrKf0JwUaHZk2Klo1itZL+zPeYLRjZXOorVStuR01wJFr3aU3yP4vtwyGvpyOU3gGD1/f2a++n7nuxA2K4UnSja5EKw5jLEdbg5wBPA2eYWGE8h2jUngGDN0eW7A5rVf2yOgEcum3sNI4dlDucSlopiZRAsHDm0XROZs0MnbNKbXm0p9mGnUmfQ85yZ54Ng9b5s8U3idxS9KXYNLVhjKcYFcLgUT4ACmfCYee4IIFjafHdAs/qPpWCluOIIFhOtgRS1BrGqZfeVeAgWnq1Ya7GB5sDmFitBsLpKBKlvm/Yd+/U4c/o5HbqW9pd9T9EHa1regkUjMJjiIYrPKeoYPmefDbZ1OBOPQ6IkPDni8c13HfLpPxrx0XL5CBYTrVEGwRqlEitLwSphAxY6wRqVD7ESBKs9a/L1dUApxW7wY5uHRyoc4YNSirkWK63n4hClwggnHk1iJDw55vHNdwXy7j8h4uQoWHAE2BKFWC1hx9rHFSw4AmyJQqzg853yJVipWk/0+g6rbe1LsT9r9vVh4tSLYj+KvSg6U7TDH/kI1kCKzQ572cC9AyXOlvAUAY/EmQrCrhBxchQswBCFYA3RiZWDYAGGKARrSD7FylZolAIkF6xfUrxNUUWxkWIKxT68YMGTZavHboFb+SdcwlNcPJyDFYxdoeLkKFiAjwSx+sgkVo6CBfhIEKuP8ilWBsGCJTi92DYyp1AMouhH0V72QOA+O5c/2ILDaopueNM8z+1NAfO4QBOeIuLhnKxg7AoVJw/BulwQrMtzIFiXC4J1eQEK1rEUT7CakSxtYa+saRQnUbQReL6HDxk4wOLhdwh5ZH7ktw/DTT/VZd4jc9OrAAwZfJyKZ8z0psMVK6rTx1SH4Pnry348PFZvTB+d7Rsf8br+737xGfFwOi54adJIyQNhyy6FfUoeiAt/GKZvfvE8vvkl+h5wVFQ3Hdgp4TyOOf5PY4hVhMtBsPamaGBi1cjehxasvSkamFg1wvt8CxYnOAdqtpRRYRHFjzjBGoLfba0kZMbHhNz4fOT+jdoTL9BhLATrPhnPz+9KOxgURijgcHx1akfGl+PxQCGE6/SJbjw8Zi/SFmgjz3Pzm0QKAfH0iQ8UPgDYNm9Zmhf+d+GBsPm4YN4p0lrJw8cF08g1vwCQXwDg4dPKlkf0Pd4HgAde4b2Q5vcxx5fG6YgxhDz17/TTG/DkQkIOu00bJxfBAixmgvWxjVh5CBZgMROsj12mheRYrM6hqBDT8HCatoPvoeV0cvqg1cNvU+4++gdxsTT85pwphEx6K3rQKty0TFcg8SlpEKylMh54yqLT4mdwPTffjQeECcQOHR5rN5oCsFRll1gbMQiWkgfiA2mDAuGTPnxc+DSC9FFwau0ShQfi6BofvlYFYuCTX2gTL3QgMCDGNjwy3xPzXJZujEfp0yBQ4vXEAm2cTCNiogA9xATriRwK1kNMsJ6A96qrGcVqBN/nNOBWQq5+jpB3qO/V1kfTurqOkLdWEHLF09Ijv/7M+rhS719dlha7CW9E7plfouqYxIKIzmPRUWns4AQHNjyxtTxQgKAw4ZPWJz7AAQUBOQyCpeThm3BwwXtNDUvJg+mLtUZDM8wqnZFTUwNV8kA8sOmOcdIIspRHJiaGtI7wyHxP5ocSMd3KBEtqW7lkCytoemjiZBIsfhnKvmc8WnI7CNaZj5fcTd/3oNibDfHv7CtYYhj/+fFht4NgrRx4WFYYzS1YNH1OZDWkdNm6m5APV9vt3fXel4QMmpCV5iMppsL/pz5AyMoyQp55P/MdiOKQEjaBzuj8hkJSa+LB2pZBaLQ8wAFOj4ID7115sMkFBQK4DIKl5IE4oEhhAdUIjZIH0xebu/heUasxpjM2xzS1Gav0wSaXTzqLTXhelF14PASrlglWXQDBqtUIlnQZyknjS34HgkVfr5JMkoQ5SZ1sBUsVxpz/Ouh3IFj0VRlGcwgWTZvdKcr4JlxZudN+g2RjefqQVb7JR3EExbNCXpRTXITTGtYGEKy1Oh4o0OjAmlqIkUesJWmaPFIebFZAwcF+EICmQFrFB2smmgKp5MH05dNFUxsxxgdrsRqblDzwG14EUHhc01nsdMd+Mdf08RCstUywpHGa8k52oXnobW2cVIK1h2zmdqeuJT84fnTJhfCqmNndy0GwpGHs3XGnH7x0eL8L4VUVRjMJ1gRMq+PG0/zdoRYm7A7gB3Pw+mozIceMi6T7TO70nfMohlHsxk8cnRlAsGaoeLAAWYiVkgdrZ2KfiKYASHnQFsuRNG18UPQs+4yU6YMiyjffNLbNMOUXOAaklU86ezTllPHh++GwL0xTA9XmF59OKMQorkIf1gzm2NI4QQc79GNtr0rXrAyd7jM0grUTm7Htugyls4NgeYeRa8Gi6dKV35jvteXRsnTP7Gj5uu4pffmD0UAu3RuZWClnul8aQLAulfFAIcRhbXAs7JvQ9K1IefBJj6NXGCcYSXLhcawVGeODTR6L0TRlfBy5jHYZhNPJLkPzVBsfbFLyo8OaWp+Uh/c9FD3ghbTBPkThIXgpc+xL+8ef1nCpRR8WLEPZXbEM5QC2tu77rA+qrW3/UnOEEVOwLsZ0Gv5gVHzQ9zDPQbx+dmf6QQqvt03Prmk1NBJyUrRpOFaZNvTL7/JtUQ/BKmMcWTwqRVUUACWPbF6P5mmt5XEQLKf4aAq1MT6W87Cs7DIIjJNdhlqRU/poxNzoP7J5WBJO5CmxyXsDMlymUUKfy1GwchJGTMF6RjfyesnD6bwDscIpRFDO4BVECz67RPCze6OVj/d0goXT4X0z91zOkISniHiE5RQFYVeoOPlu4VsMoOnyKabVig3ySsmUOWlxGi60pqB5CLUtsTKzaHXkvhqKdjrBKjFNtFRgksSYhKcIeCT9CwVhV4g4xdlzvEgEq1w28sq3VkCQQJj4VgzWtHDqDH/BCKOQD3uZBKsdxSsOGTtLpoIJT3HwSASrIOySxOmlOLYlAiUVrFR6HTI6KjogQihOpn5Uft4h9mMJ9/Q0CRagE8UCi4xdwO5VGeTEo0mYhCfHPL75rkDe/SdEnBLBMgpWZmKuOJsd+xyxFnXb9CbxghrXJQ9nT7qG69vs+XB72AgWYE92JI8qY79k92gz1JbHInESnhzy+Oa7Bnn1nxBxSgTL6HOfYNp9ul4tWNBfBf1YOFkcpzzgZ/y1+OtIflTY9GHxOJR1fIkZW8O+s8pQE49DAiU8OeLxzXcD8uY/IeKUCJYxX57G9HvsXblgQR8WCBPUrnAeFl/rEgXr/ugi5/mmUUIZbpFk7i2uGari8UikhCcHPL75boG8+E+IOCWCZcyTCzH9ht4Pp1w3XbgkDMQKalMgWPAKo4bY4Q6d7/woIfRfnXhvJE/G+AjWd4RNuDayz1wdTsrjkUgJTw54fPPdAnnxnxBxSgTLmCdd+JHCWUualmDhHCsUKpx3JWL4xCbB+seirJnuB/kIlvhEGuWboSJPjIRKeALz+Oa7Ry2rWfwnRJwSwbLKk/GYjgPvImT9tuiWQLbXZ2WEHH1HRLBe1E6qNWTYAI5oQAyHi/DESKSEJzCPb75botn9J0ScomcYHplCZWqNH30ddFTqf/q6N329imI2xWr6XTV9rWb/z2bfBdkRtOIXRx1BAdvKvE+xje2HtY29h8+PyINgwXrCDZiWsEHfuq1uYgX3C01B2K3hwDiCBVjHrYL3fgLhivwACbWuwHhatF2afF+ry3cHNKv/WMbJ2raUODGxYuhMxeov9LMqClKZEo8jCf2s6X/2Of0M7rkbfuMpVH0pXrM8+Rnu69vMonUCv3kf7Nowf5WdWM1bmb5faCpeaVy2ZJFpcxniOhzs9zw3QCLNLTCeQrRrTgDBmqPLdwc0q/9YxsnatkzNKv16SOUvjvycF6qIQDUJVeZzds/n8FtHsTqVotxSrBBw/6nNLFo3Zq0jfYqQmUuy9x/bVkXISx8RctHjdqsefAVrLMW4AA6X4nE4Kl11qnCKx/Woc9v4+PL4HuWeo/jcEUCwtPnugJz6j6dgWdvW1CQ88iAqQFsrmUhlxGpQtnCJ31emv6O/Paq/pVidTFHvKFYI+N3JzSxayiVQ0L8Fm/TBbqQHq+fBva6ad+UkWNTwjhS/oniQnTC7lSXKVvb+QfZ9xxjtc+swdAU+VBge8Ud42ZGXTtPRJRkEEKRYKLSDPRWC1ZViJd/k45uBWTWuQUc1IVrTAo6uBn8qpdjuKVYI+H1pMwoWLGd60XOhuXY1R5ZgKZ78O1FcQ7HBMoHK2P0dHAq6dxi2Bb4l2JFvwYqFIhgNYx3sd0f6qzI1qiPFpp8U6d9mfnO3wZ9mxRQrxMxmPpewk8dZkCttVnOYBKsPxSLPRILf9bMo5HHD6GMSrBZiR78AI0jHUNxPsYKihmEF++xoB8H6IcVDFCspahlWss9+WKyCRUVmPyoytRWcSFVG/pf3W0VqYZnaVkq4gGs/RV4eGkisEAOaUbBwCdRKS7HaQuFcCxTF6kiKzTETCX5/pKaABQtDJVgtzQ5PoepC8YxFGHBPF41g7UoxlYIYAPd8t/hqWEfeJIoQL1yVg44hNWNvJvWvzCT1s14k1ddfGRExXri4fq6bFHk6LrBg3ZyHk5/7s9OddWJVz46wL4kjWL1ZcyVEQpXJ2tBJGPZhGMRqd4pPHMKAe/eUCFZnisUWYoWAe3cvsibhm5XZgpMWLvpZw5tvZA3Z1z35SNa9TQKWEro3Ffm6MLBgvZsHwQJcYBCs0b59mChW7Sk+CJxYwNeeywzrMKr/cBWpHHZ8TsNoDjt8w7AQrJkeYbwqEaznHcQK8UKRNQnLoiN+Tai56Tr5JKPGBlL137+RTW9AjjJFvm4K7Feb8iRYJZpj61dQdIwrWFcETijEVVxmWIVRM34MIQ0NpOGrL0jlmSfZhHGlaxjNYUecMAxi9asYYfyKE6yfeYgV4qdFJFgNMrGCmlLdP6YqJ0bW/uWO7GZh02ujIm9D+1RjHgXrGIVgnRFnlLiEjVaty1EhXMf4rcKofeAe+nRqWvvd+M06UnnesKBhNIcdccKwEKxnpUI/9mbS8PGHpH7Re6kaqiKMZznBeiyGYD1WRE3CikifFIfaR/+mFKya0X+MjBDyQkc/r1DkbXlgnyrPo2AB3pGMCraNK1inWBn/y2NI1dWXkuoxfyRVl53vkmhDbcKoffyhTGbXvzMvJVYp0dq8iVT99mxTGKc42XHlb0n1rX8gVSP+X3A7AJXnnpriR1QO/YV1GBaC9U1WE/p/rxb2m21Q2fYNJ1hfxxCsr4tIsFZUKqYqVJ9/OiF1tdktwi2bSeVJP5NOeWA1rhWKvF0WWLCW5lmwzhAE68a48/AgkSabDK+64AzS8EV0kVD9on+TymGDbRJtsjaMQUeTuuefaeqwfOkf9LNjSOU5p5DGsvR2ho3bt5OqkRf6h2GyY/gJ8e3gUPfqzOjT9u6xtg422UKwssN74bnsJsnfJkrD4ASrIYZg1RdRk/Cp6LSEaOd7qh9ra9Oq34Z1a+gD/QLpzPfKppnvTyny9tHAgvVongVrF/7AVYo+IQTrQ63RvzqWNK7/Rlrtrf/wfZtEW6wMg9Z26l6Z0VTIpj6aErCKEwemayq0Odi4sSz9ZVUlqb5upHsYiCHHkcYNcjsalixOh+trhyggb7wSFawJ42wdbLGFYH2b1Ry8584sm6pv+r2M/1tOsMpjCNb2IhKss7jRvaaRvkFNc6/AX6t/N4JUXf7fpJL6tGwmvFBDO1WRt0MDC9bQPAsW3/n+VYiVDpBIW7Sd4HeN1q66rvqfC0yJtkUVRv2b/+RqBPexGtcxpGHZx7QZNShTK2r8dgu7qUbVP7PFaMf42/V2XHWJtx0BBWuLhWC9lfW7wT8kdS9T4a+vp4HVkNqnH1cJ8FucYL0fQ7A+KJom4aCjOlDBWSedWxWZwc6JmrgYOrpQei19ba/IWxiB/iKQWK1yGXnOoWDdyQRruvToecfDX40jE7qRkFRhvOvW4B3QqVrPl5+TytN/le7feug+LrzR0tEQox3Tn9bbYS8quRQsYiFYF6trwz8hFScM1PFfzAnWDTEE6/qiWprziyPPk82rEl+zRhIHRZuD7PU8Q/6eFsgPhzXz0hwUoPYU36P4PkX30pHLbwDB6vv7NffT9z0pulF0pehE0cZHsLQjE7VT7tcWdEXTg8cOVRipKQyaq3HN16n5WFD7ShX8ieOdw8jY8dhkvR23/Z/JjgrbUZwYgrXDQrB2plju4cDwm505wYIJoJs8xKosM3m0OJqEuLXMM/xynCwhkkwslQjXM5ZTVx6IKVYPNOPCZxSqthT7UPTl0fOcmeeDYPW+bPFN4ncUvSl2dRWsVdqO6gt/k5oIJxWU7dtI5a9/alM1XSXvBD+d1E59LAuZPrI3XycVx/84I1g+YVjZsaOcVJ5iHMn7UhcGjAbWf7Awhcat30b5N3xDGj79JAXDyOQqS4c+jAmorQPDvYdJJo6e6iFYpxbZxFEUrE70dYHYHJTWrLgpEFxfFvy2k2X+wvSZNzzF6g2XxfsBBaurRJD6tmnfsV+PM6ef06FraX/Z9xR9sKZlK1jTjFMOHvxrdimvq7WpXRHGP821SQgjbdApnwrfLFjT7OyIzvPK2HHz9Var37VhHP+j1HQM3VX7xEPGtHKY7f5rttDZxAn3/FqzlvAmB7H6Y1Hu1tC0id+elamF5fLFzfJ+rRQ+reSXRtnlb2eKjx3FCu7v3JzpIzQFeypESYVSit1ca1jXWC2XueGKVCd5w9KPUh28VZeca5uI15jCyIwQorA89Uik09hCsK6xtQPmkkFNJ1WDW/COzRwv+zB+dSxNn8VSsaqb9rRVGI5OPdyw0Rt8N9xit4a/WIjVX4pyexncw71pT/fuVJC+FmtZFcJWM00jikd9TdHdc4F7d4qVlv4J9+2bh73dS4TrO6y2tS/F/qzZ14eJUy+K/Sj2ouhM0c6nD6sHRV2OZm/XMX5tGKlO9q++SM0dkgG+0wiWVRiRvrP7xqf7rdTTJLzDqDz556Rh5X+iYvXySzbTJlJheDj1ZRrOyyy3l2lD8aRGrJ5k9xSlYGGzkO2NBa8D6OvW7G2So6OE9POtFAPiNUlTG/qZ1hhuas4N+3SCxdYJ/oriQYol3LH2W9n7B9n3HUWlc1lLODVHgjWVS3hlGDAz2HTB1IY4YchmhsOM9JB2ZERr2PGk4fPPWD/cPzNNW9swPJx6ooTvr44b+HWgeEciVu+w74p3Az9OsDLiNeion6QPolBs2AcHUAw66thAp+YcrxkJh88H5/G4L8ROFNfwJ+kYUMbud+pvQ8ECFa8KLFbA10d4UhREGNDZD3OWYP6SZRgHuIZRedrx6Wbu8T92tsPDoTtRfMXxwf+dPHYc7U1RyYlVJfusqHccbTre68hIbYv+f31WM7CpdnUt3Buu81/6UAJMLIAzCmEG+yLPLZLhd/1cBQswIrCYXCFJ9NBhXOkVBhWRxjWrbcMYkQ87YjYNL4uxRfIETrAmJFskYw2LF6tMLasd/WyhZP7VQvraLrBgdZFsGLm5uTvZJWJ1JMVmXoTg+K7bZhPyr5WErN2aPi3nS9qIeuM/hNw8g5CjxmaJFvz+SFfBCrmWaYom4YOFodlx1BhG3aznC8aOQA69K6upVcP/MQSrFydYvRLBOirTjxU5ULXp/WBxzhX7LPW7sFMsjhol+M5NeRar3qxplxKew28jZPK/CKmu03fvbK0k5NZZWafolNlsmSwKVpz5H1bzQEKGoREsYxjVt9xQMHb4OIvsolxvwvIb2XeOh1AsY0gOoeBEiuu/ir5P7c+faRp+yPd3BRasbhQNzHfgtVsexao9xQcoOD++k5DFXxOna/ZSQg67LSJawNfe9RCKzjG2al1oU0UNEYbFIRTaMHCtYr7t8HUY7tqVDRP3XH3sEU8B2NAxzDruwmYgWwkWvXaG31SMKnkOwObIpJZQFPEhFELNqqkvK/PdoKOu4jrcr2qaCnFkDuJz1NvMf97Oc+3qCr5m9dEatTBVVBOyabv8OzhYVWgeXuVzzNeeDvM/+HkgezokvHcYDsd8FbwdMQWrCz8Rb0xpj8EAYXJeNxvBYvNmUr95/7KSGylu4Dhg/kzbou505zvfs+dm9eOW3/TjRc512N6iFn0H86Gxxpp07sSqA8U6FJkp7zQJEAjTB59FRem26en75i2Ti9Yfno8I1jrdyKHuVOJSh4MWynzmgfiE4XqQaq7t8E2ruAepsqsNqwXty0SllE3Sg8l6PSj2YDOQbQTrO6xWdoDAA9zfK+YaVmYOVtM8rEw/Fvu8TWpe1qCjtv9fr+5tcyRYO0Ft+vOfHD4S/OizgYeNZIuMd+YXETeTYJ2CAjNoAiG19Vwzb1H6c6xRgUjB+3tmE/KzO7PFDK4N27OahkN9BAswkKLWUADh+4ExqrjWYcQ4+TlndvikVYiTn12vUFzFIFJZgjWoaaSQiVBb9qDoxh4Ufbf87L+WUSznlpzAA2NPio4xBasja+Knart/H9DnbPClpwaUniUsIu7cjII1GcVl0lvZzT/4/Ln5TWKFNSt8P3xi+nv+uvq5iGBN9hUs2ciEiFEx2+RWYajiF2OEJYgdrmnlG/8E+R0lxFe2nKSXuC5uwVEHj3r/mINvUayZ2zWGYEUWFX+3XbsDnzu07/+DVyGMns0oWB+iuCxdm11jgtrVlDnp76FWxfdRgVhBbeu6p6K/mf5h5L7FcQQLNhVboiiA8PlOAQTLGEYAwcqJHa5plQhWS1xLGKldtWNr5GwX+ELTepeYTcJd2MDKfqz2hrwHsFqefHAld4K1BcWFn8KwemNaiADQNITmH3wGgHvhM/hfdi1ZGz0VOo5gAYYoCuGQAKMexjB0cXMMK7gdLmkVN/4J8gvugj6j77JN6npyC3yxObg/N0rbPmSneyE02VFYjhybXbOCph5898ka/Qz3T4RRxTXfRr+PK1iAj4QC+FGIAmcTRijBYuFlhREw/s52JEKQoKWBCko5iMqAWwlpaMyuLaEgAaC2hX1XIGbQJISaF/R18dfKsohg7QghWJcLhfDyHAiWNIzAgpUVRg4Ey9qOpAAkaIGCtQrFZc23asGCviq+tgXCBX1alzycLVhzP40I1qoQgrU3N8u2kb0PLVjSMAILVlYYORAsazuSAlDY6HUTKemNGMW9H0X2pq9X0fez6f+r6Ws1fa2mn62mr7N7pb/bO5BAHEExhuJ9im2sUG9j7+Hzw5tZsKahuLz4kVywsNMdalVQy0Lhgj4sqGWJfVl//mdEsKaFEKwSdtQV7mxYkgPBkoYRUrBYmJkwchB/JzsSUSh8wUL0Tr92pq9/oa9V9JVQcSKpV/n/VfT1bviNpzD0pXjNcteDf7rsehBTsK7BcH/7ZFR4sIMdRApEC95DTQuEC2e8Y3MxsxV6AyG/uDtiyzWhBOshVgifwM98Ov6EmbvGMHwKvO7iw4jTgamIv5MdiSgUNrBmlcJN5BD6+nkvTpQy/0vQC4WL/gZ+6ygKp2JfkQMqKIY1g2D1oKjDcHENIYgTNvlAoOBVFVf4Dq/nPoh8B7w9vARLOLJn3//8+LDboRCuHHjY3Wxi3N5snsjOvoLlEkYMwcqZHT5plQhWCxKsUZma1UEUW3kxEiF+FxEu+lv62t9SEE6mqPfcXwp+d3IziNZUDPPX9xFSVZsWH7FDna9R8cAm4bqthPwoOldrqvNaQtWRPXP+66DfQSGkr1dJ5pvszxbK2gqWdxgOglXwdiSiUPg1LCo0Xenryqxa1KimZmAvyXe9xJpWmqOrxZYt2z3FClFus1VLTMEqpajCMC/7OyE19W67NWzeQcjQ+yPxBr4+PoK1h2wS3N4dd/rBS4f3uxBeFZPkejkUdO8wHASr4O1IRKEF1LBGkbt5UcqqVYnilF274oXsboMQvBRTrBCzm6GWNYIP89wphHy12U6soBl54r1ZcTZuZKkSrJ349UsOR/Z0dijo3mE4CFbB25GIQsEL1n5UaGqlzb1RQj+WRri472sp9lMIwCGBxApxaDOI1qN8mLCIedyrhHyxSXIuA5vRft20rM37AFYbWWrPumcr+HdXHNlzAJvl+33Wd9PWsw/LKwyMby7DaA47mqvgUQcJAs/w21KcQfECxTcUDez1eYrT2feF2iS8SWjWRWpYfehn1z5HyLRFhDz7PiH//ai001383U2Kwj8usGCNa6atZt6QhQ8jfxc+TshVzxJyPk2XgXcp4/mG7WEUWsHyPbLHpaD7huEiWIVsh+dUCjhu7FaKWQzwf3cPwfoOxdUU71B8S7GDYjHFGIrvBxIsOMDjvYYPFpHqq35PKn/4E1LR+0D6eiypueY60vBh6hzH9yj2L1DBelNVYyqleHlpdk1i0pvRWpbkt28qCv+CwIL172aa5tCZYqFnHOF31tM+sgSruY7siRMGH9dchdFcdniK1YwdZw+dW37ZhSnsOGvoXPhMd66hRHwOofgcquYKbKM4KaZg9SJ1dRtqbr6VVJ1+Fql74UXSuKEs3TzYsIHUTX+BVJT+gNT86TY4xWh9IYoWFZcyvunHN/+go1l2wXKVE/7aVMPqJc7TGkXKFL60KbBgbWoGsULsSbHSMX5wv9OJ2DKxyvmRPQHC6GMSrBZiRz8Pwbp1x29+PXfHJedFQT+D7ywFaz+KMo1YIWoojvMULGjmvVfzhz+SmlvH0FLcIC/d9fWk5pbRadEiqRpBQTUPqdg0qKYyPDpf3al800vyqQ7ss0aFPzUGFizSjIKFI4dlDg9u55FMMcCsI3s8oD2yJ2QYKsFqaXY4CtasHeedPnfHBb+J4vzTQbBmWwrWPyzECrGCor2HYJ3V8P4HpOqMs5u0acYsUnXCSaSi38Gp1/pZszOiBTWthkUfwrszC6yGVSHUjjLCc+8ctWBBv43YJOQErEK3qDggdjSzYAEGUtQa4lXL7iuJI1i9HdTRSz2TMOI/aVKCdebJtBl4ShT0M0vB2pOiXhCldyl+SDGAYqpEtAZ5CNZL1b+7hjYDX0oV4LqXZpKKPgdlof6V19LfP/8iqbnmevj35QIbJVyhmqrwS2F74MxkyR3p0TKpYKWblysUhX9pYMFalgfBAowyxGuUTZeOTrAiR/YEQuTIHpcwLn1KO6IQJIzmsMM3DFOTsGLIT+dWDDs+CvjMrkn4K4kg9eS+70CxVvj+Bg/B+gY61qGvCq5UzUoiWFUnDU33aa1fTyp/dBz8u7bAalhP9c7ug8qIF/RjbaloEquvtxBy6gP6JTvAqSj8UwL71SN5Eqz2bKBJFqclrN83lmBdEbrtLB7ZYxvGqJfSnZarNhLy87utwrjSNYzmsCNOGDad7hUnDJxbcdJxacD/9p3upwhiVE2xk9BkfE+4Z4yHYNVXHDiAVkHSazYqDjpUKlgVhxyRLun0vtT99HcFJlhnidMUegnTHA6iaXTWQ4Sc9kB6moPs3l5RoTtVUfiHBvapoXkSLMAQRZyG2A6aqQQrcmRPYKxj/FZh3PVaenIZvwuhZDZsrDCaw444YViKVvcY0xr6S2pYf6Jow74/jaJR+P4CD8Ha7FTDovfB/fTaWGCC1YFiXe9R6rlV4jwr2f9c7Wotfd+eqA8nXRXIn76wrbXnSLAAHwlx+ki8x0ewTrFJANhdECZ/wSzVM/7mpvI2YfCnb8z5T9PGYBvL01Vsw+9PcbEDlhBc8xwhwx8Mbwfg+L+m+RE/HJf/J6JQg1ouEa3/ULwvEasq1u/lKlgzqq+8mtS/NFPfh/Xyq+nvX3gxNS+r0Pqw2LYy5/XWNfFGZa8h7CXpqGfidR6xPEIrJk5rpjlYOlwuxOnyEII12WT8SfeltzDlr3c/t+5nmqwLAwrFkwubeJ9+Ly0qg+8h5Jtt6c+2VRFy9sP+YZjsOPbP8e3g8cLiaBh/mmntZJObSbCGSIRJhVGe0xrObvj3+6TqzHNo9alRP0rY0JAeJfxgEbw7u+C2l0lvMfMMX7PKiJAoUKOyl+1w3z1jKQIPxBSryc2VPgbB2puigcWpkb2PLVgf6oz//24nZO1W+dDtwi+sEm+xKgwQpue5wv23t9OF5Igx6e+hObiBHchYWUvIxU+4h4H4r9vTW1nIrg++kq5tcg4DMXNJlP/WWdaOttjSSfqxXR+3M8D/fR1nul9vIVbPUbSLMQ9rcc2oP6XnYakuKlapeVg335rKikKbh9W7afO+ThQLeKGKCJQJo8gC+rtOcZe7WMB6mUszCFYJKzcQr49l3/sI1hZdAvzxRf2q69+Ym4dbVGG8wh1dfffrTSIGK7lxjxyoFcE2FHDB9hWXPuUWBuLmGXo7znvE346AgrXFUqy+PWosIT+5Kw34Hz7TTURVLM25SlPTepyff+U5072U1NWV1dx0S6qmBc1DGA2EDnZ4hWYgzIBPiVV9fVnq/kLewG8U2ZO+X8GLlWw/LMkUiE8p9nQUgs6skLuI1ccuy1yaSbAeYnF7Qva96xK1ElMiPL5AX9BB0HIwO5d8Rt33p+PT7ye8YQzPOEOYb3bKLgdRyaVgEQsHmQbHK0FznMeRY/V7YWsWNP9BIlYvijWrGGsJe1N8BM1DmJcFUxdgNBBeYW0hawZ+xO4r5A38sKbVneLrrL4r1S6ko1L3dvcUg24Oy13gvn3ycCCFKECRjSz7XvPV7RC/vr9fk7WRpa9gaWfX3jNHX9BHPm2ebasKY9RLem7YWwcKI9S+4Lr9ZfcwEPe9qQ/r2n9YbT9bnmPB2mHhINuOGZfuyOdxTLpjv9xRsDqxeVczObH6jKILxT4Bd2uA0SrobJ4l7NYwi33evhDFiu/D6hV9HQA7iIriJBkVhB1KBwTYKG+jwW825nrDPpNgqTayPODi+b+DONLXWJtl8oKlHUY9eZL87DG4tlZmmiM6rFKFMWQiIQ+9nQ28oMkIM4ZRsHzCsLGjvDpT4HX4UhcGjAbOX5UGP5EQt4Fdti4Nw8jkKhvBgtrUUQJYDctGsGD6whkUc9hawb9S7EtRzgTrZxTj2f9LKUZ6Ls1pVafmRA6jSNe6fpI5iEIiWPAdxbGBROF4TSsCPj8+j0d+oWBJN7Jsv+s+P9jvvFcvhNc4m2XygjXN9OSHI3jEC5YkWNSuCOOf5tokhJE26M+C9xaCZRWGOM8L7bjyGat4zdSFcejo9HQM3XX/W+a0smkSHkpF/Ijbo4DPLJuEuPSmgeK/KTqzz++geI39DwI1nKKO3Tu92AWLByda10u3Qk7jWrg3oDBMVPjMxHymDydYOd0skxesa2xEBI7zgRrPh6sJmf4hIafZz2G6xhQGjhDi+8n/io7aWQjWNbZ2wFwyqOnA9dYKqzle1mHAiOqi1XKxemKBXRi2ne4DRqdFCgD/O3S6f8NEqJ7VtLD2BE3Awez/thS/pqhl95YVq2BhHxbfLOTet6NYKJlAupD+3w5+G1AYukgW28N2NF3ynUbNuZFl1pE9gVHH+LVhwAVLcf7yuhyrNmoFyyoMHmNfSfNppkl4h3H0HYQs/yYqViDwB1uGYem8fVhtbxvDNNPm/ZxgHcN2YMA+q0qKD1g/1hNsIfRW7vuv+C1mirGG1UveJMTXwb2yJ48Oxu8D12ZuFnzmj4WQRiEu17WEU3MkWFNlxwKJ2LTD7oSNOGHwwI3XYEZ6SDsQMFCwYkNTPxw2bW3DaIaJo+3Y5NH7KBZSbGBNRBCoTRQfUjzMmoUdAnS6t/xzCbNPfuYnlS7iRg0/5Pu9AgvWvtxETHjtVmz5wW+8VRVYrCJH9hRSGNDZD6fNHjLaOowDXMP4yZ/TzdzDbnO3oxXu6d6im4S9hKPqs/q1RpGruM72q/h7ctBn9A7zmX8V46Eg/ByKEYHF5ArTsUABcKVPGCAiX262DmNEPuxIBKvgluZkjRhy3/XjOt778bWvOPv3yy7uoIrb4zStWoNgZR3ZEwNTbI8FihOGZsdRYxjC8dh5tSM5TqvARwlHCU3Am7I64tuweVnbux53a1v++4CCBaNwu/a7bv2V4Df9rl37P6zjGk4rb1OsghVnDZPVWqaQYWgEyxgGbGFbKHYkwtAypjVgzYqNbu1G0Y3NI+rb+3/rlvX6Q91ybrgeZnXvSdExpmB15KcL9Dhz2tngOz1+89yZ3PSA3q7TA1qLYDXLkT0hwrA4hEIbBq5VzLcdiSi0nImjUMuiVzsUKR7dL1kyqsely29RzDfaNYZg7c5zte2464E9z37x3DbtO/YTwuhZrILVLEf2xAnD4ZivgrcjEYUW0iSMCtb+DpMjYQ7SLjGbhPD7vVhNq5TjPYDV8rrgnKZiFaxmObLHJwzX7SlybYdvWvlur5GgIOYbQZ/Rd9kEyJ7c5EhsDu7P1tV1YYuBlU1C3U4HuZzP1BoFy+nInhjDtE7HAvnsp5NLO3yPN0oEK4Hl9ixaFPO0Bu8jewJkmPWxQL4Zlis7fI83SgQrgaVgdaQYzkall7INGwl7Xco+h+87JoJleWRPgAyzPhYohmDlxA7f440SwUpgECzwJdiaZb1lV8N6dn/7Yhcs7ZE9ATPM6ligOAU+F3b4Hm+UCFYCjWAdQPFvz9Hnf/MrM4pVsJRH9gTOMOOxQHELvCyMHDictR1JoU0ES8DBFN/EnN8Hvz+42AVLemRP4AwzHgsUQLCywsiBYFnbkRTaRLA4dKf4OtAKCuDpXsyCJT2yJ3CGGY8FCiBYWWHkQLCs7UgKbSJYDG0o3gy8RhX42hSrYEmP7MlBlVh7LFCIAs+HkcNOUys7kkKbCBbD+Tna4un8YhasrCN7fCavCavPnY4Fsi3wuosPI84kPEX8nexICm0iWBRtPVZLuKyqaFsUguVyZI+vYLkeC+QpWDmzw/d4o0SwEnCC9YsciRXi561asHJ9ZA+7vMNwEKyCtyMptIlgUUzIsWBNaO2CldMje9jlHYaDYBW8HUmhTQQrxpwr651BWrtg5fTIHm5DMq8wHASr4O3IuxOMLskvEsEqYaff5FKwNrYawRIdqDmO7EnCcD/eKBGsVi1Y9TkWrLpWLVj0dTDFQxSfU9QxfM4+G2y9xUVMngyfgcd2lNA1PppCnje7fOLjIFh6HnshsufJlV0tS7CqcixYla1VsEop5lIQA+CePkqHc+VRO2zCk2se33yXo7D8p+UI1rocC9a61ihYAyk2WzgJYnPqN9nOlvAUA0+2WBWWXS1LsOblWLDmtTbBgqfdVgcnQWyNPOESnuLiGV2g/tPyBGtsjgVrbGsTrHkeToKYxzlcwlNMPKML1H9anmAdnWPBOro1CdZPtY7w5iSSuvTOcpyS54UbCdleluaoriBk0QtheF4Z68fDY+MXhKxZ6h8f8Zo6wi8+jwxPxwUvdRqpeSBs2SW3T80DccF01sfFnsc3v0TfAw7gggu4szmPa8FrCRflSKwWtaq1hDSTJxnFyixY90l5xpemHQwKIxTwVQvSXGrnteOBQgjXpOPceHhAQVQXaDPPu080iRQC4ukTHyh8ALBt+etpXvjfhQfC5uOCeSdPazUPHxdMI9f8AkB+AYCHTytbHtH3eB8AHniF99E0v68FC9aQHAnWkNYmWMu0BRKfknrBWirlgacsOi1+Bhdwu/CAMIHYocNj7UZdAJYq7RJrI3rBUvNAfCBtUCB80oePC59GkD5yTr1dovBAHF3jw9eqQAx88gtt4oUOBAbE2IZH5ntinsvSDXha9n5YzwQWq2da3X5Yyk5OLIjoPOZOT3NnKTiw/omt54ECBIUJn7Q+8QEOKAjIoRcsNQ/fhIML3qtrWGoeTF+sNeqbYXbpjJzqGqiaB+KBTXeMk1qQ5TwyMdGndZRH5nsyP8wW060tXLA6B9y1YWVrPKi3hE3GMzu/vpDUGnmwtqUXGj0PcIDTo+DAe1cebHJBgQAuvWCpeSAOKFJYQNVCo+bB9MXmLr6X12rM6YzNMXVtxi59sMnlk85iE54XZRced8GqbQVbJPen2BpTrOD3P2iVWyTTTF4bQLDWanmgQKMDq2shZh6xlqRu8sh5sFkBBQf7QQDqAmkXH6yZqAukmgfTl08XdW3EHB+sxaptUvPAb3gRQOFxTWex0x37xVzTx12w1raSQyh+TlHjKVY1rWk7GZlgzQwgWDOUPFiAzGKl5sHamdgnoi4Ach60xW4kTR8fFD27PiN1+qCI8s03tW0zjPkFNSRIK590dm/KqePD98NhX5i6BqrPLz6dUIhRXKN9WDNa0TFfwz3WGML9Q1v1MV80ky8NIFiXSnmgEOKwNjgW9k2o+1bkPPikx9ErjBOMJLnwuNWKzPHBJo95NE0dHzcus1164XSzS9881ccHm5T86LC61ifn4X0PRQ94IW2wDzH6ELy0FQkWYKSjYF3W2heLg2B9l6IshmCVMY5sHlWNRl4A1DyyeT3qp7Wex16w3OKjLtTm+NjNw7KzSy8wbnbpa0Vu6aMWc7P/yOZhZXOmeVrfyc8PWIrVA8WwuwXOVD43xgzjc7mZyglPMfGMLlD/aV2C1YHifYNYwfcdikmwSowTLeWYJFm8mvAUA0/24ufCsqv1CBaOHNYqxAo+718s+4fxDteO4hUHJ5mV+k22wyU8xcCTLViFZVfrEizdvu8TimnDQ9HpOlEssHCSBexe1X5Gbjzq/Z4Snlzz+Oa7HIXlP61LsHrCzqHiTqLweTELFmBPiq80TvIlu0e/Y6Qtj3k3zYQnlzy++a5GYflP6xEswNOCYP292LaUVjndoRQ1EiepYd/ZbnGr57HfAjjhyRWPb77rUVj+03oEa5AgWIMSwWrCLRJHucX5EAEVj/thCQlPLnh8892MwvKf1iFYO1FsZ2IFrzslgtWE71Bs5JxkI/vM1eHkPO4FMuHJBY9vvptRWP7TOgQL8CoTrFfZkXwl1oentHLBEp9uo7yPaRJ5/I+kSnhC8/jmu3stK//+08IFi17tDxpV+xcQLPo6np2J2SYRrCYM4BxlQAyHi/L4F8iEJzSPb77bobD8pwUKFr12oejGzrfsW3r50tEgWPDKDuWFsy97UHRB8SpmwQKsYyvp4x2EiSvy4x/8ua7AeFq2Xep8X6vNd3sUlv+0IMFiIhQ5Nbz7aU8O739Lw7Z9hz1xmuRE8Z6JYKXPfpsbwOHmpHjiF8i5BcZTiHbNCSBYc7T5bo/C8p+WJVi7YM3KEnslgjW6ZCzFuAAOl+aJXyATHjPPHQEES5/v9igs/2kpBbPpakexG2sW7s8JGDQFe1F0p9iDYudi6MP6/wFrz5s4jewT/gAAAABJRU5ErkJggg==)", { el: o, offset: [0, -r[1] / 2] } }(r, o); e.element = t.el, e.offset = t.offset; } else if (s) { const t = n.create("div", "sfmap-default-div-icon"); t.style.width = `${a[0]}px`, t.style.height = `${a[1]}px`, t.style.backgroundImage = `url(${s})`, t.style.backgroundSize = "contain", e.element = t, e.offset = l || [0, -a[1] / 2]; } super(e), this.options = e; } setPosition(t) { return this.setLngLat(t), this } getPosition() { return this._lnglat } setHover(t) { const { iconIndex: e } = this.options; if (e && /^[\d]*$/i.test(e) && parseInt(e) <= 10 && parseInt(e) > 0) { const i = [18 * (e - 1), t ? -161 : -134]; this.getElement().style.backgroundPosition = `${-i[0]}px ${-i[1]}px`; } return this } setRotationAngle(t) { return this.setRotation(t), this } _toggle(t) { this.getElement().style.visibility = t ? "visible" : "hidden"; } show() { this._toggle(!0); } hide() { this._toggle(!1); } } const En = { id: null, map: null, visible: !0, properties: {}, paint: {}, layout: {}, filter: null, metadata: null }; class Tn extends t.Evented { constructor(e = {}) { super(), this.options = t.extend({}, e), this._source = null, this._layer = null, this._isAdd = !1, this._options = t.extend({}, En, e), this.id = e.id ? e.id : [this._getIdPrefix(), "layer", t.uuid()].join("_"), this._map = this._options.map, this._visible = this._options.visible, this._minzoom = this._options.minzoom || this._options.minZoom, this._maxzoom = this._options.maxzoom || this._options.maxZoom; } initialize() { this._create(); } _create() { this._createPaint(), this._createLayout(), this.options.source ? "[object String]" === Object.prototype.toString.call(this.options.source) ? this.sourceId = this.options.source : (this.source = this.options.source, this.sourceId = this.options.source.id) : this._createSource(), this._createLayer(), this._map && this.addTo(this._map); } setData(t) { return this._sourceData = t, this._redraw() } _redraw() { if (!this._map) return this; const t = this._map.getSource(this.getSourceId()); return t && t.setData(this._sourceData), this } redraw() { return this.setData(this._sourceData), this } addTo(e, i) { if (this._isAdd || !e) return; this._isAdd = !0, this._map = e, this._unbindMapEvents(e), this._onAddBeforeLoad && this._onAddBeforeLoad(e), this._onAddBeforeLoad && this._onAddBeforeLoad(e); const r = () => { this.onAdd && this.onAdd(e); const { zIndex: r } = this._options; if (!i && r) { const t = e.getStyle().layers.filter((t => !!t.metadata && !!t.metadata.zIndex)), o = t.map((t => t.metadata.zIndex)); let n; for (let t = 0; t < o.length; t++) { const e = o[t], i = o[t + 1]; if (r <= e) { n = t; break } if (r > e && i && r <= i) { n = t + 1; break } } void 0 !== n && (i = t[n].id); } e.getSource(this.getSourceId()) || (e.addSource(this.getSourceId(), this._source), this.source = e.getSource(this.getSourceId())), Array.isArray(this._layer) ? this._layer.forEach((t => e.addLayer(t, i))) : e.addLayer(this._layer, i), this._bindMapEvents(e), this.fire(new t.Event("load")), this._visible || this.hide(); }; return e._loaded ? r() : e.once("load", (() => { r(); })), this } _unbindMapEvents() { } _bindMapEvents() { } remove() { if (this._map) return this.removeFrom(this._map) } removeFrom(t) { if (this._isAdd && t) return this._isAdd = !1, this._visible = !1, Array.isArray(this._layer) ? this._layer.forEach((e => t.removeLayer(e.id))) : t.removeLayer(this._layer.id), t.removeSource(this.getSourceId()), this._map = null, this.onRemove && this.onRemove(t), this } destroy() { this.remove(), this._source = null, this._layer = null, this._map = null; } _createSource() { this._source = { type: this._sourceType || "geojson", data: this._sourceData || {} }; } _getCommonProps() { const { zIndex: e } = this._options; let i = { zIndex: e }; const { _minzoom: r, _maxzoom: o } = this; this._options.metadata && Object.keys(this._options.metadata).length && (i = t.extend({}, i, this._options.metadata)); const n = { metadata: i }; return r && (n.minzoom = r), o && (n.maxzoom = o), this._options.sourceLayer && (n["source-layer"] = this._options.sourceLayer), this._options.filter && this._options.filter.length && (n.filter = this._options.filter), n } _createLayer() { const e = this._getCommonProps(), i = t.extend({}, e, { id: this.getLayerId(), type: this._layerType, source: this.getSourceId(), layout: this.layout, paint: this.paint, metadata: this._options.metadata }); this._layer = i; } _createPaint() { this.paint = this.paint || this._options.paint; } setPaint(e) { this.paint = t.extend({}, this.paint, e), this._map && Object.keys(e).forEach((t => { this._map.setPaintProperty(this.getLayerId(), t, e[t]); })); } _createLayout() { this.layout = this.layout || this._options.layout; } _getIdPrefix() { return this._layerType || "" } getSourceId() { return this.sourceId || (this.sourceId = [this.id, "source"].join("_")), this.sourceId } getLayerId() { return this.id } getSource() { return this._map ? (this.source || (this.source = this._map.getSource(this.getSourceId())), this.source) : null } _toggle(t, e) { this._map && this._map.setLayoutProperty(t, "visibility", e ? "visible" : "none"); } toggle(t) { void 0 === t && (this._visible = !this._visible), Array.isArray(this._layer) ? this._layer.forEach((t => this._toggle(t.id, this._visible))) : this._toggle(this._layer.id, this._visible); } show() { this._visible = !0, this.toggle(!0); } hide() { this._visible = !1, this.toggle(!1); } setZIndex(e) { this._options = t.extend({}, this._options, { zIndex: e }), this._map && (this.remove(), this.addTo(this._map)); } } function Cn(t, e) { return t.feature ? Util.extend({}, t.feature, { geometry: e }) : Sn(e) } function Sn(t) { return "Feature" === t.type || "FeatureCollection" === t.type ? t : { type: "Feature", properties: {}, geometry: t } } class An extends Tn { constructor(t, e = {}) { super(e), this._initializeLayers = t, An.prototype.initialize.apply(this); } initialize() { this._create(), this._layers = {}; const t = this._initializeLayers; t && t.forEach((t => { this.addLayer(t); })); } addLayer(t, e) { const i = this.getIdFromLayer(t); return this._layers[i] = t, this._map && (t.addTo ? t.addTo(this._map, e) : this._map.addLayer(t, e)), this } removeLayer(t) { const e = t in this._layers ? t : this.getIdFromLayer(t); return this._map && this._layers[e] && this._layers[e].removeFrom(this._map), delete this._layers[e], this } hasLayer(t) { return !!t && (t in this._layers || this.getIdFromLayer(t) in this._layers) } clearLayers() { return this.eachLayer(this.removeLayer, this) } invoke(t) { const e = Array.prototype.slice.call(arguments, 1); let i, r; for (i in this._layers) r = this._layers[i], r[t] && r[t].apply(r, e); return this } onAdd(t) { this._map = t, this.eachLayer(this.addLayer, this); } onRemove() { this.eachLayer(this.removeLayer, this); } eachLayer(t, e) { for (const i in this._layers) t.call(e, this._layers[i]); return this } getLayer(t) { return this._layers[t] } getLayers() { const t = []; return this.eachLayer(t.push, t), t } setZIndex(t) { return this.invoke("setZIndex", t) } getBounds() { return this._bounds } getIdFromLayer(t) { return t.getLayerId ? t.getLayerId() : t.id } toMultiPoint(t) { const e = []; return this.eachLayer((i => { e.push(i.toGeoJSON(t).geometry.coordinates); })), Cn(this, { type: "MultiPoint", coordinates: e }) } toGeoJson(t) { return this.toGeoJSON(t) } toGeojson(t) { return this.toGeoJSON(t) } toGeoJSON(t) { const e = this.feature && this.feature.geometry && this.feature.geometry.type; if ("MultiPoint" === e) return this.toMultiPoint(t); const i = "GeometryCollection" === e, r = []; return this.eachLayer((e => { if (e.toGeoJSON) { const o = e.toGeoJSON(t); if (i) r.push(o.geometry); else { const t = Sn(o); "FeatureCollection" === t.type ? r.push.apply(r, t.features) : r.push(t); } } })), i ? Cn(this, { geometries: r, type: "GeometryCollection" }) : { type: "FeatureCollection", features: r } } } class Ln extends An { addLayer(t) { return this.hasLayer(t) || (t.setEventedParent(this), An.prototype.addLayer.call(this, t), this.fire(new Event("layeradd", { layer: t }))), this } removeLayer(t) { return this.hasLayer(t) ? (t in this._layers && (t = this._layers[t]), t.setEventedParent(null), An.prototype.removeLayer.call(this, t), this.fire(new Event("layerremove", { layer: t })), this) : this } } const In = (t, e, i, r, o) => { if (!Array.isArray(e) || !e.length) return t; e = e[0]; for (let n = 0; n < i.length; n++) { const s = i[n]; let a = e[s]; if (("string" == typeof a || "number" == typeof a) && (a = Number(a), a >= r && a <= o)) { t = s; break } } return t }, Mn = (t, e) => In(t, e, [0, "0", "x", "X", "lng", "Lng", "longitude", "LNG", "Longitude", "LONGITUDE"], -180, 180), Pn = (t, e) => In(t, e, [1, "1", "y", "Y", "lat", "Lat", "latitude", "LAT", "Latitude", "LATITUDE"], -90, 90); class zn extends Tn { toGeoJSON() { return { type: "Feature", properties: this._properties, geometry: { type: this._type, coordinates: this._coordinates } } } toGeoJson() { return this.toGeoJSON() } toGeojson() { return this.toGeoJSON() } getBounds() { return this._bounds } _getIdPrefix() { return this._layerType } } function Dn(t) { return !Array.isArray(t[0]) || "object" != typeof t[0][0] && void 0 !== t[0][0] } function kn(e, i, r) { return e instanceof t.LngLat ? e : Array.isArray(e) && "object" != typeof e[0] ? 3 === e.length ? new t.LngLat(e[0], e[1], e[2]) : 2 === e.length ? new t.LngLat(e[0], e[1]) : null : null == e ? e : "object" == typeof e && "lat" in e ? new t.LngLat(e.lng, e.lat, e.alt) : void 0 === i ? null : new t.LngLat(e, i, r) } function Rn(e) { return Array.isArray(e) ? e.map((e => e instanceof t.LngLat ? [e.lng, e.lat] : Array.isArray(e) && "object" == typeof e[0] ? Rn(e) : e)) : e } const Fn = "Point", On = "symbol", Bn = { "icon-opacity": 1, "icon-halo-color": "rgba(0,0,0,0)", "icon-halo-width": 0, "icon-halo-blur": 0, "icon-translate": [0, 0], "icon-translate-anchor": "map", "text-opacity": 1, "text-color": "#000000", "text-halo-color": " rgba(0,0,0,0)", "text-halo-width": 0, "text-halo-blur": 0, "text-translate": [0, 0], "text-translate-anchor": "map" }, Un = { "symbol-placement": "point", "symbol-spacing": 250, "icon-size": 1, "icon-image": "{icon}", "icon-padding": 2, "text-field": "{name}" }; class Nn extends zn { constructor(t, e = {}) { super(e), this._data = t, Nn.prototype.initialize.apply(this); } initialize() { this._type = Fn, this._layerType = On, this.paint = this._options.paint || Bn, this.layout = t.extend({}, Un, this._options.layout), this._sourceData = this.toGeoJSON(), this._create(); } setData(t = []) { if (Array.isArray(t)) return this._data = t, this._sourceData = this.toGeoJSON(), this._redraw() } toGeoJSON() { this._bounds = new t.LngLatBounds; let e = this._data; e[0] && "number" == typeof e[0] && (e = [e]); let { lngField: i = "0", latField: r = "1" } = this._options; i = Mn(i, e), r = Pn(r, e); let o = []; return e && e.length > 0 && (o = e.map((e => { const o = e[i], n = e[r], s = t.extend({}, e); return delete s[i], delete s[r], this._bounds.extend(kn([o, n])), { type: "Feature", geometry: { type: "Point", coordinates: [o, n] }, properties: s } }))), { type: "FeatureCollection", features: o } } } const Gn = "LineString", jn = "line", Hn = { "line-opacity": 1, "line-color": "#3388ff", "line-width": 3 }, Vn = { "line-cap": "butt", "line-join": "miter", "line-miter-limit": 2, "line-round-limit": 1.05 }; class Wn extends zn { constructor(t, e = {}) { super(e), this._lnglats = t, Wn.prototype.initialize.apply(this); } initialize() { const e = this._options; this._type = Gn, this._layerType = jn, this._properties = e.properties || {}, this.paint = t.extend({}, Hn, e.paint), this.layout = t.extend({}, Vn, e.layout), this.setLngLats(this._lnglats), this._create(); } _onAddBeforeLoad(t) { const { arrow: e } = this._options; if (e && e.visible) { const { fill: i = !1, color: r = "#fff", offset: o = 2, size: n = 32, lineWidth: s = 12 } = e, a = `${this.getLayerId()}_arrow`; if (this._arrowIcon = a, !t.hasImage(a)) { const e = { width: n * (o + 1), height: parseInt(1.4 * n), data: new Uint8Array(n * (o + 1) * parseInt(1.4 * n) * 4), onAdd() { const t = document.createElement("canvas"); t.width = this.width, t.height = this.height, this.context = t.getContext("2d"); }, render() { const t = this.context, { width: e, height: o } = this; return t.clearRect(0, 0, e, o), t.beginPath(), t.moveTo(0, 0), t.lineTo(n, o / 2), t.lineTo(0, o), i ? (t.fillStyle = r, t.closePath(), t.fill()) : (t.strokeStyle = r, t.lineWidth = s, t.stroke()), this.data = t.getImageData(0, 0, this.width, this.height).data, !0 } }; t.addImage(a, e, { pixelRatio: 2 }); } } } setData(e) { return this._bounds = new t.LngLatBounds, this._lnglats = this._convertLngLats(e), this._coordinates = Rn(e), this._sourceData = this.toGeoJSON(), this._redraw() } setLngLats(t) { return this.setData(t) } getLngLats() { return this._lnglats } addLngLat(t, e) { return e = e || this._defaultShape(), t = kn(t), e.push(t), this._bounds.extend(t), this._coordinates.push(t.toArray()), this._sourceData = this.toGeoJSON(), this._redraw() } _convertLngLats(t) { const e = [], i = Dn(t); for (let r = 0, o = t.length; r < o; r++)i ? (e[r] = kn(t[r]), this._bounds.extend(e[r])) : e[r] = this._convertLngLats(t[r]); return e } _defaultShape() { return Dn(this._lnglats) ? this._lnglats : this._lnglats[0] } _createLayer() { const e = this._getCommonProps(), i = t.extend({}, e, { id: `${this.getLayerId()}`, type: this._layerType, source: this.getSourceId(), filter: ["all", ["==", "$type", "LineString"]], layout: this.layout, paint: this.paint }); this._layer = [i]; const { arrow: r } = this._options; if (r && r.visible) { const i = t.extend({}, e, { type: "line", id: `${this.getLayerId()}_arrow`, source: this.getSourceId(), paint: { "line-width": this.paint["line-width"] || 6, "line-pattern": `${this.getLayerId()}_arrow` } }); this._layer.push(i); } } getBounds() { return this._bounds } getDistance(t = {}) { if (this._coordinates.length < 2) return 0; const e = this._coordinates, { units: i = "kilometers" } = t || {}; let r = 0; return this._coordinates.forEach(((t, o) => { o > 0 && (r += xi(e[o - 1], t, { units: i })); })), r } onRemove(t) { const e = this._arrowIcon; e && t.hasImage(e) && (t.removeImage(e), this._arrowIcon = null); } } const Zn = "Polygon", Yn = "fill", qn = { "fill-antialias": !0, "fill-opacity": .7, "fill-color": "#1094e2" }, Xn = {}; class Qn extends Wn { constructor(t, e = {}) { super(t, e), this._lnglats = t, Qn.prototype.initialize.apply(this); } initialize() { const e = this._options; this._type = Zn, this._layerType = Yn, this._properties = e.properties || {}, this.paint = t.extend({}, qn, this._options.paint), this.layout = t.extend({}, Xn, this._options.layout), this.setLngLats(this._lnglats), this._create(); } toGeoJSON() { return { type: "Feature", properties: this._properties, geometry: { type: this._type, coordinates: [this._coordinates] } } } _createLayer() { const e = this._getCommonProps(), i = {}, r = {}; for (const t in this.paint) t.indexOf("fill-") > -1 ? i[t] = this.paint[t] : t.indexOf("line-") > -1 && (r[t] = this.paint[t]); const o = t.extend({}, e, { id: `${this.getLayerId()}`, type: "fill", source: this.getSourceId(), filter: ["all", ["==", "$type", "Polygon"]], paint: i }), n = t.extend({}, e, { id: `${this.getLayerId()}_line`, type: "line", source: this.getSourceId(), filter: ["all", ["==", "$type", "Polygon"]], layout: { "line-cap": "round", "line-join": "round" }, paint: r }); this._layer = [o, n]; } } const Kn = { layout: { [On]: Un, [jn]: Vn, [Yn]: Xn }, paint: { [On]: Bn, [jn]: Hn, [Yn]: qn } }; class Jn extends Ln { constructor(e, i) { super([], i = t.extend({}, i)), this._initializeGeoJSON = e, Jn.prototype.initialize.apply(this); } initialize() { this._layers = {}, this._initializeGeoJSON && this.addData(this._initializeGeoJSON), this._create(); } addData(t) { this._sourceData = t; } toGeoJSON() { return this._sourceData } toGeoJson() { return this.toGeoJSON() } toGeojson() { return this.toGeoJSON() } getBounds() { const e = Ti(this.toGeoJSON()); return e ? new t.LngLatBounds([e[0], e[1]], [e[2], e[3]]) : null } _getIdPrefix() { return "GeoJSON" } _createSource() { this._source = { type: "geojson", data: this._sourceData }; } _createLayer() { const e = this._getCommonProps(), i = { [On]: [Fn], [jn]: [Gn], [Yn]: [Zn] }; this._layer = Object.keys(i).map((r => t.extend({}, e, { id: `${this.getLayerId()}-${r}`, type: r, source: this.getSourceId(), layout: this.layout[r], paint: this.paint[r], filter: ["in", "$type", ...i[r]] }))), this._layer.push(t.extend({}, e, { id: `${this.getLayerId()}-fill-line`, type: jn, source: this.getSourceId(), layout: this.layout.line, paint: this.paint.line, filter: ["in", "$type", ...i.fill] })); } _createPaint() { const e = this._options.paint || this._options.style; if (!e) return void (this.paint = Kn.paint); const i = { [On]: t.extend({}, Bn), [jn]: t.extend({}, Hn), [Yn]: t.extend({}, qn) }; for (const t in e) t.indexOf("fill-") > -1 ? i.fill[t] = e[t] : t.indexOf("line-") > -1 ? i.line[t] = e[t] : i.symbol[t] = e[t]; this.paint = i; } _createLayout() { const e = this._options.layout; if (!e) return void (this.layout = Kn.layout); const i = { [On]: t.extend({}, Un), [jn]: t.extend({}, Vn), [Yn]: t.extend({}, Xn) }; for (const t in e) "visibility" === t ? (i.fill[t] = e[t], i.line[t] = e[t], i.symbol[t] = e[t]) : t.indexOf("fill-") > -1 ? i.fill[t] = e[t] : t.indexOf("line-") > -1 ? i.line[t] = e[t] : i.symbol[t] = e[t]; this.layout = i; } } var $n = rs, ts = rs, es = /[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/, is = new RegExp("^" + es.source + "(\\s" + es.source + "){1,}"); function rs(t) { var e, i = t.split(";"), r = i.pop(), o = (i.shift() || "").split("=").pop(), n = 0; function s(t) { var e = r.substring(n).match(t); return e ? (n += e[0].length, e[0]) : null } function a() { s(/^\s*/); } function l() { a(); for (var t, e = 0, i = [], r = [i], o = i; t = s(/^(\()/) || s(/^(\))/) || s(/^(,)/) || s(is);) { if ("(" === t) r.push(o), r[r.length - 1].push(o = []), e++; else if (")" === t) { if (0 === o.length) return null; if (!(o = r.pop())) return null; if (0 == --e) break } else if ("," === t) r[r.length - 1].push(o = []); else { if (t.split(/\s/g).some(isNaN)) return null; Array.prototype.push.apply(o, t.split(/\s/g).map(parseFloat)); } a(); } return 0 !== e ? null : i } function c() { for (var t, e, i = []; e = s(is) || s(/^(,)/);)"," === e ? (i.push(t), t = []) : e.split(/\s/g).some(isNaN) || (t || (t = []), Array.prototype.push.apply(t, e.split(/\s/g).map(parseFloat))), a(); return t ? (i.push(t), i.length ? i : null) : null } return (e = function t() { return function () { if (!s(/^(point(\sz)?)/i)) return null; if (a(), !s(/^(\()/)) return null; var t = c(); return t ? (a(), s(/^(\))/) ? { type: "Point", coordinates: t[0] } : null) : null }() || function () { if (!s(/^(linestring(\sz)?)/i)) return null; if (a(), !s(/^(\()/)) return null; var t = c(); return t && s(/^(\))/) ? { type: "LineString", coordinates: t } : null }() || function () { if (!s(/^(polygon(\sz)?)/i)) return null; a(); var t = l(); return t ? { type: "Polygon", coordinates: t } : null }() || function () { if (!s(/^(multipoint)/i)) return null; a(); var t = r.substring(r.indexOf("(") + 1, r.length - 1).replace(/\(/g, "").replace(/\)/g, ""); r = "MULTIPOINT (" + t + ")"; var e = l(); return e ? (a(), { type: "MultiPoint", coordinates: e }) : null }() || function () { if (!s(/^(multilinestring)/i)) return null; a(); var t = l(); return t ? (a(), { type: "MultiLineString", coordinates: t }) : null }() || function () { if (!s(/^(multipolygon)/i)) return null; a(); var t = l(); return t ? { type: "MultiPolygon", coordinates: t } : null }() || function () { var e, i = []; if (!s(/^(geometrycollection)/i)) return null; if (a(), !s(/^(\()/)) return null; for (; e = t();)i.push(e), a(), s(/^(,)/), a(); return s(/^(\))/) ? { type: "GeometryCollection", geometries: i } : null }() }()) && o.match(/\d+/) && (e.crs = { type: "name", properties: { name: "urn:ogc:def:crs:EPSG::" + o } }), e } $n.parse = ts, $n.stringify = function t(e) { function i(t) { return t.join(" ") } function r(t) { return t.map(i).join(", ") } function o(t) { return t.map(r).map(n).join(", ") } function n(t) { return "(" + t + ")" } switch ("Feature" === e.type && (e = e.geometry), e.type) { case "Point": return "POINT (" + i(e.coordinates) + ")"; case "LineString": return "LINESTRING (" + r(e.coordinates) + ")"; case "Polygon": return "POLYGON (" + o(e.coordinates) + ")"; case "MultiPoint": return "MULTIPOINT (" + r(e.coordinates) + ")"; case "MultiPolygon": return "MULTIPOLYGON (" + e.coordinates.map(o).map(n).join(", ") + ")"; case "MultiLineString": return "MULTILINESTRING (" + o(e.coordinates) + ")"; case "GeometryCollection": return "GEOMETRYCOLLECTION (" + e.geometries.map(t).join(", ") + ")"; default: throw new Error("stringify requires a valid GeoJSON Feature or geometry object as input") } }; class os extends Jn { constructor(t, e = {}) { super(null, e), this._initializeWkt = t, this._initializeGeoJSON = os.parse(t), os.prototype.initialize.apply(this); } setData(t) { const e = os.parse(t); Jn.prototype.setData.apply(this, e); } static parse(t) { return Sn(ts(t)) } _getIdPrefix() { return "WKT" } } function ns(t) { let e, i, r = []; e = t.length; for (let o = 0; o < e; o++)i = t.charCodeAt(o), i >= 65536 && i <= 1114111 ? (r.push(i >> 18 & 7 | 240), r.push(i >> 12 & 63 | 128), r.push(i >> 6 & 63 | 128), r.push(63 & i | 128)) : i >= 2048 && i <= 65535 ? (r.push(i >> 12 & 15 | 224), r.push(i >> 6 & 63 | 128), r.push(63 & i | 128)) : i >= 128 && i <= 2047 ? (r.push(i >> 6 & 31 | 192), r.push(63 & i | 128)) : r.push(255 & i); return r } class ss extends Jn { constructor(t, e = {}) { super(null, e), this._extinfo = t, this._initializeGeoJSON = this._parse(t), ss.prototype.initialize.apply(this); } setData(t) { const e = this._parse(t); Jn.prototype.setData.apply(this, e); } _parse(t) { return Sn(this._convert(this._decrypt(t))) } _getIdPrefix() { return "MssExtInfo" } _isLocalFormat(t) { return "" === t.replace(/[\d\.]+\|[\d\.]+[;|,]?/g, "") } _isPolygon(t) { const e = t[0], i = t[t.length - 1]; return e[0] === i[0] && e[1] === i[1] } _convert(t) { if (this._isLocalFormat(t)) { const e = t.split(",")[0].split(";").map((t => (t = t.split("|"), [Number(t[0]), Number(t[1])]))), i = this._isPolygon(e), r = t.replace(/,/g, i ? ")),((" : "),(").replace(/^/, i ? "(((" : "((").replace(/$/, i ? ")))" : "))").replace(/\|/g, " ").replace(/\;/g, ","); t = [i ? "MULTIPOLYGON" : "MULTILINESTRING", r].join(""); } let e; try { e = JSON.parse(t); } catch (i) { e = os.parse(t); } return e } _decrypt(t) { return this._isLocalFormat(t) ? t : function (t, e) { let i = ns(t.split("").reverse().join("")), r = ns(function (t) { if ("" === t) return ""; let e = []; for (let i = 0; i < t.length; i++)e.push(t.charCodeAt(i).toString(16)); return e.join("") }(e)); return i = i.map(((t, e) => r.length > e ? t ^ r[e] : t)), function (t) { let e, i = t.trim(), r = "0x" === i.substr(0, 2).toLowerCase() ? i.substr(2) : i, o = r.length; if (o % 2 != 0) return console.error("Illegal ASCII Code Format!"), ""; let n = []; for (let t = 0; t < o; t += 2)e = parseInt(r.substr(t, 2), 16), n.push(String.fromCharCode(e)); return n.join("") }(function (t) { if ("string" == typeof t) return t; let e = "", i = t; for (let t = 0; t < i.length; t++) { let r = i[t].toString(2), o = r.match(/^1+?(?=0)/); if (o && 8 === r.length) { let r = o[0].length, n = i[t].toString(2).slice(7 - r); for (let e = 1; e < r; e++)n += i[e + t].toString(2).slice(2); e += String.fromCharCode(parseInt(n, 2)), t += r - 1; } else e += String.fromCharCode(i[t]); } return e }(i)) }(t, this.options.key || "82626121-5782-1454-1247-617142522121") } } function as(t, e, i, r) { void 0 === r && (r = {}); var o = vi(t), n = fi(o[0]), s = fi(o[1]), a = fi(i), l = function (t, e) { void 0 === e && (e = "kilometers"); var i = hi[e]; if (!i) throw new Error(e + " units is invalid"); return t / i }(e, r.units), c = Math.asin(Math.sin(s) * Math.cos(l) + Math.cos(s) * Math.sin(l) * Math.cos(a)); return di([_i(n + Math.atan2(Math.sin(a) * Math.sin(l) * Math.cos(s), Math.cos(l) - Math.sin(s) * Math.sin(c))), _i(c)], r.properties) } const ls = { "fill-opacity": .7, "fill-color": "#1094e2" }; class cs extends zn { constructor(t, e = {}) { if (super(e), !Array.isArray(t)) throw new Error("lnglat must be an array"); this._lnglat = t, cs.prototype.initialize.apply(this); } initialize() { const e = this._options; this._type = "Polygon", this._layerType = "fill", 2 !== this._lnglat.length && (this._lnglat = [0, 0], this._visible = !1); const i = this._center = this._lnglat = kn(this._lnglat); this._coordinates = i.toArray(), this._radius = e.radius || 1, this._paint = t.extend({}, ls, e.paint), this._sourceData = this.toGeoJSON(), this._create(); } setData(t, e) { return void 0 !== e && this.setRadius(e), this.setCenter(t), this } setRadius(t) { this._radius = t || 1, this.setCenter(this._coordinates); } getRadius() { return this._radius } setCenter(t = []) { return 2 !== t.length ? (t = [0, 0], this.hide()) : this.show(), t = this._center = this._lnglat = kn(t), this._coordinates = t.toArray(), this._sourceData = this.toGeoJSON(), this._redraw() } getCenter() { return this._center } toGeoJSON() { const e = t.pick(this.options, ["steps", "units", "properties"]); let i = this._radius; "meter" === e.units && (e.units = "kilometers", i /= 1e3); const r = function (t, e, i) { void 0 === i && (i = {}); for (var r = i.steps || 64, o = i.properties ? i.properties : !Array.isArray(t) && "Feature" === t.type && t.properties ? t.properties : {}, n = [], s = 0; s < r; s++)n.push(as(t, e, -360 * s / r, i).geometry.coordinates); return n.push(n[0]), pi([n], o) }(this._coordinates, i, e); return r } _createLayer() { const e = this._getCommonProps(), i = {}, r = {}; for (const t in this.paint) t.indexOf("fill-") > -1 ? i[t] = this.paint[t] : t.indexOf("line-") > -1 && (r[t] = this.paint[t]); const o = t.extend({}, e, { id: `${this.getLayerId()}`, type: "fill", source: this.getSourceId(), filter: ["all", ["==", "$type", "Polygon"]], paint: i }), n = t.extend({}, e, { id: `${this.getLayerId()}_line`, type: "line", source: this.getSourceId(), filter: ["all", ["==", "$type", "Polygon"]], layout: { "line-cap": "round", "line-join": "round" }, paint: r }); this._layer = [o, n]; } getBounds() { return this._lnglat.toBounds(this._radius) } getBoundsBak() { const t = function (t, e) { void 0 === e && (e = {}); var i = e.precision, r = e.coordinates, o = e.mutate; if (i = null == i || isNaN(i) ? 6 : i, r = null == r || isNaN(r) ? 3 : r, !t) throw new Error("<geojson> is required"); if ("number" != typeof i) throw new Error("<precision> must be a number"); if ("number" != typeof r) throw new Error("<coordinates> must be a number"); !1 !== o && void 0 !== o || (t = JSON.parse(JSON.stringify(t))); var n = Math.pow(10, i); return wi(t, (function (t) { !function (t, e, i) { t.length > i && t.splice(i, t.length); for (var r = 0; r < t.length; r++)t[r] = Math.round(t[r] * e) / e; }(t, n, r); })), t }(function (t, e) { void 0 === e && (e = {}); var i = Number(t[0]), r = Number(t[1]), o = Number(t[2]), n = Number(t[3]); if (6 === t.length) throw new Error("@turf/bbox-polygon does not support BBox with 6 positions"); var s = [i, r]; return pi([[s, [o, r], [o, n], [i, n], s]], e.properties, { bbox: t, id: e.id }) }(Ti(this._sourceData)), { precision: 6 }).geometry.coordinates[0]; return { sw: { lng: t[0][0], lat: t[0][1] }, ne: { lng: t[2][0], lat: t[2][1] } } } } const hs = { type: "Feature", geometry: { type: "Point", coordinates: [0, 0, 0] } }, us = { "circle-radius": 20, "circle-color": "blue", "circle-stroke-color": "white", "circle-stroke-width": 1, "circle-opacity": 1 }; class ds extends Tn { constructor(t, e) { super(e), this._data = t, ds.prototype.initialize.apply(this); } initialize() { this._maxzoom = this._maxzoom || 18, this._layerType = "heatmap", this._sourceData = this.toGeoJSON(), this._create(); } setData(t = []) { if (Array.isArray(t)) return this._data = t, this._sourceData = this.toGeoJSON(t), this._redraw() } toGeoJSON() { const e = this._data; let { lngField: i = "0", latField: r = "1" } = this._options; i = Mn(i, e), r = Pn(r, e); const o = e.map((e => { const o = e[i], n = e[r], s = t.extend({}, e); return delete s[i], delete s[r], { type: "Feature", geometry: { type: "Point", coordinates: [o, n] }, properties: s } })); return { type: "FeatureCollection", features: o } } _createPaint() { const { radius: e, min: i = 0, max: r = 1, colors: o, valueField: n = "value", paint: s = {} } = this._options, { _minzoom: a, _maxzoom: l } = this; let c = ["interpolate", ["linear"], ["heatmap-density"]]; if ("[object Array]" === Object.prototype.toString.apply(o)) { if (o.length > 1) { const t = parseFloat((1 / (o.length - 1)).toFixed(2)); for (let e = 0; e < o.length; e++)c.push(e === o.length - 1 ? 1 : 0 + t * e), c.push(o[e]); } } else "[object Object]" === Object.prototype.toString.apply(o) ? Object.keys(o).map((t => parseFloat(t))).sort().forEach((t => { c.push(t), c.push(o[t]); })) : c = null; const h = { "heatmap-radius": e || ["interpolate", ["linear"], ["zoom"], 0, 2, 9, 20], "heatmap-weight": ["interpolate", ["linear"], ["get", n], i, 0, r, 1], "heatmap-intensity": ["interpolate", ["linear"], ["zoom"], 0, 1, 9, 3], "heatmap-opacity": ["interpolate", ["linear"], ["zoom"], a, 1, l, 0] }; c && (h["heatmap-color"] = c), this._heatPaint = t.extend({}, h, s); } _createLayer() { const e = this._getCommonProps(), i = [], { point: r = {} } = this._options, { _maxzoom: o } = this, n = t.extend({}, e, { id: `${this.getLayerId()}_heat`, type: "heatmap", source: this.getSourceId(), _maxzoom: o, paint: this._heatPaint }); i.push(n); const { enable: s = !1, paint: a } = r, l = r.minzoom || r.minZoom || 18; if (s) { const r = t.extend({}, e, { id: `${this.getLayerId()}_point`, type: "circle", source: this.getSourceId(), minzoom: l, paint: t.extend({}, us, a) }); i.push(r); } this._layer = i; } _createSource() { this._source = { type: "geojson", data: this._sourceData || hs }; } } const ps = ["#00ff00", 100, "#ffff00", 500, "#ff0000"], ms = [20, 100, 30, 500, 40], _s = { "circle-color": "#11b4da", "circle-radius": 4 }, fs = { "text-field": "{point_count_abbreviated}", "text-size": 12 }, gs = { type: "Feature", geometry: { type: "Point", coordinates: [0, 0, 0] } }; class vs extends Tn { constructor(t, e) { super(e), this._data = t, vs.prototype.initialize.apply(this); } initialize() { t.bindAll(["_clusterClickHandle", "_clusterMouseenterHandle", "_clusterMouseleaveHandle"], this), this._layer = null, this._layerType = "circle", this._clickable = this.options.clickable || !0, this._sourceData = this.toGeoJSON(), this._create(); } _unbindMapEvents(t) { const e = `${this.getLayerId()}_clusters`; t.off("click", e), t.off("mouseenter", e), t.off("mouseleave", e); } _bindMapEvents(t) { if (!this._clickable) return; const e = `${this.getLayerId()}_clusters`; t.on("click", e, this._clusterClickHandle), t.on("mouseenter", e, this._clusterMouseenterHandle), t.on("mouseleave", e, this._clusterMouseleaveHandle); } _clusterClickHandle(t) { const e = this._map.queryRenderedFeatures(t.point, { layers: [`${this.getLayerId()}_clusters`] }); this.source.getClusterExpansionZoom(e[0].properties.cluster_id, ((t, i) => { t || this._map.easeTo({ center: e[0].geometry.coordinates, zoom: i }); })); } _clusterMouseenterHandle() { this._map.getCanvas().style.cursor = "pointer"; } _clusterMouseleaveHandle() { this._map.getCanvas().style.cursor = ""; } setData(t = []) { if (Array.isArray(t)) return this._data = t, this._sourceData = this.toGeoJSON(t), this._redraw() } toGeoJSON() { const e = this._data; let { lngField: i = "0", latField: r = "1" } = this._options; i = Mn(i, e), r = Pn(r, e); const o = e.map((e => { const o = e[i], n = e[r], s = t.extend({}, e); return delete s[i], delete s[r], { type: "Feature", geometry: { type: "Point", coordinates: [o, n] }, properties: s } })); return { type: "FeatureCollection", features: o } } _createPaint() { const { radius: e = ms, colors: i = ps, paint: r = {} } = this._options, o = ["step", ["get", "point_count"]], n = ["step", ["get", "point_count"]]; if ("[object Array]" === Object.prototype.toString.apply(i)) for (let t = 0; t < i.length; t++)o.push(i[t]); if ("[object Array]" === Object.prototype.toString.apply(e)) for (let t = 0; t < e.length; t++)n.push(e[t]); this._clustersPaint = t.extend({}, { "circle-color": o, "circle-radius": n }, this._options.clustersPaint), this._clustersLayout = t.extend({}, {}, this._options.clustersLayout), this._clustersCountPaint = t.extend({}, { "circle-color": o, "circle-radius": n }, this._options.clustersCountPaint), this._clustersCountLayout = t.extend({}, {}, this._options.clustersCountLayout), this.paint = t.extend({}, _s, r || this.paint); } _createLayout() { const { layout: e = {} } = this._options; this.layout = t.extend({}, fs, e || this.layout); } _createLayer() { const e = this._getCommonProps(), i = t.extend({}, e, { id: `${this.getLayerId()}`, type: "circle", source: this.getSourceId(), filter: ["has", "point_count"], paint: this._clustersPaint, layout: this._clustersLayout }), r = t.extend({}, e, { id: `${this.getLayerId()}_clusteredCount`, type: "symbol", source: this.getSourceId(), filter: ["has", "point_count"], paint: this._clustersCountPaint, layout: this._clustersCountLayout }), o = t.extend({}, e, { id: `${this.getLayerId()}_unclusteredPoint`, type: "circle", source: this.getSourceId(), filter: ["!", ["has", "point_count"]], paint: this.paint, layout: this.layout }); this._layer = [i, r, o]; } _createSource() { this._source = { type: "geojson", data: this._sourceData || gs, cluster: !0, clusterMaxZoom: this._options.clusterMaxZoom || 15, clusterRadius: this._options.clusterRadius || 50 }; } } const xs = (window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI) > 1; void 0 === Array.prototype.flat && (Array.prototype.flat = function (t = 1) { if (!Number(t) || Number(t) < 0) return this; let e = []; return this.forEach((i => { Array.isArray(i) ? e = e.concat(i.flat(--t)) : e.push(i); })), e }); const ys = { map: null, visible: !0, paint: {}, layout: {}, properties: {}, getSourceTileUrl: (t, e) => { } }, bs = "raster", ws = { request: "GetMap", service: "WMS", srs: "EPSG:3857", layers: "", styles: "", format: "image/png", transparent: !0, version: "1.1.1", bbox: "{bbox-epsg-3857}" }; class Es extends Tn { constructor(t, e) { super(e), this._url = t, Es.prototype.initialize.apply(this); } initialize() { this._layerType = bs, this.tileSize = this._options.tileSize || 256; const e = t.extend({}, ws), i = this._options; for (const t in i) t in ys || (e[t] = i[t]); e.width = e.height = this.tileSize * (this._options.detectRetina && xs ? 2 : 1), this.wmsParams = e, this._create(); } _getIdPrefix() { return "wms" } _getSourceTileUrl() { const e = t.extend({}, this.wmsParams); let i = ""; for (const t in e) i += `&${t}=${e[t]}`; return i = i.substr(1), `${this._url}?${i}` } _createSource() { let t; this._options.getSourceTileUrl && "function" == typeof this._options.getSourceTileUrl && (t = this._options.getSourceTileUrl(this._url, Object.assign({}, this.wmsParams))), t = t || this._getSourceTileUrl(), this._source = { type: bs, tiles: [t], tileSize: this.tileSize }; } } const Ts = { map: null, visible: !0, paint: {}, layout: {}, properties: {} }, Cs = { service: "gwc/service/tms", layer: "", sourceLayer: "", srs: "EPSG:900913", format: "pbf", version: "1.0.0" }; class Ss extends Tn { constructor(t, e) { super(e), this._url = t, this._scheme = "tms", Ss.prototype.initialize.apply(this); } initialize() { this._layerType = this._options.type, this._options.sourceLayer = this._options.sourceLayer || (this._options.layer || ":").split(":")[1]; const e = t.extend({}, Cs), i = this._options; for (const t in i) t in Ts || (e[t] = i[t]); this.tmsParams = e, this._create(); } _getIdPrefix() { return "tms" } _getSourceTileUrl() { const { service: e, layer: i, srs: r, format: o, version: n } = t.extend({}, this.tmsParams); return `${this._url}/${e}/${n}/${i}@${r}@${o}/{z}/{x}/{y}.${o}` } _createSource() { let t; this._options.getSourceTileUrl && "function" == typeof this._options.getSourceTileUrl && (t = this._options.getSourceTileUrl(this._url, Object.assign({}, this.tmsParams))), t = t || this._getSourceTileUrl(), this._source = { type: "vector", tiles: [t], scheme: "tms", promoteId: this._options.promoteId }; } } const As = { id: "sfmapgl-minimap", width: "320px", height: "180px", center: [0, 0], zoom: 10, zoomAdjust: null, zoomLevels: [[18, 12, 14], [16, 10, 12], [14, 8, 10], [12, 6, 8], [10, 4, 6], [8, 2, 4], [6, 1, 3], [3, 1, 1]], bounds: "parent", lineColor: "#08F", lineWidth: 1, lineOpacity: 1, fillColor: "#F80", fillOpacity: .25, dragPan: !1, scrollZoom: !1, boxZoom: !1, dragRotate: !1, keyboard: !1, doubleClickZoom: !1, touchZoomRotate: !1 }, Ls = { map: void 0, pitch: 45 }; e(".sfmap-ctrl-rightmenu-default{display:none;position:absolute;cursor:pointer;pointer-events:auto}.sfmap-ctrl-rightmenu{background:#fff;border:1px solid #ede7e7;border-radius:3px;box-shadow:2px 2px 16px #ecd6d6;max-width:250px}.sfmap-ctrl-rightmenu .rightmenu-body{margin:3px 5px}.sfmap-ctrl-rightmenu .rightmenu-item{white-space:nowrap;margin-top:5px}.sfmap-ctrl-rightmenu .rightmenu-body .rightmenu-item:hover{background:#f0f0f0}"); const Is = { map: void 0, className: "sfmap-ctrl-rightmenu", menuItems: t => [] }, Ms = { enabled: !1, shouldExclude: t => !1, getOffset: t => [0, 0], getSize: t => [0, 0], getBuffer: t => [0, 0, 0, 0] }; function Ps(t, e) { return Math.abs((t[0] + t[2]) / 2 - (e[0] + e[2]) / 2) < (t[2] + e[2] - t[0] - e[0]) / 2 && Math.abs((t[1] + t[3]) / 2 - (e[1] + e[3]) / 2) < (t[3] + e[3] - t[1] - e[1]) / 2 } class zs { constructor() { this._bounds = [0, 0, 0, 0], this._alternatives = [], this._passed = [], this._unpassed = []; } setBounds(t) { this._bounds = t; } push(t) { this._alternatives.push(t); } apply(t) { const e = this._bounds, i = []; this._unpassed = [], this._passed = this._alternatives.sort(((e, i) => i.priority(t) - e.priority(t))).filter((r => { const o = r.bounds(t); if (!Ps(e, o)) return this._unpassed.push(r), !1; const n = i.find((t => Ps(t, o))); return n ? (this._unpassed.push(r), !1) : (i.push(o), !0) })), this._alternatives.splice(0, this._alternatives.length); } passed() { return this._passed } unpassed() { return this._unpassed } reset() { this._alternatives.splice(0, this._alternatives.length), this._unpassed.splice(0, this._unpassed.length), this._passed.splice(0, this._passed.length); } } const Ds = { show: !0, getClassNames: t => [], getContent: t => `<span>${t.text}</span>`, getTransform: (t, e, i) => `translate(-50%, -50%) translate(${e[0]}px, ${e[1]}px)` }, ks = { show: !0, stroke: "rgba(255, 0, 0)", "stroke-width": 2, opacity: .5 }, Rs = { show: !0, r: 4, "stroke-width": 0, getFillColor: () => "rgba(255, 0, 0)", opacity: .4 }, Fs = { show: !1, getElement: (t, e) => document.createElement("div"), getTransform: (t, e, i) => `translate(${i[0]}px, ${i[1]}px)` }, Os = { OPACITY_EVENTS: "opacity,events", OPACITY: "opacity", EVENTS: "events", NONE: "" }; class Bs { constructor(t) { this.show = void 0 === (t = t || {}).show || !!t.show, this.disabled = "function" == typeof t.disabled ? t.disabled : () => !1, this.disabledLevels = "function" == typeof t.disabledLevels ? t.disabledLevels : () => [Os.OPACITY_EVENTS], this.disabledOpacity = void 0 !== t.disabledOpacity ? t.disabledOpacity : .5, this.heightRatio = null != t.heightRatio && null != t.heightRatio ? t.heightRatio : 1, this.label = { ...Ds, ...t.label }, this.tailLine = { ...ks, ...t.tailLine }, this.tailAnchor = { ...Rs, ...t.tailAnchor }, this.slot = { ...Fs, ...t.slot }; } } const Us = "default_group"; class Ns { constructor() { this._tables = new Map; } set(t, e) { this._tables.set(e || Us, t); } get(t) { return this._tables.get(t || Us) } } function Gs(t, e) { const i = document.createElementNS("http://www.w3.org/2000/svg", t); return js(i, e), i } function js(t, e) { if (e && t) for (let i in e) "function" != typeof e[i] && t.setAttribute(i, e[i]); } function Hs(t, e) { t.forEach((t => { e[t] && (e[t] = e[t].bind(e)); })); } function Vs(t, e) { return function (t, e) { return t.project3D(e) }(t, e).map((t => parseFloat(parseFloat(t).toFixed(0)))) } class Ws { constructor(t) { this.id = t.id, this.lng = t.lng, this.lat = t.lat, this.text = t.text, this.group = t.group, this.feature = t.feature, this.getHeight = "function" == typeof t.getHeight ? t.getHeight : () => 0, this.getBottomHeight = "function" == typeof t.getBottomHeight ? t.getBottomHeight : () => 0, this._clickCallback = "function" == typeof t.clickCallback ? t.clickCallback : () => { }, this._postRender = "function" == typeof t.postRender ? t.postRender : () => { }, this.style = t.style instanceof Bs ? t.style : new Bs({}), this._rendered = !1, this._disabled = void 0, this._labelElement = void 0, this._tailGraphic = void 0, this._tailAnchor = void 0, this._tailLine = void 0, this._slotElement = void 0, Hs(["_onClick"], this); } priority(t) { return this._getAnchor(t)[1] } bounds(t) { if (!1 === this.style.show || !1 === this.style.label.show) return [0, 0, 0, 0]; const { option: e } = t, i = this._getAnchor(t), r = e.getSize(this), o = e.getOffset(this), n = [i[0] + r[0] * parseFloat(o[0]) / 100, i[1] + r[1] * parseFloat(o[1]) / 100, 0, 0]; n[2] = n[0] + r[0], n[3] = n[1] + r[1]; const s = e.getBuffer(this); return n[0] -= s[0], n[1] -= s[1], n[2] += s[2], n[3] += s[3], n } isRendered() { return this._rendered } render(t) { const { map: e } = t; t.show = this.style.show, t.bottomPoint = Vs(e, [this.lng, this.lat, this.getBottomHeight(this)]), t.topPoint = Vs(e, [this.lng, this.lat, this._getHeight()]); const i = void 0 !== this._disabled ? this._disabled : this.style.disabled(this), r = this.style.disabledLevels(this).map((t => t.split(","))).flat(); t.opacity = i && r.indexOf("opacity") >= 0 ? this.style.disabledOpacity : 1, t.disabled = i, t.pointerEvent = i && r.indexOf("events") >= 0 ? "none" : "all", this._renderLabel(t), this._renderTail(t), this._renderCustom(t); try { this._postRender(); } catch (t) { console.warn(t); } this._rendered = !0; } _getHeight() { return this.style.heightRatio * this.getHeight(this) } _renderLabel(t) { const { labelContainer: e, topPoint: i, bottomPoint: r, pointerEvent: o, opacity: n, show: s } = t, { getClassNames: a, getTransform: l, getContent: c } = this.style.label, h = l(this, i, r); let u = this._labelElement; const d = a(this); u ? (u.style.transform = h, u.style.opacity = n, u.style["pointer-events"] = o, d.forEach((t => u.classList.add(t)))) : (u = document.createElement("div"), u.innerHTML = c(this), u.style.transform = h, u.style.opacity = n, u.style["pointer-events"] = o, u.classList.add("tailed-label"), d.forEach((t => u.classList.add(t))), e.appendChild(u), this._labelElement = u, u.addEventListener("click", this._onClick)), u.style.display = !1 === s || !1 === this.style.label.show ? "none" : ""; } _renderTail(t) { const { svgContainer: e, topPoint: i, bottomPoint: r, opacity: o, show: n } = t, { tailLine: s, tailAnchor: a } = this.style; if (null == this._tailGraphic) { this._tailGraphic = Gs("g", { id: this.getTailElementId() }); const t = Gs("defs", {}); this._tailGraphic.appendChild(t), e.appendChild(this._tailGraphic); } let l = this._tailGraphic; if (l.style.display = !1 === n || !1 === this.style.show ? "none" : "", this._createGradientIfNeed(l), s.show) { r[0] === i[0] && (r[0] += .1); const t = `M ${r.join(" ")} L ${i.join(" ")}`; if (this._tailLine) this._tailLine.style.opacity = o, t.indexOf(Number.MAX_VALUE + "") < 0 && js(this._tailLine, { d: t }); else { let e = s.stroke || ""; "[object Function]" === Object.prototype.toString.call(s.getStroke) && (e = s.getStroke(this)); const i = Gs("path", { ...s, d: t, stroke: e }); i.style.opacity = o, l.appendChild(i), this._tailLine = i; } } if (a.show) if (this._tailAnchor) this._tailAnchor.style.opacity = o, this._tailAnchor.setAttribute("cx", r[0]), this._tailAnchor.setAttribute("cy", r[1]); else { const t = Gs("circle", { ...a, fill: a.getFillColor(this), cx: r[0], cy: r[1] }); t.style.opacity = o, l.appendChild(t), this._tailAnchor = t; } } _renderCustom(t) { const { labelContainer: e, topPoint: i, bottomPoint: r, show: o } = t, n = this.style.slot; if (n && o && n.show) { const { getTransform: t, getElement: o } = n; if (this._slotElement) { const e = t(this, i, r); this._slotElement.style.transform = e; } else { const s = o(this, n); if (s) { const o = t(this, i, r); s.style.transform = o, e.appendChild(s), this._slotElement = s; } } } this._slotElement && (this._slotElement.style.display = !1 === o || !1 === n.show ? "none" : ""); } updateStyle(t) { const e = this.style; this.style = t, this._updateOnStyleChange(t, e); } remove() { this._tailAnchor && this._tailAnchor.remove(), this._tailLine && this._tailLine.remove(), this._tailGraphic && this._tailGraphic.remove(), this._labelElement && (this._labelElement.removeEventListener("click", this._onClick), this._labelElement.remove()), this._slotElement && this._slotElement.remove(), this._tailGraphic = void 0, this._tailAnchor = void 0, this._tailLine = void 0, this._labelElement = void 0, this._slotElement = void 0, this._rendered = !1; } getTailElementId() { return this.id + "-svgg" } disable() { if (!0 === this._disabled) return; const t = this.style.disabledOpacity; this._labelElement && (this._labelElement.style.opacity = t, this._labelElement.style["pointer-events"] = "none"), this._tailGraphic && (this._tailGraphic.style.opacity = t), this._disabled = !0; } enable() { !1 !== this._disabled && (this._labelElement && (this._labelElement.style.opacity = 1, this._labelElement.style["pointer-events"] = "all"), this._tailGraphic && (this._tailGraphic.style.opacity = 1), this._disabled = !1); } clone() { return new Ws({ id: this.id, feature: this.feature, text: this.text, lng: this.lng, lat: this.lat, getHeight: this.getHeight, getBottomHeight: this.getBottomHeight, group: this.group }) } destroy() { this.remove(), this.style = null, this._clickCallback = void 0, this._postRender = void 0; } _createGradientIfNeed(t, e = !1) { if ("[object Function]" === Object.prototype.toString.call(this.style.tailLine.getLineGradient)) { const i = t.children[0], r = this.style.tailLine.getLineGradient(this), o = r.flat().join(""); let n = !1; for (let t = i.children.length - 1; t >= 0; t--)i.children[t].getAttribute("id") === o && !1 === e ? n = !0 : i.children[t].remove(); if (!0 === n) return this.style.tailLine.stroke = `url(#${o})`, !1; const s = Gs("linearGradient", { id: o, x1: "0%", y1: "0%", x2: "0%", y2: "100%" }); return r.forEach(((t, e, i) => { const r = Gs("stop", { offset: `${Math.round(100 * e / (i.length - 1))}%`, style: `stop-color:rgb(${t.slice(0, 3).join(",")}); stop-opacity: ${t[3]}` }); s.appendChild(r); })), i.appendChild(s), this.style.tailLine.stroke = `url(#${o})`, !0 } return !1 } _onClick(t) { this._clickCallback(this); } _updateOnStyleChange(t, e) { const { label: i, tailLine: r, tailAnchor: o } = t; if (this._labelElement) { const t = this._labelElement, { getClassNames: r, getContent: o } = i, n = e.label.getClassNames(this), s = r(this); n.forEach((e => t.classList.remove(e))), s.forEach((e => t.classList.add(e))), t.innerHTML = o(this); } this._tailGraphic && (!0 === r.show ? (this._createGradientIfNeed(this._tailGraphic, !0), this._tailLine && js(this._tailLine, r)) : this._tailLine && (this._tailLine.remove(), this._tailLine = void 0), !0 === o.show ? this._tailAnchor && js(this._tailAnchor, { ...o, fill: o.getFillColor(this) }) : this._tailAnchor && (this._tailAnchor.remove(), this._tailAnchor = void 0)); } _getAnchor(t) { const { map: e } = t; return Vs(e, [this.lng, this.lat, this._getHeight()]) } } class Zs { constructor(t, e) { this.target = t, this._options = { getOffset: t => [-50, -50], getSize: t => [100, 30], getBuffer: t => [20, 20, 20, 20], ...e || {} }; } priority(t) { return this.target.priority(t) } bounds(t) { return t.option = { ...this._options }, this.target.bounds(t) } } class Ys { constructor(t, e) { this._executor = t, this._option = e; } exec() { this._executor.exec(this._option); } } class qs { constructor() { this._queue = [], this._executing = !1; } push(t) { this._queue.push(t), this._nextTick(); } clear() { this._queue.splice(0, this._queue.length); } _nextTick() { !1 === this._executing && (this._executing = !0, Promise.resolve().then((() => { this._exec(), this._executing = !1, this.clear(); }))); } _exec() { this._queue.length <= 0 || this._queue[this._queue.length - 1].exec(); } } e(".tailed-label{position:absolute;top:0;left:0;display:flex}"); const Xs = { map: void 0, speed: 12, autoView: !0, autoRotate: !1, iconUrl: "", iconSize: null, iconAnchor: null, zIndexOffset: 0 }, Qs = { size: 200, duration: 1e3, color: [0, 255, 255], innerOpacity: .6, innerRatio: .2 }, Ks = { size: 150, color: [0, 255, 255], opacityBreaks: 6, opacityRange: [.2, .6], speedRatio: 1 }; function Js(t, e) { var i = { each: c, map: function (t, e) { var i = []; return c(t, (function (t, r) { i.push(e(t, r)); })), i }, mapTimes: function (t, e) { var i = []; return h(t, (function (t) { i.push(e(t)); })), i }, eachTimes: h }, r = function () { }, o = { animate: !1, animationSpeed: 0, customPin: !1, initializeLeg: r, onClick: r, circleSpiralSwitchover: 9, circleFootSeparation: 25, spiralFootSeparation: 28, spiralLengthStart: 15, spiralLengthFactor: 4 }, n = 2 * Math.PI, s = []; for (var a in e) o[a] = e[a]; function l() { i.each(s.reverse(), (function (t, e) { o.animate ? (t.elements.container.style.transitionDelay = o.animationSpeed / 1e3 / s.length * e + "s", t.elements.container.className += " exit", setTimeout((function () { t.mapboxMarker.remove(); }), o.animationSpeed + 100)) : t.mapboxMarker.remove(); })), s = []; } function c(t, e) { var i = 0; if (!t || !t.length) return []; for (i = 0; i < t.length; i++)e(t[i], i); } function h(t, e) { if (!t) return []; for (var i = 0; i < t; i++)e(i); } this.spiderfy = (e, r) => function (e, r) { var a, c, h = (c = r.length) >= o.circleSpiralSwitchover ? function (t) { var e = o.spiralLengthStart, r = 0; return i.mapTimes(t, (function (t) { var i; return r += o.spiralFootSeparation / e + 5e-4 * t, i = { x: e * Math.cos(r), y: e * Math.sin(r), angle: r, legLength: e, index: t }, e += n * o.spiralLengthFactor / r, i })) }(c) : function (t) { var e = o.circleFootSeparation * (2 + t) / n, r = n / t; return i.mapTimes(t, (function (t) { var i = t * r; return { x: e * Math.cos(i), y: e * Math.sin(i), angle: i, legLength: e, index: t } })) }(c); l(), a = i.map(r, (function (t, i) { var r, n, s = h[i], a = function (t) { var e = document.createElement("div"), i = document.createElement("div"), r = document.createElement("div"); return e.className = "spider-leg-container" + (o.animate ? " animate initial " : " "), r.className = "spider-leg-line", i.className = "spider-leg-pin" + (o.customPin ? "" : " default-spider-pin"), e.appendChild(r), e.appendChild(i), e.style["margin-left"] = t.x + "px", e.style["margin-top"] = t.y + "px", r.style.height = t.legLength + "px", r.style.transform = "rotate(" + (t.angle - Math.PI / 2) + "rad)", { container: e, line: r, pin: i } }(s); return r = new li(a.container).setLngLat(e), o.initializeLeg(n = { feature: t, elements: a, mapboxMarker: r, param: s }), a.container.onclick = function (t) { o.onClick(t, n); }, n })), i.each(a.reverse(), (function (e) { e.mapboxMarker.addTo(t); })), o.animate && setTimeout((function () { i.each(a.reverse(), (function (t, e) { t.elements.container.className = (t.elements.container.className || "").replace("initial", ""), t.elements.container.style.transitionDelay = o.animationSpeed / 1e3 / a.length * e + "s"; })); })), s = a; }(e, r), this.unspiderfy = () => l(), this.each = function (t) { i.each(s, t); }; } function $s(t, e, i) { return [t[0] + (e || 0), t[1] + (i || 0)] } Js.popupOffsetForSpiderLeg = function (t, e) { var i = t.param.x, r = t.param.y; return { top: $s([0, e = e || 0], i, r), "top-left": $s([e, e], i, r), "top-right": $s([-e, e], i, r), bottom: $s([0, -e], i, r), "bottom-left": $s([e, -e], i, r), "bottom-right": $s([-e, -e], i, r), left: $s([e, -e], i, r), right: $s([-e, -e], i, r) } }, window.turf = { center: Ci, bbox: Ti, area: Ai, distance: xi, length: function (t, e) { return void 0 === e && (e = {}), function (t, i, r) { var o = 0; return function (t, i) { !function (t, e) { Ei(t, (function (t, i, r, o, n) { var s, a = null === t ? null : t.type; switch (a) { case null: case "Point": case "LineString": case "Polygon": return !1 !== e(ui(t, r, { bbox: o, id: n }), i, 0) && void 0 }switch (a) { case "MultiPoint": s = "Point"; break; case "MultiLineString": s = "LineString"; break; case "MultiPolygon": s = "Polygon"; }for (var l = 0; l < t.coordinates.length; l++)if (!1 === e(ui({ type: s, coordinates: t.coordinates[l] }, r), i, l)) return !1 })); }(t, (function (t, i, r) { if (t.geometry) { var n = t.geometry.type; if ("Point" !== n && "MultiPoint" !== n) { var s, a = 0, l = 0, c = 0; return !1 !== wi(t, (function (r, n, h, u, d) { return void 0 === s || i > a || u > l || d > c ? (s = r, a = i, l = u, c = d, void 0) : !1 !== function (t, i, r, n, s) { o = function (t, i) { var r = i.geometry.coordinates; return t + xi(r[0], r[1], e) }(o, t); }(mi([s, r], t.properties)) && (void (s = r)) })) && void 0 } } })); }(t), o }(t) }, ...window.turf || {} }; var ta = { getApiPath: function () { return xn().replace(/\/api.*$/, "/api/") }, getDefaultImagePath: xn }; const ea = { version: `${t.version}.${(new Date).toLocaleDateString().replace(/\//g, "")}`, supported: i, Map: class extends fn { constructor(e) { var i; Object.prototype.hasOwnProperty.call(e, "style") || (e.style = "true" === ["<<<SFMAP_FALLBACK_URL_ENABLE>>>", ""].join("") ? Ui.substring(0, 1) + Ui.substring(1) || Vi : Ui, e.style && !/\<\<\<.*\>\>\>/.test(e.style) || (console.error("Invalid or none default style config"), console.debug("Use default vector-normal style!"), e.style = Vi)), vn = (i = e.protocol) ? [i, ":"].join("") : null, function (t) { switch (t.style) { case ki: t.style = Ni; break; case Fi: t.style = Gi; break; case Ri: t.style = ji; break; case Bi: t.style = Hi; break; case Oi: t.style = Vi; } }(e = t.extend({}, bn, e)), t.updateProjectionContext(e), e.createTransform = t.createTransform, super(e); } remove() { this && (this.__base_style_ = null, delete this.__base_style_), super.remove(); } getCRS() { return t.getCRS() } setCRS(e) { return !!t.validateCRS(e) && e != t.getCRS() && (console.debug(`change map crs from ${t.getCRS().CODE} to ${e.CODE}`), t.updateProjectionContext({ crs: e }), t.updateTransform({ size: [this._canvas.width, this._canvas.height] }), !0) } project3D(e) { const i = t.MercatorCoordinate.fromLngLat(e.slice(0, 2)), r = e[2] || 0, { worldSize: o, pixelMatrix: n } = this.transform, s = [i.x * o, i.y * o, r + i.toAltitude(), 1]; return t.transformMat4$1(s, s, n), s[3] > 0 ? [s[0] / s[3], s[1] / s[3]] : [Number.MAX_VALUE, Number.MAX_VALUE] } _updateDiff(t, e) { if (!0 === e.reserveLayers) { const i = { ...t }, r = function (t, e, i) { if (!t) return; if (!e) return; const r = function (t, e) { e = { layerFilter: t => "basemap" !== t.metadata.source, sourceFilter: t => !0, ...e || {} }; const i = { lastMapCrs: t.getCRS().CODE, currentMapCrs: t.getCRS().CODE, mapCrsChanged: !1, businessLayers: [], businessSources: [], customLayers: [] }, r = t.__base_style_; if (r) { const o = t.getStyle(); i.lastMapCrs = r.mapCrs; const n = i.lastMapCrs === i.currentMapCrs ? t => !0 : t => ["vector", "raster", "raster-dem"].indexOf(o.sources[t.source].type) < 0; i.businessLayers = o.layers.map(((t, e, i) => r.layers.findIndex((e => e.id === t.id)) < 0 && { id: t.id, beforeLayerId: e < i.length - 1 ? i[e + 1].id : null, source: t.source, metadata: t })).filter(Boolean).filter(n).filter(e.layerFilter), i.businessSources = i.businessLayers.reduce(((t, e) => { const i = e.source; return !0 !== t.keys[i] && (t.keys[i] = !0, t.values.push({ id: i, metadata: o.sources[i] })), t }), { values: [], keys: {} }).values.filter(e.sourceFilter); } return i.mapCrsChanged = i.currentMapCrs !== i.lastMapCrs, i }(t, i = { ...i || {} }), { businessLayers: o, businessSources: n } = r; return yn(t, e), n.forEach((t => { e.sources[t.id] = e.sources[t.id] || t.metadata; })), o.reverse().filter((t => e.layers.findIndex((e => e.id === t.id)) < 0)).forEach(((t, i, r) => { if (null === t.beforeLayerId) e.layers.push(t.metadata); else { let o = e.layers.findIndex((e => e.id === t.beforeLayerId)); if (o >= 0) e.layers.splice(o, 0, t.metadata); else if (console.debug("beforeLayer 涓嶅瓨鍦紝淇濈暀businessLayers鍐呯殑鐩稿椤哄簭锛�"), i > 0) { const n = r[i - 1].id; o = e.layers.findIndex((t => t.id === n)), o >= 0 && e.layers.splice(Math.max(0, o - 1), 0, t.metadata); } else e.layers.push(t.metadata); } })), r }(this, i, {}); console.debug("搴曞浘鍒囨崲澶勭悊鏍峰紡瀵规瘮鈥︹€�", t, i); const o = super._updateDiff(i, e); try { !function (t, e) { const { businessSources: i, mapCrsChanged: r } = e; !0 === r && (console.debug("鍧愭爣绯绘湁鏀瑰彉锛屽己鍒舵洿鏂癵eojson/image/video鏁版嵁婧愶紒", e), i.filter((t => "geojson" === t.metadata.type)).forEach((e => { const i = t.getSource(e.id); if (i) try { i._updateWorkerData(); } catch (t) { console.warn(t); } })), i.filter((t => "image" === t.metadata.type)).forEach((e => { const i = t.getSource(e.id); if (i) try { i.updateImage({ url: e.metadata.url }); } catch (t) { console.warn(t); } })), i.filter((t => "video" === t.metadata.type)).forEach((e => { const i = t.getSource(e.id); if (i) try { i.load(); } catch (t) { console.warn(t); } }))); }(this, r); } catch (t) { console.warn(t); } return o } return super._updateDiff(t, e) } _updateStyle(t, e) { const i = super._updateStyle(t, e); return e && !1 !== e.diff && !0 === e.reserveLayers || (this.style._load = (t, e) => (e && yn(this, t), ai.prototype._load.call(this.style, t, e))), i } }, CRS: t.CRS, NavigationControl: class { constructor(e) { this.options = t.extend({}, v, e), this._container = n.create("div", "mapboxgl-ctrl mapboxgl-ctrl-group"), this._container.addEventListener("contextmenu", (t => t.preventDefault())), this.options.showZoom && (t.bindAll(["_setButtonTitle", "_updateZoomButtons"], this), this._zoomInButton = this._createButton("mapboxgl-ctrl-zoom-in", (t => this._map.zoomIn({}, { originalEvent: t }))), n.create("span", "mapboxgl-ctrl-icon", this._zoomInButton).setAttribute("aria-hidden", !0), this._zoomOutButton = this._createButton("mapboxgl-ctrl-zoom-out", (t => this._map.zoomOut({}, { originalEvent: t }))), n.create("span", "mapboxgl-ctrl-icon", this._zoomOutButton).setAttribute("aria-hidden", !0)), this.options.showCompass && (t.bindAll(["_rotateCompassArrow"], this), this._compass = this._createButton("mapboxgl-ctrl-compass", (t => { this.options.visualizePitch ? this._map.resetNorthPitch({}, { originalEvent: t }) : this._map.resetNorth({}, { originalEvent: t }); })), this._compassIcon = n.create("span", "mapboxgl-ctrl-icon", this._compass), this._compassIcon.setAttribute("aria-hidden", !0)); } _updateZoomButtons() { const t = this._map.getZoom(), e = t === this._map.getMaxZoom(), i = t === this._map.getMinZoom(); this._zoomInButton.disabled = e, this._zoomOutButton.disabled = i, this._zoomInButton.setAttribute("aria-disabled", e.toString()), this._zoomOutButton.setAttribute("aria-disabled", i.toString()); } _rotateCompassArrow() { const t = this.options.visualizePitch ? `scale(${1 / Math.pow(Math.cos(this._map.transform.pitch * (Math.PI / 180)), .5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle * (180 / Math.PI)}deg)` : `rotate(${this._map.transform.angle * (180 / Math.PI)}deg)`; this._map._requestDomTask((() => { this._compassIcon && (this._compassIcon.style.transform = t); })); } onAdd(t) { return this._map = t, this.options.showZoom && (this._setButtonTitle(this._zoomInButton, "ZoomIn"), this._setButtonTitle(this._zoomOutButton, "ZoomOut"), this._map.on("zoom", this._updateZoomButtons), this._updateZoomButtons()), this.options.showCompass && (this._setButtonTitle(this._compass, "ResetBearing"), this.options.visualizePitch && this._map.on("pitch", this._rotateCompassArrow), this._map.on("rotate", this._rotateCompassArrow), this._rotateCompassArrow(), this._handler = new x(this._map, this._compass, this.options.visualizePitch)), this._container } onRemove() { n.remove(this._container), this.options.showZoom && this._map.off("zoom", this._updateZoomButtons), this.options.showCompass && (this.options.visualizePitch && this._map.off("pitch", this._rotateCompassArrow), this._map.off("rotate", this._rotateCompassArrow), this._handler.off(), delete this._handler), delete this._map; } _createButton(t, e) { const i = n.create("button", t, this._container); return i.type = "button", i.addEventListener("click", e), i } _setButtonTitle(t, e) { const i = this._map._getUIString(`NavigationControl.${e}`); t.title = i, t.setAttribute("aria-label", i); } }, AttributionControl: ln, ScaleControl: class { constructor(e) { this.options = t.extend({}, y, e), t.bindAll(["_onMove", "setUnit"], this); } getDefaultPosition() { return "bottom-left" } _onMove() { b(this._map, this._container, this.options); } onAdd(t) { return this._map = t, this._container = n.create("div", "mapboxgl-ctrl mapboxgl-ctrl-scale", t.getContainer()), this._map.on("move", this._onMove), this._onMove(), this._container } onRemove() { n.remove(this._container), this._map.off("move", this._onMove), this._map = void 0; } setUnit(t) { this.options.unit = t, b(this._map, this._container, this.options); } }, FullscreenControl: class { constructor(e) { this._fullscreen = !1, e && e.container && (e.container instanceof t.window.HTMLElement ? this._container = e.container : t.warnOnce("Full screen control 'container' must be a DOM element.")), t.bindAll(["_onClickFullscreen", "_changeIcon"], this), "onfullscreenchange" in t.window.document ? this._fullscreenchange = "fullscreenchange" : "onwebkitfullscreenchange" in t.window.document && (this._fullscreenchange = "webkitfullscreenchange"); } onAdd(e) { return this._map = e, this._container || (this._container = this._map.getContainer()), this._controlContainer = n.create("div", "mapboxgl-ctrl mapboxgl-ctrl-group"), this._checkFullscreenSupport() ? this._setupUI() : (this._controlContainer.style.display = "none", t.warnOnce("This device does not support fullscreen mode.")), this._controlContainer } onRemove() { n.remove(this._controlContainer), this._map = null, t.window.document.removeEventListener(this._fullscreenchange, this._changeIcon); } _checkFullscreenSupport() { return !(!t.window.document.fullscreenEnabled && !t.window.document.webkitFullscreenEnabled) } _setupUI() { const e = this._fullscreenButton = n.create("button", "mapboxgl-ctrl-fullscreen", this._controlContainer); n.create("span", "mapboxgl-ctrl-icon", e).setAttribute("aria-hidden", !0), e.type = "button", this._updateTitle(), this._fullscreenButton.addEventListener("click", this._onClickFullscreen), t.window.document.addEventListener(this._fullscreenchange, this._changeIcon); } _updateTitle() { const t = this._getTitle(); this._fullscreenButton.setAttribute("aria-label", t), this._fullscreenButton.title = t; } _getTitle() { return this._map._getUIString(this._isFullscreen() ? "FullscreenControl.Exit" : "FullscreenControl.Enter") } _isFullscreen() { return this._fullscreen } _changeIcon() { (t.window.document.fullscreenElement || t.window.document.webkitFullscreenElement) === this._container !== this._fullscreen && (this._fullscreen = !this._fullscreen, this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"), this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"), this._updateTitle()); } _onClickFullscreen() { this._isFullscreen() ? t.window.document.exitFullscreen ? t.window.document.exitFullscreen() : t.window.document.webkitCancelFullScreen && t.window.document.webkitCancelFullScreen() : this._container.requestFullscreen ? this._container.requestFullscreen() : this._container.webkitRequestFullscreen && this._container.webkitRequestFullscreen(); } }, Popup: P, Popup3D: class extends P { constructor(t) { super(t), this.options = { ...Zi, ...this.options }; } setElevation(t) { return this._elevation = t, this } _update() { if (!this._map || !this._lngLat && !this._geo || !this._content) return; this._container || (this._container = n.create("div", "mapboxgl-popup", this._map.getContainer()), this._tip = n.create("div", "mapboxgl-popup-tip", this._container), this._container.appendChild(this._content), this.options.className && this.options.className.split(" ").forEach((t => this._container.classList.add(t)))), this.options.maxWidth && this._container.style.maxWidth !== this.options.maxWidth && (this._container.style.maxWidth = this.options.maxWidth), this._map.transform.renderWorldCopies && (this._lngLat = S(this._lngLat, this._pos, this._map.transform)); let t = this._pos = this.transform(this._lngLat), e = this.options.anchor; const i = z(this.options.offset); if (!e) { const r = this._container.offsetWidth, o = this._container.offsetHeight; let n; n = t.y + i.bottom.y < o ? ["top"] : t.y > this._map.transform.height - o ? ["bottom"] : [], t.x < r / 2 ? n.push("left") : t.x > this._map.transform.width - r / 2 && n.push("right"), e = 0 === n.length ? "bottom" : n.join("-"); } const r = t.add(i[e]).round(); this._map._requestDomTask((() => { this._container && e && (n.setTransform(this._container, `${A[e]} translate(${r.x}px,${r.y}px)`), L(this._container, e, "popup")); })); } transform(t) { return this.transform3D(t, this._elevation || 0) } transform3D(e, i) { const r = t.MercatorCoordinate.fromLngLat(e), { worldSize: o, pixelMatrix: n } = this._map.transform, s = [r.x * o, r.y * o, i + r.toAltitude(), 1]; return t.transformMat4$1(s, s, n), s[3] > 0 ? new t.pointGeometry(s[0] / s[3], s[1] / s[3]) : new t.pointGeometry(Number.MAX_VALUE, Number.MAX_VALUE) } }, Marker: wn, Style: ai, LngLat: t.LngLat, LngLatBounds: t.LngLatBounds, Point: t.pointGeometry, MercatorCoordinate: t.MercatorCoordinate, FreeCameraOptions: t.FreeCameraOptions, Evented: t.Evented, config: t.config, MapMouseEvent: E, GeoJSON: Jn, WKT: os, MssExtInfo: ss, MeasureDistanceHandler: class extends t.Evented { constructor(t, e = {}) { super(), this.LAYER_GUIDE_LINE = "ctrl-measure-distance-layer-guide-line", this.LAYER_LINE = "ctrl-measure-distance-layer-line", this.LAYER_VERTEX = "ctrl-measure-distance-layer-vertex", this.SOURCE_GUIDE_LINE = "ctrl-measure-distance-source-guide-line", this.SOURCE_LINE = "ctrl-measure-distance-source-line", this.SOURCE_SYMBOL = "ctrl-measure-distance-source-symbol", this.BASE_CLS = "mapboxgl-handler-measure", this._enabled = !1, this._active = !1, this.map = t, this.isMeasuring = 0, this.markers = [], this.coordinates = [], this.textLabels = [], this.resultLabels = [], this.isDoubleClickZoomEnable = null, this.isFeatureInteractiveEnable = null, this.onMoveListener = this.onMove.bind(this), this.onClickListener = this.onClick.bind(this), this._options = Object.assign({}, { units: "meters", themeColor: "#4693FF", labelFormat: t => (t < 1e3 ? [t.toFixed(0), "M"] : [(t / 1e3).toFixed(0), "KM虏"]).join("") }, e), this._drawed = !1, this.map.measureDistanceHandler = this; } isEnabled() { return this._enabled } disable() { this.measuringStop(), this.measuringOff(), this.fire(new t.Event("disable")); } enable() { this.measuringOn(), this.fire(new t.Event("enable")); } draw() { this._drawed || (this.map.addSource(this.SOURCE_GUIDE_LINE, { type: "geojson", data: yi(this.coordinates) }), this.map.addSource(this.SOURCE_LINE, { type: "geojson", data: yi(this.coordinates) }), this.map.addSource(this.SOURCE_SYMBOL, { type: "geojson", data: bi(this.coordinates, this.textLabels) }), this.map.addLayer({ id: this.LAYER_GUIDE_LINE, type: "line", source: this.SOURCE_GUIDE_LINE, layout: { "line-cap": "round", "line-join": "round" }, filter: ["all", ["==", "$type", "LineString"]], paint: { "line-color": this._options.themeColor, "line-dasharray": [2, 2], "line-width": 3 } }), this.map.addLayer({ id: this.LAYER_LINE, type: "line", source: this.SOURCE_LINE, layout: { "line-cap": "round", "line-join": "round" }, filter: ["all", ["==", "$type", "LineString"]], paint: { "line-color": this._options.themeColor, "line-width": 3 } }), this.map.addLayer({ id: this.LAYER_VERTEX, type: "circle", source: this.SOURCE_SYMBOL, paint: { "circle-radius": 3, "circle-stroke-color": this._options.themeColor, "circle-color": "transparent" } }), this._drawed = !0); } measuringOn() { -1 === this.isMeasuring && this.measuringRemove(), this.stopDoubleClickZoom(), this.stopFeatureAware(), this.map.getCanvas().style.cursor = "crosshair", this.isMeasuring = 1, this.markers = [], this.lastPoint = null, this.coordinates = [], this.textLabels = [], this.resultLabels = [], this.draw(), this.map.on("mousemove", this.onMoveListener), this.map.on("click", this.onClickListener), this.map.fire(new t.Event("measure.distance.on")), this.fire(new t.Event("on")), this._enabled = !0; } measuringOff() { this.revertDoubleClickZoom(), this.revertFeatureAware(), this.isMeasuring = 0, this.map.getCanvas().style.cursor = "", this.measuringRemove(), this.map.off("mousemove", this.onMoveListener), this.map.off("click", this.onClickListener), this.map.fire(new t.Event("measure.distance.off")), this.fire(new t.Event("off")), this._enabled = !1; } measuringStop() { this.isMeasuring = -1, this.map.getCanvas().style.cursor = "", this.map.off("mousemove", this.onMoveListener), this.map.off("click", this.onClickListener), this.map.fire(new t.Event("measure.distance.stop")), this.revertDoubleClickZoom(), this.revertFeatureAware(), this.fire(new t.Event("stop")), this._enabled = !1; } measuringRemove() { this.isMeasuring = 0, this.revertDoubleClickZoom(), this.revertFeatureAware(), this._drawed && this.clear(); } clear() { this.fire(new t.Event("clear")), this.clearMarkers(), this.clearPath(); } clearMarkers() { this.startPoint = null, this.resultLabels.forEach((t => t.remove())) && (this.resultLabels = []), this.markers.forEach((t => t.remove())) && (this.markers = []), this.textLabels = [], this.coordinates = []; } clearPath() { const t = this.map.getSource(this.SOURCE_GUIDE_LINE), e = this.map.getSource(this.SOURCE_LINE), i = this.map.getSource(this.SOURCE_SYMBOL); t && t.setData(yi([])), e && e.setData(yi([])), i && i.setData(bi([], [])); } stopDoubleClickZoom() { this.isDoubleClickZoomEnable = this.map.doubleClickZoom.isEnabled(), this.map.doubleClickZoom.disable(); } revertDoubleClickZoom() { null !== this.isDoubleClickZoomEnable && setTimeout((() => { this.isDoubleClickZoomEnable && this.map.doubleClickZoom.enable(), this.isDoubleClickZoomEnable = null; })); } stopFeatureAware() { this.map.featureAware && (this.featureAwareEnable = this.map.featureAware.isEnabled(), this.map.featureAware.disable()); } revertFeatureAware() { this.map.featureAware && null !== this.featureAwareEnable && setTimeout((() => { this.featureAwareEnable && this.map.featureAware.enable(), this.featureAwareEnable = null; })); } showResultLabels() { this.coordinates.map(((t, e) => { if (0 === e) return; const i = this.resultLabels[e]; i && i.remove && i.remove(), this.resultLabels[e] = this.showResultLabel(e, e === this.coordinates.length - 1); })); const e = [...this.textLabels]; e.shift(), this.fire(new t.Event("measure", { data: e })); } showResultLabel(t, e) { const i = this.coordinates[t], r = this.BASE_CLS, o = [`<div class="${this.BASE_CLS}-popup">`, `<span class="${this.BASE_CLS}-content" style="border-color: ${this._options.themeColor};color: ${this._options.themeColor};">${this.textLabels[t].text}</span>`, e ? `<span title="娓呴櫎" class="${this.BASE_CLS}-trush-icon ${this.BASE_CLS}-distance-trush-icon" style="background-color: ${this._options.themeColor}">脳</span>` : "", "</div>"].join(""), n = new P({ offset: 3, closeButton: !1, closeOnClick: !1, anchor: "bottom", className: [r, `${r}-distance`].join(" "), maxWidth: null }).setLngLat(i).setHTML(o).addTo(this.map); return e && document.querySelectorAll(`.${this.BASE_CLS}-distance-trush-icon`)[0].addEventListener("click", (() => { this.measuringRemove(); })), n } onMove(t) { const e = this.coordinates; if (!e.length) return; const { lng: i, lat: r } = t.lngLat; this.map.getSource(this.SOURCE_GUIDE_LINE).setData(yi([e[e.length - 1], [i, r]])); } onClick(t) { const e = document.createElement("div"); if (e.style.width = "12px", e.style.height = "12px", e.style.borderRadius = "50%", e.style.background = "#fff", e.style.boxSizing = "border-box", e.style.border = `2px solid ${this._options.themeColor}`, this.coordinates.length >= 2) { const { point: e } = t, i = this.map.queryRenderedFeatures([[e.x - 5, e.y - 5], [e.x + 5, e.y + 5]], { layers: [this.LAYER_VERTEX] }); if (i && i.length && Math.abs(t.point.x - this.lastPoint.x) < 5 && Math.abs(t.point.y - this.lastPoint.y) < 5) return this.measuringStop(), void this.showResultLabels() } this.lastPoint = t.point, this.coordinates.push([t.lngLat.lng, t.lngLat.lat]), this.textLabels = this.coordinatesToLabels(), this.coordinates.length > 1 && this.showResultLabels(), this.map.getSource(this.SOURCE_GUIDE_LINE).setData(yi([])), this.map.getSource(this.SOURCE_LINE).setData(yi(this.coordinates)), this.map.getSource(this.SOURCE_SYMBOL).setData(bi(this.coordinates, this.textLabels)); const i = new li({ element: e, draggable: !0 }).setLngLat(t.lngLat).addTo(this.map); this.markers.push(i), i.on("drag", (() => { const t = this.markers.indexOf(i), e = i.getLngLat(); this.coordinates[t] = [e.lng, e.lat], this.textLabels = this.coordinatesToLabels(), this.map.getSource(this.SOURCE_LINE).setData(yi(this.coordinates)), this.map.getSource(this.SOURCE_SYMBOL).setData(bi(this.coordinates, this.textLabels)), this.showResultLabels(); })); } coordinatesToLabels() { const { coordinates: t } = this, { units: e, labelFormat: i } = this._options; let r = 0; return t.map(((o, n) => 0 === n ? { distance: 0, text: i(0, e) } : (r += xi(t[n - 1], t[n], { units: e }), { distance: r, text: i(r, e) }))) } destroy() { 1 === this.isMeasuring && this.measuringOff(), this.map && (this.map.off("mousemove", this.onMoveListener), this.map.off("click", this.onClickListener), this.clearMarkers(), this.clearPath(), [this.LAYER_GUIDE_LINE, this.LAYER_LINE, this.LAYER_VERTEX].forEach((t => { this.map.getLayer(t) && this.map.removeLayer(t); })), [this.SOURCE_GUIDE_LINE, this.SOURCE_LINE, this.SOURCE_SYMBOL].forEach((t => { this.map.getSource(t) && this.map.removeSource(t); })), this.map.measureDistanceHandler = void 0, this.map = void 0); } }, MeasureAreaHandler: class extends t.Evented { constructor(t, e = {}) { super(), this.LAYER_GUIDE_LINE = "ctrl-measure-area-layer-guide-line", this.LAYER_LINE = "ctrl-measure-area-layer-line", this.LAYER_VERTEX = "ctrl-measure-area-layer-vertex", this.LAYER_FILL = "ctrl-measure-area-layer-fill", this.SOURCE_GUIDE_LINE = "ctrl-measure-area-source-guide-line", this.SOURCE_POLYGON = "ctrl-measure-area-source-line", this.SOURCE_SYMBOL = "ctrl-measure-area-source-symbol", this.BASE_CLS = "mapboxgl-handler-measure", this._enabled = !1, this._active = !1, this.map = t, this.isMeasuring = 0, this.startPoint = 0, this.lastPoint = 0, this.markers = [], this.coordinates = [], this.vertex = 0, this.isDoubleClickZoomEnable = null, this.featureAwareEnable = null, this.onClickListener = this.onClick.bind(this), this.onMoveListener = this.onMove.bind(this), this._options = Object.assign({}, { themeColor: "#4693FF", labelFormat: t => (t < 1e6 ? [t.toFixed(0), "M虏"] : [(t / 1e6).toFixed(0), "KM虏"]).join("") }, e), this._drawed = !1, this.map.measureAreaHandler = this; } isEnabled() { return this._enabled } disable() { this.measuringStop(), this.measuringOff(), this.fire(new t.Event("disable")); } enable() { this.measuringOn(), this.fire(new t.Event("enable")); } draw() { this._drawed || (this.map.addSource(this.SOURCE_GUIDE_LINE, { type: "geojson", data: Pi(this.coordinates) }), this.map.addSource(this.SOURCE_POLYGON, { type: "geojson", data: zi(this.coordinates) }), this.map.addSource(this.SOURCE_SYMBOL, { type: "geojson", data: Di(this.coordinates) }), this.map.addLayer({ id: this.LAYER_GUIDE_LINE, type: "line", source: this.SOURCE_GUIDE_LINE, layout: { "line-cap": "round", "line-join": "round" }, filter: ["all", ["==", "$type", "LineString"]], paint: { "line-color": this._options.themeColor, "line-dasharray": [2, 2], "line-width": 3 } }), this.map.addLayer({ id: this.LAYER_LINE, type: "line", source: this.SOURCE_POLYGON, layout: { "line-cap": "round", "line-join": "round" }, filter: ["all", ["==", "$type", "Polygon"]], paint: { "line-color": this._options.themeColor, "line-width": 3 } }), this.map.addLayer({ id: this.LAYER_FILL, type: "fill", source: this.SOURCE_POLYGON, filter: ["all", ["==", "$type", "Polygon"]], paint: { "fill-color": this._options.themeColor, "fill-opacity": .2 } }), this.map.addLayer({ id: this.LAYER_VERTEX, type: "circle", source: this.SOURCE_SYMBOL, paint: { "circle-radius": 3, "circle-color": "transparent" } }), this._drawed = !0); } measuringOn() { -1 === this.isMeasuring && this.measuringRemove(), this.stopDoubleClickZoom(), this.stopFeatureAware(), this.isMeasuring = 1, this.markers = [], this.coordinates = [], this.vertex = 0, this.map.getCanvas().style.cursor = "crosshair", this.resultLabel = null, this.draw(), this.map.on("click", this.onClickListener), this.map.on("mousemove", this.onMoveListener), this.map.fire(new t.Event("measure.area.on")), this.fire(new t.Event("on")), this._enabled = !0; } measuringOff() { this.revertDoubleClickZoom(), this.revertFeatureAware(), this.isMeasuring = 0, this.map.getCanvas().style.cursor = "", this.measuringRemove(), this.map.off("click", this.onClickListener), this.map.off("mousemove", this.onMoveListener), this.map.fire(new t.Event("measure.area.off")), this.fire(new t.Event("off")), this._enabled = !1; } measuringStop() { this.isMeasuring = -1, this.map.getCanvas().style.cursor = "", this.map.off("click", this.onClickListener), this.map.off("mousemove", this.onMoveListener), this.map.fire(new t.Event("measure.area.stop")), this.revertDoubleClickZoom(), this.revertFeatureAware(), this.fire(new t.Event("stop")), this._enabled = !1; } measuringRemove() { this.vertex = 0, this.revertDoubleClickZoom(), this.revertFeatureAware(), this._drawed && this.clear(); } clear() { this.fire(new t.Event("clear")), this.clearMarkers(), this.clearPath(); } clearMarkers() { this.isMeasuring = 0, this.startPoint = null, this.lastPoint = null, this.resultLabel && this.resultLabel.remove(), this.markers.forEach((t => t.remove())) && (this.markers = []), this.coordinates = []; } clearPath() { const t = this.map.getSource(this.SOURCE_GUIDE_LINE), e = this.map.getSource(this.SOURCE_POLYGON), i = this.map.getSource(this.SOURCE_SYMBOL); t && t.setData(Pi([])), e && e.setData(zi([])), i && i.setData(Di([])); } stopDoubleClickZoom() { this.isDoubleClickZoomEnable = this.map.doubleClickZoom.isEnabled(), this.map.doubleClickZoom.disable(); } revertDoubleClickZoom() { null !== this.isDoubleClickZoomEnable && setTimeout((() => { this.isDoubleClickZoomEnable && this.map.doubleClickZoom.enable(), this.isDoubleClickZoomEnable = null; })); } stopFeatureAware() { this.map.featureAware && (this.featureAwareEnable = this.map.featureAware.isEnabled(), this.map.featureAware.disable()); } revertFeatureAware() { this.map.featureAware && null !== this.featureAwareEnable && setTimeout((() => { this.featureAwareEnable && this.map.featureAware.enable(), this.featureAwareEnable = null; })); } showResultLabel(t, e) { this.resultLabel && this.resultLabel.remove(); const i = this.BASE_CLS, r = this.BASE_CLS + "-popup", o = this.BASE_CLS + "-content", n = this.BASE_CLS + "-trush-icon " + this.BASE_CLS + "-area-trush-icon", s = new P({ offset: [3, 7], closeButton: !1, closeOnClick: !1, anchor: "bottom", className: [i, i + "-area"].join(" "), maxWidth: null }).setLngLat(e).setHTML([`<div class="${r}">`, `<span class="${o}" style="border-color: ${this._options.themeColor};color: ${this._options.themeColor};">${t}</span>`, `<span title="娓呴櫎" class="${n}" style="background-color: ${this._options.themeColor}">脳</span>`, "</div>"].join("")).addTo(this.map); document.querySelectorAll("." + this.BASE_CLS + "-area-trush-icon")[0].addEventListener("click", (() => { this.measuringRemove(); })), this.resultLabel = s; } updateCenterAndTrush() { const e = Ci(zi(this.coordinates)).geometry.coordinates, i = this.coordinatesToLabelText(); this.fire(new t.Event("measure", { data: i })), this.showResultLabel(i.text, e); } onMove(t) { const e = this.coordinates; if (!e.length) return; const { lng: i, lat: r } = t.lngLat, o = [i, r]; let n = []; 1 === this.vertex && (n = [e[0], [i, r]]), 2 === this.vertex && (n = [e[0], e[1], o, e[0]]), this.vertex > 2 && (n = [e[e.length - 2], o, e[0]]), this.map.getSource(this.SOURCE_GUIDE_LINE).setData(Pi(n)); } onClick(t) { const e = document.createElement("div"); e.style.width = "12px", e.style.height = "12px", e.style.borderRadius = "50%", e.style.background = "#fff", e.style.boxSizing = "border-box", e.style.border = `2px solid ${this._options.themeColor}`, this.coordinates.length || (this.startPoint = t.point); const i = [t.lngLat.lng, t.lngLat.lat]; if (0 === this.vertex && (this.coordinates = [i, i, i]), 1 === this.vertex && (this.coordinates[1] = i), this.vertex >= 3) { const { point: e } = t, i = this.map.queryRenderedFeatures([[e.x - 5, e.y - 5], [e.x + 5, e.y + 5]], { layers: [this.LAYER_VERTEX] }); if (i && i.length && (Math.abs(t.point.x - this.startPoint.x) < 5 && Math.abs(t.point.y - this.startPoint.y) < 5 || Math.abs(t.point.x - this.lastPoint.x) < 5 && Math.abs(t.point.y - this.lastPoint.y) < 5)) return this.map.getSource(this.SOURCE_GUIDE_LINE).setData(zi([])), this.map.getSource(this.SOURCE_POLYGON).setData(zi(this.coordinates)), this.map.getSource(this.SOURCE_SYMBOL).setData(Di(this.coordinates)), this.measuringStop(), void this.updateCenterAndTrush() } this.vertex >= 2 && (this.coordinates.splice(this.vertex, 0, i), this.updateCenterAndTrush()), this.lastPoint = t.point, this.vertex = this.vertex + 1, this.map.getSource(this.SOURCE_POLYGON).setData(zi(this.coordinates)), this.map.getSource(this.SOURCE_SYMBOL).setData(Di(this.coordinates)); const r = new li({ element: e, draggable: !0 }).setLngLat(t.lngLat).addTo(this.map); this.markers.push(r), r.on("drag", (() => { const t = this.markers.indexOf(r), e = r.getLngLat(); this.coordinates[t] = [e.lng, e.lat], 0 !== t && t !== this.coordinates.length - 1 || (this.coordinates[0] = [e.lng, e.lat], this.coordinates[this.coordinates.length - 1] = [e.lng, e.lat]), this.map.getSource(this.SOURCE_POLYGON).setData(zi(this.coordinates)), this.map.getSource(this.SOURCE_SYMBOL).setData(Di(this.coordinates)), this.updateCenterAndTrush(); })); } coordinatesToLabelText() { const { labelFormat: t } = this._options, { coordinates: e } = this, i = zi(e); return { area: Ai(i), text: t(Ai(i)) } } destroy() { 1 === this.isMeasuring && this.measuringOff(), this.map && (this.map.off("click", this.onClickListener), this.map.off("mousemove", this.onMoveListener), this.clearMarkers(), this.clearPath(), [this.LAYER_GUIDE_LINE, this.LAYER_LINE, this.LAYER_VERTEX, this.LAYER_FILL].forEach((t => { this.map.getLayer(t) && this.map.removeLayer(t); })), [this.SOURCE_GUIDE_LINE, this.SOURCE_POLYGON, this.SOURCE_SYMBOL].forEach((t => { this.map.getSource(t) && this.map.removeSource(t); })), this.map.measureAreaHandler = void 0, this.map = void 0); } }, FeatureAwareHandler: class { constructor(e, i) { this._map = e, this._canvasContainer = e.getCanvasContainer(), this._enabled = !1, this._active = !1, this._featureHover = null, this._options = Object.assign({}, { clickBuffer: 5, awareLayers: [], awareSources: [], getAwareLayers: t => { }, getAwareSources: t => { } }, i), "number" == typeof this._options.clickBuffer && (this._options.clickBuffer = [this._options.clickBuffer, this._options.clickBuffer]), t.bindAll(["_onMouseEnter", "_onMouseLeave", "_onClick"], this), e.featureAware = this, this.enable(); } isEnabled() { return !!this._enabled } isActive() { return !!this._active } enable() { this.isEnabled() || (this._enabled = !0, this._bindAll()); } disable() { this.isEnabled() && (this._enabled = !1, this._unbindAll()); } _getQueryLayers() { let t = this._options.awareLayers; return t && t.length || (t = this._options.getAwareLayers()), t && t.length || (t = this._map.getStyle().layers.filter((t => "symbol" === t.type)).filter((t => t.metadata && 1 === t.metadata.click)).map((t => t.id))), t || [] } _getQuerySources() { let t = this._options.awareSources; if (t && t.length || (t = this._options.getAwareSources()), !t || !t.length) { const e = this._map.getStyle(); t = Object.keys(e.sources).filter((t => "vector" === e.sources[t].type)).map((t => t)); } return t || [] } _bindAll() { this._map.on("click", this._onClick), this._getQueryLayers().map((t => { this._map.on("mouseenter", t, this._onMouseEnter), this._map.on("mouseleave", t, this._onMouseLeave); })); } _unbindAll() { this._map.off("click", this._onClick), this._getQueryLayers().map((t => { this._map.off("mouseenter", t, this._onMouseEnter), this._map.off("mouseleave", t, this._onMouseLeave); })); } _onMouseEnter(t) { if (this._active = !0, !t.features || !t.features.length) return; const e = t.features[0]; this._featureHover = e, e && e.id && (this._map.setFeatureState(this._featureHover, { hover: !0 }), this._canvasContainer.style.cursor = "pointer"); } _onMouseLeave(t) { this._active = !1, this._canvasContainer.style.cursor = ""; const e = this._featureHover; e && e.id && (this._getQuerySources().map((t => { this._map.setFeatureState({ source: t, id: this._featureHover.id, sourceLayer: this._featureHover.sourceLayer }, { hover: !1 }); })), this._canvasContainer.style.cursor = "default"); } _onClick(e) { if (!this.isEnabled()) return; const i = this._options.clickBuffer || [5, 5]; let r = this._map.queryRenderedFeatures([[e.point.x - i[0], e.point.y - i[1]], [e.point.x + i[0], e.point.y + i[1]]], { layers: this._getQueryLayers().filter((t => !!this._map.getLayer(t))) }); r && r.length && this._map.fire(new t.Event("featureaware", { originalEvent: e, features: r })); } }, STYLES: Wi, Symbol: Nn, Polyline: Wn, Polygon: Qn, Circle: cs, HeatmapLayer: ds, ClusterLayer: vs, WmsLayer: Es, TmsLayer: Ss, LayerGroup: An, PitchViewControl: class { constructor(e) { this.options = t.extend({}, e), this._options = t.extend({}, Ls, e), this._pitch = this._options.pitch, this._map = this._options.map, this._3dViewOn = !1; } onAdd(t) { this._map = t; const e = this._container = n.create("div", "mapboxgl-ctrl mapboxgl-ctrl-group mapboxgl-ctrl-pitch"); e.addEventListener("contextmenu", (t => t.preventDefault())); const i = this._3dView = n.create("button", "", e); i.type = "button", i.setAttribute("ariaLabel", "3dViewButton"), i.addEventListener("click", (() => this._pitchToggle())), i.innerHTML = "2D"; const r = () => { t.on("pitchend", this._pitchendHandle.bind(this)); }; return t._loaded ? r() : t.once("load", (() => { r(); })), e } _pitchendHandle(t) { const e = t.target.getPitch(); this._switchText(e > 0); } onRemove() { n.remove(this._container), this._map.off("pitchend", this._pitchendHandle.bind(this)), this._map = null; } getDefaultPosition() { return "bottom-right" } _pitchToggle() { this._map.setPitch(this._3dViewOn ? 0 : this._pitch); } _switchText(t) { this._3dView && (console.log(t, 2), t ? (this._3dView.innerHTML = "3D", this._3dViewOn = !0) : (this._3dView.innerHTML = "2D", this._3dViewOn = !1)); } }, MiniMapControl: class { constructor(e) { this.options = t.extend({}, As, e), this._ticking = !1, this._parentMap = null, this._isDragging = !1, this._isCursorOverFeature = !1, this._previousPoint = [0, 0], this._currentPoint = [0, 0], this._trackingRectCoordinates = [[[], [], [], [], []]]; } onAdd(t) { this._parentMap = t; const e = this.options, i = t.options, r = this._container = this._createContainer(this._parentMap), o = this._miniMap = new fn({ container: r, sourceType: e.sourceType || i.sourceType, style: e.style || i.style, zoom: e.zoom || i.zoom, center: e.center || i.center, attributionControl: !1 }); return o._loaded ? (() => { this._load(); })() : (console.log("loading"), o.once("load", this._load.bind(this))), r } _createContainer(t) { const { width: e, height: i, lineColor: r } = this.options, o = t.getContainer(), s = n.create("div", "mapboxgl-ctrl mapboxgl-ctrl-minimap", o); return s.setAttribute("style", `width:${e};height: ${i};border:1px solid ${r};`), s.addEventListener("contextMenu", this._preventDefault), "" !== this.options.id && (s.id = this.options.id), s } onRemove() { this._miniMap.remove(), n.remove(this._container); } getDefaultPosition() { return "bottom-right" } _load() { const t = this.options, e = this._parentMap, i = this._miniMap;["dragPan", "dragRotate", "scrollZoom", "boxZoom", "doubleClickZoom", "keyboard", "touchZoomRotate"].forEach((e => { !0 !== t[e] && i[e].disable(); })), "function" == typeof t.zoomAdjust ? this.options.zoomAdjust = t.zoomAdjust.bind(this) : null === t.zoomAdjust && (this.options.zoomAdjust = this._zoomAdjust.bind(this)), "parent" === t.bounds && (t.bounds = e.getBounds()), "object" == typeof t.bounds && i.fitBounds(t.bounds, { duration: 50 }); const r = i.getBounds(); this._convertBoundsToPoints(r), i.addSource("trackingRect", { type: "geojson", data: { type: "Feature", properties: { name: "trackingRect" }, geometry: { type: "Polygon", coordinates: this._trackingRectCoordinates } } }); const o = { id: "trackingRectFill", source: "trackingRect", type: "fill", paint: { "fill-color": t.fillColor, "fill-opacity": t.fillOpacity } }; i.addLayer({ id: "trackingRectOutline", source: "trackingRect", type: "line", paint: { "line-color": t.lineColor, "line-width": t.lineWidth, "line-opacity": t.lineOpacity } }), i.addLayer(o), this._trackingRect = i.getSource("trackingRect"), this._update(), e.on("move", this._update.bind(this)), console.log(i), i.on("mousemove", this._mouseMove.bind(this)), i.on("mousedown", this._mouseDown.bind(this)), i.on("mouseup", this._mouseUp.bind(this)), i.on("touchmove", this._mouseMove.bind(this)), i.on("touchstart", this._mouseDown.bind(this), !0), i.on("touchend", this._mouseUp.bind(this)), this._miniMapCanvas = i.getCanvasContainer(), this._miniMapCanvas.addEventListener("wheel", this._preventDefault), this._miniMapCanvas.addEventListener("mousewheel", this._preventDefault); } _mouseDown(t) { this._isCursorOverFeature && (this._isDragging = !0, this._previousPoint = this._currentPoint, this._currentPoint = [t.lngLat.lng, t.lngLat.lat]); } _mouseMove(t) { this._ticking = !1; const e = this._miniMap.queryRenderedFeatures(t.point, { layers: ["trackingRectFill"] }); if (this._isCursorOverFeature && e.length > 0 || (this._isCursorOverFeature = e.length > 0, this._miniMapCanvas.style.cursor = this._isCursorOverFeature ? "move" : ""), console.log(this._isDragging), this._isDragging) { this._previousPoint = this._currentPoint, this._currentPoint = [t.lngLat.lng, t.lngLat.lat]; const e = this._moveTrackingRect([this._previousPoint[0] - this._currentPoint[0], this._previousPoint[1] - this._currentPoint[1]]); this._parentMap.fitBounds(e, { duration: 80, noMoveStart: !0 }); } } _mouseUp() { this._isDragging = !1, this._ticking = !1; } _moveTrackingRect(t) { const e = this._trackingRect, i = e._data, r = i.properties.bounds; return r._ne.lat -= t[1], r._ne.lng -= t[0], r._sw.lat -= t[1], r._sw.lng -= t[0], this._convertBoundsToPoints(r), e.setData(i), r } _setTrackingRectBounds(t) { const e = this._trackingRect, i = e._data; i.properties.bounds = t, this._convertBoundsToPoints(t), e.setData(i); } _convertBoundsToPoints(t) { const e = t._ne, i = t._sw, r = this._trackingRectCoordinates; r[0][0][0] = e.lng, r[0][0][1] = e.lat, r[0][1][0] = i.lng, r[0][1][1] = e.lat, r[0][2][0] = i.lng, r[0][2][1] = i.lat, r[0][3][0] = e.lng, r[0][3][1] = i.lat, r[0][4][0] = e.lng, r[0][4][1] = e.lat; } _update() { if (this._isDragging) return; const t = this._parentMap.getBounds(); this._setTrackingRectBounds(t), "function" == typeof this.options.zoomAdjust && this.options.zoomAdjust(); } _zoomAdjust() { const t = this._miniMap, e = this._parentMap, i = parseInt(t.getZoom(), 10), r = parseInt(e.getZoom(), 10); let o = !1; this.options.zoomLevels.forEach((n => { !o && r >= n[0] && (i >= n[1] && t.setZoom(n[2]), t.setCenter(e.getCenter()), o = !0); })), o || i === this.options.zoom || ("object" == typeof this.options.bounds && t.fitBounds(this.options.bounds, { duration: 50 }), t.setZoom(this.options.zoom)); } _preventDefault(t) { t.preventDefault(); } }, RightMenuControl: class { constructor(e) { this.options = t.extend({}, e), this._options = t.extend({}, Is, e), this._map = this._options.map, this._menuItems = [], this._isAdded = !1; } onAdd(t) { if (!0 === this._isAdded) return; this._map = t, this._onContextMenu = t => this._contextMenuHandler(t), this._onMouseDown = t => this._mouseDownHandler(t), this._onMenuClick = t => this._menuClickHandler(t); const e = this._container = n.create("div", `${this._options.className} sfmap-ctrl-rightmenu-default`); e.addEventListener("contextmenu", (t => t.preventDefault())), e.addEventListener("click", this._onMenuClick); const i = () => { this._isAdded = !0, t.on("contextmenu", this._onContextMenu), t.on("mousedown", this._onMouseDown); }; return t._loaded ? i() : t.once("load", (() => { i(); })), e } onRemove() { !1 !== this._isAdded && (this._container.removeEventListener("click", this._onMenuClick), n.remove(this._container), this._container = null, this._map.off("contextmenu", this._onContextMenu), this._map.off("mousedown", this._onMouseDown), this._onContextMenu = null, this._onMouseDown = null, this._onMenuClick = null, this._map = null, this._isAdded = !1); } getDefaultPosition() { return "top-left" } _contextMenuHandler(t) { this._menuItems = this._getMenuItems(t), this._updateMenu(this._menuItems, t); } _mouseDownHandler(t) { 2 !== t.originalEvent.button && this._updateMenu(null); } _getMenuItems(t) { let e = this._options.menuItems; return "[object Function]" === Object.prototype.toString.call(this._options.menuItems) && (e = this._options.menuItems(t)), e || [] } _updateMenu(t, e) { if ("[object Array]" === Object.prototype.toString.call(t) && t.length > 0) { const i = "block" === this._container.style.display; this._menuItems = t; const r = `\n <div class="rightmenu-body">\n ${t.map((t => `<div class="rightmenu-item" rightmenu-id = "${t.id}">${t.content}</div>`)).join("")}\n </div>\n `; this._container.innerHTML = r, this._container.style.display = "block", this._container.style.transform = `translate(${e.point.x}px, ${e.point.y}px)`, this._map.fire(i ? "rightmenu.update" : "rightmenu.show", { point: e.point, items: t }); } else this._container.style.display = "none", this._container.style.transform = "translate(0px, 0px)", this._map.fire("rightmenu.hide", {}); } _menuClickHandler(t) { const e = t.srcElement.hasAttribute("rightmenu-id") ? t.srcElement : t.path.find((t => t.hasAttribute && t.hasAttribute("rightmenu-id"))); if (e) { const t = e.getAttribute("rightmenu-id"), i = this._menuItems.find((e => e.id == t)); this._map.fire("rightmenu.click", Object.assign({}, i)), this._updateMenu(null), this._menuItems = []; } } }, TailedLabels: class { constructor(t) { this._labels = [], this._renderedLabels = [], this._containerId = t.containerId, this._selection = [], this._toSelectLabelIds = [], this._updateOnMove = !0, this._labelGroupMap = new Map, this._updateQueue = new qs, this._container = null, this._added = !1, this._clickCallback = "function" == typeof t.clickCallback ? t.clickCallback : t => { }, this._styleTable = t.styleTable instanceof Ns ? t.styleTable : new Ns, t.collisionParams && (this._collisionParams = { ...Ms, ...t.collisionParams }), Hs(["update", "_update", "_onLabelClick", "_onMapMove", "_onResize"], this); } setClickCallback(t) { "function" == typeof t && (this._clickCallback = t); } onAdd(t) { if (!1 !== this._added) return; this._map = t, this._map.on("move", this._onMapMove), window.addEventListener("resize", this._onResize); let e = document.getElementById(this._containerId); return e || (e = document.createElement("div"), e.setAttribute("id", this._containerId), e.style.position = "absolute", e.style.top = 0, e.style.left = 0, e.style.width = "100%", e.style.height = "100%", e.style["pointer-events"] = "none", t.getContainer().appendChild(e)), this._added = !0, this._container = e, document.createElement("div") } onRemove() { !0 === this._added && (this.clear(), window.removeEventListener("resize", this._onResize), this._map.off("move", this._onMapMove), this._map = null, this._removeSvgContainer(), this._removeLabelContainer(), this._container && (this._container.remove(), this._container = null), this._added = !1); } addLabel(t, e) { e = e || Us; const i = { ...t, group: e, clickCallback: this._onLabelClick }; if (this.getLabel(i.id) instanceof Ws && this.removeLabel(i.id), !(t.style instanceof Bs)) { const t = this._styleTable.get(e); null != t && (i.style = t.getNormalStyle(), i.style.disabled = t => !!this._labelGroupMap.get(t.group) && this._labelGroupMap.get(t.group).disabled(t), i.style.disabledLevels = t => this._labelGroupMap.get(t.group) ? this._labelGroupMap.get(t.group).disabledLevels(t) : []); } const r = new Ws(i); return this._labels.push(r), r } getLabel(t) { return this._labels.find((e => e.id === t)) } getByGroup(t) { return t = t || Us, this._labels.filter((e => e.group === t)) } removeLabel(t) { for (let e = this._labels.length - 1; e >= 0; e--) { const i = this._labels[e]; if (i.id === t) { i.remove(), this._labels.splice(e, 1); break } } } removeByGroup(t) { t = t || Us; for (let e = this._labels.length - 1; e >= 0; e--) { const i = this._labels[e]; i.group === t && (i.destroy(), this._labels.splice(e, 1)); } } clear() { this._labels.forEach((t => t.remove())), this._labels = [], this._renderedLabels = [], this._clickCallback = void 0, this.clearSelection(), this._updateQueue.clear(), this._labelGroupMap.clear(); } update() { this._updateQueue.push(new Ys({ exec: () => { this._update(); } })); } _update() { if (!0 !== this._added) return; const t = this._container; for (let t = this._toSelectLabelIds.length - 1; t >= 0; t--) { const e = this._toSelectLabelIds[t], i = this._labels.find((t => t.id === e)); i && (this._select(i), this._toSelectLabelIds.splice(t, 1)); } const e = this._createSvgContainer(this._map, t), i = this._map.getPitch(); e.setAttribute("opacity", i < 45 ? i / 90 : 1); const r = this._createLabelContainer(this._map, t), o = { map: this._map, svgContainer: e, labelContainer: r }, n = this._labels.filter((t => !this._selection.find((e => e.id === t.id)))); if (!0 === this._collisionParams.enabled) { const t = n.filter(this._collisionParams.shouldExclude), e = this._applyCollisionDeteck(n.filter((e => t.indexOf(e) < 0))).concat(t); e.forEach((t => t.render(o))), this._renderedLabels = e; } else n.forEach((t => t.render(o))), this._renderedLabels = n; this._selection.length > 0 && this._selection.forEach((t => t.render(o))); } updateStyle() { this._labels.filter((t => t.isRendered())).forEach((t => { const e = this._styleTable.get(t.group); if (null != e) { const i = e.getNormalStyle(t); t.updateStyle(i); } else console.warn("label normal style not assigned !"); })), this._selection.forEach((t => { const e = this._styleTable.get(t.group); if (null != e) { const i = e.getSelectStyle(t); t.updateStyle(i); } else console.warn("label select style not assigned !"); })); } toggleVisible(t, e) { const i = this._styleTable.get(t = t || Us); if (null != i) { const t = i.getNormalStyle(); t && (t.show = !!e); } else console.warn("label select style not assigned !"); this.update(); } findById(t) { return this.getLabel(t) } select(t) { this._select(t, !0); } _select(t, e) { let i; if ("string" == typeof t ? (i = t, t = this.findById(t)) : i = t.id, t instanceof Ws) { if (this.isSelected(t.id)) return; t.remove(); const i = t.clone(), r = this._styleTable.get(t.group); if (null != r) { const e = r.getSelectStyle(t); i.style = e; } else console.warn(" label select style not assigned !"); e && this.updateLabel(i), this._selection.push(i); } else i && this._toSelectLabelIds.push(i); } unSelect(t) { let e, i = t; if ("string" == typeof t && (e = t, i = this.findById(t)), i instanceof Ws) { const t = this._selection.indexOf(i); if (t < 0) return; i.destroy(), this._selection.splice(t, 1), this._labels.find((t => t.id === i.id && (this.updateLabel(t), !0))); } else { const t = this._toSelectLabelIds.indexOf(e); t >= 0 && this._toSelectLabelIds.splice(t, 1); } } getSelection() { return this._selection } clearSelection(t) { if (this._toSelectLabelIds = [], t) for (let e = this._selection.length - 1; e >= 0; e--) { const i = this._selection[e]; i.group === t && this.unSelect(i); } else { for (let t = this._selection.length - 1; t >= 0; t--)this.unSelect(this._selection[t]); this._selection.splice(0, this._selection.length); } } isSelected(t) { return !!this._selection.find((e => e.id === t)) } disable(t, e = Os.OPACITY_EVENTS) { this._toggleDisabled(t = t || Us, e, !0); } enable(t, e = Os.OPACITY_EVENTS) { this._toggleDisabled(t = t || Us, e, !1); } _toggleDisabled(t, e, i) { let r = this._labelGroupMap.get(t); r || (r = {}, r.disabledList = [], this._labelGroupMap.set(t, r)); const o = r.disabledList.findIndex((t => t.level === e)); o >= 0 && r.disabledList.splice(o, 1), i && r.disabledList.push({ disabled: !0, level: e }), r.disabled = t => r.disabledList.length > 0, r.disabledLevels = t => r.disabledList.length > 0 ? r.disabledList.map((t => t.level)) : [], this.update(); } _onLabelClick(t) { this._clickCallback(t, t.group); } _onMapMove() { !0 === this._updateOnMove && this.update(); } _onResize() { if (!this._map) return; const t = this._map.getCanvas(), e = this._getSvgContainer(); e && (e.setAttribute("width", t.width), e.setAttribute("height", t.height)); } updateLabel(t) { let e = document.getElementById(this._containerId); const i = this._createLabelContainer(this._map, e), r = this._createSvgContainer(this._map, e); t.render({ map: this._map, labelContainer: i, svgContainer: r }); } _applyCollisionDeteck(t) { const e = t.map((t => new Zs(t, { ...this._collisionParams }))), i = new zs, r = this._map.getCanvas(); return i.setBounds([0, 0, r.width, r.height]), e.forEach((t => i.push(t))), i.apply({ map: this._map }), i.unpassed().forEach((t => t.target.remove())), i.passed().map((t => t.target)) } _createSvgContainer(t, e) { const i = this._containerId + "-tlc-svg"; let r = this._getSvgContainer(); return r || (r = Gs("svg", { id: i, width: t.getCanvas().width, height: t.getCanvas().height }), e.appendChild(r)), r } _getSvgContainer() { return document.getElementById(this._containerId + "-tlc-svg") } _removeSvgContainer() { let t = document.getElementById(this._containerId + "-tlc-svg"); t && t.remove(); } _createLabelContainer(t, e) { const i = this._containerId + "-tlc-label"; let r = document.getElementById(i); return r || (r = document.createElement("div"), r.setAttribute("id", i), r.style = "\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0px;\n left: 0px;\n pointer-events: none;\n ", e.appendChild(r)), r } _getLabelContainer() { return document.getElementById(this._containerId + "-tlc-label") } _removeLabelContainer() { let t = document.getElementById(this._containerId + "-tlc-label"); t && t.remove(); } }, TailedLabel: Ws, TailedLabelStyleTable: Ns, TailedLabelStyleGroup: class { constructor(t) { null != (t = t || {}).normalStyle && (this.normalStyle = t.normalStyle), null != t.selectStyle && (this.selectStyle = t.selectStyle), this.getNormalStyle = "function" == typeof t.getNormalStyle ? t.getNormalStyle : t => this.normalStyle, this.getSelectStyle = "function" == typeof t.getSelectStyle ? t.getSelectStyle : t => this.selectStyle; } }, TailedLabelStyle: Bs, TAILED_LABEL_DISABLED_LEVEL: Os, CollisionDeteckTarget: class { constructor() { } priority(t) { } bounds(t) { } }, CollisionDeteckContext: {}, CollisionDeteck: zs, TrackAnimation: class extends t.Evented { constructor(e, i) { super(), this.options = t.extend({}, Xs, i); const r = e[0]; this._lnglats = e, this._count = e.length, this._speed = i.speed > 0 && i.speed <= 60 ? i.speed : 12, this._autoRotate = i.autoRotate, this._autoView = i.autoView, this.initRotation = i.initRotation, this._setTracker(r, i), i.map && this.addTo(i.map); } _setTracker(t, e) { this.tracker || (this.tracker = new wn(e.iconUrl ? { iconUrl: e.iconUrl, iconSize: e.iconSize, offset: e.offset, rotation: e.initRotation } : { anchor: "center", offset: [0, -15], color: "#3FB1CE", draggable: !1 })), this._updateTracker(t); } getCurrentPosition() { return this.tracker.getLngLat() } _hideTracker() { this.tracker && this.tracker.hide(); } _showTracker() { this.tracker && this.tracker.show(); } _updateTracker(t, e) { this.tracker && (t && this.tracker.setLngLat(t), e && this.tracker.setRotation(e)); } _getAngel(t, e) { return -180 * Math.atan2(e[1] - t[1], e[0] - t[0]) / Math.PI + this.initRotation - this._map.getBearing() } _fillPoint(t, e) { const i = this._lnglats[t], r = this._lnglats[t + 1]; return [i[0] + (r[0] - i[0]) * e, i[1] + (r[1] - i[1]) * e] } _animateStart(e) { const i = (e = e || 0) - this._then, r = 1e3 / this._speed; if (this._index >= this._count - 1) this._stop(); else { switch (this._last = this._current || this._lnglats[0], i > r) { case !0: this._index++, this._then = e, this._point = this._current = this._lnglats[this._index], this._autoRotate && (this._next = this._index + 1 < this._count - 1 ? this._lnglats[this._index + 1] : this._lnglats[this._count - 1], this._angel = this._getAngel(this._last, this._next), this._updateTracker(null, this._angel)), this._updateTracker(this._current), this.fire(new t.Event("progress", { progress: (100 * (this._index + 1) / this._count).toFixed(2), index: this._index + 1 })); break; case !1: this._point = this._fillPoint(this._index, (e - this._then) / r), this._updateTracker(this._point); }this._checkView(this._point), this._animationId = t.window.requestAnimationFrame(this._animateStart.bind(this)), this._playing = !0; } } _checkView(t) { this._autoView && ("center" === this._autoView.toString().toLocaleLowerCase() && this._map.panTo(t), this._trackerContain(t, this._map) || this._map.panTo(t)); } _trackerContain(t, e) { const i = e.getBounds(), r = i.getSouthWest(), o = i.getNorthEast(); return t[0] > r.lng && t[0] < o.lng && t[1] > r.lat && t[0] < o.lat } _animateStop() { this._playing = !1, t.window.cancelAnimationFrame(this._animationId), this.fire(new t.Event("stop")); } _animateReset() { this._index = 0, this._then = 0, this._angel = 0, this._playing = !1, this._pause = !1, this._updateTracker(this._lnglats[0], this._getAngel(this._lnglats[0], this._lnglats[1])), this._hideTracker(); } addTo(t) { return this._map = t, this._remove = !1, this.tracker && this.tracker.addTo(this._map), this._hideTracker(), this._autoRotate && this._updateTracker(null, this._getAngel(this._lnglats[0], this._lnglats[1])), this } _stop() { this._animateStop(), this.fire(new t.Event("stop")); } start() { if (!this._remove && !this._playing) return this._animateReset(), this._showTracker(), this._animateStart(), this.fire(new t.Event("start")), this } stop() { if (!this._remove) return this._stop(), this._animateReset(), this } pause() { if (!this._remove && this._playing) return this._pause = !0, this._animateStop(), this.fire(new t.Event("pause", this.getCurrentPosition())), this } resume() { if (!this._remove && !this._playing && this._pause) return this._pause = !1, this._animateStart(), this.fire(new t.Event("resume", this.getCurrentPosition())), this } remove() { if (!this._remove) return this._animateStop(), this._animateReset(), this.tracker && this.tracker.remove(), this.fire(new t.Event("remove")), this._remove = !0, this } }, DynamicSymbolCreator: class { addTo(t) { this._map = t; } createGradientWave(t) { const e = this._map, { size: i, duration: r, color: o, innerRatio: n, innerOpacity: s } = { ...Qs, ...t }; return { width: i, height: i, data: new Uint8Array(i * i * 4), onAdd: function () { var t = document.createElement("canvas"); t.width = this.width, t.height = this.height, this.context = t.getContext("2d"); }, render: function () { var t = this.width, a = this.height, l = performance.now() % r / r, c = i / 2 * n, h = i / 2 * (1 - n) * l + c, u = this.context; u.clearRect(0, 0, this.width, this.height), u.beginPath(), u.arc(this.width / 2, this.height / 2, h, 0, 2 * Math.PI); var d = u.createRadialGradient(t / 2, a / 2, c, t / 2, a / 2, i); return d.addColorStop(0, `rgba(${o.join(",")}, 0)`), d.addColorStop(1, `rgba(${o.join(",")}, 1.0)`), u.fillStyle = d, u.fill(), u.beginPath(), u.arc(t / 2, a / 2, n * t / 2, 0, 2 * Math.PI), u.strokeStyle = `rgba(${o.join(",")}, ${s})`, u.lineWidth = 3, u.stroke(), this.data = u.getImageData(0, 0, t, a).data, e.triggerRepaint(), !0 } } } createBreakWave(t) { const e = this._map, { size: i, color: r, opacityBreaks: o, opacityRange: n, speedRatio: s } = { ...Ks, ...t }; return { width: i, height: i, data: new Uint8Array(i * i * 4), onAdd: function () { var t = document.createElement("canvas"); t.width = this.width, t.height = this.height, this.context = t.getContext("2d"); }, render: function () { var t = this.width, a = this.height, l = Math.round(performance.now() * s / 100) % o, c = this.context; c.clearRect(0, 0, this.width, this.height); var h = n[1] - n[0]; return new Array(o).fill(0).forEach(((e, s) => { var u = i * s / (2 * o), d = (1 - s / o) * h + n[0]; d += Math.sin(l - s) / o * h / 2, c.beginPath(), c.arc(t / 2, a / 2, u, 0, 2 * Math.PI), c.fillStyle = `rgba(${r.join(",")}, ${d})`, c.fill(); })), this.data = c.getImageData(0, 0, t, a).data, e.triggerRepaint(), !0 } } } remove() { this._map = null; } }, Spiderifier: Js, Util: ta, prewarm: function () { te().acquire(Qt); }, clearPrewarmedResources: function () { const t = $t; t && (t.isPreloaded() && 1 === t.numActive() ? (t.release(Qt), $t = null) : console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()")); }, get accessToken() { return t.config.ACCESS_TOKEN }, set accessToken(e) { t.config.ACCESS_TOKEN = e; }, get baseApiUrl() { return t.config.API_URL }, set baseApiUrl(e) { t.config.API_URL = e; }, get workerCount() { return Kt.workerCount }, set workerCount(t) { Kt.workerCount = t; }, get maxParallelImageRequests() { return t.config.MAX_PARALLEL_IMAGE_REQUESTS }, set maxParallelImageRequests(e) { t.config.MAX_PARALLEL_IMAGE_REQUESTS = e; }, clearStorage(e) { t.clearTileCache(e); }, workerUrl: "", workerClass: null, setNow: t.exported.setNow, restoreNow: t.exported.restoreNow }; return ea }));
|
|
45
|
+
|
|
46
|
+
//
|
|
47
|
+
|
|
48
|
+
var SFMap = mapboxgl;
|
|
49
|
+
|
|
50
|
+
const oldMapboxgl = window.mapboxgl;
|
|
51
|
+
const oldSFMap = window.SFMap;
|
|
52
|
+
function noConflict() {
|
|
53
|
+
window.mapboxgl = oldMapboxgl;
|
|
54
|
+
window.SFMap = oldSFMap;
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
window.mapboxgl = window.SFMap = SFMap;
|
|
59
|
+
|
|
60
|
+
exports.noConflict = noConflict;
|
|
61
|
+
|
|
62
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
63
|
+
|
|
64
|
+
}));
|
|
65
|
+
//# sourceMappingURL=sfmap.min.js.map
|