@loaders.gl/mvt 4.2.0-alpha.5 → 4.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +70 -18
- package/dist/dist.min.js +1 -1
- package/dist/helpers/binary-util-functions.d.ts +3 -3
- package/dist/helpers/binary-util-functions.d.ts.map +1 -1
- package/dist/helpers/binary-util-functions.js +3 -0
- package/dist/helpers/mapbox-util-functions.d.ts +1 -1
- package/dist/helpers/mapbox-util-functions.d.ts.map +1 -1
- package/dist/helpers/mapbox-util-functions.js +3 -0
- package/dist/index.cjs +64 -18
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/binary-vector-tile/vector-tile-feature.d.ts +1 -1
- package/dist/lib/binary-vector-tile/vector-tile-feature.d.ts.map +1 -1
- package/dist/lib/binary-vector-tile/vector-tile-feature.js +13 -2
- package/dist/lib/binary-vector-tile/vector-tile-layer.d.ts +5 -5
- package/dist/lib/binary-vector-tile/vector-tile-layer.d.ts.map +1 -1
- package/dist/lib/binary-vector-tile/vector-tile-layer.js +16 -5
- package/dist/lib/binary-vector-tile/vector-tile.d.ts +3 -3
- package/dist/lib/binary-vector-tile/vector-tile.d.ts.map +1 -1
- package/dist/lib/binary-vector-tile/vector-tile.js +7 -3
- package/dist/lib/geojson-tiler/clip.js +3 -0
- package/dist/lib/geojson-tiler/geojson-tiler.js +6 -5
- package/dist/lib/geojson-tiler/wrap.js +3 -0
- package/dist/lib/mapbox-vector-tile/vector-tile-feature.d.ts +1 -1
- package/dist/lib/mapbox-vector-tile/vector-tile-feature.d.ts.map +1 -1
- package/dist/lib/mapbox-vector-tile/vector-tile-feature.js +12 -1
- package/dist/lib/mapbox-vector-tile/vector-tile-layer.d.ts +2 -2
- package/dist/lib/mapbox-vector-tile/vector-tile-layer.d.ts.map +1 -1
- package/dist/lib/mapbox-vector-tile/vector-tile-layer.js +13 -4
- package/dist/lib/mapbox-vector-tile/vector-tile.d.ts +2 -2
- package/dist/lib/mapbox-vector-tile/vector-tile.d.ts.map +1 -1
- package/dist/lib/mapbox-vector-tile/vector-tile.js +6 -2
- package/dist/lib/parse-mvt.d.ts +2 -2
- package/dist/lib/parse-mvt.d.ts.map +1 -1
- package/dist/lib/parse-mvt.js +7 -4
- package/dist/lib/types.d.ts +0 -10
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +3 -0
- package/dist/mvt-loader.d.ts +63 -6
- package/dist/mvt-loader.d.ts.map +1 -1
- package/dist/mvt-loader.js +7 -9
- package/dist/mvt-source.js +8 -3
- package/dist/mvt-worker.js +50 -11
- package/dist/tilejson-loader.d.ts +2 -3
- package/dist/tilejson-loader.d.ts.map +1 -1
- package/dist/tilejson-loader.js +3 -1
- package/dist/workers/mvt-worker.js +3 -0
- package/package.json +6 -6
- package/src/helpers/binary-util-functions.ts +7 -3
- package/src/helpers/mapbox-util-functions.ts +5 -1
- package/src/index.ts +1 -1
- package/src/lib/binary-vector-tile/vector-tile-feature.ts +5 -1
- package/src/lib/binary-vector-tile/vector-tile-layer.ts +11 -7
- package/src/lib/binary-vector-tile/vector-tile.ts +13 -5
- package/src/lib/mapbox-vector-tile/vector-tile-feature.ts +5 -1
- package/src/lib/mapbox-vector-tile/vector-tile-layer.ts +6 -2
- package/src/lib/mapbox-vector-tile/vector-tile.ts +6 -2
- package/src/lib/parse-mvt.ts +13 -8
- package/src/lib/types.ts +3 -11
- package/src/mvt-loader.ts +35 -22
- package/src/tilejson-loader.ts +5 -2
- package/src/workers/mvt-worker.ts +4 -0
package/dist/dist.dev.js
CHANGED
|
@@ -1703,6 +1703,14 @@ var __exports__ = (() => {
|
|
|
1703
1703
|
|
|
1704
1704
|
// src/lib/mapbox-vector-tile/vector-tile-feature.ts
|
|
1705
1705
|
var VectorTileFeature = class {
|
|
1706
|
+
properties;
|
|
1707
|
+
extent;
|
|
1708
|
+
type;
|
|
1709
|
+
id;
|
|
1710
|
+
_pbf;
|
|
1711
|
+
_geometry;
|
|
1712
|
+
_keys;
|
|
1713
|
+
_values;
|
|
1706
1714
|
static get types() {
|
|
1707
1715
|
return ["Unknown", "Point", "LineString", "Polygon"];
|
|
1708
1716
|
}
|
|
@@ -1862,6 +1870,14 @@ var __exports__ = (() => {
|
|
|
1862
1870
|
|
|
1863
1871
|
// src/lib/mapbox-vector-tile/vector-tile-layer.ts
|
|
1864
1872
|
var VectorTileLayer = class {
|
|
1873
|
+
version;
|
|
1874
|
+
name;
|
|
1875
|
+
extent;
|
|
1876
|
+
length;
|
|
1877
|
+
_pbf;
|
|
1878
|
+
_keys;
|
|
1879
|
+
_values;
|
|
1880
|
+
_features;
|
|
1865
1881
|
constructor(pbf, end) {
|
|
1866
1882
|
this.version = 1;
|
|
1867
1883
|
this.name = "";
|
|
@@ -1916,6 +1932,7 @@ var __exports__ = (() => {
|
|
|
1916
1932
|
|
|
1917
1933
|
// src/lib/mapbox-vector-tile/vector-tile.ts
|
|
1918
1934
|
var VectorTile = class {
|
|
1935
|
+
layers;
|
|
1919
1936
|
constructor(pbf, end) {
|
|
1920
1937
|
this.layers = pbf.readFields(readTile, {}, end);
|
|
1921
1938
|
}
|
|
@@ -2017,7 +2034,16 @@ var __exports__ = (() => {
|
|
|
2017
2034
|
var x;
|
|
2018
2035
|
var y;
|
|
2019
2036
|
var i;
|
|
2020
|
-
var
|
|
2037
|
+
var BinaryVectorTileFeature = class {
|
|
2038
|
+
properties;
|
|
2039
|
+
extent;
|
|
2040
|
+
type;
|
|
2041
|
+
id;
|
|
2042
|
+
_pbf;
|
|
2043
|
+
_geometry;
|
|
2044
|
+
_keys;
|
|
2045
|
+
_values;
|
|
2046
|
+
_geometryInfo;
|
|
2021
2047
|
// eslint-disable-next-line max-params
|
|
2022
2048
|
constructor(pbf, end, extent, keys, values, geometryInfo) {
|
|
2023
2049
|
this.properties = {};
|
|
@@ -2123,7 +2149,15 @@ var __exports__ = (() => {
|
|
|
2123
2149
|
};
|
|
2124
2150
|
|
|
2125
2151
|
// src/lib/binary-vector-tile/vector-tile-layer.ts
|
|
2126
|
-
var
|
|
2152
|
+
var BinaryVectorTileLayer = class {
|
|
2153
|
+
version;
|
|
2154
|
+
name;
|
|
2155
|
+
extent;
|
|
2156
|
+
length;
|
|
2157
|
+
_pbf;
|
|
2158
|
+
_keys;
|
|
2159
|
+
_values;
|
|
2160
|
+
_features;
|
|
2127
2161
|
constructor(pbf, end) {
|
|
2128
2162
|
this.version = 1;
|
|
2129
2163
|
this.name = "";
|
|
@@ -2137,11 +2171,11 @@ var __exports__ = (() => {
|
|
|
2137
2171
|
this.length = this._features.length;
|
|
2138
2172
|
}
|
|
2139
2173
|
/**
|
|
2140
|
-
* return feature `i` from this layer as a `
|
|
2174
|
+
* return feature `i` from this layer as a `BinaryVectorTileFeature`
|
|
2141
2175
|
*
|
|
2142
2176
|
* @param index
|
|
2143
2177
|
* @param geometryInfo
|
|
2144
|
-
* @returns {
|
|
2178
|
+
* @returns {BinaryVectorTileFeature}
|
|
2145
2179
|
*/
|
|
2146
2180
|
feature(i2, geometryInfo) {
|
|
2147
2181
|
if (i2 < 0 || i2 >= this._features.length) {
|
|
@@ -2149,7 +2183,7 @@ var __exports__ = (() => {
|
|
|
2149
2183
|
}
|
|
2150
2184
|
this._pbf.pos = this._features[i2];
|
|
2151
2185
|
const end = this._pbf.readVarint() + this._pbf.pos;
|
|
2152
|
-
return new
|
|
2186
|
+
return new BinaryVectorTileFeature(
|
|
2153
2187
|
this._pbf,
|
|
2154
2188
|
end,
|
|
2155
2189
|
this.extent,
|
|
@@ -2186,7 +2220,8 @@ var __exports__ = (() => {
|
|
|
2186
2220
|
}
|
|
2187
2221
|
|
|
2188
2222
|
// src/lib/binary-vector-tile/vector-tile.ts
|
|
2189
|
-
var
|
|
2223
|
+
var BinaryVectorTile = class {
|
|
2224
|
+
layers;
|
|
2190
2225
|
constructor(pbf, end) {
|
|
2191
2226
|
this.layers = pbf.readFields(readTile2, {}, end);
|
|
2192
2227
|
}
|
|
@@ -2194,7 +2229,7 @@ var __exports__ = (() => {
|
|
|
2194
2229
|
function readTile2(tag, layers, pbf) {
|
|
2195
2230
|
if (tag === 3) {
|
|
2196
2231
|
if (pbf) {
|
|
2197
|
-
const layer = new
|
|
2232
|
+
const layer = new BinaryVectorTileLayer(pbf, pbf.readVarint() + pbf.pos);
|
|
2198
2233
|
if (layer.length && layers) {
|
|
2199
2234
|
layers[layer.name] = layer;
|
|
2200
2235
|
}
|
|
@@ -2250,7 +2285,7 @@ var __exports__ = (() => {
|
|
|
2250
2285
|
if (arrayBuffer.byteLength <= 0) {
|
|
2251
2286
|
return [features, geometryInfo];
|
|
2252
2287
|
}
|
|
2253
|
-
const tile = new
|
|
2288
|
+
const tile = new BinaryVectorTile(new import_pbf.default(arrayBuffer));
|
|
2254
2289
|
const selectedLayers = options && Array.isArray(options.layers) ? options.layers : Object.keys(tile.layers);
|
|
2255
2290
|
selectedLayers.forEach((layerName) => {
|
|
2256
2291
|
const vectorTileLayer = tile.layers[layerName];
|
|
@@ -2309,7 +2344,7 @@ var __exports__ = (() => {
|
|
|
2309
2344
|
}
|
|
2310
2345
|
function getDecodedFeatureBinary(feature, options, layerName) {
|
|
2311
2346
|
const decodedFeature = feature.toBinaryCoordinates(
|
|
2312
|
-
// @ts-expect-error
|
|
2347
|
+
// @ts-expect-error
|
|
2313
2348
|
options.coordinates === "wgs84" ? options.tileIndex : transformToLocalCoordinatesBinary
|
|
2314
2349
|
);
|
|
2315
2350
|
if (options.layerProperty && decodedFeature.properties) {
|
|
@@ -2335,6 +2370,8 @@ var __exports__ = (() => {
|
|
|
2335
2370
|
// src/mvt-loader.ts
|
|
2336
2371
|
var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
2337
2372
|
var MVTWorkerLoader = {
|
|
2373
|
+
dataType: null,
|
|
2374
|
+
batchType: null,
|
|
2338
2375
|
name: "Mapbox Vector Tile",
|
|
2339
2376
|
id: "mvt",
|
|
2340
2377
|
module: "mvt",
|
|
@@ -2573,6 +2610,8 @@ var __exports__ = (() => {
|
|
|
2573
2610
|
// src/tilejson-loader.ts
|
|
2574
2611
|
var VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
2575
2612
|
var TileJSONLoader = {
|
|
2613
|
+
dataType: null,
|
|
2614
|
+
batchType: null,
|
|
2576
2615
|
name: "TileJSON",
|
|
2577
2616
|
id: "tilejson",
|
|
2578
2617
|
module: "pmtiles",
|
|
@@ -2642,8 +2681,13 @@ var __exports__ = (() => {
|
|
|
2642
2681
|
|
|
2643
2682
|
// ../loader-utils/src/lib/sources/data-source.ts
|
|
2644
2683
|
var DataSource = class {
|
|
2684
|
+
/** A resolved fetch function extracted from loadOptions prop */
|
|
2685
|
+
fetch;
|
|
2686
|
+
/** The actual load options, if calling a loaders.gl loader */
|
|
2687
|
+
loadOptions;
|
|
2688
|
+
_needsRefresh = true;
|
|
2689
|
+
props;
|
|
2645
2690
|
constructor(props) {
|
|
2646
|
-
this._needsRefresh = true;
|
|
2647
2691
|
this.props = { ...props };
|
|
2648
2692
|
this.loadOptions = { ...props.loadOptions };
|
|
2649
2693
|
this.fetch = getFetchFunction(this.loadOptions);
|
|
@@ -3074,6 +3118,8 @@ var __exports__ = (() => {
|
|
|
3074
3118
|
// imagebitmap: {} - passes (platform dependent) parameters to ImageBitmap constructor
|
|
3075
3119
|
};
|
|
3076
3120
|
var ImageLoader = {
|
|
3121
|
+
dataType: null,
|
|
3122
|
+
batchType: null,
|
|
3077
3123
|
id: "image",
|
|
3078
3124
|
module: "images",
|
|
3079
3125
|
name: "Images",
|
|
@@ -3088,11 +3134,16 @@ var __exports__ = (() => {
|
|
|
3088
3134
|
|
|
3089
3135
|
// src/mvt-source.ts
|
|
3090
3136
|
var MVTSource = class extends DataSource {
|
|
3137
|
+
props;
|
|
3138
|
+
url;
|
|
3139
|
+
metadataUrl = null;
|
|
3140
|
+
data;
|
|
3141
|
+
schema = "tms";
|
|
3142
|
+
metadata;
|
|
3143
|
+
extension;
|
|
3144
|
+
mimeType = null;
|
|
3091
3145
|
constructor(props) {
|
|
3092
3146
|
super(props);
|
|
3093
|
-
this.metadataUrl = null;
|
|
3094
|
-
this.schema = "tms";
|
|
3095
|
-
this.mimeType = null;
|
|
3096
3147
|
this.props = props;
|
|
3097
3148
|
this.url = resolvePath(props.url);
|
|
3098
3149
|
this.metadataUrl = props.metadataUrl === void 0 ? `${this.url}/tilejson.json` : props.metadataUrl;
|
|
@@ -3809,12 +3860,13 @@ var __exports__ = (() => {
|
|
|
3809
3860
|
// logging level (0, 1 or 2)
|
|
3810
3861
|
};
|
|
3811
3862
|
var GeoJSONTiler = class {
|
|
3863
|
+
options;
|
|
3864
|
+
// tiles and tileCoords are part of the public API
|
|
3865
|
+
tiles = {};
|
|
3866
|
+
tileCoords = [];
|
|
3867
|
+
stats = {};
|
|
3868
|
+
total = 0;
|
|
3812
3869
|
constructor(data, options) {
|
|
3813
|
-
// tiles and tileCoords are part of the public API
|
|
3814
|
-
this.tiles = {};
|
|
3815
|
-
this.tileCoords = [];
|
|
3816
|
-
this.stats = {};
|
|
3817
|
-
this.total = 0;
|
|
3818
3870
|
this.options = { ...DEFAULT_OPTIONS, ...options };
|
|
3819
3871
|
options = this.options;
|
|
3820
3872
|
const debug = options.debug;
|
package/dist/dist.min.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['loaders'] = factory();
|
|
6
6
|
else root['loaders'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var nn=Object.create;var lt=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var sn=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty;var St=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ln=(t,e)=>{for(var n in e)lt(t,n,{get:e[n],enumerable:!0})},at=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of on(e))!an.call(t,r)&&r!==n&<(t,r,{get:()=>e[r],enumerable:!(i=rn(e,r))||i.enumerable});return t},ft=(t,e,n)=>(at(t,e,"default"),n&&at(n,e,"default")),ie=(t,e,n)=>(n=t!=null?nn(sn(t)):{},at(e||!t||!t.__esModule?lt(n,"default",{value:t,enumerable:!0}):n,t)),fn=t=>at(lt({},"__esModule",{value:!0}),t);var oe=St((yr,re)=>{re.exports=globalThis.loaders});var he=St(Ct=>{Ct.read=function(t,e,n,i,r){var o,s,a=r*8-i-1,l=(1<<a)-1,f=l>>1,c=-7,u=n?r-1:0,p=n?-1:1,h=t[e+u];for(u+=p,o=h&(1<<-c)-1,h>>=-c,c+=a;c>0;o=o*256+t[e+u],u+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=s*256+t[e+u],u+=p,c-=8);if(o===0)o=1-f;else{if(o===l)return s?NaN:(h?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-f}return(h?-1:1)*s*Math.pow(2,o-i)};Ct.write=function(t,e,n,i,r,o){var s,a,l,f=o*8-r-1,c=(1<<f)-1,u=c>>1,p=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:o-1,d=i?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+u>=1?e+=p/l:e+=p*Math.pow(2,1-u),e*l>=2&&(s++,l/=2),s+u>=c?(a=0,s=c):s+u>=1?(a=(e*l-1)*Math.pow(2,r),s=s+u):(a=e*Math.pow(2,u-1)*Math.pow(2,r),s=0));r>=8;t[n+h]=a&255,h+=d,a/=256,r-=8);for(s=s<<r|a,f+=r;f>0;t[n+h]=s&255,h+=d,s/=256,f-=8);t[n+h-d]|=x*128}});var ye=St((po,xe)=>{"use strict";xe.exports=y;var pt=he();function y(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}y.Varint=0;y.Fixed64=1;y.Bytes=2;y.Fixed32=5;var bt=(1<<16)*(1<<16),pe=1/bt,Un=12,me=typeof TextDecoder>"u"?null:new TextDecoder("utf8");y.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var i=this.readVarint(),r=i>>3,o=this.pos;this.type=i&7,t(r,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=dt(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ge(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=dt(this.buf,this.pos)+dt(this.buf,this.pos+4)*bt;return this.pos+=8,t},readSFixed64:function(){var t=dt(this.buf,this.pos)+ge(this.buf,this.pos+4)*bt;return this.pos+=8,t},readFloat:function(){var t=pt.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=pt.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,n,i;return i=e[this.pos++],n=i&127,i<128||(i=e[this.pos++],n|=(i&127)<<7,i<128)||(i=e[this.pos++],n|=(i&127)<<14,i<128)||(i=e[this.pos++],n|=(i&127)<<21,i<128)?n:(i=e[this.pos],n|=(i&15)<<28,Gn(n,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>=Un&&me?ti(this.buf,e,t):qn(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!==y.Bytes)return t.push(this.readVarint(e));var n=D(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==y.Bytes)return t.push(this.readSVarint());var e=D(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==y.Bytes)return t.push(this.readBoolean());var e=D(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==y.Bytes)return t.push(this.readFloat());var e=D(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==y.Bytes)return t.push(this.readDouble());var e=D(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==y.Bytes)return t.push(this.readFixed32());var e=D(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==y.Bytes)return t.push(this.readSFixed32());var e=D(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==y.Bytes)return t.push(this.readFixed64());var e=D(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==y.Bytes)return t.push(this.readSFixed64());var e=D(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===y.Varint)for(;this.buf[this.pos++]>127;);else if(e===y.Bytes)this.pos=this.readVarint()+this.pos;else if(e===y.Fixed32)this.pos+=4;else if(e===y.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},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 n=new Uint8Array(e);n.set(this.buf),this.buf=n,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),j(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),j(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),j(this.buf,t&-1,this.pos),j(this.buf,Math.floor(t*pe),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),j(this.buf,t&-1,this.pos),j(this.buf,Math.floor(t*pe),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){Rn(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=ei(this.buf,t,this.pos);var n=this.pos-e;n>=128&&de(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),pt.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),pt.write(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 n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var i=this.pos-n;i>=128&&de(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,n){this.writeTag(t,y.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,zn,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Jn,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Xn,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Wn,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Yn,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,$n,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Hn,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Kn,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Qn,e)},writeBytesField:function(t,e){this.writeTag(t,y.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,y.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,y.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,y.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,y.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,y.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,y.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,y.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,y.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,y.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function Gn(t,e,n){var i=n.buf,r,o;if(o=i[n.pos++],r=(o&112)>>4,o<128||(o=i[n.pos++],r|=(o&127)<<3,o<128)||(o=i[n.pos++],r|=(o&127)<<10,o<128)||(o=i[n.pos++],r|=(o&127)<<17,o<128)||(o=i[n.pos++],r|=(o&127)<<24,o<128)||(o=i[n.pos++],r|=(o&1)<<31,o<128))return R(t,r,e);throw new Error("Expected varint not more than 10 bytes")}function D(t){return t.type===y.Bytes?t.readVarint()+t.pos:t.pos+1}function R(t,e,n){return n?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Rn(t,e){var n,i;if(t>=0?(n=t%4294967296|0,i=t/4294967296|0):(n=~(-t%4294967296),i=~(-t/4294967296),n^4294967295?n=n+1|0:(n=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),jn(n,i,e),Zn(i,e)}function jn(t,e,n){n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos]=t&127}function Zn(t,e){var n=(t&7)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function de(t,e,n){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));n.realloc(i);for(var r=n.pos-1;r>=t;r--)n.buf[r+i]=n.buf[r]}function zn(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function Jn(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function Wn(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function Yn(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function Xn(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function $n(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function Hn(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Kn(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function Qn(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function dt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function j(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function ge(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function qn(t,e,n){for(var i="",r=e;r<n;){var o=t[r],s=null,a=o>239?4:o>223?3:o>191?2:1;if(r+a>n)break;var l,f,c;a===1?o<128&&(s=o):a===2?(l=t[r+1],(l&192)===128&&(s=(o&31)<<6|l&63,s<=127&&(s=null))):a===3?(l=t[r+1],f=t[r+2],(l&192)===128&&(f&192)===128&&(s=(o&15)<<12|(l&63)<<6|f&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):a===4&&(l=t[r+1],f=t[r+2],c=t[r+3],(l&192)===128&&(f&192)===128&&(c&192)===128&&(s=(o&15)<<18|(l&63)<<12|(f&63)<<6|c&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,a=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),r+=a}return i}function ti(t,e,n){return me.decode(t.subarray(e,n))}function ei(t,e,n){for(var i=0,r,o;i<e.length;i++){if(r=e.charCodeAt(i),r>55295&&r<57344)if(o)if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,o=r;continue}else r=o-55296<<10|r-56320|65536,o=null;else{r>56319||i+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):o=r;continue}else o&&(t[n++]=239,t[n++]=191,t[n++]=189,o=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=r&63|128)}return n}});var st={};ln(st,{GeoJSONTiler:()=>Tt,MVTLoader:()=>xt,MVTSource:()=>Pt,MVTWorkerLoader:()=>Rt,TileJSONLoader:()=>Z});ft(st,ie(oe(),1));function L(t){return L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(t)}function Mt(t,e){if(L(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(L(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vt(t){var e=Mt(t,"string");return L(e)==="symbol"?e:String(e)}function _(t,e,n){return e=Vt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var J={x:0,y:1,z:2};function b(t,e={}){let{start:n=0,end:i=t.length,plane:r="xy"}=e,o=e.size||2,s=0,a=J[r[0]],l=J[r[1]];for(let f=n,c=i-o;f<i;f+=o)s+=(t[f+a]-t[c+a])*(t[f+l]+t[c+l]),c=f;return s/2}function Bt(t,e,n=2,i,r="xy"){let o=e&&e.length,s=o?e[0]*n:t.length,a=ae(t,0,s,n,!0,i&&i[0],r),l=[];if(!a||a.next===a.prev)return l;let f,c,u,p,h,d,x;if(o&&(a=mn(t,e,a,n,i,r)),t.length>80*n){p=c=t[0],h=u=t[1];for(let w=n;w<s;w+=n)d=t[w],x=t[w+1],d<p&&(p=d),x<h&&(h=x),d>c&&(c=d),x>u&&(u=x);f=Math.max(c-p,u-h),f=f!==0?32767/f:0}return W(a,l,n,p,h,f,0),l}function ae(t,e,n,i,r,o,s){let a,l;o===void 0&&(o=b(t,{start:e,end:n,size:i,plane:s}));let f=J[s[0]],c=J[s[1]];if(r===o<0)for(a=e;a<n;a+=i)l=se(a,t[a+f],t[a+c],l);else for(a=n-i;a>=e;a-=i)l=se(a,t[a+f],t[a+c],l);return l&&ht(l,l.next)&&(X(l),l=l.next),l}function O(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(ht(n,n.next)||P(n.prev,n,n.next)===0)){if(X(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function W(t,e,n,i,r,o,s){if(!t)return;!s&&o&&Fn(t,i,r,o);let a=t,l,f;for(;t.prev!==t.next;){if(l=t.prev,f=t.next,o?pn(t,i,r,o):hn(t)){e.push(l.i/n|0),e.push(t.i/n|0),e.push(f.i/n|0),X(t),t=f.next,a=f.next;continue}if(t=f,t===a){s?s===1?(t=dn(O(t),e,n),W(t,e,n,i,r,o,2)):s===2&&gn(t,e,n,i,r,o):W(O(t),e,n,i,r,o,1);break}}}function hn(t){let e=t.prev,n=t,i=t.next;if(P(e,n,i)>=0)return!1;let r=e.x,o=n.x,s=i.x,a=e.y,l=n.y,f=i.y,c=r<o?r<s?r:s:o<s?o:s,u=a<l?a<f?a:f:l<f?l:f,p=r>o?r>s?r:s:o>s?o:s,h=a>l?a>f?a:f:l>f?l:f,d=i.next;for(;d!==e;){if(d.x>=c&&d.x<=p&&d.y>=u&&d.y<=h&&G(r,a,o,l,s,f,d.x,d.y)&&P(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function pn(t,e,n,i){let r=t.prev,o=t,s=t.next;if(P(r,o,s)>=0)return!1;let a=r.x,l=o.x,f=s.x,c=r.y,u=o.y,p=s.y,h=a<l?a<f?a:f:l<f?l:f,d=c<u?c<p?c:p:u<p?u:p,x=a>l?a>f?a:f:l>f?l:f,w=c>u?c>p?c:p:u>p?u:p,I=_t(h,d,e,n,i),M=_t(x,w,e,n,i),g=t.prevZ,m=t.nextZ;for(;g&&g.z>=I&&m&&m.z<=M;){if(g.x>=h&&g.x<=x&&g.y>=d&&g.y<=w&&g!==r&&g!==s&&G(a,c,l,u,f,p,g.x,g.y)&&P(g.prev,g,g.next)>=0||(g=g.prevZ,m.x>=h&&m.x<=x&&m.y>=d&&m.y<=w&&m!==r&&m!==s&&G(a,c,l,u,f,p,m.x,m.y)&&P(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;g&&g.z>=I;){if(g.x>=h&&g.x<=x&&g.y>=d&&g.y<=w&&g!==r&&g!==s&&G(a,c,l,u,f,p,g.x,g.y)&&P(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;m&&m.z<=M;){if(m.x>=h&&m.x<=x&&m.y>=d&&m.y<=w&&m!==r&&m!==s&&G(a,c,l,u,f,p,m.x,m.y)&&P(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function dn(t,e,n){let i=t;do{let r=i.prev,o=i.next.next;!ht(r,o)&&le(r,i,i.next,o)&&Y(r,o)&&Y(o,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(o.i/n|0),X(i),X(i.next),i=t=o),i=i.next}while(i!==t);return O(i)}function gn(t,e,n,i,r,o){let s=t;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&Tn(s,a)){let l=fe(s,a);s=O(s,s.next),l=O(l,l.next),W(s,e,n,i,r,o,0),W(l,e,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==t)}function mn(t,e,n,i,r,o){let s=[],a,l,f,c,u;for(a=0,l=e.length;a<l;a++)f=e[a]*i,c=a<l-1?e[a+1]*i:t.length,u=ae(t,f,c,i,!1,r&&r[a+1],o),u===u.next&&(u.steiner=!0),s.push(vn(u));for(s.sort(xn),a=0;a<s.length;a++)n=yn(s[a],n);return n}function xn(t,e){return t.x-e.x}function yn(t,e){let n=wn(t,e);if(!n)return e;let i=fe(n,t);return O(i,i.next),O(n,n.next)}function wn(t,e){let n=e,i=t.x,r=t.y,o=-1/0,s;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let p=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(p<=i&&p>o&&(o=p,s=n.x<n.next.x?n:n.next,p===i))return s}n=n.next}while(n!==e);if(!s)return null;let a=s,l=s.x,f=s.y,c=1/0,u;n=s;do i>=n.x&&n.x>=l&&i!==n.x&&G(r<f?i:o,r,l,f,r<f?o:i,r,n.x,n.y)&&(u=Math.abs(r-n.y)/(i-n.x),Y(n,t)&&(u<c||u===c&&(n.x>s.x||n.x===s.x&&Pn(s,n)))&&(s=n,c=u)),n=n.next;while(n!==a);return s}function Pn(t,e){return P(t.prev,t,e.prev)<0&&P(e.next,t,t.next)<0}function Fn(t,e,n,i){let r=t;do r.z===0&&(r.z=_t(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,In(r)}function In(t){let e,n,i=1,r,o,s,a,l,f;do{for(o=t,t=null,f=null,r=0;o;){for(r++,a=o,s=0,n=0;n<i&&(s++,a=a.nextZ,!!a);n++);for(l=i;s>0||l>0&&a;)s!==0&&(l===0||!a||o.z<=a.z)?(e=o,o=o.nextZ,s--):(e=a,a=a.nextZ,l--),f?f.nextZ=e:t=e,e.prevZ=f,f=e;o=a}f.nextZ=null,i*=2}while(r>1);return t}function _t(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function vn(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function G(t,e,n,i,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(i-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function Tn(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Sn(t,e)&&(Y(t,e)&&Y(e,t)&&Mn(t,e)&&(P(t.prev,t,e.prev)||P(t,e.prev,e))||ht(t,e)&&P(t.prev,t,t.next)>0&&P(e.prev,e,e.next)>0)}function P(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ht(t,e){return t.x===e.x&&t.y===e.y}function le(t,e,n,i){let r=ut(P(t,e,n)),o=ut(P(t,e,i)),s=ut(P(n,i,t)),a=ut(P(n,i,e));return!!(r!==o&&s!==a||r===0&&ct(t,n,e)||o===0&&ct(t,i,e)||s===0&&ct(n,t,i)||a===0&&ct(n,e,i))}function ct(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function ut(t){return t>0?1:t<0?-1:0}function Sn(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&le(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Y(t,e){return P(t.prev,t,t.next)<0?P(t,e,t.next)>=0&&P(t,t.prev,e)>=0:P(t,e,t.prev)<0||P(t,t.next,e)<0}function Mn(t,e){let n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==t);return i}function fe(t,e){let n=new $(t.i,t.x,t.y),i=new $(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function se(t,e,n,i){let r=new $(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function X(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)}var $=class{constructor(e,n,i){_(this,"i",void 0),_(this,"x",void 0),_(this,"y",void 0),_(this,"prev",null),_(this,"next",null),_(this,"z",0),_(this,"prevZ",null),_(this,"nextZ",null),_(this,"steiner",!1),this.i=e,this.x=n,this.y=i}};function Dt(t,e,n){let i=En(t),r=Object.keys(i).filter(o=>i[o]!==Array);return Dn(t,{propArrayTypes:i,...e},{numericPropKeys:n&&n.numericPropKeys||r,PositionDataType:n?n.PositionDataType:Float32Array,triangulate:n?n.triangulate:!0})}function En(t){let e={};for(let n of t)if(n.properties)for(let i in n.properties){let r=n.properties[i];e[i]=kn(r,e[i])}return e}function Dn(t,e,n){let{pointPositionsCount:i,pointFeaturesCount:r,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:l,polygonObjectsCount:f,polygonRingsCount:c,polygonFeaturesCount:u,propArrayTypes:p,coordLength:h}=e,{numericPropKeys:d=[],PositionDataType:x=Float32Array,triangulate:w=!0}=n,I=t[0]&&"id"in t[0],M=t.length>65535?Uint32Array:Uint16Array,g={type:"Point",positions:new x(i*h),globalFeatureIds:new M(i),featureIds:r>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},m={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new x(o*h),globalFeatureIds:new M(o),featureIds:a>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},v={type:"Polygon",polygonIndices:l>65535?new Uint32Array(f+1):new Uint16Array(f+1),primitivePolygonIndices:l>65535?new Uint32Array(c+1):new Uint16Array(c+1),positions:new x(l*h),globalFeatureIds:new M(l),featureIds:u>65535?new Uint32Array(l):new Uint16Array(l),numericProps:{},properties:[],fields:[]};w&&(v.triangles=[]);for(let T of[g,m,v])for(let S of d){let V=p[S];T.numericProps[S]=new V(T.positions.length/h)}m.pathIndices[s]=o,v.polygonIndices[f]=l,v.primitivePolygonIndices[c]=l;let F={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let T of t){let S=T.geometry,V=T.properties||{};switch(S.type){case"Point":Ln(S,g,F,h,V),g.properties.push(Et(V,d)),I&&g.fields.push({id:T.id}),F.pointFeature++;break;case"LineString":Cn(S,m,F,h,V),m.properties.push(Et(V,d)),I&&m.fields.push({id:T.id}),F.lineFeature++;break;case"Polygon":bn(S,v,F,h,V),v.properties.push(Et(V,d)),I&&v.fields.push({id:T.id}),F.polygonFeature++;break;default:throw new Error("Invalid geometry type")}F.feature++}return Nn(g,m,v,h)}function Ln(t,e,n,i,r){e.positions.set(t.data,n.pointPosition*i);let o=t.data.length/i;Lt(e,r,n.pointPosition,o),e.globalFeatureIds.fill(n.feature,n.pointPosition,n.pointPosition+o),e.featureIds.fill(n.pointFeature,n.pointPosition,n.pointPosition+o),n.pointPosition+=o}function Cn(t,e,n,i,r){e.positions.set(t.data,n.linePosition*i);let o=t.data.length/i;Lt(e,r,n.linePosition,o),e.globalFeatureIds.fill(n.feature,n.linePosition,n.linePosition+o),e.featureIds.fill(n.lineFeature,n.linePosition,n.linePosition+o);for(let s=0,a=t.indices.length;s<a;++s){let l=t.indices[s],f=s===a-1?t.data.length:t.indices[s+1];e.pathIndices[n.linePath++]=n.linePosition,n.linePosition+=(f-l)/i}}function bn(t,e,n,i,r){e.positions.set(t.data,n.polygonPosition*i);let o=t.data.length/i;Lt(e,r,n.polygonPosition,o),e.globalFeatureIds.fill(n.feature,n.polygonPosition,n.polygonPosition+o),e.featureIds.fill(n.polygonFeature,n.polygonPosition,n.polygonPosition+o);for(let s=0,a=t.indices.length;s<a;++s){let l=n.polygonPosition;e.polygonIndices[n.polygonObject++]=l;let f=t.areas[s],c=t.indices[s],u=t.indices[s+1];for(let h=0,d=c.length;h<d;++h){let x=c[h],w=h===d-1?u===void 0?t.data.length:u[0]:c[h+1];e.primitivePolygonIndices[n.polygonRing++]=n.polygonPosition,n.polygonPosition+=(w-x)/i}let p=n.polygonPosition;On(e,f,c,{startPosition:l,endPosition:p,coordLength:i})}}function On(t,e,n,{startPosition:i,endPosition:r,coordLength:o}){if(!t.triangles)return;let s=i*o,a=r*o,l=t.positions.subarray(s,a),f=n[0],c=n.slice(1).map(p=>(p-f)/o),u=Bt(l,c,o,e);for(let p=0,h=u.length;p<h;++p)t.triangles.push(i+u[p])}function At(t,e){let n={};for(let i in t)n[i]={value:t[i],size:e};return n}function Nn(t,e,n,i){let r={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:i},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:At(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:i},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:At(e.numericProps,1)},polygons:{...n,positions:{value:n.positions,size:i},polygonIndices:{value:n.polygonIndices,size:1},primitivePolygonIndices:{value:n.primitivePolygonIndices,size:1},globalFeatureIds:{value:n.globalFeatureIds,size:1},featureIds:{value:n.featureIds,size:1},numericProps:At(n.numericProps,1)}};return r.polygons&&n.triangles&&(r.polygons.triangles={value:new Uint32Array(n.triangles),size:1}),r}function Lt(t,e,n,i){for(let r in t.numericProps)if(r in e){let o=e[r];t.numericProps[r].fill(o,n,n+i)}}function Et(t,e){let n={};for(let i in t)e.includes(i)||(n[i]=t[i]);return n}function kn(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}var Gt=ie(ye(),1);function we(t){let e=t.length;if(e<=1)return[t];let n=[],i,r;for(let o=0;o<e;o++){let s=ni(t[o]);s!==0&&(r===void 0&&(r=s<0),r===s<0?(i&&n.push(i),i=[t[o]]):i&&i.push(t[o]))}return i&&n.push(i),n}function ni(t){let e=0;for(let n=0,i=t.length-1,r,o;n<t.length;i=n++)r=t[n],o=t[i],e+=(o[0]-r[0])*(r[1]+o[1]);return e}function Pe(t,e,n){e&&n&&(t===1?e.id=n.readVarint():t===2?ii(n,e):t===3?e.type=n.readVarint():t===4&&(e._geometry=n.pos))}function ii(t,e){let n=t.readVarint()+t.pos;for(;t.pos<n;){let i=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[i]=r}}var N=class{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,n,i,r,o){this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=r,this._values=o,e.readFields(Pe,this,n)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let n=e.readVarint()+e.pos,i=1,r=0,o=0,s=0,a=[],l;for(;e.pos<n;){if(r<=0){let f=e.readVarint();i=f&7,r=f>>3}if(r--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),i===1&&(l&&a.push(l),l=[]),l&&l.push([o,s]);else if(i===7)l&&l.push(l[0].slice());else throw new Error(`unknown command ${i}`)}return l&&a.push(l),a}bbox(){let e=this._pbf;e.pos=this._geometry;let n=e.readVarint()+e.pos,i=1,r=0,o=0,s=0,a=1/0,l=-1/0,f=1/0,c=-1/0;for(;e.pos<n;){if(r<=0){let u=e.readVarint();i=u&7,r=u>>3}if(r--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),o<a&&(a=o),o>l&&(l=o),s<f&&(f=s),s>c&&(c=s);else if(i!==7)throw new Error(`unknown command ${i}`)}return[a,f,l,c]}_toGeoJSON(e){let n=this.loadGeometry(),i=N.types[this.type],r,o;switch(this.type){case 1:let a=[];for(r=0;r<n.length;r++)a[r]=n[r][0];n=a,e(n,this);break;case 2:for(r=0;r<n.length;r++)e(n[r],this);break;case 3:for(n=we(n),r=0;r<n.length;r++)for(o=0;o<n[r].length;o++)e(n[r][o],this);break}n.length===1?n=n[0]:i=`Multi${i}`;let s={type:"Feature",geometry:{type:i,coordinates:n},properties:this.properties};return this.id!==null&&(s.id=this.id),s}toGeoJSON(e){if(typeof e=="function")return this._toGeoJSON(e);let{x:n,y:i,z:r}=e,o=this.extent*Math.pow(2,r),s=this.extent*n,a=this.extent*i;function l(f){for(let c=0;c<f.length;c++){let u=f[c];u[0]=(u[0]+s)*360/o-180;let p=180-(u[1]+a)*360/o;u[1]=360/Math.PI*Math.atan(Math.exp(p*Math.PI/180))-90}}return this._toGeoJSON(l)}};var H=class{constructor(e,n){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(ri,this,n),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let n=this._pbf.readVarint()+this._pbf.pos;return new N(this._pbf,n,this.extent,this._keys,this._values)}};function ri(t,e,n){e&&n&&(t===15?e.version=n.readVarint():t===1?e.name=n.readString():t===5?e.extent=n.readVarint():t===2?e._features.push(n.pos):t===3?e._keys.push(n.readString()):t===4&&e._values.push(oi(n)))}function oi(t){let e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var K=class{constructor(e,n){this.layers=e.readFields(si,{},n)}};function si(t,e,n){if(t===3&&n){let i=new H(n,n.readVarint()+n.pos);i.length&&e&&(e[i.name]=i)}}function Fe(t){let e=t.indices.length,n="Polygon";if(e<=1)return{type:n,data:t.data,areas:[[b(t.data)]],indices:[t.indices]};let i=[],r=[],o=[],s=[],a,l=0;for(let f,c=0,u;c<e;c++){u=t.indices[c]-l,f=t.indices[c+1]-l||t.data.length;let p=t.data.slice(u,f),h=b(p);if(h===0){let d=t.data.slice(0,u),x=t.data.slice(f);t.data=d.concat(x),l+=f-u;continue}a===void 0&&(a=h<0),a===h<0?(s.length&&(i.push(o),r.push(s)),s=[u],o=[h]):(o.push(h),s.push(u))}return o&&i.push(o),s.length&&r.push(s),{type:n,areas:i,indices:r,data:t.data}}function Ie(t,e,n,i){for(let r=0,o=t.length;r<o;r+=2){t[r]=(t[r]+e)*360/i-180;let s=180-(t[r+1]+n)*360/i;t[r+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function ve(t,e,n){e&&n&&(t===1?e.id=n.readVarint():t===2?ai(n,e):t===3?e.type=n.readVarint():t===4&&(e._geometry=n.pos))}function ai(t,e){let n=t.readVarint()+t.pos;for(;t.pos<n;){let i=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[i]=r}}var Te,k,Ot,gt,Nt,kt,Q;var q=class{constructor(e,n,i,r,o,s){this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=r,this._values=o,this._geometryInfo=s,e.readFields(ve,this,n)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,Te=e.readVarint()+e.pos,k=1,gt=0,Nt=0,kt=0,Q=0;let n=[],i=[];for(;e.pos<Te;)if(gt<=0&&(Ot=e.readVarint(),k=Ot&7,gt=Ot>>3),gt--,k===1||k===2)Nt+=e.readSVarint(),kt+=e.readSVarint(),k===1&&n.push(Q),i.push(Nt,kt),Q+=2;else if(k===7){if(Q>0){let r=n[n.length-1];i.push(i[r],i[r+1]),Q+=2}}else throw new Error(`unknown command ${k}`);return{data:i,indices:n}}_toBinaryCoordinates(e){let n=this.loadGeometry(),i;e(n.data,this);let r=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=n.indices.length,i={type:"Point",...n};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=n.indices.length,this._geometryInfo.linePositionsCount+=n.data.length/r,i={type:"LineString",...n};break;case 3:i=Fe(n),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=i.indices.length;for(let s of i.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=i.data.length/r;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:i,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(e){if(typeof e=="function")return this._toBinaryCoordinates(e);let{x:n,y:i,z:r}=e,o=this.extent*Math.pow(2,r),s=this.extent*n,a=this.extent*i;return this._toBinaryCoordinates(l=>Ie(l,s,a,o))}};var tt=class{constructor(e,n){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(li,this,n),this.length=this._features.length}feature(e,n){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let i=this._pbf.readVarint()+this._pbf.pos;return new q(this._pbf,i,this.extent,this._keys,this._values,n)}};function li(t,e,n){e&&n&&(t===15?e.version=n.readVarint():t===1?e.name=n.readString():t===5?e.extent=n.readVarint():t===2?e._features.push(n.pos):t===3?e._keys.push(n.readString()):t===4&&e._values.push(fi(n)))}function fi(t){let e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var et=class{constructor(e,n){this.layers=e.readFields(ci,{},n)}};function ci(t,e,n){if(t===3&&n){let i=new tt(n,n.readVarint()+n.pos);i.length&&e&&(e[i.name]=i)}}function mt(t,e){let n=hi(e),i=e?.gis?.format||e?.mvt?.shape||e?.shape;switch(i){case"columnar-table":return{shape:"columnar-table",data:Ut(t,n)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:Se(t,n)};case"geojson":return Se(t,n);case"binary-geometry":return Ut(t,n);case"binary":return Ut(t,n);default:throw new Error(i||"undefined shape")}}function Ut(t,e){let[n,i]=ui(t,e),r=Dt(n,i);return r.byteLength=t.byteLength,r}function ui(t,e){let n=[],i={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[n,i];let r=new et(new Gt.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(r.layers)).forEach(s=>{let a=r.layers[s];if(a)for(let l=0;l<a.length;l++){let f=a.feature(l,i),c=di(f,e,s);n.push(c)}}),[n,i]}function Se(t,e){if(t.byteLength<=0)return[];let n=[],i=new K(new Gt.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(o=>{let s=i.layers[o];if(s)for(let a=0;a<s.length;a++){let l=s.feature(a),f=pi(l,e,o);n.push(f)}}),n}function hi(t){if(!t?.mvt)throw new Error("mvt options required");let e=t.mvt?.coordinates==="wgs84",{tileIndex:n}=t.mvt,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(e&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function pi(t,e,n){let i=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:gi);return e.layerProperty&&(i.properties[e.layerProperty]=n),i}function di(t,e,n){let i=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:mi);return e.layerProperty&&i.properties&&(i.properties[e.layerProperty]=n),i}function gi(t,e){let{extent:n}=e;for(let i=0;i<t.length;i++){let r=t[i];r[0]/=n,r[1]/=n}}function mi(t,e){let{extent:n}=e;for(let i=0,r=t.length;i<r;++i)t[i]/=n}var xi="4.2.0-alpha.4",Rt={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:xi,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}},xt={...Rt,parse:async(t,e)=>mt(t,e),parseSync:mt,binary:!0};var Be=t=>t!==null&&typeof t=="object";function jt(t,e){if(!t||!Be(t))return null;let n={name:t.name||"",description:t.description||""};if(typeof t.generator=="string"&&(n.generator=t.generator),typeof t.generator_options=="string"&&(n.generatorOptions=t.generator_options),n.boundingBox=Me(t.bounds)||Me(t.antimeridian_adjusted_bounds),n.center=vi(t.center),n.maxZoom=Ve(t.maxzoom),n.minZoom=Ve(t.minzoom),typeof t?.json=="string")try{n.metaJson=JSON.parse(t.json)}catch(a){console.warn("Failed to parse tilejson.json field",a)}let i=t.tilestats||n.metaJson?.tilestats,r=Pi(i,e),o=yi(t.vector_layers),s=Ii(o,r);return n={...n,layers:s},n.maxZoom===null&&s.length>0&&(n.maxZoom=s[0].maxZoom||null),n.minZoom===null&&s.length>0&&(n.minZoom=s[0].minZoom||null),n}function yi(t){return Array.isArray(t)?t.map(e=>wi(e)):[]}function wi(t){let e=Object.entries(t.fields||[]).map(([i,r])=>({name:i,...Le(String(r))})),n={...t};return delete n.fields,{name:t.id||"",...n,fields:e}}function Pi(t,e){return Be(t)&&Array.isArray(t.layers)?t.layers.map(n=>Fi(n,e)):[]}function Fi(t,e){let n=[],i={},r=t.attributes||[];for(let o of r){let s=o.attribute;if(typeof s=="string")if(s.split("|").length>1){let a=s.split("|")[0];i[a]=i[a]||[],i[a].push(o),console.warn("ignoring tilestats indexed field",a)}else n[s]||n.push(Si(o,e))}return{name:t.layer||"",dominantGeometry:t.geometry,fields:n}}function Ii(t,e){return t.map(n=>{let i=e.find(s=>s.name===n.name),r=i?.fields||[],o={...n};return delete o.fields,{...o,...i,fields:r}})}function Me(t){let e=De(t);if(Array.isArray(e)&&e.length===4&&[e[0],e[2]].every(Ee)&&[e[1],e[3]].every(Ae))return[[e[0],e[1]],[e[2],e[3]]]}function vi(t){let e=De(t);return Array.isArray(e)&&e.length===3&&Ee(e[0])&&Ae(e[1])&&Ti(e[2])?e:null}function Ve(t){let e=typeof t=="string"?parseFloat(t):typeof t=="number"?t:null;return e===null||isNaN(e)?null:e}function Ae(t){return Number.isFinite(t)&&t<=90&&t>=-90}function Ee(t){return Number.isFinite(t)&&t<=180&&t>=-180}function Ti(t){return Number.isFinite(t)&&t>=0&&t<=22}function De(t){return typeof t=="string"?t.split(",").map(parseFloat):Array.isArray(t)?t:null}var _e={number:{type:"float32"},numeric:{type:"float32"},string:{type:"utf8"},vachar:{type:"utf8"},float:{type:"float32"},int:{type:"int32"},int4:{type:"int32"},boolean:{type:"boolean"},bool:{type:"boolean"}};function Si(t={},e){let n=Le(t.type),i={name:t.attribute,...n};return typeof t.min=="number"&&(i.min=t.min),typeof t.max=="number"&&(i.max=t.max),typeof t.count=="number"&&(i.uniqueValueCount=t.count),t.values&&(i.values=t.values),i.values&&typeof e.maxValues=="number"&&(i.values=i.values?.slice(0,e.maxValues)),i}function Le(t){let e=t.toLowerCase();return!e||_e[e],_e[e]||{type:"string"}}var Mi="4.2.0-alpha.4",Z={name:"TileJSON",id:"tilejson",module:"pmtiles",version:Mi,worker:!0,extensions:["json"],mimeTypes:["application/json"],text:!0,options:{tilejson:{maxValues:void 0}},parse:async(t,e)=>{let n=new TextDecoder().decode(t),i=JSON.parse(n),r={...Z.options.tilejson,...e?.tilejson};return jt(i,r)},parseTextSync:(t,e)=>{let n=JSON.parse(t),i={...Z.options.tilejson,...e?.tilejson};return jt(n,i)}};function nt(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var A={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Vi=A.self||A.window||A.global||{},_i=A.window||A.self||A.global||{},Bi=A.global||A.self||A.window||{},Ai=A.document||{};var Zt=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Ce=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Ei=Ce&&parseFloat(Ce[1])||0;var Di="",be={};function zt(t){for(let e in be)if(t.startsWith(e)){let n=be[e];t=t.replace(e,n)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${Di}${t}`),t}var it=class{constructor(e){this._needsRefresh=!0,this.props={...e},this.loadOptions={...e.loadOptions},this.fetch=Li(this.loadOptions)}setProps(e){this.props=Object.assign(this.props,e),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(e=!0){let n=this._needsRefresh;return e&&(this._needsRefresh=!1),n}};function Li(t){let e=t?.fetch;if(e&&typeof e=="function")return(i,r)=>e(i,r);let n=t?.fetch;return n&&typeof n!="function"?i=>fetch(i,n):i=>fetch(i)}var Oe="4.2.0-alpha.4";var Ci=globalThis.loaders?.parseImageNode,Jt=typeof Image<"u",Wt=typeof ImageBitmap<"u",bi=Boolean(Ci),Yt=Zt?!0:bi;function Ne(t){switch(t){case"auto":return Wt||Jt||Yt;case"imagebitmap":return Wt;case"image":return Jt;case"data":return Yt;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function ke(){if(Wt)return"imagebitmap";if(Jt)return"image";if(Yt)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Oi(t){let e=Ni(t);if(!e)throw new Error("Not an image");return e}function Ue(t){switch(Oi(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Ni(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var ki=/^data:image\/svg\+xml/,Ui=/\.svg((\?|#).*)?$/;function yt(t){return t&&(ki.test(t)||Ui.test(t))}function Ge(t,e){if(yt(e)){let i=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return Xt(t,e)}function Xt(t,e){if(yt(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function wt(t,e,n){let i=Ge(t,n),r=self.URL||self.webkitURL,o=typeof i!="string"&&r.createObjectURL(i);try{return await Gi(o||i,e)}finally{o&&r.revokeObjectURL(o)}}async function Gi(t,e){let n=new Image;return n.src=t,e.image&&e.image.decode&&n.decode?(await n.decode(),n):await new Promise((i,r)=>{try{n.onload=()=>i(n),n.onerror=o=>{let s=o instanceof Error?o.message:"error";r(new Error(s))}}catch(o){r(o)}})}var Ri={},Re=!0;async function je(t,e,n){let i;yt(n)?i=await wt(t,e,n):i=Xt(t,n);let r=e&&e.imagebitmap;return await ji(i,r)}async function ji(t,e=null){if((Zi(e)||!Re)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(n){console.warn(n),Re=!1}return await createImageBitmap(t)}function Zi(t){for(let e in t||Ri)return!1;return!0}function Ze(t){return!Yi(t,"ftyp",4)||!(t[8]&96)?null:zi(t)}function zi(t){switch(Ji(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Ji(t,e,n){return String.fromCharCode(...t.slice(e,n))}function Wi(t){return[...t].map(e=>e.charCodeAt(0))}function Yi(t,e,n=0){let i=Wi(e);for(let r=0;r<i.length;++r)if(i[r]!==t[r+n])return!1;return!0}var E=!1,rt=!0;function U(t){let e=ot(t);return $i(e)||Qi(e)||Hi(e)||Ki(e)||Xi(e)}function Xi(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),n=Ze(e);return n?{mimeType:n.mimeType,width:0,height:0}:null}function $i(t){let e=ot(t);return e.byteLength>=24&&e.getUint32(0,E)===2303741511?{mimeType:"image/png",width:e.getUint32(16,E),height:e.getUint32(20,E)}:null}function Hi(t){let e=ot(t);return e.byteLength>=10&&e.getUint32(0,E)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,rt),height:e.getUint16(8,rt)}:null}function Ki(t){let e=ot(t);return e.byteLength>=14&&e.getUint16(0,E)===16973&&e.getUint32(2,rt)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,rt),height:e.getUint32(22,rt)}:null}function Qi(t){let e=ot(t);if(!(e.byteLength>=3&&e.getUint16(0,E)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:r}=qi(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,E);if(r.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,E),width:e.getUint16(o+7,E)};if(!i.has(s))return null;o+=2,o+=e.getUint16(o,E)}return null}function qi(){let t=new Set([65499,65476,65484,65501,65534]);for(let n=65504;n<65520;++n)t.add(n);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function ot(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function ze(t,e){let{mimeType:n}=U(t)||{},i=globalThis.loaders?.parseImageNode;return nt(i),await i(t,n)}async function Je(t,e,n){e=e||{};let r=(e.image||{}).type||"auto",{url:o}=n||{},s=tr(r),a;switch(s){case"imagebitmap":a=await je(t,e,o);break;case"image":a=await wt(t,e,o);break;case"data":a=await ze(t,e);break;default:nt(!1)}return r==="data"&&(a=Ue(a)),a}function tr(t){switch(t){case"auto":case"data":return ke();default:return Ne(t),t}}var er=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],nr=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],ir={image:{type:"auto",decode:!0}},$t={id:"image",module:"images",name:"Images",version:Oe,mimeTypes:nr,extensions:er,parse:Je,tests:[t=>Boolean(U(new DataView(t)))],options:ir};var Pt=class extends it{constructor(e){super(e),this.metadataUrl=null,this.schema="tms",this.mimeType=null,this.props=e,this.url=zt(e.url),this.metadataUrl=e.metadataUrl===void 0?`${this.url}/tilejson.json`:e.metadataUrl,this.extension=e.extension||".png",this.data=this.url,this.getTileData=this.getTileData.bind(this),this.metadata=this.getMetadata(),rr(this.url)&&(this.schema="template")}async getMetadata(){if(!this.metadataUrl)return null;let e;try{e=await this.fetch(this.metadataUrl)}catch(r){return console.error(r.message),null}if(!e.ok)return console.error(e.statusText),null;let n=await e.text();return Z.parseTextSync?.(n)||null}getTileMIMEType(){return this.mimeType}async getTile(e){let{x:n,y:i,zoom:r}=e,o=this.getTileURL(n,i,r),s=await this.fetch(o);return s.ok?await s.arrayBuffer():null}async getTileData(e){let{x:n,y:i,z:r}=e.index,o=await this.getTile({x:n,y:i,zoom:r,layers:[]});if(o===null)return null;let s=U(o);switch(this.mimeType=this.mimeType||s?.mimeType||"application/vnd.mapbox-vector-tile",this.mimeType){case"application/vnd.mapbox-vector-tile":return await this._parseVectorTile(o,{x:n,y:i,zoom:r,layers:[]});default:return await this._parseImageTile(o)}}async getImageTile(e){let n=await this.getTile(e);return n?this._parseImageTile(n):null}async _parseImageTile(e){return await $t.parse(e,this.loadOptions)}async getVectorTile(e){let n=await this.getTile(e);return n?this._parseVectorTile(n,e):null}async _parseVectorTile(e,n){let i={shape:"geojson-table",mvt:{coordinates:"wgs84",tileIndex:{x:n.x,y:n.y,z:n.zoom},...this.loadOptions?.mvt},...this.loadOptions};return await xt.parse(e,i)}getMetadataUrl(){return this.metadataUrl}getTileURL(e,n,i){switch(this.schema){case"xyz":return`${this.url}/${e}/${n}/${i}${this.extension}`;case"tms":return`${this.url}/${i}/${e}/${n}${this.extension}`;case"template":return lr(this.url,e,n,i,"0");default:throw new Error(this.schema)}}};function rr(t){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))|(?=.*{x})(?=.*({y}|{-y})(?=.*{z}))/.test(t)}var or=new RegExp("{x}","g"),sr=new RegExp("{y}","g"),ar=new RegExp("{z}","g");function lr(t,e,n,i,r="0"){if(Array.isArray(t)){let s=fr(r)%t.length;t=t[s]}let o=t;return o=o.replace(or,String(e)),o=o.replace(sr,String(n)),o=o.replace(ar,String(i)),Number.isInteger(n)&&Number.isInteger(i)&&(o=o.replace(/\{-y\}/g,String(Math.pow(2,i)-n-1))),o}function fr(t){return Math.abs(t.split("").reduce((e,n)=>(e<<5)-e+n.charCodeAt(0)|0,0))}function Ft(t,e,n,i){let r=i,o=n-e>>1,s=n-e,a,l=t[e],f=t[e+1],c=t[n],u=t[n+1];for(let p=e+3;p<n;p+=3){let h=cr(t[p],t[p+1],l,f,c,u);if(h>r)a=p,r=h;else if(h===r){let d=Math.abs(p-o);d<s&&(a=p,s=d)}}r>i&&(a-e>3&&Ft(t,e,a,i),t[a+2]=r,n-a>3&&Ft(t,a,n,i))}function cr(t,e,n,i,r,o){let s=r-n,a=o-i;if(s!==0||a!==0){let l=((t-n)*s+(e-i)*a)/(s*s+a*a);l>1?(n=r,i=o):l>0&&(n+=s*l,i+=a*l)}return s=t-n,a=e-i,s*s+a*a}function C(t,e,n,i){let r={id:t??null,type:e,geometry:n,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(e==="Point"||e==="MultiPoint"||e==="LineString")It(r,n);else if(e==="Polygon")It(r,n[0]);else if(e==="MultiLineString")for(let o of n)It(r,o);else if(e==="MultiPolygon")for(let o of n)It(r,o[0]);return r}function It(t,e){for(let n=0;n<e.length;n+=3)t.minX=Math.min(t.minX,e[n]),t.minY=Math.min(t.minY,e[n+1]),t.maxX=Math.max(t.maxX,e[n]),t.maxY=Math.max(t.maxY,e[n+1])}function Ye(t,e){let n=[];if(t.type==="FeatureCollection")for(let i=0;i<t.features.length;i++)vt(n,t.features[i],e,i);else t.type==="Feature"?vt(n,t,e):vt(n,{geometry:t},e);return n}function vt(t,e,n,i){if(!e.geometry)return;let r=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),a=[],l=e.id;if(n.promoteId?l=e.properties[n.promoteId]:n.generateId&&(l=i||0),o==="Point")We(r,a);else if(o==="MultiPoint")for(let f of r)We(f,a);else if(o==="LineString")Kt(r,a,s,!1);else if(o==="MultiLineString")if(n.lineMetrics){for(let f of r)a=[],Kt(f,a,s,!1),t.push(C(l,"LineString",a,e.properties));return}else Ht(r,a,s,!1);else if(o==="Polygon")Ht(r,a,s,!0);else if(o==="MultiPolygon")for(let f of r){let c=[];Ht(f,c,s,!0),a.push(c)}else if(o==="GeometryCollection"){for(let f of e.geometry.geometries)vt(t,{id:l,geometry:f,properties:e.properties},n,i);return}else throw new Error("Input data is not a valid GeoJSON object.");t.push(C(l,o,a,e.properties))}function We(t,e){e.push(Xe(t[0]),$e(t[1]),0)}function Kt(t,e,n,i){let r,o,s=0;for(let l=0;l<t.length;l++){let f=Xe(t[l][0]),c=$e(t[l][1]);e.push(f,c,0),l>0&&(i?s+=(r*c-f*o)/2:s+=Math.sqrt(Math.pow(f-r,2)+Math.pow(c-o,2))),r=f,o=c}let a=e.length-3;e[2]=1,Ft(e,0,a,n),e[a+2]=1,e.size=Math.abs(s),e.start=0,e.end=e.size}function Ht(t,e,n,i){for(let r=0;r<t.length;r++){let o=[];Kt(t[r],o,n,i),e.push(o)}}function Xe(t){return t/360+.5}function $e(t){let e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function B(t,e,n,i,r,o,s,a){if(n/=e,i/=e,o>=n&&s<i)return t;if(s<n||o>=i)return null;let l=[];for(let f of t){let c=f.geometry,u=f.type,p=r===0?f.minX:f.minY,h=r===0?f.maxX:f.maxY;if(p>=n&&h<i){l.push(f);continue}else if(h<n||p>=i)continue;let d=[];if(u==="Point"||u==="MultiPoint")ur(c,d,n,i,r);else if(u==="LineString")Ke(c,d,n,i,r,!1,a.lineMetrics);else if(u==="MultiLineString")Qt(c,d,n,i,r,!1);else if(u==="Polygon")Qt(c,d,n,i,r,!0);else if(u==="MultiPolygon")for(let x of c){let w=[];Qt(x,w,n,i,r,!0),w.length&&d.push(w)}if(d.length){if(a.lineMetrics&&u==="LineString"){for(let x of d)l.push(C(f.id,u,x,f.tags));continue}(u==="LineString"||u==="MultiLineString")&&(d.length===1?(u="LineString",d=d[0]):u="MultiLineString"),(u==="Point"||u==="MultiPoint")&&(u=d.length===3?"Point":"MultiPoint"),l.push(C(f.id,u,d,f.tags))}}return l.length?l:null}function ur(t,e,n,i,r){for(let o=0;o<t.length;o+=3){let s=t[o+r];s>=n&&s<=i&&z(e,t[o],t[o+1],t[o+2])}}function Ke(t,e,n,i,r,o,s){let a=He(t),l=r===0?hr:pr,f=t.start,c,u;for(let I=0;I<t.length-3;I+=3){let M=t[I],g=t[I+1],m=t[I+2],v=t[I+3],F=t[I+4],T=r===0?M:g,S=r===0?v:F,V=!1;s&&(c=Math.sqrt(Math.pow(M-v,2)+Math.pow(g-F,2))),T<n?S>n&&(u=l(a,M,g,v,F,n),s&&(a.start=f+c*u)):T>i?S<i&&(u=l(a,M,g,v,F,i),s&&(a.start=f+c*u)):z(a,M,g,m),S<n&&T>=n&&(u=l(a,M,g,v,F,n),V=!0),S>i&&T<=i&&(u=l(a,M,g,v,F,i),V=!0),!o&&V&&(s&&(a.end=f+c*u),e.push(a),a=He(t)),s&&(f+=c)}let p=t.length-3,h=t[p],d=t[p+1],x=t[p+2],w=r===0?h:d;w>=n&&w<=i&&z(a,h,d,x),p=a.length-3,o&&p>=3&&(a[p]!==a[0]||a[p+1]!==a[1])&&z(a,a[0],a[1],a[2]),a.length&&e.push(a)}function He(t){let e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Qt(t,e,n,i,r,o){for(let s of t)Ke(s,e,n,i,r,o,!1)}function z(t,e,n,i){t.push(e,n,i)}function hr(t,e,n,i,r,o){let s=(o-e)/(i-e);return z(t,o,n+(r-n)*s,1),s}function pr(t,e,n,i,r,o){let s=(o-n)/(r-n);return z(t,e+(i-e)*s,o,1),s}function qe(t,e){let n=e.buffer/e.extent,i=t,r=B(t,1,-1-n,n,0,-1,2,e),o=B(t,1,1-n,2+n,0,-1,2,e);return(r||o)&&(i=B(t,1,-n,1+n,0,-1,2,e)||[],r&&(i=Qe(r,1).concat(i)),o&&(i=i.concat(Qe(o,-1)))),i}function Qe(t,e){let n=[];for(let i=0;i<t.length;i++){let r=t[i],o=r.type,s;if(o==="Point"||o==="MultiPoint"||o==="LineString")s=qt(r.geometry,e);else if(o==="MultiLineString"||o==="Polygon"){s=[];for(let a of r.geometry)s.push(qt(a,e))}else if(o==="MultiPolygon"){s=[];for(let a of r.geometry){let l=[];for(let f of a)l.push(qt(f,e));s.push(l)}}n.push(C(r.id,o,s,r.tags))}return n}function qt(t,e){let n=[];n.size=t.size,t.start!==void 0&&(n.start=t.start,n.end=t.end);for(let i=0;i<t.length;i+=3)n.push(t[i]+e,t[i+1],t[i+2]);return n}function te(t,e){if(t.transformed)return t;let n=1<<t.z,i=t.x,r=t.y;for(let o of t.features){let s=o.geometry,a=o.type;if(o.geometry=[],a===1)for(let l=0;l<s.length;l+=2)o.geometry.push(tn(s[l],s[l+1],e,n,i,r));else for(let l=0;l<s.length;l++){let f=[];for(let c=0;c<s[l].length;c+=2)f.push(tn(s[l][c],s[l][c+1],e,n,i,r));o.geometry.push(f)}}return t.transformed=!0,t}function tn(t,e,n,i,r,o){return[Math.round(n*(t*i-r)),Math.round(n*(e*i-o))]}function en(t,e,n,i,r){let o=e===r.maxZoom?0:r.tolerance/((1<<e)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:n,y:i,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let a of t)dr(s,a,o,r);return s}function dr(t,e,n,i){let r=e.geometry,o=e.type,s=[];if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),o==="Point"||o==="MultiPoint")for(let a=0;a<r.length;a+=3)s.push(r[a],r[a+1]),t.numPoints++,t.numSimplified++;else if(o==="LineString")ee(s,r,t,n,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(let a=0;a<r.length;a++)ee(s,r[a],t,n,o==="Polygon",a===0);else if(o==="MultiPolygon")for(let a=0;a<r.length;a++){let l=r[a];for(let f=0;f<l.length;f++)ee(s,l[f],t,n,!0,f===0)}if(s.length){let a=e.tags||null;if(o==="LineString"&&i.lineMetrics){a={};for(let f in e.tags)a[f]=e.tags[f];a.mapbox_clip_start=r.start/r.size,a.mapbox_clip_end=r.end/r.size}let l={geometry:s,type:o==="Polygon"||o==="MultiPolygon"?3:o==="LineString"||o==="MultiLineString"?2:1,tags:a};e.id!==null&&(l.id=e.id),t.features.push(l)}}function ee(t,e,n,i,r,o){let s=i*i;if(i>0&&e.size<(r?s:i)){n.numPoints+=e.length/3;return}let a=[];for(let l=0;l<e.length;l+=3)(i===0||e[l+2]>s)&&(n.numSimplified++,a.push(e[l],e[l+1])),n.numPoints++;r&&gr(a,o),t.push(a)}function gr(t,e){let n=0;for(let i=0,r=t.length-2;i<t.length;r=i,i+=2)n+=(t[i]-t[r])*(t[i+1]+t[r+1]);if(n>0===e)for(let i=0,r=t.length;i<r/2;i+=2){let o=t[i],s=t[i+1];t[i]=t[r-2-i],t[i+1]=t[r-1-i],t[r-2-i]=o,t[r-1-i]=s}}var mr={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:void 0,generateId:!1,debug:0},Tt=class{constructor(e,n){this.tiles={},this.tileCoords=[],this.stats={},this.total=0,this.options={...mr,...n},n=this.options;let i=n.debug;if(i&&console.time("preprocess data"),this.options.maxZoom<0||this.options.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(n.promoteId&&this.options.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=Ye(e,n);i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",n.indexMaxZoom,n.indexMaxPoints),console.time("generate tiles")),r=qe(r,this.options),r.length&&this.splitTile(r,0,0,0),i&&(r.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)))}getTile(e,n,i){let{extent:r,debug:o}=this.options;if(e<0||e>24)return null;let s=1<<e;n=n+s&s-1;let a=ne(e,n,i);if(this.tiles[a])return te(this.tiles[a],r);o>1&&console.log("drilling down to z%d-%d-%d",e,n,i);let l=e,f=n,c=i,u;for(;!u&&l>0;)l--,f=f>>1,c=c>>1,u=this.tiles[ne(l,f,c)];return!u||!u.source?null:(o>1&&(console.log("found parent tile z%d-%d-%d",l,f,c),console.time("drilling down")),this.splitTile(u.source,l,f,c,e,n,i),o>1&&console.timeEnd("drilling down"),this.tiles[a]?te(this.tiles[a],r):null)}splitTile(e,n,i,r,o,s,a){let l=[e,n,i,r],f=this.options,c=f.debug;for(;l.length;){r=l.pop(),i=l.pop(),n=l.pop(),e=l.pop();let u=1<<n,p=ne(n,i,r),h=this.tiles[p];if(!h&&(c>1&&console.time("creation"),h=this.tiles[p]=en(e,n,i,r,f),this.tileCoords.push({z:n,x:i,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",n,i,r,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));let S=`z${n}`;this.stats[S]=(this.stats[S]||0)+1,this.total++}if(h.source=e,o===void 0){if(n===f.indexMaxZoom||h.numPoints<=f.indexMaxPoints)continue}else{if(n===f.maxZoom||n===o)continue;if(o!==void 0){let S=o-n;if(i!==s>>S||r!==a>>S)continue}}if(h.source=null,e.length===0)continue;c>1&&console.time("clipping");let d=.5*f.buffer/f.extent,x=.5-d,w=.5+d,I=1+d,M=null,g=null,m=null,v=null,F=B(e,u,i-d,i+w,0,h.minX,h.maxX,f),T=B(e,u,i+x,i+I,0,h.minX,h.maxX,f);e=null,F&&(M=B(F,u,r-d,r+w,1,h.minY,h.maxY,f),g=B(F,u,r+x,r+I,1,h.minY,h.maxY,f),F=null),T&&(m=B(T,u,r-d,r+w,1,h.minY,h.maxY,f),v=B(T,u,r+x,r+I,1,h.minY,h.maxY,f),T=null),c>1&&console.timeEnd("clipping"),l.push(M||[],n+1,i*2,r*2),l.push(g||[],n+1,i*2,r*2+1),l.push(m||[],n+1,i*2+1,r*2),l.push(v||[],n+1,i*2+1,r*2+1)}}};function ne(t,e,n){return((1<<t)*n+e)*32+t}return fn(st);})();
|
|
7
|
+
"use strict";var __exports__=(()=>{var nn=Object.create;var ie=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var sn=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty;var Te=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ln=(e,t)=>{for(var n in t)ie(e,n,{get:t[n],enumerable:!0})},ne=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of on(t))!an.call(e,r)&&r!==n&&ie(e,r,{get:()=>t[r],enumerable:!(i=rn(t,r))||i.enumerable});return e},re=(e,t,n)=>(ne(e,t,"default"),n&&ne(n,t,"default")),it=(e,t,n)=>(n=e!=null?nn(sn(e)):{},ne(t||!e||!e.__esModule?ie(n,"default",{value:e,enumerable:!0}):n,e)),fn=e=>ne(ie({},"__esModule",{value:!0}),e);var ot=Te((yr,rt)=>{rt.exports=globalThis.loaders});var ht=Te(be=>{be.read=function(e,t,n,i,r){var o,s,a=r*8-i-1,l=(1<<a)-1,f=l>>1,c=-7,u=n?r-1:0,p=n?-1:1,h=e[t+u];for(u+=p,o=h&(1<<-c)-1,h>>=-c,c+=a;c>0;o=o*256+e[t+u],u+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=s*256+e[t+u],u+=p,c-=8);if(o===0)o=1-f;else{if(o===l)return s?NaN:(h?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-f}return(h?-1:1)*s*Math.pow(2,o-i)};be.write=function(e,t,n,i,r,o){var s,a,l,f=o*8-r-1,c=(1<<f)-1,u=c>>1,p=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:o-1,d=i?1:-1,x=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+u>=1?t+=p/l:t+=p*Math.pow(2,1-u),t*l>=2&&(s++,l/=2),s+u>=c?(a=0,s=c):s+u>=1?(a=(t*l-1)*Math.pow(2,r),s=s+u):(a=t*Math.pow(2,u-1)*Math.pow(2,r),s=0));r>=8;e[n+h]=a&255,h+=d,a/=256,r-=8);for(s=s<<r|a,f+=r;f>0;e[n+h]=s&255,h+=d,s/=256,f-=8);e[n+h-d]|=x*128}});var yt=Te((po,xt)=>{"use strict";xt.exports=y;var le=ht();function y(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}y.Varint=0;y.Fixed64=1;y.Bytes=2;y.Fixed32=5;var Le=(1<<16)*(1<<16),pt=1/Le,Un=12,mt=typeof TextDecoder>"u"?null:new TextDecoder("utf8");y.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos<n;){var i=this.readVarint(),r=i>>3,o=this.pos;this.type=i&7,e(r,t,this),this.pos===o&&this.skip(i)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=fe(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=gt(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=fe(this.buf,this.pos)+fe(this.buf,this.pos+4)*Le;return this.pos+=8,e},readSFixed64:function(){var e=fe(this.buf,this.pos)+gt(this.buf,this.pos+4)*Le;return this.pos+=8,e},readFloat:function(){var e=le.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=le.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,n,i;return i=t[this.pos++],n=i&127,i<128||(i=t[this.pos++],n|=(i&127)<<7,i<128)||(i=t[this.pos++],n|=(i&127)<<14,i<128)||(i=t[this.pos++],n|=(i&127)<<21,i<128)?n:(i=t[this.pos],n|=(i&15)<<28,Gn(n,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=Un&&mt?ei(this.buf,t,e):qn(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==y.Bytes)return e.push(this.readVarint(t));var n=D(this);for(e=e||[];this.pos<n;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==y.Bytes)return e.push(this.readSVarint());var t=D(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==y.Bytes)return e.push(this.readBoolean());var t=D(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==y.Bytes)return e.push(this.readFloat());var t=D(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==y.Bytes)return e.push(this.readDouble());var t=D(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==y.Bytes)return e.push(this.readFixed32());var t=D(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==y.Bytes)return e.push(this.readSFixed32());var t=D(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==y.Bytes)return e.push(this.readFixed64());var t=D(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==y.Bytes)return e.push(this.readSFixed64());var t=D(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===y.Varint)for(;this.buf[this.pos++]>127;);else if(t===y.Bytes)this.pos=this.readVarint()+this.pos;else if(t===y.Fixed32)this.pos+=4;else if(t===y.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var n=new Uint8Array(t);n.set(this.buf),this.buf=n,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),R(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),R(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),R(this.buf,e&-1,this.pos),R(this.buf,Math.floor(e*pt),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),R(this.buf,e&-1,this.pos),R(this.buf,Math.floor(e*pt),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){Rn(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=ti(this.buf,e,this.pos);var n=this.pos-t;n>=128&&dt(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),le.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),le.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n<t;n++)this.buf[this.pos++]=e[n]},writeRawMessage:function(e,t){this.pos++;var n=this.pos;e(t,this);var i=this.pos-n;i>=128&&dt(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeMessage:function(e,t,n){this.writeTag(e,y.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,zn,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Jn,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Xn,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Wn,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Yn,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,$n,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Hn,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Kn,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Qn,t)},writeBytesField:function(e,t){this.writeTag(e,y.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,y.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,y.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,y.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,y.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,y.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,y.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,y.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,y.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,y.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};function Gn(e,t,n){var i=n.buf,r,o;if(o=i[n.pos++],r=(o&112)>>4,o<128||(o=i[n.pos++],r|=(o&127)<<3,o<128)||(o=i[n.pos++],r|=(o&127)<<10,o<128)||(o=i[n.pos++],r|=(o&127)<<17,o<128)||(o=i[n.pos++],r|=(o&127)<<24,o<128)||(o=i[n.pos++],r|=(o&1)<<31,o<128))return G(e,r,t);throw new Error("Expected varint not more than 10 bytes")}function D(e){return e.type===y.Bytes?e.readVarint()+e.pos:e.pos+1}function G(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Rn(e,t){var n,i;if(e>=0?(n=e%4294967296|0,i=e/4294967296|0):(n=~(-e%4294967296),i=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,i=i+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),jn(n,i,t),Zn(i,t)}function jn(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function Zn(e,t){var n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function dt(e,t,n){var i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(i);for(var r=n.pos-1;r>=e;r--)n.buf[r+i]=n.buf[r]}function zn(e,t){for(var n=0;n<e.length;n++)t.writeVarint(e[n])}function Jn(e,t){for(var n=0;n<e.length;n++)t.writeSVarint(e[n])}function Wn(e,t){for(var n=0;n<e.length;n++)t.writeFloat(e[n])}function Yn(e,t){for(var n=0;n<e.length;n++)t.writeDouble(e[n])}function Xn(e,t){for(var n=0;n<e.length;n++)t.writeBoolean(e[n])}function $n(e,t){for(var n=0;n<e.length;n++)t.writeFixed32(e[n])}function Hn(e,t){for(var n=0;n<e.length;n++)t.writeSFixed32(e[n])}function Kn(e,t){for(var n=0;n<e.length;n++)t.writeFixed64(e[n])}function Qn(e,t){for(var n=0;n<e.length;n++)t.writeSFixed64(e[n])}function fe(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function R(e,t,n){e[n]=t,e[n+1]=t>>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function gt(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function qn(e,t,n){for(var i="",r=t;r<n;){var o=e[r],s=null,a=o>239?4:o>223?3:o>191?2:1;if(r+a>n)break;var l,f,c;a===1?o<128&&(s=o):a===2?(l=e[r+1],(l&192)===128&&(s=(o&31)<<6|l&63,s<=127&&(s=null))):a===3?(l=e[r+1],f=e[r+2],(l&192)===128&&(f&192)===128&&(s=(o&15)<<12|(l&63)<<6|f&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):a===4&&(l=e[r+1],f=e[r+2],c=e[r+3],(l&192)===128&&(f&192)===128&&(c&192)===128&&(s=(o&15)<<18|(l&63)<<12|(f&63)<<6|c&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,a=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),r+=a}return i}function ei(e,t,n){return mt.decode(e.subarray(t,n))}function ti(e,t,n){for(var i=0,r,o;i<t.length;i++){if(r=t.charCodeAt(i),r>55295&&r<57344)if(o)if(r<56320){e[n++]=239,e[n++]=191,e[n++]=189,o=r;continue}else r=o-55296<<10|r-56320|65536,o=null;else{r>56319||i+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):o=r;continue}else o&&(e[n++]=239,e[n++]=191,e[n++]=189,o=null);r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=r&63|128)}return n}});var te={};ln(te,{GeoJSONTiler:()=>ve,MVTLoader:()=>me,MVTSource:()=>we,MVTWorkerLoader:()=>Re,TileJSONLoader:()=>Z});re(te,it(ot(),1));function b(e){return b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(e)}function Se(e,t){if(b(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||"default");if(b(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _e(e){var t=Se(e,"string");return b(t)==="symbol"?t:String(t)}function V(e,t,n){return t=_e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var J={x:0,y:1,z:2};function C(e,t={}){let{start:n=0,end:i=e.length,plane:r="xy"}=t,o=t.size||2,s=0,a=J[r[0]],l=J[r[1]];for(let f=n,c=i-o;f<i;f+=o)s+=(e[f+a]-e[c+a])*(e[f+l]+e[c+l]),c=f;return s/2}function Ve(e,t,n=2,i,r="xy"){let o=t&&t.length,s=o?t[0]*n:e.length,a=at(e,0,s,n,!0,i&&i[0],r),l=[];if(!a||a.next===a.prev)return l;let f,c,u,p,h,d,x;if(o&&(a=mn(e,t,a,n,i,r)),e.length>80*n){p=c=e[0],h=u=e[1];for(let w=n;w<s;w+=n)d=e[w],x=e[w+1],d<p&&(p=d),x<h&&(h=x),d>c&&(c=d),x>u&&(u=x);f=Math.max(c-p,u-h),f=f!==0?32767/f:0}return W(a,l,n,p,h,f,0),l}function at(e,t,n,i,r,o,s){let a,l;o===void 0&&(o=C(e,{start:t,end:n,size:i,plane:s}));let f=J[s[0]],c=J[s[1]];if(r===o<0)for(a=t;a<n;a+=i)l=st(a,e[a+f],e[a+c],l);else for(a=n-i;a>=t;a-=i)l=st(a,e[a+f],e[a+c],l);return l&&ae(l,l.next)&&(X(l),l=l.next),l}function O(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(ae(n,n.next)||P(n.prev,n,n.next)===0)){if(X(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function W(e,t,n,i,r,o,s){if(!e)return;!s&&o&&Fn(e,i,r,o);let a=e,l,f;for(;e.prev!==e.next;){if(l=e.prev,f=e.next,o?pn(e,i,r,o):hn(e)){t.push(l.i/n|0),t.push(e.i/n|0),t.push(f.i/n|0),X(e),e=f.next,a=f.next;continue}if(e=f,e===a){s?s===1?(e=dn(O(e),t,n),W(e,t,n,i,r,o,2)):s===2&&gn(e,t,n,i,r,o):W(O(e),t,n,i,r,o,1);break}}}function hn(e){let t=e.prev,n=e,i=e.next;if(P(t,n,i)>=0)return!1;let r=t.x,o=n.x,s=i.x,a=t.y,l=n.y,f=i.y,c=r<o?r<s?r:s:o<s?o:s,u=a<l?a<f?a:f:l<f?l:f,p=r>o?r>s?r:s:o>s?o:s,h=a>l?a>f?a:f:l>f?l:f,d=i.next;for(;d!==t;){if(d.x>=c&&d.x<=p&&d.y>=u&&d.y<=h&&U(r,a,o,l,s,f,d.x,d.y)&&P(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function pn(e,t,n,i){let r=e.prev,o=e,s=e.next;if(P(r,o,s)>=0)return!1;let a=r.x,l=o.x,f=s.x,c=r.y,u=o.y,p=s.y,h=a<l?a<f?a:f:l<f?l:f,d=c<u?c<p?c:p:u<p?u:p,x=a>l?a>f?a:f:l>f?l:f,w=c>u?c>p?c:p:u>p?u:p,I=Me(h,d,t,n,i),_=Me(x,w,t,n,i),g=e.prevZ,m=e.nextZ;for(;g&&g.z>=I&&m&&m.z<=_;){if(g.x>=h&&g.x<=x&&g.y>=d&&g.y<=w&&g!==r&&g!==s&&U(a,c,l,u,f,p,g.x,g.y)&&P(g.prev,g,g.next)>=0||(g=g.prevZ,m.x>=h&&m.x<=x&&m.y>=d&&m.y<=w&&m!==r&&m!==s&&U(a,c,l,u,f,p,m.x,m.y)&&P(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;g&&g.z>=I;){if(g.x>=h&&g.x<=x&&g.y>=d&&g.y<=w&&g!==r&&g!==s&&U(a,c,l,u,f,p,g.x,g.y)&&P(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;m&&m.z<=_;){if(m.x>=h&&m.x<=x&&m.y>=d&&m.y<=w&&m!==r&&m!==s&&U(a,c,l,u,f,p,m.x,m.y)&&P(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function dn(e,t,n){let i=e;do{let r=i.prev,o=i.next.next;!ae(r,o)&<(r,i,i.next,o)&&Y(r,o)&&Y(o,r)&&(t.push(r.i/n|0),t.push(i.i/n|0),t.push(o.i/n|0),X(i),X(i.next),i=e=o),i=i.next}while(i!==e);return O(i)}function gn(e,t,n,i,r,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&Tn(s,a)){let l=ft(s,a);s=O(s,s.next),l=O(l,l.next),W(s,t,n,i,r,o,0),W(l,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function mn(e,t,n,i,r,o){let s=[],a,l,f,c,u;for(a=0,l=t.length;a<l;a++)f=t[a]*i,c=a<l-1?t[a+1]*i:e.length,u=at(e,f,c,i,!1,r&&r[a+1],o),u===u.next&&(u.steiner=!0),s.push(vn(u));for(s.sort(xn),a=0;a<s.length;a++)n=yn(s[a],n);return n}function xn(e,t){return e.x-t.x}function yn(e,t){let n=wn(e,t);if(!n)return t;let i=ft(n,e);return O(i,i.next),O(n,n.next)}function wn(e,t){let n=t,i=e.x,r=e.y,o=-1/0,s;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let p=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(p<=i&&p>o&&(o=p,s=n.x<n.next.x?n:n.next,p===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,l=s.x,f=s.y,c=1/0,u;n=s;do i>=n.x&&n.x>=l&&i!==n.x&&U(r<f?i:o,r,l,f,r<f?o:i,r,n.x,n.y)&&(u=Math.abs(r-n.y)/(i-n.x),Y(n,e)&&(u<c||u===c&&(n.x>s.x||n.x===s.x&&Pn(s,n)))&&(s=n,c=u)),n=n.next;while(n!==a);return s}function Pn(e,t){return P(e.prev,e,t.prev)<0&&P(t.next,e,e.next)<0}function Fn(e,t,n,i){let r=e;do r.z===0&&(r.z=Me(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,In(r)}function In(e){let t,n,i=1,r,o,s,a,l,f;do{for(o=e,e=null,f=null,r=0;o;){for(r++,a=o,s=0,n=0;n<i&&(s++,a=a.nextZ,!!a);n++);for(l=i;s>0||l>0&&a;)s!==0&&(l===0||!a||o.z<=a.z)?(t=o,o=o.nextZ,s--):(t=a,a=a.nextZ,l--),f?f.nextZ=t:e=t,t.prevZ=f,f=t;o=a}f.nextZ=null,i*=2}while(r>1);return e}function Me(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function vn(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function U(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function Tn(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Sn(e,t)&&(Y(e,t)&&Y(t,e)&&_n(e,t)&&(P(e.prev,e,t.prev)||P(e,t.prev,t))||ae(e,t)&&P(e.prev,e,e.next)>0&&P(t.prev,t,t.next)>0)}function P(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ae(e,t){return e.x===t.x&&e.y===t.y}function lt(e,t,n,i){let r=se(P(e,t,n)),o=se(P(e,t,i)),s=se(P(n,i,e)),a=se(P(n,i,t));return!!(r!==o&&s!==a||r===0&&oe(e,n,t)||o===0&&oe(e,i,t)||s===0&&oe(n,e,i)||a===0&&oe(n,t,i))}function oe(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function se(e){return e>0?1:e<0?-1:0}function Sn(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&<(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Y(e,t){return P(e.prev,e,e.next)<0?P(e,t,e.next)>=0&&P(e,e.prev,t)>=0:P(e,t,e.prev)<0||P(e,e.next,t)<0}function _n(e,t){let n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function ft(e,t){let n=new $(e.i,e.x,e.y),i=new $(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function st(e,t,n,i){let r=new $(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function X(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}var $=class{constructor(t,n,i){V(this,"i",void 0),V(this,"x",void 0),V(this,"y",void 0),V(this,"prev",null),V(this,"next",null),V(this,"z",0),V(this,"prevZ",null),V(this,"nextZ",null),V(this,"steiner",!1),this.i=t,this.x=n,this.y=i}};function Ee(e,t,n){let i=En(e),r=Object.keys(i).filter(o=>i[o]!==Array);return Dn(e,{propArrayTypes:i,...t},{numericPropKeys:n&&n.numericPropKeys||r,PositionDataType:n?n.PositionDataType:Float32Array,triangulate:n?n.triangulate:!0})}function En(e){let t={};for(let n of e)if(n.properties)for(let i in n.properties){let r=n.properties[i];t[i]=kn(r,t[i])}return t}function Dn(e,t,n){let{pointPositionsCount:i,pointFeaturesCount:r,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:l,polygonObjectsCount:f,polygonRingsCount:c,polygonFeaturesCount:u,propArrayTypes:p,coordLength:h}=t,{numericPropKeys:d=[],PositionDataType:x=Float32Array,triangulate:w=!0}=n,I=e[0]&&"id"in e[0],_=e.length>65535?Uint32Array:Uint16Array,g={type:"Point",positions:new x(i*h),globalFeatureIds:new _(i),featureIds:r>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},m={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new x(o*h),globalFeatureIds:new _(o),featureIds:a>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},v={type:"Polygon",polygonIndices:l>65535?new Uint32Array(f+1):new Uint16Array(f+1),primitivePolygonIndices:l>65535?new Uint32Array(c+1):new Uint16Array(c+1),positions:new x(l*h),globalFeatureIds:new _(l),featureIds:u>65535?new Uint32Array(l):new Uint16Array(l),numericProps:{},properties:[],fields:[]};w&&(v.triangles=[]);for(let T of[g,m,v])for(let S of d){let M=p[S];T.numericProps[S]=new M(T.positions.length/h)}m.pathIndices[s]=o,v.polygonIndices[f]=l,v.primitivePolygonIndices[c]=l;let F={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let T of e){let S=T.geometry,M=T.properties||{};switch(S.type){case"Point":bn(S,g,F,h,M),g.properties.push(Ae(M,d)),I&&g.fields.push({id:T.id}),F.pointFeature++;break;case"LineString":Ln(S,m,F,h,M),m.properties.push(Ae(M,d)),I&&m.fields.push({id:T.id}),F.lineFeature++;break;case"Polygon":Cn(S,v,F,h,M),v.properties.push(Ae(M,d)),I&&v.fields.push({id:T.id}),F.polygonFeature++;break;default:throw new Error("Invalid geometry type")}F.feature++}return Nn(g,m,v,h)}function bn(e,t,n,i,r){t.positions.set(e.data,n.pointPosition*i);let o=e.data.length/i;De(t,r,n.pointPosition,o),t.globalFeatureIds.fill(n.feature,n.pointPosition,n.pointPosition+o),t.featureIds.fill(n.pointFeature,n.pointPosition,n.pointPosition+o),n.pointPosition+=o}function Ln(e,t,n,i,r){t.positions.set(e.data,n.linePosition*i);let o=e.data.length/i;De(t,r,n.linePosition,o),t.globalFeatureIds.fill(n.feature,n.linePosition,n.linePosition+o),t.featureIds.fill(n.lineFeature,n.linePosition,n.linePosition+o);for(let s=0,a=e.indices.length;s<a;++s){let l=e.indices[s],f=s===a-1?e.data.length:e.indices[s+1];t.pathIndices[n.linePath++]=n.linePosition,n.linePosition+=(f-l)/i}}function Cn(e,t,n,i,r){t.positions.set(e.data,n.polygonPosition*i);let o=e.data.length/i;De(t,r,n.polygonPosition,o),t.globalFeatureIds.fill(n.feature,n.polygonPosition,n.polygonPosition+o),t.featureIds.fill(n.polygonFeature,n.polygonPosition,n.polygonPosition+o);for(let s=0,a=e.indices.length;s<a;++s){let l=n.polygonPosition;t.polygonIndices[n.polygonObject++]=l;let f=e.areas[s],c=e.indices[s],u=e.indices[s+1];for(let h=0,d=c.length;h<d;++h){let x=c[h],w=h===d-1?u===void 0?e.data.length:u[0]:c[h+1];t.primitivePolygonIndices[n.polygonRing++]=n.polygonPosition,n.polygonPosition+=(w-x)/i}let p=n.polygonPosition;On(t,f,c,{startPosition:l,endPosition:p,coordLength:i})}}function On(e,t,n,{startPosition:i,endPosition:r,coordLength:o}){if(!e.triangles)return;let s=i*o,a=r*o,l=e.positions.subarray(s,a),f=n[0],c=n.slice(1).map(p=>(p-f)/o),u=Ve(l,c,o,t);for(let p=0,h=u.length;p<h;++p)e.triangles.push(i+u[p])}function Be(e,t){let n={};for(let i in e)n[i]={value:e[i],size:t};return n}function Nn(e,t,n,i){let r={shape:"binary-feature-collection",points:{...e,positions:{value:e.positions,size:i},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:Be(e.numericProps,1)},lines:{...t,positions:{value:t.positions,size:i},pathIndices:{value:t.pathIndices,size:1},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:Be(t.numericProps,1)},polygons:{...n,positions:{value:n.positions,size:i},polygonIndices:{value:n.polygonIndices,size:1},primitivePolygonIndices:{value:n.primitivePolygonIndices,size:1},globalFeatureIds:{value:n.globalFeatureIds,size:1},featureIds:{value:n.featureIds,size:1},numericProps:Be(n.numericProps,1)}};return r.polygons&&n.triangles&&(r.polygons.triangles={value:new Uint32Array(n.triangles),size:1}),r}function De(e,t,n,i){for(let r in e.numericProps)if(r in t){let o=t[r];e.numericProps[r].fill(o,n,n+i)}}function Ae(e,t){let n={};for(let i in e)t.includes(i)||(n[i]=e[i]);return n}function kn(e,t){return t===Array||!Number.isFinite(e)?Array:t===Float64Array||Math.fround(e)!==e?Float64Array:Float32Array}var Ue=it(yt(),1);function wt(e){let t=e.length;if(t<=1)return[e];let n=[],i,r;for(let o=0;o<t;o++){let s=ni(e[o]);s!==0&&(r===void 0&&(r=s<0),r===s<0?(i&&n.push(i),i=[e[o]]):i&&i.push(e[o]))}return i&&n.push(i),n}function ni(e){let t=0;for(let n=0,i=e.length-1,r,o;n<e.length;i=n++)r=e[n],o=e[i],t+=(o[0]-r[0])*(r[1]+o[1]);return t}function Pt(e,t,n){t&&n&&(e===1?t.id=n.readVarint():e===2?ii(n,t):e===3?t.type=n.readVarint():e===4&&(t._geometry=n.pos))}function ii(e,t){let n=e.readVarint()+e.pos;for(;e.pos<n;){let i=t._keys[e.readVarint()],r=t._values[e.readVarint()];t.properties[i]=r}}var j=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(t,n,i,r,o){this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=r,this._values=o,t.readFields(Pt,this,n)}loadGeometry(){let t=this._pbf;t.pos=this._geometry;let n=t.readVarint()+t.pos,i=1,r=0,o=0,s=0,a=[],l;for(;t.pos<n;){if(r<=0){let f=t.readVarint();i=f&7,r=f>>3}if(r--,i===1||i===2)o+=t.readSVarint(),s+=t.readSVarint(),i===1&&(l&&a.push(l),l=[]),l&&l.push([o,s]);else if(i===7)l&&l.push(l[0].slice());else throw new Error(`unknown command ${i}`)}return l&&a.push(l),a}bbox(){let t=this._pbf;t.pos=this._geometry;let n=t.readVarint()+t.pos,i=1,r=0,o=0,s=0,a=1/0,l=-1/0,f=1/0,c=-1/0;for(;t.pos<n;){if(r<=0){let u=t.readVarint();i=u&7,r=u>>3}if(r--,i===1||i===2)o+=t.readSVarint(),s+=t.readSVarint(),o<a&&(a=o),o>l&&(l=o),s<f&&(f=s),s>c&&(c=s);else if(i!==7)throw new Error(`unknown command ${i}`)}return[a,f,l,c]}_toGeoJSON(t){let n=this.loadGeometry(),i=j.types[this.type],r,o;switch(this.type){case 1:let a=[];for(r=0;r<n.length;r++)a[r]=n[r][0];n=a,t(n,this);break;case 2:for(r=0;r<n.length;r++)t(n[r],this);break;case 3:for(n=wt(n),r=0;r<n.length;r++)for(o=0;o<n[r].length;o++)t(n[r][o],this);break}n.length===1?n=n[0]:i=`Multi${i}`;let s={type:"Feature",geometry:{type:i,coordinates:n},properties:this.properties};return this.id!==null&&(s.id=this.id),s}toGeoJSON(t){if(typeof t=="function")return this._toGeoJSON(t);let{x:n,y:i,z:r}=t,o=this.extent*Math.pow(2,r),s=this.extent*n,a=this.extent*i;function l(f){for(let c=0;c<f.length;c++){let u=f[c];u[0]=(u[0]+s)*360/o-180;let p=180-(u[1]+a)*360/o;u[1]=360/Math.PI*Math.atan(Math.exp(p*Math.PI/180))-90}}return this._toGeoJSON(l)}};var ce=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(t,n){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ri,this,n),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];let n=this._pbf.readVarint()+this._pbf.pos;return new j(this._pbf,n,this.extent,this._keys,this._values)}};function ri(e,t,n){t&&n&&(e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t._features.push(n.pos):e===3?t._keys.push(n.readString()):e===4&&t._values.push(oi(n)))}function oi(e){let t=null,n=e.readVarint()+e.pos;for(;e.pos<n;){let i=e.readVarint()>>3;t=i===1?e.readString():i===2?e.readFloat():i===3?e.readDouble():i===4?e.readVarint64():i===5?e.readVarint():i===6?e.readSVarint():i===7?e.readBoolean():null}return t}var ue=class{layers;constructor(t,n){this.layers=t.readFields(si,{},n)}};function si(e,t,n){if(e===3&&n){let i=new ce(n,n.readVarint()+n.pos);i.length&&t&&(t[i.name]=i)}}function Ft(e){let t=e.indices.length,n="Polygon";if(t<=1)return{type:n,data:e.data,areas:[[C(e.data)]],indices:[e.indices]};let i=[],r=[],o=[],s=[],a,l=0;for(let f,c=0,u;c<t;c++){u=e.indices[c]-l,f=e.indices[c+1]-l||e.data.length;let p=e.data.slice(u,f),h=C(p);if(h===0){let d=e.data.slice(0,u),x=e.data.slice(f);e.data=d.concat(x),l+=f-u;continue}a===void 0&&(a=h<0),a===h<0?(s.length&&(i.push(o),r.push(s)),s=[u],o=[h]):(o.push(h),s.push(u))}return o&&i.push(o),s.length&&r.push(s),{type:n,areas:i,indices:r,data:e.data}}function It(e,t,n,i){for(let r=0,o=e.length;r<o;r+=2){e[r]=(e[r]+t)*360/i-180;let s=180-(e[r+1]+n)*360/i;e[r+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function vt(e,t,n){t&&n&&(e===1?t.id=n.readVarint():e===2?ai(n,t):e===3?t.type=n.readVarint():e===4&&(t._geometry=n.pos))}function ai(e,t){let n=e.readVarint()+e.pos;for(;e.pos<n;){let i=t._keys[e.readVarint()],r=t._values[e.readVarint()];t.properties[i]=r}}var Tt,N,Ce,he,Oe,Ne,H;var pe=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;_geometryInfo;constructor(t,n,i,r,o,s){this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=r,this._values=o,this._geometryInfo=s,t.readFields(vt,this,n)}loadGeometry(){let t=this._pbf;t.pos=this._geometry,Tt=t.readVarint()+t.pos,N=1,he=0,Oe=0,Ne=0,H=0;let n=[],i=[];for(;t.pos<Tt;)if(he<=0&&(Ce=t.readVarint(),N=Ce&7,he=Ce>>3),he--,N===1||N===2)Oe+=t.readSVarint(),Ne+=t.readSVarint(),N===1&&n.push(H),i.push(Oe,Ne),H+=2;else if(N===7){if(H>0){let r=n[n.length-1];i.push(i[r],i[r+1]),H+=2}}else throw new Error(`unknown command ${N}`);return{data:i,indices:n}}_toBinaryCoordinates(t){let n=this.loadGeometry(),i;t(n.data,this);let r=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=n.indices.length,i={type:"Point",...n};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=n.indices.length,this._geometryInfo.linePositionsCount+=n.data.length/r,i={type:"LineString",...n};break;case 3:i=Ft(n),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=i.indices.length;for(let s of i.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=i.data.length/r;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:i,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(t){if(typeof t=="function")return this._toBinaryCoordinates(t);let{x:n,y:i,z:r}=t,o=this.extent*Math.pow(2,r),s=this.extent*n,a=this.extent*i;return this._toBinaryCoordinates(l=>It(l,s,a,o))}};var de=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(t,n){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(li,this,n),this.length=this._features.length}feature(t,n){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];let i=this._pbf.readVarint()+this._pbf.pos;return new pe(this._pbf,i,this.extent,this._keys,this._values,n)}};function li(e,t,n){t&&n&&(e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t._features.push(n.pos):e===3?t._keys.push(n.readString()):e===4&&t._values.push(fi(n)))}function fi(e){let t=null,n=e.readVarint()+e.pos;for(;e.pos<n;){let i=e.readVarint()>>3;t=i===1?e.readString():i===2?e.readFloat():i===3?e.readDouble():i===4?e.readVarint64():i===5?e.readVarint():i===6?e.readSVarint():i===7?e.readBoolean():null}return t}var ge=class{layers;constructor(t,n){this.layers=t.readFields(ci,{},n)}};function ci(e,t,n){if(e===3&&n){let i=new de(n,n.readVarint()+n.pos);i.length&&t&&(t[i.name]=i)}}function Ge(e,t){let n=hi(t),i=t?.gis?.format||t?.mvt?.shape||t?.shape;switch(i){case"columnar-table":return{shape:"columnar-table",data:ke(e,n)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:St(e,n)};case"geojson":return St(e,n);case"binary-geometry":return ke(e,n);case"binary":return ke(e,n);default:throw new Error(i||"undefined shape")}}function ke(e,t){let[n,i]=ui(e,t),r=Ee(n,i);return r.byteLength=e.byteLength,r}function ui(e,t){let n=[],i={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength<=0)return[n,i];let r=new ge(new Ue.default(e));return(t&&Array.isArray(t.layers)?t.layers:Object.keys(r.layers)).forEach(s=>{let a=r.layers[s];if(a)for(let l=0;l<a.length;l++){let f=a.feature(l,i),c=di(f,t,s);n.push(c)}}),[n,i]}function St(e,t){if(e.byteLength<=0)return[];let n=[],i=new ue(new Ue.default(e));return(Array.isArray(t.layers)?t.layers:Object.keys(i.layers)).forEach(o=>{let s=i.layers[o];if(s)for(let a=0;a<s.length;a++){let l=s.feature(a),f=pi(l,t,o);n.push(f)}}),n}function hi(e){if(!e?.mvt)throw new Error("mvt options required");let t=e.mvt?.coordinates==="wgs84",{tileIndex:n}=e.mvt,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(t&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return e.mvt}function pi(e,t,n){let i=e.toGeoJSON(t.coordinates==="wgs84"?t.tileIndex:gi);return t.layerProperty&&(i.properties[t.layerProperty]=n),i}function di(e,t,n){let i=e.toBinaryCoordinates(t.coordinates==="wgs84"?t.tileIndex:mi);return t.layerProperty&&i.properties&&(i.properties[t.layerProperty]=n),i}function gi(e,t){let{extent:n}=t;for(let i=0;i<e.length;i++){let r=e[i];r[0]/=n,r[1]/=n}}function mi(e,t){let{extent:n}=t;for(let i=0,r=e.length;i<r;++i)e[i]/=n}var xi="4.2.0-alpha.6",Re={dataType:null,batchType:null,name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:xi,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}},me={...Re,parse:async(e,t)=>Ge(e,t),parseSync:Ge,binary:!0};var Bt=e=>e!==null&&typeof e=="object";function je(e,t){if(!e||!Bt(e))return null;let n={name:e.name||"",description:e.description||""};if(typeof e.generator=="string"&&(n.generator=e.generator),typeof e.generator_options=="string"&&(n.generatorOptions=e.generator_options),n.boundingBox=_t(e.bounds)||_t(e.antimeridian_adjusted_bounds),n.center=vi(e.center),n.maxZoom=Mt(e.maxzoom),n.minZoom=Mt(e.minzoom),typeof e?.json=="string")try{n.metaJson=JSON.parse(e.json)}catch(a){console.warn("Failed to parse tilejson.json field",a)}let i=e.tilestats||n.metaJson?.tilestats,r=Pi(i,t),o=yi(e.vector_layers),s=Ii(o,r);return n={...n,layers:s},n.maxZoom===null&&s.length>0&&(n.maxZoom=s[0].maxZoom||null),n.minZoom===null&&s.length>0&&(n.minZoom=s[0].minZoom||null),n}function yi(e){return Array.isArray(e)?e.map(t=>wi(t)):[]}function wi(e){let t=Object.entries(e.fields||[]).map(([i,r])=>({name:i,...bt(String(r))})),n={...e};return delete n.fields,{name:e.id||"",...n,fields:t}}function Pi(e,t){return Bt(e)&&Array.isArray(e.layers)?e.layers.map(n=>Fi(n,t)):[]}function Fi(e,t){let n=[],i={},r=e.attributes||[];for(let o of r){let s=o.attribute;if(typeof s=="string")if(s.split("|").length>1){let a=s.split("|")[0];i[a]=i[a]||[],i[a].push(o),console.warn("ignoring tilestats indexed field",a)}else n[s]||n.push(Si(o,t))}return{name:e.layer||"",dominantGeometry:e.geometry,fields:n}}function Ii(e,t){return e.map(n=>{let i=t.find(s=>s.name===n.name),r=i?.fields||[],o={...n};return delete o.fields,{...o,...i,fields:r}})}function _t(e){let t=Dt(e);if(Array.isArray(t)&&t.length===4&&[t[0],t[2]].every(Et)&&[t[1],t[3]].every(At))return[[t[0],t[1]],[t[2],t[3]]]}function vi(e){let t=Dt(e);return Array.isArray(t)&&t.length===3&&Et(t[0])&&At(t[1])&&Ti(t[2])?t:null}function Mt(e){let t=typeof e=="string"?parseFloat(e):typeof e=="number"?e:null;return t===null||isNaN(t)?null:t}function At(e){return Number.isFinite(e)&&e<=90&&e>=-90}function Et(e){return Number.isFinite(e)&&e<=180&&e>=-180}function Ti(e){return Number.isFinite(e)&&e>=0&&e<=22}function Dt(e){return typeof e=="string"?e.split(",").map(parseFloat):Array.isArray(e)?e:null}var Vt={number:{type:"float32"},numeric:{type:"float32"},string:{type:"utf8"},vachar:{type:"utf8"},float:{type:"float32"},int:{type:"int32"},int4:{type:"int32"},boolean:{type:"boolean"},bool:{type:"boolean"}};function Si(e={},t){let n=bt(e.type),i={name:e.attribute,...n};return typeof e.min=="number"&&(i.min=e.min),typeof e.max=="number"&&(i.max=e.max),typeof e.count=="number"&&(i.uniqueValueCount=e.count),e.values&&(i.values=e.values),i.values&&typeof t.maxValues=="number"&&(i.values=i.values?.slice(0,t.maxValues)),i}function bt(e){let t=e.toLowerCase();return!t||Vt[t],Vt[t]||{type:"string"}}var _i="4.2.0-alpha.6",Z={dataType:null,batchType:null,name:"TileJSON",id:"tilejson",module:"pmtiles",version:_i,worker:!0,extensions:["json"],mimeTypes:["application/json"],text:!0,options:{tilejson:{maxValues:void 0}},parse:async(e,t)=>{let n=new TextDecoder().decode(e),i=JSON.parse(n),r={...Z.options.tilejson,...t?.tilejson};return je(i,r)},parseTextSync:(e,t)=>{let n=JSON.parse(e),i={...Z.options.tilejson,...t?.tilejson};return je(n,i)}};function K(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var A={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Mi=A.self||A.window||A.global||{},Vi=A.window||A.self||A.global||{},Bi=A.global||A.self||A.window||{},Ai=A.document||{};var Ze=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Lt=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Ei=Lt&&parseFloat(Lt[1])||0;var Di="",Ct={};function ze(e){for(let t in Ct)if(e.startsWith(t)){let n=Ct[t];e=e.replace(t,n)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${Di}${e}`),e}var Q=class{fetch;loadOptions;_needsRefresh=!0;props;constructor(t){this.props={...t},this.loadOptions={...t.loadOptions},this.fetch=bi(this.loadOptions)}setProps(t){this.props=Object.assign(this.props,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(t=!0){let n=this._needsRefresh;return t&&(this._needsRefresh=!1),n}};function bi(e){let t=e?.fetch;if(t&&typeof t=="function")return(i,r)=>t(i,r);let n=e?.fetch;return n&&typeof n!="function"?i=>fetch(i,n):i=>fetch(i)}var Ot="4.2.0-alpha.6";var Li=globalThis.loaders?.parseImageNode,Je=typeof Image<"u",We=typeof ImageBitmap<"u",Ci=Boolean(Li),Ye=Ze?!0:Ci;function Nt(e){switch(e){case"auto":return We||Je||Ye;case"imagebitmap":return We;case"image":return Je;case"data":return Ye;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function kt(){if(We)return"imagebitmap";if(Je)return"image";if(Ye)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Oi(e){let t=Ni(e);if(!t)throw new Error("Not an image");return t}function Ut(e){switch(Oi(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),n=t.getContext("2d");if(!n)throw new Error("getImageData");return t.width=e.width,t.height=e.height,n.drawImage(e,0,0),n.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function Ni(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var ki=/^data:image\/svg\+xml/,Ui=/\.svg((\?|#).*)?$/;function xe(e){return e&&(ki.test(e)||Ui.test(e))}function Gt(e,t){if(xe(t)){let i=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return Xe(e,t)}function Xe(e,t){if(xe(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function ye(e,t,n){let i=Gt(e,n),r=self.URL||self.webkitURL,o=typeof i!="string"&&r.createObjectURL(i);try{return await Gi(o||i,t)}finally{o&&r.revokeObjectURL(o)}}async function Gi(e,t){let n=new Image;return n.src=e,t.image&&t.image.decode&&n.decode?(await n.decode(),n):await new Promise((i,r)=>{try{n.onload=()=>i(n),n.onerror=o=>{let s=o instanceof Error?o.message:"error";r(new Error(s))}}catch(o){r(o)}})}var Ri={},Rt=!0;async function jt(e,t,n){let i;xe(n)?i=await ye(e,t,n):i=Xe(e,n);let r=t&&t.imagebitmap;return await ji(i,r)}async function ji(e,t=null){if((Zi(t)||!Rt)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(n){console.warn(n),Rt=!1}return await createImageBitmap(e)}function Zi(e){for(let t in e||Ri)return!1;return!0}function Zt(e){return!Yi(e,"ftyp",4)||!(e[8]&96)?null:zi(e)}function zi(e){switch(Ji(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Ji(e,t,n){return String.fromCharCode(...e.slice(t,n))}function Wi(e){return[...e].map(t=>t.charCodeAt(0))}function Yi(e,t,n=0){let i=Wi(t);for(let r=0;r<i.length;++r)if(i[r]!==e[r+n])return!1;return!0}var E=!1,q=!0;function k(e){let t=ee(e);return $i(t)||Qi(t)||Hi(t)||Ki(t)||Xi(t)}function Xi(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),n=Zt(t);return n?{mimeType:n.mimeType,width:0,height:0}:null}function $i(e){let t=ee(e);return t.byteLength>=24&&t.getUint32(0,E)===2303741511?{mimeType:"image/png",width:t.getUint32(16,E),height:t.getUint32(20,E)}:null}function Hi(e){let t=ee(e);return t.byteLength>=10&&t.getUint32(0,E)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,q),height:t.getUint16(8,q)}:null}function Ki(e){let t=ee(e);return t.byteLength>=14&&t.getUint16(0,E)===16973&&t.getUint32(2,q)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,q),height:t.getUint32(22,q)}:null}function Qi(e){let t=ee(e);if(!(t.byteLength>=3&&t.getUint16(0,E)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:r}=qi(),o=2;for(;o+9<t.byteLength;){let s=t.getUint16(o,E);if(r.has(s))return{mimeType:"image/jpeg",height:t.getUint16(o+5,E),width:t.getUint16(o+7,E)};if(!i.has(s))return null;o+=2,o+=t.getUint16(o,E)}return null}function qi(){let e=new Set([65499,65476,65484,65501,65534]);for(let n=65504;n<65520;++n)e.add(n);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function ee(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function zt(e,t){let{mimeType:n}=k(e)||{},i=globalThis.loaders?.parseImageNode;return K(i),await i(e,n)}async function Jt(e,t,n){t=t||{};let r=(t.image||{}).type||"auto",{url:o}=n||{},s=er(r),a;switch(s){case"imagebitmap":a=await jt(e,t,o);break;case"image":a=await ye(e,t,o);break;case"data":a=await zt(e,t);break;default:K(!1)}return r==="data"&&(a=Ut(a)),a}function er(e){switch(e){case"auto":case"data":return kt();default:return Nt(e),e}}var tr=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],nr=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],ir={image:{type:"auto",decode:!0}},$e={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Ot,mimeTypes:nr,extensions:tr,parse:Jt,tests:[e=>Boolean(k(new DataView(e)))],options:ir};var we=class extends Q{props;url;metadataUrl=null;data;schema="tms";metadata;extension;mimeType=null;constructor(t){super(t),this.props=t,this.url=ze(t.url),this.metadataUrl=t.metadataUrl===void 0?`${this.url}/tilejson.json`:t.metadataUrl,this.extension=t.extension||".png",this.data=this.url,this.getTileData=this.getTileData.bind(this),this.metadata=this.getMetadata(),rr(this.url)&&(this.schema="template")}async getMetadata(){if(!this.metadataUrl)return null;let t;try{t=await this.fetch(this.metadataUrl)}catch(r){return console.error(r.message),null}if(!t.ok)return console.error(t.statusText),null;let n=await t.text();return Z.parseTextSync?.(n)||null}getTileMIMEType(){return this.mimeType}async getTile(t){let{x:n,y:i,zoom:r}=t,o=this.getTileURL(n,i,r),s=await this.fetch(o);return s.ok?await s.arrayBuffer():null}async getTileData(t){let{x:n,y:i,z:r}=t.index,o=await this.getTile({x:n,y:i,zoom:r,layers:[]});if(o===null)return null;let s=k(o);switch(this.mimeType=this.mimeType||s?.mimeType||"application/vnd.mapbox-vector-tile",this.mimeType){case"application/vnd.mapbox-vector-tile":return await this._parseVectorTile(o,{x:n,y:i,zoom:r,layers:[]});default:return await this._parseImageTile(o)}}async getImageTile(t){let n=await this.getTile(t);return n?this._parseImageTile(n):null}async _parseImageTile(t){return await $e.parse(t,this.loadOptions)}async getVectorTile(t){let n=await this.getTile(t);return n?this._parseVectorTile(n,t):null}async _parseVectorTile(t,n){let i={shape:"geojson-table",mvt:{coordinates:"wgs84",tileIndex:{x:n.x,y:n.y,z:n.zoom},...this.loadOptions?.mvt},...this.loadOptions};return await me.parse(t,i)}getMetadataUrl(){return this.metadataUrl}getTileURL(t,n,i){switch(this.schema){case"xyz":return`${this.url}/${t}/${n}/${i}${this.extension}`;case"tms":return`${this.url}/${i}/${t}/${n}${this.extension}`;case"template":return lr(this.url,t,n,i,"0");default:throw new Error(this.schema)}}};function rr(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))|(?=.*{x})(?=.*({y}|{-y})(?=.*{z}))/.test(e)}var or=new RegExp("{x}","g"),sr=new RegExp("{y}","g"),ar=new RegExp("{z}","g");function lr(e,t,n,i,r="0"){if(Array.isArray(e)){let s=fr(r)%e.length;e=e[s]}let o=e;return o=o.replace(or,String(t)),o=o.replace(sr,String(n)),o=o.replace(ar,String(i)),Number.isInteger(n)&&Number.isInteger(i)&&(o=o.replace(/\{-y\}/g,String(Math.pow(2,i)-n-1))),o}function fr(e){return Math.abs(e.split("").reduce((t,n)=>(t<<5)-t+n.charCodeAt(0)|0,0))}function Pe(e,t,n,i){let r=i,o=n-t>>1,s=n-t,a,l=e[t],f=e[t+1],c=e[n],u=e[n+1];for(let p=t+3;p<n;p+=3){let h=cr(e[p],e[p+1],l,f,c,u);if(h>r)a=p,r=h;else if(h===r){let d=Math.abs(p-o);d<s&&(a=p,s=d)}}r>i&&(a-t>3&&Pe(e,t,a,i),e[a+2]=r,n-a>3&&Pe(e,a,n,i))}function cr(e,t,n,i,r,o){let s=r-n,a=o-i;if(s!==0||a!==0){let l=((e-n)*s+(t-i)*a)/(s*s+a*a);l>1?(n=r,i=o):l>0&&(n+=s*l,i+=a*l)}return s=e-n,a=t-i,s*s+a*a}function L(e,t,n,i){let r={id:e??null,type:t,geometry:n,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(t==="Point"||t==="MultiPoint"||t==="LineString")Fe(r,n);else if(t==="Polygon")Fe(r,n[0]);else if(t==="MultiLineString")for(let o of n)Fe(r,o);else if(t==="MultiPolygon")for(let o of n)Fe(r,o[0]);return r}function Fe(e,t){for(let n=0;n<t.length;n+=3)e.minX=Math.min(e.minX,t[n]),e.minY=Math.min(e.minY,t[n+1]),e.maxX=Math.max(e.maxX,t[n]),e.maxY=Math.max(e.maxY,t[n+1])}function Yt(e,t){let n=[];if(e.type==="FeatureCollection")for(let i=0;i<e.features.length;i++)Ie(n,e.features[i],t,i);else e.type==="Feature"?Ie(n,e,t):Ie(n,{geometry:e},t);return n}function Ie(e,t,n,i){if(!t.geometry)return;let r=t.geometry.coordinates,o=t.geometry.type,s=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),a=[],l=t.id;if(n.promoteId?l=t.properties[n.promoteId]:n.generateId&&(l=i||0),o==="Point")Wt(r,a);else if(o==="MultiPoint")for(let f of r)Wt(f,a);else if(o==="LineString")Ke(r,a,s,!1);else if(o==="MultiLineString")if(n.lineMetrics){for(let f of r)a=[],Ke(f,a,s,!1),e.push(L(l,"LineString",a,t.properties));return}else He(r,a,s,!1);else if(o==="Polygon")He(r,a,s,!0);else if(o==="MultiPolygon")for(let f of r){let c=[];He(f,c,s,!0),a.push(c)}else if(o==="GeometryCollection"){for(let f of t.geometry.geometries)Ie(e,{id:l,geometry:f,properties:t.properties},n,i);return}else throw new Error("Input data is not a valid GeoJSON object.");e.push(L(l,o,a,t.properties))}function Wt(e,t){t.push(Xt(e[0]),$t(e[1]),0)}function Ke(e,t,n,i){let r,o,s=0;for(let l=0;l<e.length;l++){let f=Xt(e[l][0]),c=$t(e[l][1]);t.push(f,c,0),l>0&&(i?s+=(r*c-f*o)/2:s+=Math.sqrt(Math.pow(f-r,2)+Math.pow(c-o,2))),r=f,o=c}let a=t.length-3;t[2]=1,Pe(t,0,a,n),t[a+2]=1,t.size=Math.abs(s),t.start=0,t.end=t.size}function He(e,t,n,i){for(let r=0;r<e.length;r++){let o=[];Ke(e[r],o,n,i),t.push(o)}}function Xt(e){return e/360+.5}function $t(e){let t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function B(e,t,n,i,r,o,s,a){if(n/=t,i/=t,o>=n&&s<i)return e;if(s<n||o>=i)return null;let l=[];for(let f of e){let c=f.geometry,u=f.type,p=r===0?f.minX:f.minY,h=r===0?f.maxX:f.maxY;if(p>=n&&h<i){l.push(f);continue}else if(h<n||p>=i)continue;let d=[];if(u==="Point"||u==="MultiPoint")ur(c,d,n,i,r);else if(u==="LineString")Kt(c,d,n,i,r,!1,a.lineMetrics);else if(u==="MultiLineString")Qe(c,d,n,i,r,!1);else if(u==="Polygon")Qe(c,d,n,i,r,!0);else if(u==="MultiPolygon")for(let x of c){let w=[];Qe(x,w,n,i,r,!0),w.length&&d.push(w)}if(d.length){if(a.lineMetrics&&u==="LineString"){for(let x of d)l.push(L(f.id,u,x,f.tags));continue}(u==="LineString"||u==="MultiLineString")&&(d.length===1?(u="LineString",d=d[0]):u="MultiLineString"),(u==="Point"||u==="MultiPoint")&&(u=d.length===3?"Point":"MultiPoint"),l.push(L(f.id,u,d,f.tags))}}return l.length?l:null}function ur(e,t,n,i,r){for(let o=0;o<e.length;o+=3){let s=e[o+r];s>=n&&s<=i&&z(t,e[o],e[o+1],e[o+2])}}function Kt(e,t,n,i,r,o,s){let a=Ht(e),l=r===0?hr:pr,f=e.start,c,u;for(let I=0;I<e.length-3;I+=3){let _=e[I],g=e[I+1],m=e[I+2],v=e[I+3],F=e[I+4],T=r===0?_:g,S=r===0?v:F,M=!1;s&&(c=Math.sqrt(Math.pow(_-v,2)+Math.pow(g-F,2))),T<n?S>n&&(u=l(a,_,g,v,F,n),s&&(a.start=f+c*u)):T>i?S<i&&(u=l(a,_,g,v,F,i),s&&(a.start=f+c*u)):z(a,_,g,m),S<n&&T>=n&&(u=l(a,_,g,v,F,n),M=!0),S>i&&T<=i&&(u=l(a,_,g,v,F,i),M=!0),!o&&M&&(s&&(a.end=f+c*u),t.push(a),a=Ht(e)),s&&(f+=c)}let p=e.length-3,h=e[p],d=e[p+1],x=e[p+2],w=r===0?h:d;w>=n&&w<=i&&z(a,h,d,x),p=a.length-3,o&&p>=3&&(a[p]!==a[0]||a[p+1]!==a[1])&&z(a,a[0],a[1],a[2]),a.length&&t.push(a)}function Ht(e){let t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function Qe(e,t,n,i,r,o){for(let s of e)Kt(s,t,n,i,r,o,!1)}function z(e,t,n,i){e.push(t,n,i)}function hr(e,t,n,i,r,o){let s=(o-t)/(i-t);return z(e,o,n+(r-n)*s,1),s}function pr(e,t,n,i,r,o){let s=(o-n)/(r-n);return z(e,t+(i-t)*s,o,1),s}function qt(e,t){let n=t.buffer/t.extent,i=e,r=B(e,1,-1-n,n,0,-1,2,t),o=B(e,1,1-n,2+n,0,-1,2,t);return(r||o)&&(i=B(e,1,-n,1+n,0,-1,2,t)||[],r&&(i=Qt(r,1).concat(i)),o&&(i=i.concat(Qt(o,-1)))),i}function Qt(e,t){let n=[];for(let i=0;i<e.length;i++){let r=e[i],o=r.type,s;if(o==="Point"||o==="MultiPoint"||o==="LineString")s=qe(r.geometry,t);else if(o==="MultiLineString"||o==="Polygon"){s=[];for(let a of r.geometry)s.push(qe(a,t))}else if(o==="MultiPolygon"){s=[];for(let a of r.geometry){let l=[];for(let f of a)l.push(qe(f,t));s.push(l)}}n.push(L(r.id,o,s,r.tags))}return n}function qe(e,t){let n=[];n.size=e.size,e.start!==void 0&&(n.start=e.start,n.end=e.end);for(let i=0;i<e.length;i+=3)n.push(e[i]+t,e[i+1],e[i+2]);return n}function et(e,t){if(e.transformed)return e;let n=1<<e.z,i=e.x,r=e.y;for(let o of e.features){let s=o.geometry,a=o.type;if(o.geometry=[],a===1)for(let l=0;l<s.length;l+=2)o.geometry.push(en(s[l],s[l+1],t,n,i,r));else for(let l=0;l<s.length;l++){let f=[];for(let c=0;c<s[l].length;c+=2)f.push(en(s[l][c],s[l][c+1],t,n,i,r));o.geometry.push(f)}}return e.transformed=!0,e}function en(e,t,n,i,r,o){return[Math.round(n*(e*i-r)),Math.round(n*(t*i-o))]}function tn(e,t,n,i,r){let o=t===r.maxZoom?0:r.tolerance/((1<<t)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:e.length,source:null,x:n,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let a of e)dr(s,a,o,r);return s}function dr(e,t,n,i){let r=t.geometry,o=t.type,s=[];if(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),o==="Point"||o==="MultiPoint")for(let a=0;a<r.length;a+=3)s.push(r[a],r[a+1]),e.numPoints++,e.numSimplified++;else if(o==="LineString")tt(s,r,e,n,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(let a=0;a<r.length;a++)tt(s,r[a],e,n,o==="Polygon",a===0);else if(o==="MultiPolygon")for(let a=0;a<r.length;a++){let l=r[a];for(let f=0;f<l.length;f++)tt(s,l[f],e,n,!0,f===0)}if(s.length){let a=t.tags||null;if(o==="LineString"&&i.lineMetrics){a={};for(let f in t.tags)a[f]=t.tags[f];a.mapbox_clip_start=r.start/r.size,a.mapbox_clip_end=r.end/r.size}let l={geometry:s,type:o==="Polygon"||o==="MultiPolygon"?3:o==="LineString"||o==="MultiLineString"?2:1,tags:a};t.id!==null&&(l.id=t.id),e.features.push(l)}}function tt(e,t,n,i,r,o){let s=i*i;if(i>0&&t.size<(r?s:i)){n.numPoints+=t.length/3;return}let a=[];for(let l=0;l<t.length;l+=3)(i===0||t[l+2]>s)&&(n.numSimplified++,a.push(t[l],t[l+1])),n.numPoints++;r&&gr(a,o),e.push(a)}function gr(e,t){let n=0;for(let i=0,r=e.length-2;i<e.length;r=i,i+=2)n+=(e[i]-e[r])*(e[i+1]+e[r+1]);if(n>0===t)for(let i=0,r=e.length;i<r/2;i+=2){let o=e[i],s=e[i+1];e[i]=e[r-2-i],e[i+1]=e[r-1-i],e[r-2-i]=o,e[r-1-i]=s}}var mr={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:void 0,generateId:!1,debug:0},ve=class{options;tiles={};tileCoords=[];stats={};total=0;constructor(t,n){this.options={...mr,...n},n=this.options;let i=n.debug;if(i&&console.time("preprocess data"),this.options.maxZoom<0||this.options.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(n.promoteId&&this.options.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=Yt(t,n);i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",n.indexMaxZoom,n.indexMaxPoints),console.time("generate tiles")),r=qt(r,this.options),r.length&&this.splitTile(r,0,0,0),i&&(r.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)))}getTile(t,n,i){let{extent:r,debug:o}=this.options;if(t<0||t>24)return null;let s=1<<t;n=n+s&s-1;let a=nt(t,n,i);if(this.tiles[a])return et(this.tiles[a],r);o>1&&console.log("drilling down to z%d-%d-%d",t,n,i);let l=t,f=n,c=i,u;for(;!u&&l>0;)l--,f=f>>1,c=c>>1,u=this.tiles[nt(l,f,c)];return!u||!u.source?null:(o>1&&(console.log("found parent tile z%d-%d-%d",l,f,c),console.time("drilling down")),this.splitTile(u.source,l,f,c,t,n,i),o>1&&console.timeEnd("drilling down"),this.tiles[a]?et(this.tiles[a],r):null)}splitTile(t,n,i,r,o,s,a){let l=[t,n,i,r],f=this.options,c=f.debug;for(;l.length;){r=l.pop(),i=l.pop(),n=l.pop(),t=l.pop();let u=1<<n,p=nt(n,i,r),h=this.tiles[p];if(!h&&(c>1&&console.time("creation"),h=this.tiles[p]=tn(t,n,i,r,f),this.tileCoords.push({z:n,x:i,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",n,i,r,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));let S=`z${n}`;this.stats[S]=(this.stats[S]||0)+1,this.total++}if(h.source=t,o===void 0){if(n===f.indexMaxZoom||h.numPoints<=f.indexMaxPoints)continue}else{if(n===f.maxZoom||n===o)continue;if(o!==void 0){let S=o-n;if(i!==s>>S||r!==a>>S)continue}}if(h.source=null,t.length===0)continue;c>1&&console.time("clipping");let d=.5*f.buffer/f.extent,x=.5-d,w=.5+d,I=1+d,_=null,g=null,m=null,v=null,F=B(t,u,i-d,i+w,0,h.minX,h.maxX,f),T=B(t,u,i+x,i+I,0,h.minX,h.maxX,f);t=null,F&&(_=B(F,u,r-d,r+w,1,h.minY,h.maxY,f),g=B(F,u,r+x,r+I,1,h.minY,h.maxY,f),F=null),T&&(m=B(T,u,r-d,r+w,1,h.minY,h.maxY,f),v=B(T,u,r+x,r+I,1,h.minY,h.maxY,f),T=null),c>1&&console.timeEnd("clipping"),l.push(_||[],n+1,i*2,r*2),l.push(g||[],n+1,i*2,r*2+1),l.push(m||[],n+1,i*2+1,r*2),l.push(v||[],n+1,i*2+1,r*2+1)}}};function nt(e,t,n){return((1<<e)*n+t)*32+e}return fn(te);})();
|
|
8
8
|
/*! Bundled license information:
|
|
9
9
|
|
|
10
10
|
ieee754/index.js:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Protobuf from 'pbf';
|
|
2
2
|
import { FlatIndexedGeometry, FlatPolygon } from '@loaders.gl/schema';
|
|
3
|
-
import
|
|
3
|
+
import { BinaryVectorTileFeature } from "../lib/binary-vector-tile/vector-tile-feature.js";
|
|
4
4
|
/**
|
|
5
5
|
* Classifies an array of rings into polygons with outer rings and holes
|
|
6
6
|
* The function also detects holes which have zero area and
|
|
@@ -26,10 +26,10 @@ export declare function project(data: number[], x0: number, y0: number, size: nu
|
|
|
26
26
|
* @param feature
|
|
27
27
|
* @param pbf
|
|
28
28
|
*/
|
|
29
|
-
export declare function readFeature(tag: number, feature?:
|
|
29
|
+
export declare function readFeature(tag: number, feature?: BinaryVectorTileFeature, pbf?: Protobuf): void;
|
|
30
30
|
/**
|
|
31
31
|
* @param pbf
|
|
32
32
|
* @param feature
|
|
33
33
|
*/
|
|
34
|
-
export declare function readTag(pbf: Protobuf, feature:
|
|
34
|
+
export declare function readTag(pbf: Protobuf, feature: BinaryVectorTileFeature): void;
|
|
35
35
|
//# sourceMappingURL=binary-util-functions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary-util-functions.d.ts","sourceRoot":"","sources":["../../src/helpers/binary-util-functions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"binary-util-functions.d.ts","sourceRoot":"","sources":["../../src/helpers/binary-util-functions.ts"],"names":[],"mappings":"AAIA,OAAO,QAAQ,MAAM,KAAK,CAAC;AAE3B,OAAO,EAAC,mBAAmB,EAAE,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,yDAAsD;AAEtF;;;;;;;;GAQG;AAEH,wBAAgB,aAAa,CAAC,IAAI,EAAE,mBAAmB,GAAG,WAAW,CA4DpE;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAMlF;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,EAAE,GAAG,CAAC,EAAE,QAAQ,GAAG,IAAI,CAOhG;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,uBAAuB,GAAG,IAAI,CAQ7E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Protobuf from 'pbf';
|
|
2
2
|
import { MVTMapboxGeometry } from "../lib/types.js";
|
|
3
|
-
import VectorTileFeature from "../lib/mapbox-vector-tile/vector-tile-feature.js";
|
|
3
|
+
import { VectorTileFeature } from "../lib/mapbox-vector-tile/vector-tile-feature.js";
|
|
4
4
|
/**
|
|
5
5
|
* Classifies an array of rings into polygons with outer rings and holes
|
|
6
6
|
* @param rings
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapbox-util-functions.d.ts","sourceRoot":"","sources":["../../src/helpers/mapbox-util-functions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mapbox-util-functions.d.ts","sourceRoot":"","sources":["../../src/helpers/mapbox-util-functions.ts"],"names":[],"mappings":"AAIA,OAAO,QAAQ,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAC,iBAAiB,EAAC,wBAAqB;AAC/C,OAAO,EAAC,iBAAiB,EAAC,yDAAsD;AAEhF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,sCAuBrD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,UAQ1C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,GAAG,CAAC,EAAE,QAAQ,GAAG,IAAI,CAO1F;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAQvE"}
|