@deck.gl/carto 9.2.0 → 9.2.2
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/cartoPropertiesTile-worker.js +1 -1
- package/dist/cartoRasterTile-worker.js +1 -1
- package/dist/cartoSpatialTile-worker.js +1 -1
- package/dist/cartoVectorTile-worker.js +1 -1
- package/dist/index.cjs +4 -4
- package/dist/layers/schema/carto-properties-tile-loader.js +1 -1
- package/dist/layers/schema/carto-raster-tile-loader.js +1 -1
- package/dist/layers/schema/carto-spatial-tile-loader.js +1 -1
- package/dist/layers/schema/carto-vector-tile-loader.js +1 -1
- package/dist.min.js +2 -2
- package/package.json +8 -8
|
@@ -5530,7 +5530,7 @@
|
|
|
5530
5530
|
};
|
|
5531
5531
|
|
|
5532
5532
|
// src/layers/schema/carto-properties-tile-loader.ts
|
|
5533
|
-
var VERSION = true ? "9.2.
|
|
5533
|
+
var VERSION = true ? "9.2.2" : "latest";
|
|
5534
5534
|
var id = "cartoPropertiesTile";
|
|
5535
5535
|
var DEFAULT_OPTIONS = {
|
|
5536
5536
|
cartoPropertiesTile: {
|
|
@@ -5516,7 +5516,7 @@
|
|
|
5516
5516
|
};
|
|
5517
5517
|
|
|
5518
5518
|
// src/layers/schema/carto-raster-tile-loader.ts
|
|
5519
|
-
var VERSION = true ? "9.2.
|
|
5519
|
+
var VERSION = true ? "9.2.2" : "latest";
|
|
5520
5520
|
var id = "cartoRasterTile";
|
|
5521
5521
|
var DEFAULT_OPTIONS = {
|
|
5522
5522
|
cartoRasterTile: {
|
|
@@ -5915,7 +5915,7 @@
|
|
|
5915
5915
|
}
|
|
5916
5916
|
|
|
5917
5917
|
// src/layers/schema/carto-spatial-tile-loader.ts
|
|
5918
|
-
var VERSION = true ? "9.2.
|
|
5918
|
+
var VERSION = true ? "9.2.2" : "latest";
|
|
5919
5919
|
var id = "cartoSpatialTile";
|
|
5920
5920
|
var DEFAULT_OPTIONS = {
|
|
5921
5921
|
cartoSpatialTile: {
|
|
@@ -6135,7 +6135,7 @@
|
|
|
6135
6135
|
};
|
|
6136
6136
|
|
|
6137
6137
|
// src/layers/schema/carto-vector-tile-loader.ts
|
|
6138
|
-
var VERSION = true ? "9.2.
|
|
6138
|
+
var VERSION = true ? "9.2.2" : "latest";
|
|
6139
6139
|
var id = "cartoVectorTile";
|
|
6140
6140
|
var DEFAULT_OPTIONS = {
|
|
6141
6141
|
cartoVectorTile: {
|
package/dist/index.cjs
CHANGED
|
@@ -689,7 +689,7 @@ function binaryToSpatialjson(binary) {
|
|
|
689
689
|
}
|
|
690
690
|
|
|
691
691
|
// dist/layers/schema/carto-spatial-tile-loader.js
|
|
692
|
-
var VERSION = true ? "9.2.
|
|
692
|
+
var VERSION = true ? "9.2.2" : "latest";
|
|
693
693
|
var id = "cartoSpatialTile";
|
|
694
694
|
var DEFAULT_OPTIONS = {
|
|
695
695
|
cartoSpatialTile: {
|
|
@@ -2051,7 +2051,7 @@ var TileReader3 = class {
|
|
|
2051
2051
|
};
|
|
2052
2052
|
|
|
2053
2053
|
// dist/layers/schema/carto-raster-tile-loader.js
|
|
2054
|
-
var VERSION2 = true ? "9.2.
|
|
2054
|
+
var VERSION2 = true ? "9.2.2" : "latest";
|
|
2055
2055
|
var id2 = "cartoRasterTile";
|
|
2056
2056
|
var DEFAULT_OPTIONS2 = {
|
|
2057
2057
|
cartoRasterTile: {
|
|
@@ -2163,7 +2163,7 @@ var TileReader4 = class {
|
|
|
2163
2163
|
};
|
|
2164
2164
|
|
|
2165
2165
|
// dist/layers/schema/carto-properties-tile-loader.js
|
|
2166
|
-
var VERSION3 = true ? "9.2.
|
|
2166
|
+
var VERSION3 = true ? "9.2.2" : "latest";
|
|
2167
2167
|
var id3 = "cartoPropertiesTile";
|
|
2168
2168
|
var DEFAULT_OPTIONS3 = {
|
|
2169
2169
|
cartoPropertiesTile: {
|
|
@@ -2192,7 +2192,7 @@ var carto_properties_tile_loader_default = CartoPropertiesTileLoader;
|
|
|
2192
2192
|
|
|
2193
2193
|
// dist/layers/schema/carto-vector-tile-loader.js
|
|
2194
2194
|
var import_earcut = __toESM(require("earcut"), 1);
|
|
2195
|
-
var VERSION4 = true ? "9.2.
|
|
2195
|
+
var VERSION4 = true ? "9.2.2" : "latest";
|
|
2196
2196
|
var id4 = "cartoVectorTile";
|
|
2197
2197
|
var DEFAULT_OPTIONS4 = {
|
|
2198
2198
|
cartoVectorTile: {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { TileReader } from "./carto-properties-tile.js";
|
|
5
5
|
import { parsePbf } from "./tile-loader-utils.js";
|
|
6
6
|
import { getWorkerUrl } from "../../utils.js";
|
|
7
|
-
const VERSION = typeof "9.2.
|
|
7
|
+
const VERSION = typeof "9.2.2" !== 'undefined' ? "9.2.2" : 'latest';
|
|
8
8
|
const id = 'cartoPropertiesTile';
|
|
9
9
|
const DEFAULT_OPTIONS = {
|
|
10
10
|
cartoPropertiesTile: {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { TileReader } from "./carto-raster-tile.js";
|
|
5
5
|
import { parsePbf } from "./tile-loader-utils.js";
|
|
6
6
|
import { getWorkerUrl } from "../../utils.js";
|
|
7
|
-
const VERSION = typeof "9.2.
|
|
7
|
+
const VERSION = typeof "9.2.2" !== 'undefined' ? "9.2.2" : 'latest';
|
|
8
8
|
const id = 'cartoRasterTile';
|
|
9
9
|
const DEFAULT_OPTIONS = {
|
|
10
10
|
cartoRasterTile: {
|
|
@@ -5,7 +5,7 @@ import { TileReader } from "./carto-spatial-tile.js";
|
|
|
5
5
|
import { parsePbf } from "./tile-loader-utils.js";
|
|
6
6
|
import { getWorkerUrl } from "../../utils.js";
|
|
7
7
|
import { binaryToSpatialjson } from "./spatialjson-utils.js";
|
|
8
|
-
const VERSION = typeof "9.2.
|
|
8
|
+
const VERSION = typeof "9.2.2" !== 'undefined' ? "9.2.2" : 'latest';
|
|
9
9
|
const id = 'cartoSpatialTile';
|
|
10
10
|
const DEFAULT_OPTIONS = {
|
|
11
11
|
cartoSpatialTile: {
|
|
@@ -5,7 +5,7 @@ import earcut from 'earcut';
|
|
|
5
5
|
import { TileReader } from "./carto-tile.js";
|
|
6
6
|
import { parsePbf } from "./tile-loader-utils.js";
|
|
7
7
|
import { getWorkerUrl } from "../../utils.js";
|
|
8
|
-
const VERSION = typeof "9.2.
|
|
8
|
+
const VERSION = typeof "9.2.2" !== 'undefined' ? "9.2.2" : 'latest';
|
|
9
9
|
const id = 'cartoVectorTile';
|
|
10
10
|
const DEFAULT_OPTIONS = {
|
|
11
11
|
cartoVectorTile: {
|
package/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['deck'] = factory();
|
|
6
6
|
else root['deck'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var Sg=Object.create;var Gi=Object.defineProperty;var Tg=Object.getOwnPropertyDescriptor;var Cg=Object.getOwnPropertyNames;var Ag=Object.getPrototypeOf,Pg=Object.prototype.hasOwnProperty;var K=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Va=(e,t)=>{for(var r in t)Gi(e,r,{get:t[r],enumerable:!0})},qi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Cg(t))!Pg.call(e,i)&&i!==r&&Gi(e,i,{get:()=>t[i],enumerable:!(n=Tg(t,i))||n.enumerable});return e},et=(e,t,r)=>(qi(e,t,"default"),r&&qi(r,t,"default")),q=(e,t,r)=>(r=e!=null?Sg(Ag(e)):{},qi(t||!e||!e.__esModule?Gi(r,"default",{value:e,enumerable:!0}):r,e)),kg=e=>qi(Gi({},"__esModule",{value:!0}),e);var Mt=K((e3,_l)=>{_l.exports=globalThis.deck});var gt=K((t3,El)=>{El.exports=globalThis.deck});var pn=K((r3,Sl)=>{Sl.exports=globalThis.loaders});var Se=K((a3,Pl)=>{Pl.exports=globalThis.deck});var zl=K((s3,Nl)=>{var Dg=Math.PI/180,Ng=180/Math.PI;function Fl(e){var t=kl(e[0]+1,e[2]),r=kl(e[0],e[2]),n=Ml(e[1]+1,e[2]),i=Ml(e[1],e[2]);return[r,n,t,i]}function zg(e){var t=Fl(e),r={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r}function kl(e,t){return e/Math.pow(2,t)*360-180}function Ml(e,t){var r=Math.PI-2*Math.PI*e/Math.pow(2,t);return Ng*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))}function Za(e,t,r){var n=Dl(e,t,r);return n[0]=Math.floor(n[0]),n[1]=Math.floor(n[1]),n}function Ll(e){return[[e[0]*2,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2+1,e[2]+1],[e[0]*2,e[1]*2+1,e[2]+1]]}function Il(e){return e[0]%2===0&&e[1]%2===0?[e[0]/2,e[1]/2,e[2]-1]:e[0]%2===0&&!e[1]%2===0?[e[0]/2,(e[1]-1)/2,e[2]-1]:!e[0]%2===0&&e[1]%2===0?[(e[0]-1)/2,e[1]/2,e[2]-1]:[(e[0]-1)/2,(e[1]-1)/2,e[2]-1]}function Ol(e){return Ll(Il(e))}function Ug(e,t){for(var r=Ol(e),n=0;n<r.length;n++)if(!Rl(t,r[n]))return!1;return!0}function Rl(e,t){for(var r=0;r<e.length;r++)if(Bl(e[r],t))return!0;return!1}function Bl(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function qg(e){for(var t="",r=e[2];r>0;r--){var n=0,i=1<<r-1;e[0]&i&&n++,e[1]&i&&(n+=2),t+=n.toString()}return t}function Gg(e){for(var t=0,r=0,n=e.length,i=n;i>0;i--){var o=1<<i-1;switch(e[n-i]){case"0":break;case"1":t|=o;break;case"2":r|=o;break;case"3":t|=o,r|=o;break}}return[t,r,n]}function Vg(e){var t=Za(e[0],e[1],32),r=Za(e[2],e[3],32),n=[t[0],t[1],r[0],r[1]],i=$g(n);if(i===0)return[0,0,0];var o=n[0]>>>32-i,a=n[1]>>>32-i;return[o,a,i]}function $g(e){for(var t=28,r=0;r<t;r++){var n=1<<32-(r+1);if((e[0]&n)!=(e[2]&n)||(e[1]&n)!=(e[3]&n))return r}return t}function Dl(e,t,r){var n=Math.sin(t*Dg),i=Math.pow(2,r),o=i*(e/360+.5),a=i*(.5-.25*Math.log((1+n)/(1-n))/Math.PI);return[o,a,r]}Nl.exports={tileToGeoJSON:zg,tileToBBOX:Fl,getChildren:Ll,getParent:Il,getSiblings:Ol,hasTile:Rl,hasSiblings:Ug,tilesEqual:Bl,tileToQuadkey:qg,quadkeyToTile:Gg,pointToTile:Za,bboxToTile:Vg,pointToTileFraction:Dl}});var Gl=K(Zi=>{var Ar=zl();Zi.geojson=function(e,t){return{type:"FeatureCollection",features:ja(e,t).map(Zg)}};function Zg(e){return{type:"Feature",geometry:Ar.tileToGeoJSON(e),properties:{}}}Zi.tiles=ja;Zi.indexes=function(e,t){return ja(e,t).map(Ar.tileToQuadkey)};function ja(e,t){var r,n,i=e.coordinates,o=t.max_zoom,a={},s=[];if(e.type==="Point")return[Ar.pointToTile(i[0],i[1],o)];if(e.type==="MultiPoint")for(r=0;r<i.length;r++)n=Ar.pointToTile(i[r][0],i[r][1],o),a[Ue(n[0],n[1],n[2])]=!0;else if(e.type==="LineString")Ha(a,i,o);else if(e.type==="MultiLineString")for(r=0;r<i.length;r++)Ha(a,i[r],o);else if(e.type==="Polygon")Ul(a,s,i,o);else if(e.type==="MultiPolygon")for(r=0;r<i.length;r++)Ul(a,s,i[r],o);else throw new Error("Geometry type not implemented");if(t.min_zoom!==o){var l=s.length;for(ql(a,s),r=0;r<l;r++){var f=s[r];a[Ue(f[0],f[1],f[2])]=!0}return Hg(a,s,t)}return ql(a,s),s}function Hg(e,t,r){for(var n=[],i=r.max_zoom;i>r.min_zoom;i--){for(var o={},a=[],s=0;s<t.length;s++){var l=t[s];if(l[0]%2===0&&l[1]%2===0){var f=Ue(l[0]+1,l[1],i),c=Ue(l[0],l[1]+1,i),u=Ue(l[0]+1,l[1]+1,i);if(e[f]&&e[c]&&e[u]){e[Ue(l[0],l[1],l[2])]=!1,e[f]=!1,e[c]=!1,e[u]=!1;var d=[l[0]/2,l[1]/2,i-1];i-1===r.min_zoom?n.push(d):(o[Ue(l[0]/2,l[1]/2,i-1)]=!0,a.push(d))}}}for(s=0;s<t.length;s++)l=t[s],e[Ue(l[0],l[1],l[2])]&&n.push(l);e=o,t=a}return n}function Ul(e,t,r,n){for(var i=[],o=0;o<r.length;o++){var a=[];Ha(e,r[o],n,a);for(var s=0,l=a.length,f=l-1;s<l;f=s++){var c=(s+1)%l,u=a[s][1];(u>a[f][1]||u>a[c][1])&&(u<a[f][1]||u<a[c][1])&&u!==a[c][1]&&i.push(a[s])}}for(i.sort(jg),o=0;o<i.length;o+=2){u=i[o][1];for(var d=i[o][0]+1;d<i[o+1][0];d++){var h=Ue(d,u,n);e[h]||t.push([d,u,n])}}}function jg(e,t){return e[1]-t[1]||e[0]-t[0]}function Ha(e,t,r,n){for(var i,o,a=0;a<t.length-1;a++){var s=Ar.pointToTileFraction(t[a][0],t[a][1],r),l=Ar.pointToTileFraction(t[a+1][0],t[a+1][1],r),f=s[0],c=s[1],u=l[0],d=l[1],h=u-f,g=d-c;if(!(g===0&&h===0)){var x=h>0?1:-1,T=g>0?1:-1,_=Math.floor(f),v=Math.floor(c),M=h===0?1/0:Math.abs(((h>0?1:0)+_-f)/h),L=g===0?1/0:Math.abs(((g>0?1:0)+v-c)/g),I=Math.abs(x/h),B=Math.abs(T/g);for((_!==i||v!==o)&&(e[Ue(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v);M<1||L<1;)M<L?(M+=I,_+=x):(L+=B,v+=T),e[Ue(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v}}n&&v===n[0][1]&&n.pop()}function ql(e,t){for(var r=Object.keys(e),n=0;n<r.length;n++)t.push(Yg(+r[n]))}function Ue(e,t,r){var n=2*(1<<r);return(n*t+e)*32+r}function Yg(e){var t=e%32,r=2*(1<<t),n=(e-t)/32,i=n%r,o=(n-i)/r%r;return[i,o,t]}});var Yt=K((e5,Kl)=>{Kl.exports=globalThis.h3||{}});var mt=K(pe=>{"use strict";var _m=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Em(e,t){return Object.prototype.hasOwnProperty.call(e,t)}pe.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)Em(r,n)&&(e[n]=r[n])}}return e};pe.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var Sm={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),i);return}for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},Tm={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};pe.setTyped=function(e){e?(pe.Buf8=Uint8Array,pe.Buf16=Uint16Array,pe.Buf32=Int32Array,pe.assign(pe,Sm)):(pe.Buf8=Array,pe.Buf16=Array,pe.Buf32=Array,pe.assign(pe,Tm))};pe.setTyped(_m)});var Bc=K(Or=>{"use strict";var Cm=mt(),Am=4,pc=0,gc=1,Pm=2;function Ir(e){for(var t=e.length;--t>=0;)e[t]=0}var km=0,wc=1,Mm=2,Fm=3,Lm=258,ss=29,Sn=256,vn=Sn+1+ss,Lr=30,fs=19,_c=2*vn+1,Wt=15,ts=16,Im=7,ls=256,Ec=16,Sc=17,Tc=18,os=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Qi=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Om=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Cc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Rm=512,bt=new Array((vn+2)*2);Ir(bt);var xn=new Array(Lr*2);Ir(xn);var wn=new Array(Rm);Ir(wn);var _n=new Array(Lm-Fm+1);Ir(_n);var cs=new Array(ss);Ir(cs);var Ji=new Array(Lr);Ir(Ji);function rs(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var Ac,Pc,kc;function ns(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Mc(e){return e<256?wn[e]:wn[256+(e>>>7)]}function En(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function be(e,t,r){e.bi_valid>ts-r?(e.bi_buf|=t<<e.bi_valid&65535,En(e,e.bi_buf),e.bi_buf=t>>ts-e.bi_valid,e.bi_valid+=r-ts):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function nt(e,t,r){be(e,r[t*2],r[t*2+1])}function Fc(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Bm(e){e.bi_valid===16?(En(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Dm(e,t){var r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,f,c,u,d,h,g,x=0;for(d=0;d<=Wt;d++)e.bl_count[d]=0;for(r[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;f<_c;f++)c=e.heap[f],d=r[r[c*2+1]*2+1]+1,d>l&&(d=l,x++),r[c*2+1]=d,!(c>n)&&(e.bl_count[d]++,h=0,c>=s&&(h=a[c-s]),g=r[c*2],e.opt_len+=g*(d+h),o&&(e.static_len+=g*(i[c*2+1]+h)));if(x!==0){do{for(d=l-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[l]--,x-=2}while(x>0);for(d=l;d!==0;d--)for(c=e.bl_count[d];c!==0;)u=e.heap[--f],!(u>n)&&(r[u*2+1]!==d&&(e.opt_len+=(d-r[u*2+1])*r[u*2],r[u*2+1]=d),c--)}}function Lc(e,t,r){var n=new Array(Wt+1),i=0,o,a;for(o=1;o<=Wt;o++)n[o]=i=i+r[o-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=Fc(n[s]++,s))}}function Nm(){var e,t,r,n,i,o=new Array(Wt+1);for(r=0,n=0;n<ss-1;n++)for(cs[n]=r,e=0;e<1<<os[n];e++)_n[r++]=n;for(_n[r-1]=n,i=0,n=0;n<16;n++)for(Ji[n]=i,e=0;e<1<<Qi[n];e++)wn[i++]=n;for(i>>=7;n<Lr;n++)for(Ji[n]=i<<7,e=0;e<1<<Qi[n]-7;e++)wn[256+i++]=n;for(t=0;t<=Wt;t++)o[t]=0;for(e=0;e<=143;)bt[e*2+1]=8,e++,o[8]++;for(;e<=255;)bt[e*2+1]=9,e++,o[9]++;for(;e<=279;)bt[e*2+1]=7,e++,o[7]++;for(;e<=287;)bt[e*2+1]=8,e++,o[8]++;for(Lc(bt,vn+1,o),e=0;e<Lr;e++)xn[e*2+1]=5,xn[e*2]=Fc(e,5);Ac=new rs(bt,os,Sn+1,vn,Wt),Pc=new rs(xn,Qi,0,Lr,Wt),kc=new rs(new Array(0),Om,0,fs,Im)}function Ic(e){var t;for(t=0;t<vn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Lr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<fs;t++)e.bl_tree[t*2]=0;e.dyn_ltree[ls*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Oc(e){e.bi_valid>8?En(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function zm(e,t,r,n){Oc(e),n&&(En(e,r),En(e,~r)),Cm.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function mc(e,t,r,n){var i=t*2,o=r*2;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function is(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&mc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!mc(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function bc(e,t,r){var n,i,o=0,a,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],i=e.pending_buf[e.l_buf+o],o++,n===0?nt(e,i,t):(a=_n[i],nt(e,a+Sn+1,t),s=os[a],s!==0&&(i-=cs[a],be(e,i,s)),n--,a=Mc(n),nt(e,a,r),s=Qi[a],s!==0&&(n-=Ji[a],be(e,n,s)));while(o<e.last_lit);nt(e,ls,t)}function as(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,l=-1,f;for(e.heap_len=0,e.heap_max=_c,a=0;a<o;a++)r[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):r[a*2+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=l<2?++l:0,r[f*2]=1,e.depth[f]=0,e.opt_len--,i&&(e.static_len-=n[f*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)is(e,r,a);f=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],is(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[f*2]=r[a*2]+r[s*2],e.depth[f]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=f,e.heap[1]=f++,is(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Dm(e,t),Lc(r,l,e.bl_count)}function yc(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)&&(s<f?e.bl_tree[o*2]+=s:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[Ec*2]++):s<=10?e.bl_tree[Sc*2]++:e.bl_tree[Tc*2]++,s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4))}function xc(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),n=0;n<=r;n++)if(o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)){if(s<f)do nt(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==i&&(nt(e,o,e.bl_tree),s--),nt(e,Ec,e.bl_tree),be(e,s-3,2)):s<=10?(nt(e,Sc,e.bl_tree),be(e,s-3,3)):(nt(e,Tc,e.bl_tree),be(e,s-11,7));s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4)}}function Um(e){var t;for(yc(e,e.dyn_ltree,e.l_desc.max_code),yc(e,e.dyn_dtree,e.d_desc.max_code),as(e,e.bl_desc),t=fs-1;t>=3&&e.bl_tree[Cc[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function qm(e,t,r,n){var i;for(be(e,t-257,5),be(e,r-1,5),be(e,n-4,4),i=0;i<n;i++)be(e,e.bl_tree[Cc[i]*2+1],3);xc(e,e.dyn_ltree,t-1),xc(e,e.dyn_dtree,r-1)}function Gm(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return pc;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return gc;for(r=32;r<Sn;r++)if(e.dyn_ltree[r*2]!==0)return gc;return pc}var vc=!1;function Vm(e){vc||(Nm(),vc=!0),e.l_desc=new ns(e.dyn_ltree,Ac),e.d_desc=new ns(e.dyn_dtree,Pc),e.bl_desc=new ns(e.bl_tree,kc),e.bi_buf=0,e.bi_valid=0,Ic(e)}function Rc(e,t,r,n){be(e,(km<<1)+(n?1:0),3),zm(e,t,r,!0)}function $m(e){be(e,wc<<1,3),nt(e,ls,bt),Bm(e)}function Zm(e,t,r,n){var i,o,a=0;e.level>0?(e.strm.data_type===Pm&&(e.strm.data_type=Gm(e)),as(e,e.l_desc),as(e,e.d_desc),a=Um(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&t!==-1?Rc(e,t,r,n):e.strategy===Am||o===i?(be(e,(wc<<1)+(n?1:0),3),bc(e,bt,xn)):(be(e,(Mm<<1)+(n?1:0),3),qm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),bc(e,e.dyn_ltree,e.dyn_dtree)),Ic(e),n&&Oc(e)}function Hm(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(_n[r]+Sn+1)*2]++,e.dyn_dtree[Mc(t)*2]++),e.last_lit===e.lit_bufsize-1}Or._tr_init=Vm;Or._tr_stored_block=Rc;Or._tr_flush_block=Zm;Or._tr_tally=Hm;Or._tr_align=$m});var us=K((L5,Dc)=>{"use strict";function jm(e,t,r,n){for(var i=e&65535|0,o=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do i=i+t[n++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0}Dc.exports=jm});var ds=K((I5,Nc)=>{"use strict";function Ym(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var Wm=Ym();function Xm(e,t,r,n){var i=Wm,o=n+r;e^=-1;for(var a=n;a<o;a++)e=e>>>8^i[(e^t[a])&255];return e^-1}Nc.exports=Xm});var eo=K((O5,zc)=>{"use strict";zc.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Yc=K(at=>{"use strict";var ge=mt(),Fe=Bc(),Vc=us(),It=ds(),Km=eo(),Jt=0,Qm=1,Jm=3,Nt=4,Uc=5,ot=0,qc=1,Le=-2,e1=-3,hs=-5,t1=-1,r1=1,to=2,n1=3,i1=4,o1=0,a1=2,oo=8,s1=9,f1=15,l1=8,c1=29,u1=256,gs=u1+1+c1,d1=30,h1=19,p1=2*gs+1,g1=15,$=3,Bt=258,qe=Bt+$+1,m1=32,ao=42,ms=69,ro=73,no=91,io=103,Xt=113,Cn=666,se=1,An=2,Kt=3,Dr=4,b1=3;function Dt(e,t){return e.msg=Km[t],t}function Gc(e){return(e<<1)-(e>4?9:0)}function Rt(e){for(var t=e.length;--t>=0;)e[t]=0}function Ot(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(ge.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function le(e,t){Fe._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ot(e.strm)}function j(e,t){e.pending_buf[e.pending++]=t}function Tn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function y1(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,ge.arraySet(t,e.input,e.next_in,i,r),e.state.wrap===1?e.adler=Vc(e.adler,t,i,r):e.state.wrap===2&&(e.adler=It(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function $c(e,t){var r=e.max_chain_length,n=e.strstart,i,o,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-qe?e.strstart-(e.w_size-qe):0,f=e.window,c=e.w_mask,u=e.prev,d=e.strstart+Bt,h=f[n+a-1],g=f[n+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(f[i+a]!==g||f[i+a-1]!==h||f[i]!==f[n]||f[++i]!==f[n+1])){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<d);if(o=Bt-(d-n),n=d-Bt,o>a){if(e.match_start=t,a=o,o>=s)break;h=f[n+a-1],g=f[n+a]}}while((t=u[t&c])>l&&--r!==0);return a<=e.lookahead?a:e.lookahead}function Qt(e){var t=e.w_size,r,n,i,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-qe)){ge.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);o+=t}if(e.strm.avail_in===0)break;if(n=y1(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=$)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+$-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<$)););}while(e.lookahead<qe&&e.strm.avail_in!==0)}function x1(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Qt(e),e.lookahead===0&&t===Jt)return se;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,le(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-qe&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===Nt?(le(e,!0),e.strm.avail_out===0?Kt:Dr):(e.strstart>e.block_start&&(le(e,!1),e.strm.avail_out===0),se)}function ps(e,t){for(var r,n;;){if(e.lookahead<qe){if(Qt(e),e.lookahead<qe&&t===Jt)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-qe&&(e.match_length=$c(e,r)),e.match_length>=$)if(n=Fe._tr_tally(e,e.strstart-e.match_start,e.match_length-$),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=$){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Fe._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=e.strstart<$-1?e.strstart:$-1,t===Nt?(le(e,!0),e.strm.avail_out===0?Kt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function Rr(e,t){for(var r,n,i;;){if(e.lookahead<qe){if(Qt(e),e.lookahead<qe&&t===Jt)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=$-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-qe&&(e.match_length=$c(e,r),e.match_length<=5&&(e.strategy===r1||e.match_length===$&&e.strstart-e.match_start>4096)&&(e.match_length=$-1)),e.prev_length>=$&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-$,n=Fe._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-$),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=$-1,e.strstart++,n&&(le(e,!1),e.strm.avail_out===0))return se}else if(e.match_available){if(n=Fe._tr_tally(e,0,e.window[e.strstart-1]),n&&le(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return se}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Fe._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<$-1?e.strstart:$-1,t===Nt?(le(e,!0),e.strm.avail_out===0?Kt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function v1(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=Bt){if(Qt(e),e.lookahead<=Bt&&t===Jt)return se;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=$&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+Bt;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=Bt-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=$?(r=Fe._tr_tally(e,1,e.match_length-$),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Fe._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===Nt?(le(e,!0),e.strm.avail_out===0?Kt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function w1(e,t){for(var r;;){if(e.lookahead===0&&(Qt(e),e.lookahead===0)){if(t===Jt)return se;break}if(e.match_length=0,r=Fe._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===Nt?(le(e,!0),e.strm.avail_out===0?Kt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function it(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var Br;Br=[new it(0,0,0,0,x1),new it(4,4,8,4,ps),new it(4,5,16,8,ps),new it(4,6,32,32,ps),new it(4,4,16,16,Rr),new it(8,16,32,32,Rr),new it(8,16,128,128,Rr),new it(8,32,128,256,Rr),new it(32,128,258,1024,Rr),new it(32,258,258,4096,Rr)];function _1(e){e.window_size=2*e.w_size,Rt(e.head),e.max_lazy_match=Br[e.level].max_lazy,e.good_match=Br[e.level].good_length,e.nice_match=Br[e.level].nice_length,e.max_chain_length=Br[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=$-1,e.match_available=0,e.ins_h=0}function E1(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=oo,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ge.Buf16(p1*2),this.dyn_dtree=new ge.Buf16((2*d1+1)*2),this.bl_tree=new ge.Buf16((2*h1+1)*2),Rt(this.dyn_ltree),Rt(this.dyn_dtree),Rt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ge.Buf16(g1+1),this.heap=new ge.Buf16(2*gs+1),Rt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ge.Buf16(2*gs+1),Rt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Zc(e){var t;return!e||!e.state?Dt(e,Le):(e.total_in=e.total_out=0,e.data_type=a1,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?ao:Xt,e.adler=t.wrap===2?0:1,t.last_flush=Jt,Fe._tr_init(t),ot)}function Hc(e){var t=Zc(e);return t===ot&&_1(e.state),t}function S1(e,t){return!e||!e.state||e.state.wrap!==2?Le:(e.state.gzhead=t,ot)}function jc(e,t,r,n,i,o){if(!e)return Le;var a=1;if(t===t1&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>s1||r!==oo||n<8||n>15||t<0||t>9||o<0||o>i1)return Dt(e,Le);n===8&&(n=9);var s=new E1;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+$-1)/$),s.window=new ge.Buf8(s.w_size*2),s.head=new ge.Buf16(s.hash_size),s.prev=new ge.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new ge.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=(1+2)*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,Hc(e)}function T1(e,t){return jc(e,t,oo,f1,l1,o1)}function C1(e,t){var r,n,i,o;if(!e||!e.state||t>Uc||t<0)return e?Dt(e,Le):Le;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===Cn&&t!==Nt)return Dt(e,e.avail_out===0?hs:Le);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===ao)if(n.wrap===2)e.adler=0,j(n,31),j(n,139),j(n,8),n.gzhead?(j(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),j(n,n.gzhead.time&255),j(n,n.gzhead.time>>8&255),j(n,n.gzhead.time>>16&255),j(n,n.gzhead.time>>24&255),j(n,n.level===9?2:n.strategy>=to||n.level<2?4:0),j(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(j(n,n.gzhead.extra.length&255),j(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=It(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ms):(j(n,0),j(n,0),j(n,0),j(n,0),j(n,0),j(n,n.level===9?2:n.strategy>=to||n.level<2?4:0),j(n,b1),n.status=Xt);else{var a=oo+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=to||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,a|=s<<6,n.strstart!==0&&(a|=m1),a+=31-a%31,n.status=Xt,Tn(n,a),n.strstart!==0&&(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),e.adler=1}if(n.status===ms)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size));)j(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=ro)}else n.status=ro;if(n.status===ro)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.gzindex=0,n.status=no)}else n.status=no;if(n.status===no)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.status=io)}else n.status=io;if(n.status===io&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Ot(e),n.pending+2<=n.pending_buf_size&&(j(n,e.adler&255),j(n,e.adler>>8&255),e.adler=0,n.status=Xt)):n.status=Xt),n.pending!==0){if(Ot(e),e.avail_out===0)return n.last_flush=-1,ot}else if(e.avail_in===0&&Gc(t)<=Gc(r)&&t!==Nt)return Dt(e,hs);if(n.status===Cn&&e.avail_in!==0)return Dt(e,hs);if(e.avail_in!==0||n.lookahead!==0||t!==Jt&&n.status!==Cn){var l=n.strategy===to?w1(n,t):n.strategy===n1?v1(n,t):Br[n.level].func(n,t);if((l===Kt||l===Dr)&&(n.status=Cn),l===se||l===Kt)return e.avail_out===0&&(n.last_flush=-1),ot;if(l===An&&(t===Qm?Fe._tr_align(n):t!==Uc&&(Fe._tr_stored_block(n,0,0,!1),t===Jm&&(Rt(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Ot(e),e.avail_out===0))return n.last_flush=-1,ot}return t!==Nt?ot:n.wrap<=0?qc:(n.wrap===2?(j(n,e.adler&255),j(n,e.adler>>8&255),j(n,e.adler>>16&255),j(n,e.adler>>24&255),j(n,e.total_in&255),j(n,e.total_in>>8&255),j(n,e.total_in>>16&255),j(n,e.total_in>>24&255)):(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),Ot(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ot:qc)}function A1(e){var t;return!e||!e.state?Le:(t=e.state.status,t!==ao&&t!==ms&&t!==ro&&t!==no&&t!==io&&t!==Xt&&t!==Cn?Dt(e,Le):(e.state=null,t===Xt?Dt(e,e1):ot))}function P1(e,t){var r=t.length,n,i,o,a,s,l,f,c;if(!e||!e.state||(n=e.state,a=n.wrap,a===2||a===1&&n.status!==ao||n.lookahead))return Le;for(a===1&&(e.adler=Vc(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(a===0&&(Rt(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new ge.Buf8(n.w_size),ge.arraySet(c,t,r-n.w_size,n.w_size,0),t=c,r=n.w_size),s=e.avail_in,l=e.next_in,f=e.input,e.avail_in=r,e.next_in=0,e.input=t,Qt(n);n.lookahead>=$;){i=n.strstart,o=n.lookahead-($-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+$-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--o);n.strstart=i,n.lookahead=$-1,Qt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=$-1,n.match_available=0,e.next_in=l,e.input=f,e.avail_in=s,n.wrap=a,ot}at.deflateInit=T1;at.deflateInit2=jc;at.deflateReset=Hc;at.deflateResetKeep=Zc;at.deflateSetHeader=S1;at.deflate=C1;at.deflateEnd=A1;at.deflateSetDictionary=P1;at.deflateInfo="pako deflate (from Nodeca project)"});var bs=K(Nr=>{"use strict";var so=mt(),Wc=!0,Xc=!0;try{String.fromCharCode.apply(null,[0])}catch{Wc=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Xc=!1}var Pn=new so.Buf8(256);for(yt=0;yt<256;yt++)Pn[yt]=yt>=252?6:yt>=248?5:yt>=240?4:yt>=224?3:yt>=192?2:1;var yt;Pn[254]=Pn[254]=1;Nr.string2buf=function(e){var t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new so.Buf8(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|r&63):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|r&63):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|r&63);return t};function Kc(e,t){if(t<65534&&(e.subarray&&Xc||!e.subarray&&Wc))return String.fromCharCode.apply(null,so.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}Nr.buf2binstring=function(e){return Kc(e,e.length)};Nr.binstring2buf=function(e){for(var t=new so.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};Nr.buf2string=function(e,t){var r,n,i,o,a=t||e.length,s=new Array(a*2);for(n=0,r=0;r<a;){if(i=e[r++],i<128){s[n++]=i;continue}if(o=Pn[i],o>4){s[n++]=65533,r+=o-1;continue}for(i&=o===2?31:o===3?15:7;o>1&&r<a;)i=i<<6|e[r++]&63,o--;if(o>1){s[n++]=65533;continue}i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|i&1023)}return Kc(s,n)};Nr.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Pn[e[r]]>t?r:t}});var ys=K((D5,Qc)=>{"use strict";function k1(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}Qc.exports=k1});var ru=K(Fn=>{"use strict";var kn=Yc(),Mn=mt(),vs=bs(),ws=eo(),M1=ys(),tu=Object.prototype.toString,F1=0,xs=4,zr=0,Jc=1,eu=2,L1=-1,I1=0,O1=8;function er(e){if(!(this instanceof er))return new er(e);this.options=Mn.assign({level:L1,method:O1,chunkSize:16384,windowBits:15,memLevel:8,strategy:I1,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new M1,this.strm.avail_out=0;var r=kn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==zr)throw new Error(ws[r]);if(t.header&&kn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=vs.string2buf(t.dictionary):tu.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=kn.deflateSetDictionary(this.strm,n),r!==zr)throw new Error(ws[r]);this._dict_set=!0}}er.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;o=t===~~t?t:t===!0?xs:F1,typeof e=="string"?r.input=vs.string2buf(e):tu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Mn.Buf8(n),r.next_out=0,r.avail_out=n),i=kn.deflate(r,o),i!==Jc&&i!==zr)return this.onEnd(i),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===xs||o===eu))&&(this.options.to==="string"?this.onData(vs.buf2binstring(Mn.shrinkBuf(r.output,r.next_out))):this.onData(Mn.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&i!==Jc);return o===xs?(i=kn.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===zr):(o===eu&&(this.onEnd(zr),r.avail_out=0),!0)};er.prototype.onData=function(e){this.chunks.push(e)};er.prototype.onEnd=function(e){e===zr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Mn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function _s(e,t){var r=new er(t);if(r.push(e,!0),r.err)throw r.msg||ws[r.err];return r.result}function R1(e,t){return t=t||{},t.raw=!0,_s(e,t)}function B1(e,t){return t=t||{},t.gzip=!0,_s(e,t)}Fn.Deflate=er;Fn.deflate=_s;Fn.deflateRaw=R1;Fn.gzip=B1});var iu=K((z5,nu)=>{"use strict";var fo=30,D1=12;nu.exports=function(t,r){var n,i,o,a,s,l,f,c,u,d,h,g,x,T,_,v,M,L,I,B,N,p,m,b,y;n=t.state,i=t.next_in,b=t.input,o=i+(t.avail_in-5),a=t.next_out,y=t.output,s=a-(r-t.avail_out),l=a+(t.avail_out-257),f=n.dmax,c=n.wsize,u=n.whave,d=n.wnext,h=n.window,g=n.hold,x=n.bits,T=n.lencode,_=n.distcode,v=(1<<n.lenbits)-1,M=(1<<n.distbits)-1;e:do{x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),L=T[g&v];t:for(;;){if(I=L>>>24,g>>>=I,x-=I,I=L>>>16&255,I===0)y[a++]=L&65535;else if(I&16){B=L&65535,I&=15,I&&(x<I&&(g+=b[i++]<<x,x+=8),B+=g&(1<<I)-1,g>>>=I,x-=I),x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),L=_[g&M];r:for(;;){if(I=L>>>24,g>>>=I,x-=I,I=L>>>16&255,I&16){if(N=L&65535,I&=15,x<I&&(g+=b[i++]<<x,x+=8,x<I&&(g+=b[i++]<<x,x+=8)),N+=g&(1<<I)-1,N>f){t.msg="invalid distance too far back",n.mode=fo;break e}if(g>>>=I,x-=I,I=a-s,N>I){if(I=N-I,I>u&&n.sane){t.msg="invalid distance too far back",n.mode=fo;break e}if(p=0,m=h,d===0){if(p+=c-I,I<B){B-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}}else if(d<I){if(p+=c+d-I,I-=d,I<B){B-=I;do y[a++]=h[p++];while(--I);if(p=0,d<B){I=d,B-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}}}else if(p+=d-I,I<B){B-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}for(;B>2;)y[a++]=m[p++],y[a++]=m[p++],y[a++]=m[p++],B-=3;B&&(y[a++]=m[p++],B>1&&(y[a++]=m[p++]))}else{p=a-N;do y[a++]=y[p++],y[a++]=y[p++],y[a++]=y[p++],B-=3;while(B>2);B&&(y[a++]=y[p++],B>1&&(y[a++]=y[p++]))}}else if(I&64){t.msg="invalid distance code",n.mode=fo;break e}else{L=_[(L&65535)+(g&(1<<I)-1)];continue r}break}}else if(I&64)if(I&32){n.mode=D1;break e}else{t.msg="invalid literal/length code",n.mode=fo;break e}else{L=T[(L&65535)+(g&(1<<I)-1)];continue t}break}}while(i<o&&a<l);B=x>>3,i-=B,x-=B<<3,g&=(1<<x)-1,t.next_in=i,t.next_out=a,t.avail_in=i<o?5+(o-i):5-(i-o),t.avail_out=a<l?257+(l-a):257-(a-l),n.hold=g,n.bits=x}});var uu=K((U5,cu)=>{"use strict";var ou=mt(),Ur=15,au=852,su=592,fu=0,Es=1,lu=2,N1=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],z1=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],U1=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],q1=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];cu.exports=function(t,r,n,i,o,a,s,l){var f=l.bits,c=0,u=0,d=0,h=0,g=0,x=0,T=0,_=0,v=0,M=0,L,I,B,N,p,m=null,b=0,y,w=new ou.Buf16(Ur+1),S=new ou.Buf16(Ur+1),P=null,E=0,C,k,A;for(c=0;c<=Ur;c++)w[c]=0;for(u=0;u<i;u++)w[r[n+u]]++;for(g=f,h=Ur;h>=1&&w[h]===0;h--);if(g>h&&(g=h),h===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d<h&&w[d]===0;d++);for(g<d&&(g=d),_=1,c=1;c<=Ur;c++)if(_<<=1,_-=w[c],_<0)return-1;if(_>0&&(t===fu||h!==1))return-1;for(S[1]=0,c=1;c<Ur;c++)S[c+1]=S[c]+w[c];for(u=0;u<i;u++)r[n+u]!==0&&(s[S[r[n+u]]++]=u);if(t===fu?(m=P=s,y=19):t===Es?(m=N1,b-=257,P=z1,E-=257,y=256):(m=U1,P=q1,y=-1),M=0,u=0,c=d,p=a,x=g,T=0,B=-1,v=1<<g,N=v-1,t===Es&&v>au||t===lu&&v>su)return 1;for(;;){C=c-T,s[u]<y?(k=0,A=s[u]):s[u]>y?(k=P[E+s[u]],A=m[b+s[u]]):(k=32+64,A=0),L=1<<c-T,I=1<<x,d=I;do I-=L,o[p+(M>>T)+I]=C<<24|k<<16|A|0;while(I!==0);for(L=1<<c-1;M&L;)L>>=1;if(L!==0?(M&=L-1,M+=L):M=0,u++,--w[c]===0){if(c===h)break;c=r[n+s[u]]}if(c>g&&(M&N)!==B){for(T===0&&(T=g),p+=d,x=c-T,_=1<<x;x+T<h&&(_-=w[x+T],!(_<=0));)x++,_<<=1;if(v+=1<<x,t===Es&&v>au||t===lu&&v>su)return 1;B=M&N,o[B]=g<<24|x<<16|p-a|0}}return M!==0&&(o[p+M]=c-T<<24|64<<16|0),l.bits=g,0}});var Hu=K(Ge=>{"use strict";var Ce=mt(),ks=us(),st=ds(),G1=iu(),Ln=uu(),V1=0,Du=1,Nu=2,du=4,$1=5,lo=6,tr=0,Z1=1,H1=2,Ie=-2,zu=-3,Ms=-4,j1=-5,hu=8,Uu=1,pu=2,gu=3,mu=4,bu=5,yu=6,xu=7,vu=8,wu=9,_u=10,ho=11,xt=12,Ss=13,Eu=14,Ts=15,Su=16,Tu=17,Cu=18,Au=19,co=20,uo=21,Pu=22,ku=23,Mu=24,Fu=25,Lu=26,Cs=27,Iu=28,Ou=29,Q=30,Fs=31,Y1=32,W1=852,X1=592,K1=15,Q1=K1;function Ru(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function J1(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Ce.Buf16(320),this.work=new Ce.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function qu(e){var t;return!e||!e.state?Ie:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Uu,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Ce.Buf32(W1),t.distcode=t.distdyn=new Ce.Buf32(X1),t.sane=1,t.back=-1,tr)}function Gu(e){var t;return!e||!e.state?Ie:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,qu(e))}function Vu(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ie:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Gu(e))}function $u(e,t){var r,n;return e?(n=new J1,e.state=n,n.window=null,r=Vu(e,t),r!==tr&&(e.state=null),r):Ie}function eb(e){return $u(e,Q1)}var Bu=!0,As,Ps;function tb(e){if(Bu){var t;for(As=new Ce.Buf32(512),Ps=new Ce.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ln(Du,e.lens,0,288,As,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ln(Nu,e.lens,0,32,Ps,0,e.work,{bits:5}),Bu=!1}e.lencode=As,e.lenbits=9,e.distcode=Ps,e.distbits=5}function Zu(e,t,r,n){var i,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Ce.Buf8(o.wsize)),n>=o.wsize?(Ce.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),Ce.arraySet(o.window,t,r-n,i,o.wnext),n-=i,n?(Ce.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}function rb(e,t){var r,n,i,o,a,s,l,f,c,u,d,h,g,x,T=0,_,v,M,L,I,B,N,p,m=new Ce.Buf8(4),b,y,w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ie;r=e.state,r.mode===xt&&(r.mode=Ss),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,u=s,d=l,p=tr;e:for(;;)switch(r.mode){case Uu:if(r.wrap===0){r.mode=Ss;break}for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.wrap&2&&f===35615){r.check=0,m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0),f=0,c=0,r.mode=pu;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=Q;break}if((f&15)!==hu){e.msg="unknown compression method",r.mode=Q;break}if(f>>>=4,c-=4,N=(f&15)+8,r.wbits===0)r.wbits=N;else if(N>r.wbits){e.msg="invalid window size",r.mode=Q;break}r.dmax=1<<N,e.adler=r.check=1,r.mode=f&512?_u:xt,f=0,c=0;break;case pu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.flags=f,(r.flags&255)!==hu){e.msg="unknown compression method",r.mode=Q;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Q;break}r.head&&(r.head.text=f>>8&1),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0,r.mode=gu;case gu:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.time=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,m[2]=f>>>16&255,m[3]=f>>>24&255,r.check=st(r.check,m,4,0)),f=0,c=0,r.mode=mu;case mu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.xflags=f&255,r.head.os=f>>8),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0,r.mode=bu;case bu:if(r.flags&1024){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length=f,r.head&&(r.head.extra_len=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0}else r.head&&(r.head.extra=null);r.mode=yu;case yu:if(r.flags&1024&&(h=r.length,h>s&&(h=s),h&&(r.head&&(N=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Ce.arraySet(r.head.extra,n,o,h,N)),r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,r.length-=h),r.length))break e;r.length=0,r.mode=xu;case xu:if(r.flags&2048){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.name+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=vu;case vu:if(r.flags&4096){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.comment+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.comment=null);r.mode=wu;case wu:if(r.flags&512){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Q;break}f=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=xt;break;case _u:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}e.adler=r.check=Ru(f),f=0,c=0,r.mode=ho;case ho:if(r.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,H1;e.adler=r.check=1,r.mode=xt;case xt:if(t===$1||t===lo)break e;case Ss:if(r.last){f>>>=c&7,c-=c&7,r.mode=Cs;break}for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}switch(r.last=f&1,f>>>=1,c-=1,f&3){case 0:r.mode=Eu;break;case 1:if(tb(r),r.mode=co,t===lo){f>>>=2,c-=2;break e}break;case 2:r.mode=Tu;break;case 3:e.msg="invalid block type",r.mode=Q}f>>>=2,c-=2;break;case Eu:for(f>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if((f&65535)!==(f>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Q;break}if(r.length=f&65535,f=0,c=0,r.mode=Ts,t===lo)break e;case Ts:r.mode=Su;case Su:if(h=r.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;Ce.arraySet(i,n,o,h,a),s-=h,o+=h,l-=h,a+=h,r.length-=h;break}r.mode=xt;break;case Tu:for(;c<14;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.nlen=(f&31)+257,f>>>=5,c-=5,r.ndist=(f&31)+1,f>>>=5,c-=5,r.ncode=(f&15)+4,f>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Q;break}r.have=0,r.mode=Cu;case Cu:for(;r.have<r.ncode;){for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.lens[w[r.have++]]=f&7,f>>>=3,c-=3}for(;r.have<19;)r.lens[w[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,b={bits:r.lenbits},p=Ln(V1,r.lens,0,19,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid code lengths set",r.mode=Q;break}r.have=0,r.mode=Au;case Au:for(;r.have<r.nlen+r.ndist;){for(;T=r.lencode[f&(1<<r.lenbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(M<16)f>>>=_,c-=_,r.lens[r.have++]=M;else{if(M===16){for(y=_+2;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f>>>=_,c-=_,r.have===0){e.msg="invalid bit length repeat",r.mode=Q;break}N=r.lens[r.have-1],h=3+(f&3),f>>>=2,c-=2}else if(M===17){for(y=_+3;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=_,c-=_,N=0,h=3+(f&7),f>>>=3,c-=3}else{for(y=_+7;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=_,c-=_,N=0,h=11+(f&127),f>>>=7,c-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Q;break}for(;h--;)r.lens[r.have++]=N}}if(r.mode===Q)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Q;break}if(r.lenbits=9,b={bits:r.lenbits},p=Ln(Du,r.lens,0,r.nlen,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid literal/lengths set",r.mode=Q;break}if(r.distbits=6,r.distcode=r.distdyn,b={bits:r.distbits},p=Ln(Nu,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,b),r.distbits=b.bits,p){e.msg="invalid distances set",r.mode=Q;break}if(r.mode=co,t===lo)break e;case co:r.mode=uo;case uo:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,G1(e,d),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,r.mode===xt&&(r.back=-1);break}for(r.back=0;T=r.lencode[f&(1<<r.lenbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(v&&!(v&240)){for(L=_,I=v,B=M;T=r.lencode[B+((f&(1<<L+I)-1)>>L)],_=T>>>24,v=T>>>16&255,M=T&65535,!(L+_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=L,c-=L,r.back+=L}if(f>>>=_,c-=_,r.back+=_,r.length=M,v===0){r.mode=Lu;break}if(v&32){r.back=-1,r.mode=xt;break}if(v&64){e.msg="invalid literal/length code",r.mode=Q;break}r.extra=v&15,r.mode=Pu;case Pu:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ku;case ku:for(;T=r.distcode[f&(1<<r.distbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(!(v&240)){for(L=_,I=v,B=M;T=r.distcode[B+((f&(1<<L+I)-1)>>L)],_=T>>>24,v=T>>>16&255,M=T&65535,!(L+_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=L,c-=L,r.back+=L}if(f>>>=_,c-=_,r.back+=_,v&64){e.msg="invalid distance code",r.mode=Q;break}r.offset=M,r.extra=v&15,r.mode=Mu;case Mu:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.offset+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Q;break}r.mode=Fu;case Fu:if(l===0)break e;if(h=d-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Q;break}h>r.wnext?(h-=r.wnext,g=r.wsize-h):g=r.wnext-h,h>r.length&&(h=r.length),x=r.window}else x=i,g=a-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do i[a++]=x[g++];while(--h);r.length===0&&(r.mode=uo);break;case Lu:if(l===0)break e;i[a++]=r.length,l--,r.mode=uo;break;case Cs:if(r.wrap){for(;c<32;){if(s===0)break e;s--,f|=n[o++]<<c,c+=8}if(d-=l,e.total_out+=d,r.total+=d,d&&(e.adler=r.check=r.flags?st(r.check,i,d,a-d):ks(r.check,i,d,a-d)),d=l,(r.flags?f:Ru(f))!==r.check){e.msg="incorrect data check",r.mode=Q;break}f=0,c=0}r.mode=Iu;case Iu:if(r.wrap&&r.flags){for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Q;break}f=0,c=0}r.mode=Ou;case Ou:p=Z1;break e;case Q:p=zu;break e;case Fs:return Ms;case Y1:default:return Ie}return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,(r.wsize||d!==e.avail_out&&r.mode<Q&&(r.mode<Cs||t!==du))&&Zu(e,e.output,e.next_out,d-e.avail_out)?(r.mode=Fs,Ms):(u-=e.avail_in,d-=e.avail_out,e.total_in+=u,e.total_out+=d,r.total+=d,r.wrap&&d&&(e.adler=r.check=r.flags?st(r.check,i,d,e.next_out-d):ks(r.check,i,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===xt?128:0)+(r.mode===co||r.mode===Ts?256:0),(u===0&&d===0||t===du)&&p===tr&&(p=j1),p)}function nb(e){if(!e||!e.state)return Ie;var t=e.state;return t.window&&(t.window=null),e.state=null,tr}function ib(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Ie:(r.head=t,t.done=!1,tr)}function ob(e,t){var r=t.length,n,i,o;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==ho)?Ie:n.mode===ho&&(i=1,i=ks(i,t,r,0),i!==n.check)?zu:(o=Zu(e,t,r,r),o?(n.mode=Fs,Ms):(n.havedict=1,tr))}Ge.inflateReset=Gu;Ge.inflateReset2=Vu;Ge.inflateResetKeep=qu;Ge.inflateInit=eb;Ge.inflateInit2=$u;Ge.inflate=rb;Ge.inflateEnd=nb;Ge.inflateGetHeader=ib;Ge.inflateSetDictionary=ob;Ge.inflateInfo="pako inflate (from Nodeca project)"});var Ls=K((G5,ju)=>{"use strict";ju.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Wu=K((V5,Yu)=>{"use strict";function ab(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Yu.exports=ab});var Ku=K(On=>{"use strict";var qr=Hu(),In=mt(),po=bs(),oe=Ls(),Is=eo(),sb=ys(),fb=Wu(),Xu=Object.prototype.toString;function rr(e){if(!(this instanceof rr))return new rr(e);this.options=In.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new sb,this.strm.avail_out=0;var r=qr.inflateInit2(this.strm,t.windowBits);if(r!==oe.Z_OK)throw new Error(Is[r]);if(this.header=new fb,qr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=po.string2buf(t.dictionary):Xu.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=qr.inflateSetDictionary(this.strm,t.dictionary),r!==oe.Z_OK)))throw new Error(Is[r])}rr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s,l,f,c=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?oe.Z_FINISH:oe.Z_NO_FLUSH,typeof e=="string"?r.input=po.binstring2buf(e):Xu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new In.Buf8(n),r.next_out=0,r.avail_out=n),o=qr.inflate(r,oe.Z_NO_FLUSH),o===oe.Z_NEED_DICT&&i&&(o=qr.inflateSetDictionary(this.strm,i)),o===oe.Z_BUF_ERROR&&c===!0&&(o=oe.Z_OK,c=!1),o!==oe.Z_STREAM_END&&o!==oe.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===oe.Z_STREAM_END||r.avail_in===0&&(a===oe.Z_FINISH||a===oe.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=po.utf8border(r.output,r.next_out),l=r.next_out-s,f=po.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&In.arraySet(r.output,r.output,s,l,0),this.onData(f)):this.onData(In.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(c=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==oe.Z_STREAM_END);return o===oe.Z_STREAM_END&&(a=oe.Z_FINISH),a===oe.Z_FINISH?(o=qr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===oe.Z_OK):(a===oe.Z_SYNC_FLUSH&&(this.onEnd(oe.Z_OK),r.avail_out=0),!0)};rr.prototype.onData=function(e){this.chunks.push(e)};rr.prototype.onEnd=function(e){e===oe.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=In.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Os(e,t){var r=new rr(t);if(r.push(e,!0),r.err)throw r.msg||Is[r.err];return r.result}function lb(e,t){return t=t||{},t.raw=!0,Os(e,t)}On.Inflate=rr;On.inflate=Os;On.inflateRaw=lb;On.ungzip=Os});var ed=K((Z5,Ju)=>{"use strict";var cb=mt().assign,ub=ru(),db=Ku(),hb=Ls(),Qu={};cb(Qu,ub,db,hb);Ju.exports=Qu});var td=K(()=>{});var rd=K(Rs=>{Rs.read=function(e,t,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,f=l>>1,c=-7,u=r?i-1:0,d=r?-1:1,h=e[t+u];for(u+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=o*256+e[t+u],u+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+e[t+u],u+=d,c-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(h?-1:1)*a*Math.pow(2,o-n)};Rs.write=function(e,t,r,n,i,o){var a,s,l,f=o*8-i-1,c=(1<<f)-1,u=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,g=n?1:-1,x=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+u>=1?t+=d/l:t+=d*Math.pow(2,1-u),t*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*l-1)*Math.pow(2,i),a=a+u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=s&255,h+=g,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;e[r+h]=a&255,h+=g,a/=256,f-=8);e[r+h-g]|=x*128}});var fd=K((l7,sd)=>{"use strict";sd.exports=Y;var mo=rd();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 Bs=(1<<16)*(1<<16),nd=1/Bs,pb=12,ad=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");Y.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=bo(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=od(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=bo(this.buf,this.pos)+bo(this.buf,this.pos+4)*Bs;return this.pos+=8,e},readSFixed64:function(){var e=bo(this.buf,this.pos)+od(this.buf,this.pos+4)*Bs;return this.pos+=8,e},readFloat:function(){var e=mo.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=mo.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,gb(r,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>=pb&&ad?kb(this.buf,t,e):Pb(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 r=wt(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Y.Bytes)return e.push(this.readSVarint());var t=wt(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=wt(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=wt(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=wt(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=wt(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=wt(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=wt(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=wt(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 r=new Uint8Array(t);r.set(this.buf),this.buf=r,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),Zr(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Zr(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Zr(this.buf,e&-1,this.pos),Zr(this.buf,Math.floor(e*nd),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Zr(this.buf,e&-1,this.pos),Zr(this.buf,Math.floor(e*nd),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){mb(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=Mb(this.buf,e,this.pos);var r=this.pos-t;r>=128&&id(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),mo.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),mo.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 r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&id(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,Y.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,xb,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,vb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Eb,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,wb,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,_b,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Sb,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Tb,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Cb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Ab,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 gb(e,t,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return $r(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function wt(e){return e.type===Y.Bytes?e.readVarint()+e.pos:e.pos+1}function $r(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function mb(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),bb(r,n,t),yb(n,t)}function bb(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function yb(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((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 id(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function xb(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function vb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function wb(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function _b(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Eb(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Sb(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Tb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Cb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Ab(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function bo(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function Zr(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function od(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Pb(e,t,r){for(var n="",i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var l,f,c;s===1?o<128&&(a=o):s===2?(l=e[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=e[i+1],f=e[i+2],(l&192)===128&&(f&192)===128&&(a=(o&15)<<12|(l&63)<<6|f&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=e[i+1],f=e[i+2],c=e[i+3],(l&192)===128&&(f&192)===128&&(c&192)===128&&(a=(o&15)<<18|(l&63)<<12|(f&63)<<6|c&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}function kb(e,t,r){return ad.decode(e.subarray(t,r))}function Mb(e,t,r){for(var n=0,i,o;n<t.length;n++){if(i=t.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):o=i;continue}else o&&(e[r++]=239,e[r++]=191,e[r++]=189,o=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=i&63|128)}return r}});var Qd=K((E4,Zs)=>{"use strict";Zs.exports=Oo;Zs.exports.default=Oo;function Oo(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,o=Wd(e,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;var s,l,f,c,u,d,h;if(n&&(o=uy(e,t,o,r)),e.length>80*r){s=f=e[0],l=c=e[1];for(var g=r;g<i;g+=r)u=e[g],d=e[g+1],u<s&&(s=u),d<l&&(l=d),u>f&&(f=u),d>c&&(c=d);h=Math.max(f-s,c-l),h=h!==0?32767/h:0}return fi(o,a,r,s,l,h,0),a}function Wd(e,t,r,n,i){var o,a;if(i===$s(e,t,r,n)>0)for(o=t;o<r;o+=n)a=Yd(o,e[o],e[o+1],a);else for(o=r-n;o>=t;o-=n)a=Yd(o,e[o],e[o+1],a);return a&&Ro(a,a.next)&&(ci(a),a=a.next),a}function lr(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(Ro(r,r.next)||ee(r.prev,r,r.next)===0)){if(ci(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function fi(e,t,r,n,i,o,a){if(e){!a&&o&&my(e,n,i,o);for(var s=e,l,f;e.prev!==e.next;){if(l=e.prev,f=e.next,o?fy(e,n,i,o):sy(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(f.i/r|0),ci(e),e=f.next,s=f.next;continue}if(e=f,e===s){a?a===1?(e=ly(lr(e),t,r),fi(e,t,r,n,i,o,2)):a===2&&cy(e,t,r,n,i,o):fi(lr(e),t,r,n,i,o,1);break}}}}function sy(e){var t=e.prev,r=e,n=e.next;if(ee(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,a=n.x,s=t.y,l=r.y,f=n.y,c=i<o?i<a?i:a:o<a?o:a,u=s<l?s<f?s:f:l<f?l:f,d=i>o?i>a?i:a:o>a?o:a,h=s>l?s>f?s:f:l>f?l:f,g=n.next;g!==t;){if(g.x>=c&&g.x<=d&&g.y>=u&&g.y<=h&&Yr(i,s,o,l,a,f,g.x,g.y)&&ee(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function fy(e,t,r,n){var i=e.prev,o=e,a=e.next;if(ee(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,f=a.x,c=i.y,u=o.y,d=a.y,h=s<l?s<f?s:f:l<f?l:f,g=c<u?c<d?c:d:u<d?u:d,x=s>l?s>f?s:f:l>f?l:f,T=c>u?c>d?c:d:u>d?u:d,_=Gs(h,g,t,r,n),v=Gs(x,T,t,r,n),M=e.prevZ,L=e.nextZ;M&&M.z>=_&&L&&L.z<=v;){if(M.x>=h&&M.x<=x&&M.y>=g&&M.y<=T&&M!==i&&M!==a&&Yr(s,c,l,u,f,d,M.x,M.y)&&ee(M.prev,M,M.next)>=0||(M=M.prevZ,L.x>=h&&L.x<=x&&L.y>=g&&L.y<=T&&L!==i&&L!==a&&Yr(s,c,l,u,f,d,L.x,L.y)&&ee(L.prev,L,L.next)>=0))return!1;L=L.nextZ}for(;M&&M.z>=_;){if(M.x>=h&&M.x<=x&&M.y>=g&&M.y<=T&&M!==i&&M!==a&&Yr(s,c,l,u,f,d,M.x,M.y)&&ee(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;L&&L.z<=v;){if(L.x>=h&&L.x<=x&&L.y>=g&&L.y<=T&&L!==i&&L!==a&&Yr(s,c,l,u,f,d,L.x,L.y)&&ee(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function ly(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!Ro(i,o)&&Xd(i,n,n.next,o)&&li(i,o)&&li(o,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),ci(n),ci(n.next),n=e=o),n=n.next}while(n!==e);return lr(n)}function cy(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&xy(a,s)){var l=Kd(a,s);a=lr(a,a.next),l=lr(l,l.next),fi(a,t,r,n,i,o,0),fi(l,t,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==e)}function uy(e,t,r,n){var i=[],o,a,s,l,f;for(o=0,a=t.length;o<a;o++)s=t[o]*n,l=o<a-1?t[o+1]*n:e.length,f=Wd(e,s,l,n,!1),f===f.next&&(f.steiner=!0),i.push(yy(f));for(i.sort(dy),o=0;o<i.length;o++)r=hy(i[o],r);return r}function dy(e,t){return e.x-t.x}function hy(e,t){var r=py(e,t);if(!r)return t;var n=Kd(r,e);return lr(n,n.next),lr(r,r.next)}function py(e,t){var r=t,n=e.x,i=e.y,o=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>o&&(o=s,a=r.x<r.next.x?r:r.next,s===n))return a}r=r.next}while(r!==t);if(!a)return null;var l=a,f=a.x,c=a.y,u=1/0,d;r=a;do n>=r.x&&r.x>=f&&n!==r.x&&Yr(i<c?n:o,i,f,c,i<c?o:n,i,r.x,r.y)&&(d=Math.abs(i-r.y)/(n-r.x),li(r,e)&&(d<u||d===u&&(r.x>a.x||r.x===a.x&&gy(a,r)))&&(a=r,u=d)),r=r.next;while(r!==l);return a}function gy(e,t){return ee(e.prev,e,t.prev)<0&&ee(t.next,e,e.next)<0}function my(e,t,r,n){var i=e;do i.z===0&&(i.z=Gs(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,by(i)}function by(e){var t,r,n,i,o,a,s,l,f=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t<f&&(s++,n=n.nextZ,!!n);t++);for(l=f;s>0||l>0&&n;)s!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,f*=2}while(a>1);return e}function Gs(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|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 yy(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function Yr(e,t,r,n,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function xy(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!vy(e,t)&&(li(e,t)&&li(t,e)&&wy(e,t)&&(ee(e.prev,e,t.prev)||ee(e,t.prev,t))||Ro(e,t)&&ee(e.prev,e,e.next)>0&&ee(t.prev,t,t.next)>0)}function ee(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Ro(e,t){return e.x===t.x&&e.y===t.y}function Xd(e,t,r,n){var i=Io(ee(e,t,r)),o=Io(ee(e,t,n)),a=Io(ee(r,n,e)),s=Io(ee(r,n,t));return!!(i!==o&&a!==s||i===0&&Lo(e,r,t)||o===0&&Lo(e,n,t)||a===0&&Lo(r,e,n)||s===0&&Lo(r,t,n))}function Lo(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Io(e){return e>0?1:e<0?-1:0}function vy(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Xd(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function li(e,t){return ee(e.prev,e,e.next)<0?ee(e,t,e.next)>=0&&ee(e,e.prev,t)>=0:ee(e,t,e.prev)<0||ee(e,e.next,t)<0}function wy(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function Kd(e,t){var r=new Vs(e.i,e.x,e.y),n=new Vs(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Yd(e,t,r,n){var i=new Vs(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ci(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)}function Vs(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Oo.deviation=function(e,t,r,n){var i=t&&t.length,o=i?t[0]*r:e.length,a=Math.abs($s(e,0,o,r));if(i)for(var s=0,l=t.length;s<l;s++){var f=t[s]*r,c=s<l-1?t[s+1]*r:e.length;a-=Math.abs($s(e,f,c,r))}var u=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,h=n[s+1]*r,g=n[s+2]*r;u+=Math.abs((e[d]-e[g])*(e[h+1]-e[d+1])-(e[d]-e[h])*(e[g+1]-e[d+1]))}return a===0&&u===0?0:Math.abs((u-a)/a)};function $s(e,t,r,n){for(var i=0,o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}Oo.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[i][o][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}});var oh=K((P4,ih)=>{ih.exports=globalThis.deck});var Cr={};Va(Cr,{carto:()=>Q_});var Ua={};Va(Ua,{BASEMAP:()=>bg,CARTO_LAYERS:()=>K_,CARTO_SOURCES:()=>Xp,CartoAPIError:()=>Sr,ClusterTileLayer:()=>jn,H3TileLayer:()=>sr,HeatmapTileLayer:()=>ei,LayerFactory:()=>vl,PointLabelLayer:()=>ni,QuadbinTileLayer:()=>fr,RasterTileLayer:()=>si,SOURCE_DEFAULTS:()=>Oi,VectorTileLayer:()=>Xr,_GOOGLE_BASEMAPS:()=>Da,_QuadbinLayer:()=>Eo,_RasterLayer:()=>Fo,_STYLE_LAYER_GROUPS:()=>gl,_SpatialIndexTileLayer:()=>Hr,_applyLayerGroupFilters:()=>Na,_fetchStyle:()=>za,_getStyleUrl:()=>Qe,boundaryQuerySource:()=>il,boundaryTableSource:()=>ol,colorBins:()=>bl,colorCategories:()=>yl,colorContinuous:()=>xl,fetchBasemapProps:()=>_g,fetchMap:()=>vg,h3QuerySource:()=>Ta,h3TableSource:()=>Ca,h3TilesetSource:()=>fl,quadbinQuerySource:()=>Pa,quadbinTableSource:()=>ka,quadbinTilesetSource:()=>ll,query:()=>Kp,rasterSource:()=>Ma,vectorQuerySource:()=>Fa,vectorTableSource:()=>La,vectorTilesetSource:()=>Ia});var yd=q(Mt(),1),xd=q(gt(),1),vd=q(pn(),1);function $a(e,t){let r=t?.globalFeatureId;return r!==void 0?Mg(e,r):Fg(e,t?.type)}function Mg(e,t){let r=Cl(e);for(let n of r){let i=0,o=n.featureIds.value[0];for(let a=0;a<n.featureIds.value.length;a++){let s=n.featureIds.value[a];if(s!==o){if(t===n.globalFeatureIds.value[i])return Vi(n,i,a);i=a,o=s}}if(t===n.globalFeatureIds.value[i])return Vi(n,i,n.featureIds.value.length)}throw new Error(`featureId:${t} not found`)}function Fg(e,t){let r=Cl(e,t);return Lg(r)}function Tl(e,t,r){switch(e.type){case"Point":return Bg(e,t,r);case"LineString":return Rg(e,t,r);case"Polygon":return Al(e,t,r);default:let n=e;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function Cl(e,t){let r=[];return e.points&&(e.points.type="Point",r.push(e.points)),e.lines&&(e.lines.type="LineString",r.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",r.push(e.polygons)),r}function Lg(e){let t=[];for(let r of e){if(r.featureIds.value.length===0)continue;let n=0,i=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let a=r.featureIds.value[o];a!==i&&(t.push(Vi(r,n,o)),n=o,i=a)}t.push(Vi(r,n,r.featureIds.value.length))}return t}function Vi(e,t,r){let n=Tl(e,t,r),i=Og(e,t,r),o=Ig(e,t,r);return{type:"Feature",geometry:n,properties:i,...o}}function Ig(e,t=0,r){return e.fields&&e.fields[e.featureIds.value[t]]}function Og(e,t=0,r){let n=Object.assign({},e.properties[e.featureIds.value[t]]);for(let i in e.numericProps)n[i]=e.numericProps[i].value[t];return n}function Al(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.polygonIndices.value.filter(l=>l>=t&&l<=r),o=e.primitivePolygonIndices.value.filter(l=>l>=t&&l<=r);if(!(i.length>2)){let l=[];for(let f=0;f<o.length-1;f++){let c=o[f],u=o[f+1],d=$i(n,c,u);l.push(d)}return{type:"Polygon",coordinates:l}}let s=[];for(let l=0;l<i.length-1;l++){let f=i[l],c=i[l+1],u=Al(e,f,c).coordinates;s.push(u)}return{type:"MultiPolygon",coordinates:s}}function Rg(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.pathIndices.value.filter(s=>s>=t&&s<=r);if(!(i.length>2))return{type:"LineString",coordinates:$i(n,i[0],i[1])};let a=[];for(let s=0;s<i.length-1;s++){let l=$i(n,i[s],i[s+1]);a.push(l)}return{type:"MultiLineString",coordinates:a}}function Bg(e,t,r){let{positions:n}=e,i=$i(n,t,r);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function $i(e,t,r){t=t||0,r=r||e.value.length/e.size;let n=[];for(let i=t;i<r;i++){let o=Array();for(let a=i*e.size;a<(i+1)*e.size;a++)o.push(Number(e.value[a]));n.push(o)}return n}var Vn=q(Se(),1);var dm=q(Gl(),1);var jt=Math.PI,Jg=jt/4,h3=jt/180,Vl=180/jt,$l=512;function Te(e){let[t,r]=e,n=t/$l*(2*jt)-jt,i=2*(Math.atan(Math.exp(r/$l*(2*jt)-jt))-Jg);return[n*Vl,i*Vl]}var w3=Math.PI/180;var jl=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],Yl=[0n,1n,2n,4n,8n,16n];function Wl(e){return BigInt(`0x${e}`)}function gn(e){return e.toString(16)}function Xl(e){if(e.z<0||e.z>26)throw new Error("Wrong zoom");let t=BigInt(e.z),r=BigInt(e.x)<<32n-t,n=BigInt(e.y)<<32n-t;for(let o=0;o<5;o++){let a=Yl[5-o],s=jl[4-o];r=(r|r<<a)&s,n=(n|n<<a)&s}return 0x4000000000000000n|1n<<59n|t<<52n|(r|n<<1n)>>12n|0xfffffffffffffn>>t*2n}function Hi(e){let t=e>>59n&7n,r=e>>57n&3n,n=e>>52n&0x1fn,i=(e&0xfffffffffffffn)<<12n;if(t!==1n&&r!==0n)throw new Error("Wrong mode");let o=i,a=i>>1n;for(let s=0;s<6;s++){let l=Yl[s],f=jl[s];o=(o|o>>l)&f,a=(a|a>>l)&f}return o=o>>32n-n,a=a>>32n-n,{z:Number(n),x:Number(o),y:Number(a)}}function mn(e){return e>>52n&0x1fn}function ji(e){let t=mn(e)-1n;return e&~(0x1fn<<52n)|t<<52n|0xfffffffffffffn>>t*2n}var Wi=q(Yt(),1),ec=q(Se(),1);var Ql=q(Se(),1);function Me(e,t){Ql.log.assert(e,t)}function Jl(e,t){let{properties:r,numericProps:n}=e;return new Proxy(r[t]||{},{get(i,o){return o in n?n[o].value[t]:i[o]},has(i,o){return o in n||o in i},ownKeys(i){return[...Object.keys(n),...Reflect.ownKeys(i)]},getOwnPropertyDescriptor(i,o){return{enumerable:!0,configurable:!0}}})}function Ft(e,t){return`https://unpkg.com/@deck.gl/carto@${t}/dist/${e}-worker.js`}var bn=new Uint16Array,Wa={positions:{value:new Float32Array,size:2},properties:[],numericProps:{},featureIds:{value:bn,size:1},globalFeatureIds:{value:bn,size:1}};function Yi(){return{shape:"binary-feature-collection",points:{type:"Point",...Wa},lines:{type:"LineString",pathIndices:{value:bn,size:1},...Wa},polygons:{type:"Polygon",polygonIndices:{value:bn,size:1},primitivePolygonIndices:{value:bn,size:1},...Wa}}}function yn(e,t,r,n,i,o=2){return{type:"Point",positions:{value:new Float32Array(e),size:o},featureIds:{value:new Uint16Array(t),size:1},globalFeatureIds:{value:new Uint32Array(r),size:1},numericProps:n,properties:i}}function Xa(e,t){let r={};return t&&Object.keys(t).forEach(n=>{r[n]={value:new Float32Array(e),size:1}}),r}function Ka(e,t,r,n){Object.keys(e).forEach(i=>{t[i].value[n]=e[i].value[r]})}function tc(e,t,r,n=[],i,o,a="quadbin"){if(!e.content)return!1;e.userData||(e.userData={});let s=t.get(r)?.[0];if(s){if(n.every(f=>f.name in s))return!1;t.clear()}let l={};for(let f of e.content){let c=f.id,u=typeof i=="function"?i(f,{}):i;for(let T=0;T<r-1;T++)if(a==="h3"){let _=(0,Wi.getResolution)(c);c=(0,Wi.cellToParent)(c,Math.max(0,_-1))}else c=ji(c);let d=String(c);if(!(d in l)){l[d]={id:c,count:0,position:[0,0]};for(let{name:T,aggregation:_}of n)_==="any"?l[d][T]=f.properties[T]:l[d][T]=0}let h=l[d].count;l[d].count+=typeof o=="function"?o(f,{}):o;let g=l[d].count,x=g-h;l[d].position[0]=(h*l[d].position[0]+x*u[0])/g,l[d].position[1]=(h*l[d].position[1]+x*u[1])/g;for(let{name:T,aggregation:_}of n){let v=l[d][T],M=f.properties[T];_==="average"?l[d][T]=(h*v+x*M)/g:_==="count"||_==="sum"?l[d][T]=v+M:_==="max"?l[d][T]=Math.max(v,M):_==="min"&&(l[d][T]=Math.min(v,M))}}return t.set(r,Object.values(l)),!0}function rc(e){let t=[],r=["any","average","count","min","max","sum"];for(let n of Object.keys(e.content[0].properties)){let i=n.split("_").pop().toLowerCase();r.includes(i)||(ec.log.warn(`No valid aggregation present in ${n} property`)(),i="any"),t.push({name:n,aggregation:i})}return t}function nc(e,t){let r={};for(let{name:n,aggregation:i}of t)if(r[n]={min:1/0,max:-1/0},i!=="any")for(let o of e)r[n].min=Math.min(r[n].min,o[n]),r[n].max=Math.max(r[n].max,o[n]);return r}function ic(e){let t=new Float32Array(e.length*2),r=new Uint16Array(e.length);for(let n=0;n<e.length;n++)t.set(e[n].position,2*n),r[n]=n;return{...Yi(),points:yn(t,r,r,{},e)}}var oc=q(gt(),1);var tt=class extends oc._Tileset2D{getTileIndices(t){return super.getTileIndices(t).map(Xl).map(r=>({q:r,i:gn(r)}))}getTileId({q:t,i:r}){return r||gn(t)}getTileMetadata({q:t}){return super.getTileMetadata(Hi(t))}getTileZoom({q:t}){return Number(mn(t))}getParentIndex({q:t}){return{q:ji(t)}}};var sc=q(gt(),1),ie=q(Yt(),1),ac=85.051128;function fc({west:e,north:t,east:r,south:n},i,o=1){let l=[[t,r],[n,r],[n,e],[t,e]].map(u=>(0,ie.latLngToCell)(u[0],u[1],i)).map(u=>Math.max(...(0,ie.originToDirectedEdges)(u).map(d=>(0,ie.edgeLength)(d,ie.UNITS.rads)))*180/Math.PI),f=Math.max(...l)*o,c=Math.min(180,f/Math.cos((t+n)/2*Math.PI/180));return{north:Math.min(t+f,ac),east:r+c,south:Math.max(n-f,-ac),west:e-c}}function lc({west:e,north:t,east:r,south:n},i){let o=Math.abs(r-e);if(o>180){let s=Math.ceil(o/180),l=[];for(let f=0;f<s;f++){let c=e+f*180,u=Math.min(c+179.9999999,r);l=l.concat(lc({west:c,north:t,east:u,south:n},i))}return[...new Set(l)]}return(0,ie.polygonToCells)([[t,r],[n,r],[n,e],[t,e],[t,r]],i)}function hm(e){let t=(0,ie.cellToBoundary)(e),r=t.map(f=>f[0]),n=t.map(f=>f[1]),i=Math.min(...n),o=Math.min(...r),a=Math.max(...n),s=Math.max(...r);return fc({west:i,south:o,east:a,north:s},(0,ie.getResolution)(e),.12)}var pm=2;function Pr(e,t){let r=Math.log2(t/512),n=2/3*(e.zoom-r),i=Math.log(1/Math.cos(Math.PI*e.latitude/180));return Math.max(0,Math.floor(n+i-pm))}var Lt=class extends sc._Tileset2D{getTileIndices({viewport:t,minZoom:r,maxZoom:n}){if(t.latitude===void 0)return[];let[i,o,a,s]=t.getBounds(),{tileSize:l}=this.opts,f=Pr(t,l),c;if(typeof r=="number"&&Number.isFinite(r)&&f<r)return[];if(typeof n=="number"&&Number.isFinite(n)&&f>n){f=n;let u=(0,ie.latLngToCell)(t.latitude,t.longitude,n);c=(0,ie.gridDisk)(u,1)}else{let u=fc({west:i,north:s,east:a,south:o},f);c=lc(u,f)}return c.map(u=>({i:u}))}getTileId({i:t}){return t}getTileMetadata({i:t}){return{bbox:hm(t)}}getTileZoom({i:t}){return(0,ie.getResolution)(t)}getParentIndex(t){let r=(0,ie.getResolution)(t.i);return{i:(0,ie.cellToParent)(t.i,r-1)}}};var cc=512;function Qa(e){let{x:t,y:r,z:n}=Hi(e),i=cc/(1<<n);return[t*i,cc-r*i,i]}function gm(e,t){let[r,n,i]=Qa(e);return[[r,n],[r+t*i,n-t*i]]}function Xi(e,t=1){let[r,n]=gm(e,t),[i,o]=Te(r),[a,s]=Te(n);return[a,o,a,s,i,s,i,o,a,o]}var xo=q(Yt(),1);var rt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},mm=rt.self||rt.window||rt.global||{},bm=rt.window||rt.self||rt.global||{},ym=rt.global||rt.self||rt.window||{},xm=rt.document||{};var kr=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var uc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),vm=uc&&parseFloat(uc[1])||0;function Ja(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function dc(...e){return wm(e)}function wm(e){let t=e.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=t.reduce((o,a)=>o+a.byteLength,0),n=new Uint8Array(r),i=0;for(let o of t)n.set(o,i),i+=o.byteLength;return n.buffer}async function es(e){let t=[];for await(let r of e)t.push(r);return dc(...t)}function hc(e){return e&&typeof e=="object"&&e.isBuffer}function Mr(e){if(hc(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Fr(e){return t=>new Promise((r,n)=>e(t,(i,o)=>i?n(i):r(o)))}var Ki=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){Ja(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return es(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var nr=q(ed(),1),vt=q(td(),1),go=class extends Ki{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!kr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Fr(vt.default.gzip)(t):await Fr(vt.default.deflate)(t);return Mr(r)}return this.compressSync(t)}async decompress(t){if(!kr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Fr(vt.default.gunzip)(t):await Fr(vt.default.inflate)(t);return Mr(r)}return this.decompressSync(t)}compressSync(t){if(!kr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gzipSync(t):vt.default.deflateSync(t);return Mr(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?nr.default.deflateRaw:nr.default.deflate)(n,r).buffer}decompressSync(t){if(!kr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gunzipSync(t):vt.default.inflateSync(t);return Mr(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?nr.default.inflateRaw:nr.default.inflate)(n,r).buffer}async*compressBatches(t){let r=this.options?.deflate||{},n=new nr.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new nr.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let a of r){let s=new Uint8Array(a);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var Rn=class extends go{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(t){super({...t,deflate:{...t?.gzip,gzip:!0}})}};function ir(e,t,r,n){let i=t.type===2?t.readVarint()+t.pos:t.pos+1,o=t.buf.buffer.slice(t.pos,i);if(n?.compression==="gzip"){let s=new Rn().decompressSync(o);r.value=new e(s)}else r.value=new e(o);return t.pos=i,r.value}var Bn=class{static read(t,r){return t.readFields(Bn._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=n.readString())}},Ve=class{static read(t,r){return t.readFields(Ve._readField,{},r)}static _readField(t,r,n){if(t===1){let{key:i,value:o}=Bn.read(n,n.readVarint()+n.pos);r[i]=o}}},or=class{static read(t,r){let{value:n,size:i}=t.readFields(or._readField,{value:[],size:0},r);return{value:n,size:i}}static _readField(t,r,n){t===1?ir(Float64Array,n,r):t===2&&(r.size=n.readVarint(!0))}},ye=class{static read(t,r){let{value:n,size:i}=t.readFields(ye._readField,{value:[],size:0},r);return{value:new Uint32Array(n),size:i}}static _readField(t,r,n){t===1?n.readPackedVarint(r.value):t===2&&(r.size=n.readVarint(!0))}},ar=class{static read(t,r){return t.readFields(ar._readField,{id:0},r)}static _readField(t,r,n){t===1&&(r.id=n.readVarint())}},Dn=class{static read(t,r){return t.readFields(Dn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&ir(Float64Array,n,r)}},$e=class{static read(t,r){return t.readFields($e._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=Dn.read(n,n.readVarint()+n.pos))}},Nn=class{static read(t,r){return t.readFields(Nn._readField,{positions:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=or.read(n,n.readVarint()+n.pos);else if(t===2)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===5){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===6&&r.fields.push(ar.read(n,n.readVarint()+n.pos))}},zn=class{static read(t,r){return t.readFields(zn._readField,{positions:null,pathIndices:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=or.read(n,n.readVarint()+n.pos);else if(t===2)r.pathIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===6){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===7&&r.fields.push(ar.read(n,n.readVarint()+n.pos))}},Un=class{static read(t,r){return t.readFields(Un._readField,{positions:null,polygonIndices:null,globalFeatureIds:null,featureIds:null,primitivePolygonIndices:null,triangles:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=or.read(n,n.readVarint()+n.pos);else if(t===2)r.polygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.primitivePolygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===6)r.triangles=ye.read(n,n.readVarint()+n.pos);else if(t===7)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===8){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===9&&r.fields.push(ar.read(n,n.readVarint()+n.pos))}},Gr=class{static read(t,r){return t.readFields(Gr._readField,{points:null,lines:null,polygons:null},r)}static _readField(t,r,n){t===1?r.points=Nn.read(n,n.readVarint()+n.pos):t===2?r.lines=zn.read(n,n.readVarint()+n.pos):t===3&&(r.polygons=Un.read(n,n.readVarint()+n.pos))}};var qn=class{static read(t,r){return t.readFields(qn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&ir(BigUint64Array,n,r)}},Gn=class{static read(t,r){return t.readFields(Gn._readField,{indices:null,properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.indices=qn.read(n,n.readVarint()+n.pos);else if(t===2)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===3){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}},Vr=class{static read(t,r){return t.readFields(Vr._readField,{scheme:0,cells:null},r)}static _readField(t,r,n){t===1?r.scheme=n.readVarint():t===2&&(r.cells=Gn.read(n,n.readVarint()+n.pos))}};var ld=q(fd(),1);function zt(e,t){let r=new ld.default(e);return t.read(r)}function cd(e){let{cells:t,scheme:r}=e,n=t.indices.value.length,i=[];for(let o=0;o<n;o++){let a=r==="h3"?gn(t.indices.value[o]):t.indices.value[o],s={...t.properties[o]};for(let l of Object.keys(t.numericProps))s[l]=t.numericProps[l].value[o];i.push({id:a,properties:s})}return i}var dd="9.2.0",hd="cartoSpatialTile",Fb={cartoSpatialTile:{scheme:"quadbin",workerUrl:Ft(hd,dd)}},Lb={name:"CARTO Spatial Tile",version:dd,id:hd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-spatial-tile"],category:"geometry",parse:async(e,t)=>ud(e,t),parseSync:ud,worker:!0,options:Fb};function ud(e,t){if(!e)return null;let r=zt(e,Vr),{cells:n}=r,i=t?.cartoSpatialTile?.scheme;return cd({cells:n,scheme:i})}var yo=Lb;var pd=q(Se(),1),gd=q(Se(),1);function Ze(e,t,r=0){if(!e)return t;if(!t)return e;if(r>10)return t;let n={...e};for(let i in t){let o=t[i];o===e||o===t||(typeof o=="object"&&o!==null?n[i]=Ze(e[i],o,r+1):n[i]=o)}return n}function md(e,t){let r={};for(let{geoid:n,...i}of t.properties)n in r?pd.log.warn("Duplicate geoid key in boundary mapping, using first occurance")():r[n]=i;for(let n of["points","lines","polygons"]){let i=e[n];if(i.positions.value.length===0)continue;i.properties=i.properties.map(({geoid:f})=>r[f]);let{positions:o,globalFeatureIds:a}=i,s=null;n==="lines"&&(s=i.pathIndices.value),n==="polygons"&&(s=i.polygonIndices.value);let l=o.value.length/o.size;for(let f in t.numericProps){let c=t.numericProps[f].value,u=c.constructor,d=new u(l);if(i.numericProps[f]={value:d,size:1},s)for(let h=0;h<s.length-1;h++){let g=s[h],x=s[h+1],T=a.value[g];d.fill(c[T],g,x)}else for(let h=0;h<l;h++){let g=a.value[h];d[h]=c[g]}}}return e}var Ae={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="object"&&Array.isArray(e.tiles)&&e.tiles.every(r=>typeof r=="string"),equal:(e,t)=>(0,gd._deepEqual)(e,t,2),async:!0};(0,vd.registerLoaders)([yo]);function bd(e){if(e===Lt)return"h3";if(e===tt)return"quadbin";throw new Error("Invalid tileset class")}var wd={data:Ae,clusterLevel:{type:"number",value:5,min:1},getPosition:{type:"accessor",value:({id:e})=>{if(typeof e=="string"){let[t,r]=(0,xo.cellToLatLng)(e);return[r,t]}return Xi(e,.5).slice(2,4)}},getWeight:{type:"accessor",value:1},refinementStrategy:"no-overlap",tileSize:512},$n=class extends xd.TileLayer{initializeState(){super.initializeState(),this.state.aggregationCache=new WeakMap,this.state.scheme=bd(this.props.TilesetClass)}updateState(t){let{props:r}=t,n=bd(r.TilesetClass);this.state.scheme!==n&&(this.setState({scheme:n,tileset:null}),this.state.aggregationCache=new WeakMap),super.updateState(t)}renderLayers(){let t=this.state.tileset?.tiles.filter(h=>h.isLoaded&&h.content&&this.state.tileset.isTileVisible(h));if(!t?.length||!this.state.tileset)return null;t.sort((h,g)=>g.zoom-h.zoom);let{getPosition:r,getWeight:n}=this.props,{aggregationCache:i,scheme:o}=this.state,a=o==="h3",s=rc(t[0]),l=[],f=!1,c=this._getAggregationLevels(t);for(let h of t){let g=i.get(h.content);g||(g=new Map,i.set(h.content,g));let x=tc(h,g,c,s,r,n,a?"h3":"quadbin");f||(f=x),l.push(...g.get(c))}l.sort((h,g)=>Number(g.count-h.count));let u=l?.map(h=>h.id);if(f||(f=!(0,Vn._deepEqual)(u,this.state.clusterIds,1)),this.setState({clusterIds:u}),f){let h=nc(l,s),g=ic(l);g.points.attributes={stats:h},this.setState({data:g})}let d={...this.props,id:"clusters",data:this.state.data,dataComparator:(h,g)=>{let x=h?.points?.properties?.map(_=>_.id),T=g?.points?.properties?.map(_=>_.id);return(0,Vn._deepEqual)(x,T,1)}};return new yd.GeoJsonLayer(this.getSubLayerProps(d))}getPickingInfo(t){let r=t.info;if(r.index!==-1){let{data:n}=t.sourceLayer.props;r.object=$a(n,{globalFeatureId:r.index})}return r}_updateAutoHighlight(t){for(let r of this.getSubLayers())r.updateAutoHighlight(t)}filterSubLayer(){return!0}_getAggregationLevels(t){let r=this.state.scheme==="h3",n=t[0],i,o;r?(i=(0,xo.getResolution)(n.id),o=Pr(this.context.viewport,this.state.tileset.opts.tileSize)):(i=n.zoom,o=this.context.viewport.zoom);let a=Math.round(o-i);return Math.round(this.props.clusterLevel)-a}};$n.layerName="ClusterGeoJsonLayer";$n.defaultProps=wd;var Zn=class extends Vn.CompositeLayer{getLoadOptions(){let t=this.props.data,r=t&&"scheme"in t?t.scheme:"quadbin";return Ze(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:r}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,maxresolution:n}=t,o=t&&"scheme"in t&&t.scheme==="h3"?Lt:tt;return[new $n(this.props,{id:`cluster-geojson-layer-${this.props.id}`,data:r,TilesetClass:o,maxZoom:n,loadOptions:this.getLoadOptions()})]}};Zn.layerName="ClusterTileLayer";Zn.defaultProps=wd;var jn=Zn;var Sd=q(Se(),1),Ds=q(gt(),1);var _d=q(pn(),1);var Ed=q(gt(),1);(0,_d.registerLoaders)([yo]);function Ib(e){return e!=null&&e!==""}var Ob={tileSize:512},Yn=class extends Ed.TileLayer{_updateAutoHighlight(t){let{hoveredFeatureId:r}=this.state,n=t.object,i=null;if(n&&(i=n.id),r!==i){let{highlightColor:o}=this.props;typeof o=="function"&&(o=o(t)),this.setState({highlightColor:o,hoveredFeatureId:i})}}getSubLayerPropsByTile(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(t){let{hoveredFeatureId:r}=this.state,n=t.content;return!Ib(r)||!Array.isArray(n)||!this._featureInTile(t,r)?-1:n.findIndex(o=>o.id===r)}_featureInTile(t,r){let n=this.state.tileset,i=n.getTileZoom(t.index),o=t.index.q?"q":"i",a={[o]:r},s=n.getTileZoom(a);for(;!(s<=i);)a=n.getParentIndex(a),s=n.getTileZoom(a);return a[o]===t.index[o]}};Yn.layerName="SpatialIndexTileLayer";Yn.defaultProps=Ob;var Hr=Yn;var Rb=e=>{let{data:t}=e,{index:r}=e.tile;return!t||!t.length?null:new Ds.H3HexagonLayer(e,{getHexagon:n=>n.id,centerHexagon:r,highPrecision:!0})},Bb={data:Ae,tileSize:512},Wn=class extends Sd.CompositeLayer{initializeState(){Ds.H3HexagonLayer._checkH3Lib()}getLoadOptions(){let t=this.props.data;return Ze(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:"h3"}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r}=t,{minresolution:n,maxresolution:i}=t;this.props.minZoom&&(n=Math.max(n,Pr({zoom:this.props.minZoom,latitude:0},this.props.tileSize))),this.props.maxZoom&&(i=Math.min(i,Pr({zoom:this.props.maxZoom,latitude:0},this.props.tileSize)));let o=this.getSubLayerClass("spatial-index-tile",Hr);return new o(this.props,{id:`h3-tile-layer-${this.props.id}`,data:r,TilesetClass:Lt,renderSubLayers:Rb,minZoom:n,maxZoom:i,loadOptions:this.getLoadOptions()})}};Wn.layerName="H3TileLayer";Wn.defaultProps=Bb;var sr=Wn;var To=q(Yt(),1),Co=q(Se(),1),Pd=q(Mt(),1);var Db=`uniform heatmapUniforms {
|
|
7
|
+
"use strict";var __exports__=(()=>{var Sg=Object.create;var Gi=Object.defineProperty;var Tg=Object.getOwnPropertyDescriptor;var Cg=Object.getOwnPropertyNames;var Ag=Object.getPrototypeOf,Pg=Object.prototype.hasOwnProperty;var K=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Va=(e,t)=>{for(var r in t)Gi(e,r,{get:t[r],enumerable:!0})},qi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Cg(t))!Pg.call(e,i)&&i!==r&&Gi(e,i,{get:()=>t[i],enumerable:!(n=Tg(t,i))||n.enumerable});return e},et=(e,t,r)=>(qi(e,t,"default"),r&&qi(r,t,"default")),q=(e,t,r)=>(r=e!=null?Sg(Ag(e)):{},qi(t||!e||!e.__esModule?Gi(r,"default",{value:e,enumerable:!0}):r,e)),kg=e=>qi(Gi({},"__esModule",{value:!0}),e);var Mt=K((e3,_l)=>{_l.exports=globalThis.deck});var gt=K((t3,El)=>{El.exports=globalThis.deck});var pn=K((r3,Sl)=>{Sl.exports=globalThis.loaders});var Se=K((a3,Pl)=>{Pl.exports=globalThis.deck});var zl=K((s3,Nl)=>{var Dg=Math.PI/180,Ng=180/Math.PI;function Fl(e){var t=kl(e[0]+1,e[2]),r=kl(e[0],e[2]),n=Ml(e[1]+1,e[2]),i=Ml(e[1],e[2]);return[r,n,t,i]}function zg(e){var t=Fl(e),r={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r}function kl(e,t){return e/Math.pow(2,t)*360-180}function Ml(e,t){var r=Math.PI-2*Math.PI*e/Math.pow(2,t);return Ng*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))}function Za(e,t,r){var n=Dl(e,t,r);return n[0]=Math.floor(n[0]),n[1]=Math.floor(n[1]),n}function Ll(e){return[[e[0]*2,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2+1,e[2]+1],[e[0]*2,e[1]*2+1,e[2]+1]]}function Il(e){return e[0]%2===0&&e[1]%2===0?[e[0]/2,e[1]/2,e[2]-1]:e[0]%2===0&&!e[1]%2===0?[e[0]/2,(e[1]-1)/2,e[2]-1]:!e[0]%2===0&&e[1]%2===0?[(e[0]-1)/2,e[1]/2,e[2]-1]:[(e[0]-1)/2,(e[1]-1)/2,e[2]-1]}function Ol(e){return Ll(Il(e))}function Ug(e,t){for(var r=Ol(e),n=0;n<r.length;n++)if(!Rl(t,r[n]))return!1;return!0}function Rl(e,t){for(var r=0;r<e.length;r++)if(Bl(e[r],t))return!0;return!1}function Bl(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function qg(e){for(var t="",r=e[2];r>0;r--){var n=0,i=1<<r-1;e[0]&i&&n++,e[1]&i&&(n+=2),t+=n.toString()}return t}function Gg(e){for(var t=0,r=0,n=e.length,i=n;i>0;i--){var o=1<<i-1;switch(e[n-i]){case"0":break;case"1":t|=o;break;case"2":r|=o;break;case"3":t|=o,r|=o;break}}return[t,r,n]}function Vg(e){var t=Za(e[0],e[1],32),r=Za(e[2],e[3],32),n=[t[0],t[1],r[0],r[1]],i=$g(n);if(i===0)return[0,0,0];var o=n[0]>>>32-i,a=n[1]>>>32-i;return[o,a,i]}function $g(e){for(var t=28,r=0;r<t;r++){var n=1<<32-(r+1);if((e[0]&n)!=(e[2]&n)||(e[1]&n)!=(e[3]&n))return r}return t}function Dl(e,t,r){var n=Math.sin(t*Dg),i=Math.pow(2,r),o=i*(e/360+.5),a=i*(.5-.25*Math.log((1+n)/(1-n))/Math.PI);return[o,a,r]}Nl.exports={tileToGeoJSON:zg,tileToBBOX:Fl,getChildren:Ll,getParent:Il,getSiblings:Ol,hasTile:Rl,hasSiblings:Ug,tilesEqual:Bl,tileToQuadkey:qg,quadkeyToTile:Gg,pointToTile:Za,bboxToTile:Vg,pointToTileFraction:Dl}});var Gl=K(Zi=>{var Ar=zl();Zi.geojson=function(e,t){return{type:"FeatureCollection",features:ja(e,t).map(Zg)}};function Zg(e){return{type:"Feature",geometry:Ar.tileToGeoJSON(e),properties:{}}}Zi.tiles=ja;Zi.indexes=function(e,t){return ja(e,t).map(Ar.tileToQuadkey)};function ja(e,t){var r,n,i=e.coordinates,o=t.max_zoom,a={},s=[];if(e.type==="Point")return[Ar.pointToTile(i[0],i[1],o)];if(e.type==="MultiPoint")for(r=0;r<i.length;r++)n=Ar.pointToTile(i[r][0],i[r][1],o),a[Ue(n[0],n[1],n[2])]=!0;else if(e.type==="LineString")Ha(a,i,o);else if(e.type==="MultiLineString")for(r=0;r<i.length;r++)Ha(a,i[r],o);else if(e.type==="Polygon")Ul(a,s,i,o);else if(e.type==="MultiPolygon")for(r=0;r<i.length;r++)Ul(a,s,i[r],o);else throw new Error("Geometry type not implemented");if(t.min_zoom!==o){var l=s.length;for(ql(a,s),r=0;r<l;r++){var f=s[r];a[Ue(f[0],f[1],f[2])]=!0}return Hg(a,s,t)}return ql(a,s),s}function Hg(e,t,r){for(var n=[],i=r.max_zoom;i>r.min_zoom;i--){for(var o={},a=[],s=0;s<t.length;s++){var l=t[s];if(l[0]%2===0&&l[1]%2===0){var f=Ue(l[0]+1,l[1],i),c=Ue(l[0],l[1]+1,i),u=Ue(l[0]+1,l[1]+1,i);if(e[f]&&e[c]&&e[u]){e[Ue(l[0],l[1],l[2])]=!1,e[f]=!1,e[c]=!1,e[u]=!1;var d=[l[0]/2,l[1]/2,i-1];i-1===r.min_zoom?n.push(d):(o[Ue(l[0]/2,l[1]/2,i-1)]=!0,a.push(d))}}}for(s=0;s<t.length;s++)l=t[s],e[Ue(l[0],l[1],l[2])]&&n.push(l);e=o,t=a}return n}function Ul(e,t,r,n){for(var i=[],o=0;o<r.length;o++){var a=[];Ha(e,r[o],n,a);for(var s=0,l=a.length,f=l-1;s<l;f=s++){var c=(s+1)%l,u=a[s][1];(u>a[f][1]||u>a[c][1])&&(u<a[f][1]||u<a[c][1])&&u!==a[c][1]&&i.push(a[s])}}for(i.sort(jg),o=0;o<i.length;o+=2){u=i[o][1];for(var d=i[o][0]+1;d<i[o+1][0];d++){var h=Ue(d,u,n);e[h]||t.push([d,u,n])}}}function jg(e,t){return e[1]-t[1]||e[0]-t[0]}function Ha(e,t,r,n){for(var i,o,a=0;a<t.length-1;a++){var s=Ar.pointToTileFraction(t[a][0],t[a][1],r),l=Ar.pointToTileFraction(t[a+1][0],t[a+1][1],r),f=s[0],c=s[1],u=l[0],d=l[1],h=u-f,g=d-c;if(!(g===0&&h===0)){var x=h>0?1:-1,T=g>0?1:-1,_=Math.floor(f),v=Math.floor(c),M=h===0?1/0:Math.abs(((h>0?1:0)+_-f)/h),L=g===0?1/0:Math.abs(((g>0?1:0)+v-c)/g),I=Math.abs(x/h),B=Math.abs(T/g);for((_!==i||v!==o)&&(e[Ue(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v);M<1||L<1;)M<L?(M+=I,_+=x):(L+=B,v+=T),e[Ue(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v}}n&&v===n[0][1]&&n.pop()}function ql(e,t){for(var r=Object.keys(e),n=0;n<r.length;n++)t.push(Yg(+r[n]))}function Ue(e,t,r){var n=2*(1<<r);return(n*t+e)*32+r}function Yg(e){var t=e%32,r=2*(1<<t),n=(e-t)/32,i=n%r,o=(n-i)/r%r;return[i,o,t]}});var Yt=K((e5,Kl)=>{Kl.exports=globalThis.h3||{}});var mt=K(pe=>{"use strict";var _m=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Em(e,t){return Object.prototype.hasOwnProperty.call(e,t)}pe.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)Em(r,n)&&(e[n]=r[n])}}return e};pe.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var Sm={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),i);return}for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},Tm={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};pe.setTyped=function(e){e?(pe.Buf8=Uint8Array,pe.Buf16=Uint16Array,pe.Buf32=Int32Array,pe.assign(pe,Sm)):(pe.Buf8=Array,pe.Buf16=Array,pe.Buf32=Array,pe.assign(pe,Tm))};pe.setTyped(_m)});var Bc=K(Or=>{"use strict";var Cm=mt(),Am=4,pc=0,gc=1,Pm=2;function Ir(e){for(var t=e.length;--t>=0;)e[t]=0}var km=0,wc=1,Mm=2,Fm=3,Lm=258,ss=29,Sn=256,vn=Sn+1+ss,Lr=30,fs=19,_c=2*vn+1,Wt=15,ts=16,Im=7,ls=256,Ec=16,Sc=17,Tc=18,os=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Qi=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Om=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Cc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Rm=512,bt=new Array((vn+2)*2);Ir(bt);var xn=new Array(Lr*2);Ir(xn);var wn=new Array(Rm);Ir(wn);var _n=new Array(Lm-Fm+1);Ir(_n);var cs=new Array(ss);Ir(cs);var Ji=new Array(Lr);Ir(Ji);function rs(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var Ac,Pc,kc;function ns(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Mc(e){return e<256?wn[e]:wn[256+(e>>>7)]}function En(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function be(e,t,r){e.bi_valid>ts-r?(e.bi_buf|=t<<e.bi_valid&65535,En(e,e.bi_buf),e.bi_buf=t>>ts-e.bi_valid,e.bi_valid+=r-ts):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function nt(e,t,r){be(e,r[t*2],r[t*2+1])}function Fc(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Bm(e){e.bi_valid===16?(En(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Dm(e,t){var r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,f,c,u,d,h,g,x=0;for(d=0;d<=Wt;d++)e.bl_count[d]=0;for(r[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;f<_c;f++)c=e.heap[f],d=r[r[c*2+1]*2+1]+1,d>l&&(d=l,x++),r[c*2+1]=d,!(c>n)&&(e.bl_count[d]++,h=0,c>=s&&(h=a[c-s]),g=r[c*2],e.opt_len+=g*(d+h),o&&(e.static_len+=g*(i[c*2+1]+h)));if(x!==0){do{for(d=l-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[l]--,x-=2}while(x>0);for(d=l;d!==0;d--)for(c=e.bl_count[d];c!==0;)u=e.heap[--f],!(u>n)&&(r[u*2+1]!==d&&(e.opt_len+=(d-r[u*2+1])*r[u*2],r[u*2+1]=d),c--)}}function Lc(e,t,r){var n=new Array(Wt+1),i=0,o,a;for(o=1;o<=Wt;o++)n[o]=i=i+r[o-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=Fc(n[s]++,s))}}function Nm(){var e,t,r,n,i,o=new Array(Wt+1);for(r=0,n=0;n<ss-1;n++)for(cs[n]=r,e=0;e<1<<os[n];e++)_n[r++]=n;for(_n[r-1]=n,i=0,n=0;n<16;n++)for(Ji[n]=i,e=0;e<1<<Qi[n];e++)wn[i++]=n;for(i>>=7;n<Lr;n++)for(Ji[n]=i<<7,e=0;e<1<<Qi[n]-7;e++)wn[256+i++]=n;for(t=0;t<=Wt;t++)o[t]=0;for(e=0;e<=143;)bt[e*2+1]=8,e++,o[8]++;for(;e<=255;)bt[e*2+1]=9,e++,o[9]++;for(;e<=279;)bt[e*2+1]=7,e++,o[7]++;for(;e<=287;)bt[e*2+1]=8,e++,o[8]++;for(Lc(bt,vn+1,o),e=0;e<Lr;e++)xn[e*2+1]=5,xn[e*2]=Fc(e,5);Ac=new rs(bt,os,Sn+1,vn,Wt),Pc=new rs(xn,Qi,0,Lr,Wt),kc=new rs(new Array(0),Om,0,fs,Im)}function Ic(e){var t;for(t=0;t<vn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Lr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<fs;t++)e.bl_tree[t*2]=0;e.dyn_ltree[ls*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Oc(e){e.bi_valid>8?En(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function zm(e,t,r,n){Oc(e),n&&(En(e,r),En(e,~r)),Cm.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function mc(e,t,r,n){var i=t*2,o=r*2;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function is(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&mc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!mc(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function bc(e,t,r){var n,i,o=0,a,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],i=e.pending_buf[e.l_buf+o],o++,n===0?nt(e,i,t):(a=_n[i],nt(e,a+Sn+1,t),s=os[a],s!==0&&(i-=cs[a],be(e,i,s)),n--,a=Mc(n),nt(e,a,r),s=Qi[a],s!==0&&(n-=Ji[a],be(e,n,s)));while(o<e.last_lit);nt(e,ls,t)}function as(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,l=-1,f;for(e.heap_len=0,e.heap_max=_c,a=0;a<o;a++)r[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):r[a*2+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=l<2?++l:0,r[f*2]=1,e.depth[f]=0,e.opt_len--,i&&(e.static_len-=n[f*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)is(e,r,a);f=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],is(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[f*2]=r[a*2]+r[s*2],e.depth[f]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=f,e.heap[1]=f++,is(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Dm(e,t),Lc(r,l,e.bl_count)}function yc(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)&&(s<f?e.bl_tree[o*2]+=s:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[Ec*2]++):s<=10?e.bl_tree[Sc*2]++:e.bl_tree[Tc*2]++,s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4))}function xc(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),n=0;n<=r;n++)if(o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)){if(s<f)do nt(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==i&&(nt(e,o,e.bl_tree),s--),nt(e,Ec,e.bl_tree),be(e,s-3,2)):s<=10?(nt(e,Sc,e.bl_tree),be(e,s-3,3)):(nt(e,Tc,e.bl_tree),be(e,s-11,7));s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4)}}function Um(e){var t;for(yc(e,e.dyn_ltree,e.l_desc.max_code),yc(e,e.dyn_dtree,e.d_desc.max_code),as(e,e.bl_desc),t=fs-1;t>=3&&e.bl_tree[Cc[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function qm(e,t,r,n){var i;for(be(e,t-257,5),be(e,r-1,5),be(e,n-4,4),i=0;i<n;i++)be(e,e.bl_tree[Cc[i]*2+1],3);xc(e,e.dyn_ltree,t-1),xc(e,e.dyn_dtree,r-1)}function Gm(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return pc;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return gc;for(r=32;r<Sn;r++)if(e.dyn_ltree[r*2]!==0)return gc;return pc}var vc=!1;function Vm(e){vc||(Nm(),vc=!0),e.l_desc=new ns(e.dyn_ltree,Ac),e.d_desc=new ns(e.dyn_dtree,Pc),e.bl_desc=new ns(e.bl_tree,kc),e.bi_buf=0,e.bi_valid=0,Ic(e)}function Rc(e,t,r,n){be(e,(km<<1)+(n?1:0),3),zm(e,t,r,!0)}function $m(e){be(e,wc<<1,3),nt(e,ls,bt),Bm(e)}function Zm(e,t,r,n){var i,o,a=0;e.level>0?(e.strm.data_type===Pm&&(e.strm.data_type=Gm(e)),as(e,e.l_desc),as(e,e.d_desc),a=Um(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&t!==-1?Rc(e,t,r,n):e.strategy===Am||o===i?(be(e,(wc<<1)+(n?1:0),3),bc(e,bt,xn)):(be(e,(Mm<<1)+(n?1:0),3),qm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),bc(e,e.dyn_ltree,e.dyn_dtree)),Ic(e),n&&Oc(e)}function Hm(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(_n[r]+Sn+1)*2]++,e.dyn_dtree[Mc(t)*2]++),e.last_lit===e.lit_bufsize-1}Or._tr_init=Vm;Or._tr_stored_block=Rc;Or._tr_flush_block=Zm;Or._tr_tally=Hm;Or._tr_align=$m});var us=K((L5,Dc)=>{"use strict";function jm(e,t,r,n){for(var i=e&65535|0,o=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do i=i+t[n++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0}Dc.exports=jm});var ds=K((I5,Nc)=>{"use strict";function Ym(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var Wm=Ym();function Xm(e,t,r,n){var i=Wm,o=n+r;e^=-1;for(var a=n;a<o;a++)e=e>>>8^i[(e^t[a])&255];return e^-1}Nc.exports=Xm});var eo=K((O5,zc)=>{"use strict";zc.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Yc=K(at=>{"use strict";var ge=mt(),Fe=Bc(),Vc=us(),It=ds(),Km=eo(),Jt=0,Qm=1,Jm=3,Nt=4,Uc=5,ot=0,qc=1,Le=-2,e1=-3,hs=-5,t1=-1,r1=1,to=2,n1=3,i1=4,o1=0,a1=2,oo=8,s1=9,f1=15,l1=8,c1=29,u1=256,gs=u1+1+c1,d1=30,h1=19,p1=2*gs+1,g1=15,$=3,Bt=258,qe=Bt+$+1,m1=32,ao=42,ms=69,ro=73,no=91,io=103,Xt=113,Cn=666,se=1,An=2,Kt=3,Dr=4,b1=3;function Dt(e,t){return e.msg=Km[t],t}function Gc(e){return(e<<1)-(e>4?9:0)}function Rt(e){for(var t=e.length;--t>=0;)e[t]=0}function Ot(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(ge.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function le(e,t){Fe._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ot(e.strm)}function j(e,t){e.pending_buf[e.pending++]=t}function Tn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function y1(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,ge.arraySet(t,e.input,e.next_in,i,r),e.state.wrap===1?e.adler=Vc(e.adler,t,i,r):e.state.wrap===2&&(e.adler=It(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function $c(e,t){var r=e.max_chain_length,n=e.strstart,i,o,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-qe?e.strstart-(e.w_size-qe):0,f=e.window,c=e.w_mask,u=e.prev,d=e.strstart+Bt,h=f[n+a-1],g=f[n+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(f[i+a]!==g||f[i+a-1]!==h||f[i]!==f[n]||f[++i]!==f[n+1])){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<d);if(o=Bt-(d-n),n=d-Bt,o>a){if(e.match_start=t,a=o,o>=s)break;h=f[n+a-1],g=f[n+a]}}while((t=u[t&c])>l&&--r!==0);return a<=e.lookahead?a:e.lookahead}function Qt(e){var t=e.w_size,r,n,i,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-qe)){ge.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);o+=t}if(e.strm.avail_in===0)break;if(n=y1(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=$)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+$-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<$)););}while(e.lookahead<qe&&e.strm.avail_in!==0)}function x1(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Qt(e),e.lookahead===0&&t===Jt)return se;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,le(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-qe&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===Nt?(le(e,!0),e.strm.avail_out===0?Kt:Dr):(e.strstart>e.block_start&&(le(e,!1),e.strm.avail_out===0),se)}function ps(e,t){for(var r,n;;){if(e.lookahead<qe){if(Qt(e),e.lookahead<qe&&t===Jt)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-qe&&(e.match_length=$c(e,r)),e.match_length>=$)if(n=Fe._tr_tally(e,e.strstart-e.match_start,e.match_length-$),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=$){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Fe._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=e.strstart<$-1?e.strstart:$-1,t===Nt?(le(e,!0),e.strm.avail_out===0?Kt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function Rr(e,t){for(var r,n,i;;){if(e.lookahead<qe){if(Qt(e),e.lookahead<qe&&t===Jt)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=$-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-qe&&(e.match_length=$c(e,r),e.match_length<=5&&(e.strategy===r1||e.match_length===$&&e.strstart-e.match_start>4096)&&(e.match_length=$-1)),e.prev_length>=$&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-$,n=Fe._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-$),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=$-1,e.strstart++,n&&(le(e,!1),e.strm.avail_out===0))return se}else if(e.match_available){if(n=Fe._tr_tally(e,0,e.window[e.strstart-1]),n&&le(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return se}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Fe._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<$-1?e.strstart:$-1,t===Nt?(le(e,!0),e.strm.avail_out===0?Kt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function v1(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=Bt){if(Qt(e),e.lookahead<=Bt&&t===Jt)return se;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=$&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+Bt;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=Bt-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=$?(r=Fe._tr_tally(e,1,e.match_length-$),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Fe._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===Nt?(le(e,!0),e.strm.avail_out===0?Kt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function w1(e,t){for(var r;;){if(e.lookahead===0&&(Qt(e),e.lookahead===0)){if(t===Jt)return se;break}if(e.match_length=0,r=Fe._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===Nt?(le(e,!0),e.strm.avail_out===0?Kt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function it(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var Br;Br=[new it(0,0,0,0,x1),new it(4,4,8,4,ps),new it(4,5,16,8,ps),new it(4,6,32,32,ps),new it(4,4,16,16,Rr),new it(8,16,32,32,Rr),new it(8,16,128,128,Rr),new it(8,32,128,256,Rr),new it(32,128,258,1024,Rr),new it(32,258,258,4096,Rr)];function _1(e){e.window_size=2*e.w_size,Rt(e.head),e.max_lazy_match=Br[e.level].max_lazy,e.good_match=Br[e.level].good_length,e.nice_match=Br[e.level].nice_length,e.max_chain_length=Br[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=$-1,e.match_available=0,e.ins_h=0}function E1(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=oo,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ge.Buf16(p1*2),this.dyn_dtree=new ge.Buf16((2*d1+1)*2),this.bl_tree=new ge.Buf16((2*h1+1)*2),Rt(this.dyn_ltree),Rt(this.dyn_dtree),Rt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ge.Buf16(g1+1),this.heap=new ge.Buf16(2*gs+1),Rt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ge.Buf16(2*gs+1),Rt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Zc(e){var t;return!e||!e.state?Dt(e,Le):(e.total_in=e.total_out=0,e.data_type=a1,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?ao:Xt,e.adler=t.wrap===2?0:1,t.last_flush=Jt,Fe._tr_init(t),ot)}function Hc(e){var t=Zc(e);return t===ot&&_1(e.state),t}function S1(e,t){return!e||!e.state||e.state.wrap!==2?Le:(e.state.gzhead=t,ot)}function jc(e,t,r,n,i,o){if(!e)return Le;var a=1;if(t===t1&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>s1||r!==oo||n<8||n>15||t<0||t>9||o<0||o>i1)return Dt(e,Le);n===8&&(n=9);var s=new E1;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+$-1)/$),s.window=new ge.Buf8(s.w_size*2),s.head=new ge.Buf16(s.hash_size),s.prev=new ge.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new ge.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=(1+2)*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,Hc(e)}function T1(e,t){return jc(e,t,oo,f1,l1,o1)}function C1(e,t){var r,n,i,o;if(!e||!e.state||t>Uc||t<0)return e?Dt(e,Le):Le;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===Cn&&t!==Nt)return Dt(e,e.avail_out===0?hs:Le);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===ao)if(n.wrap===2)e.adler=0,j(n,31),j(n,139),j(n,8),n.gzhead?(j(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),j(n,n.gzhead.time&255),j(n,n.gzhead.time>>8&255),j(n,n.gzhead.time>>16&255),j(n,n.gzhead.time>>24&255),j(n,n.level===9?2:n.strategy>=to||n.level<2?4:0),j(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(j(n,n.gzhead.extra.length&255),j(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=It(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ms):(j(n,0),j(n,0),j(n,0),j(n,0),j(n,0),j(n,n.level===9?2:n.strategy>=to||n.level<2?4:0),j(n,b1),n.status=Xt);else{var a=oo+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=to||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,a|=s<<6,n.strstart!==0&&(a|=m1),a+=31-a%31,n.status=Xt,Tn(n,a),n.strstart!==0&&(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),e.adler=1}if(n.status===ms)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size));)j(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=ro)}else n.status=ro;if(n.status===ro)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.gzindex=0,n.status=no)}else n.status=no;if(n.status===no)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=It(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.status=io)}else n.status=io;if(n.status===io&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Ot(e),n.pending+2<=n.pending_buf_size&&(j(n,e.adler&255),j(n,e.adler>>8&255),e.adler=0,n.status=Xt)):n.status=Xt),n.pending!==0){if(Ot(e),e.avail_out===0)return n.last_flush=-1,ot}else if(e.avail_in===0&&Gc(t)<=Gc(r)&&t!==Nt)return Dt(e,hs);if(n.status===Cn&&e.avail_in!==0)return Dt(e,hs);if(e.avail_in!==0||n.lookahead!==0||t!==Jt&&n.status!==Cn){var l=n.strategy===to?w1(n,t):n.strategy===n1?v1(n,t):Br[n.level].func(n,t);if((l===Kt||l===Dr)&&(n.status=Cn),l===se||l===Kt)return e.avail_out===0&&(n.last_flush=-1),ot;if(l===An&&(t===Qm?Fe._tr_align(n):t!==Uc&&(Fe._tr_stored_block(n,0,0,!1),t===Jm&&(Rt(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Ot(e),e.avail_out===0))return n.last_flush=-1,ot}return t!==Nt?ot:n.wrap<=0?qc:(n.wrap===2?(j(n,e.adler&255),j(n,e.adler>>8&255),j(n,e.adler>>16&255),j(n,e.adler>>24&255),j(n,e.total_in&255),j(n,e.total_in>>8&255),j(n,e.total_in>>16&255),j(n,e.total_in>>24&255)):(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),Ot(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ot:qc)}function A1(e){var t;return!e||!e.state?Le:(t=e.state.status,t!==ao&&t!==ms&&t!==ro&&t!==no&&t!==io&&t!==Xt&&t!==Cn?Dt(e,Le):(e.state=null,t===Xt?Dt(e,e1):ot))}function P1(e,t){var r=t.length,n,i,o,a,s,l,f,c;if(!e||!e.state||(n=e.state,a=n.wrap,a===2||a===1&&n.status!==ao||n.lookahead))return Le;for(a===1&&(e.adler=Vc(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(a===0&&(Rt(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new ge.Buf8(n.w_size),ge.arraySet(c,t,r-n.w_size,n.w_size,0),t=c,r=n.w_size),s=e.avail_in,l=e.next_in,f=e.input,e.avail_in=r,e.next_in=0,e.input=t,Qt(n);n.lookahead>=$;){i=n.strstart,o=n.lookahead-($-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+$-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--o);n.strstart=i,n.lookahead=$-1,Qt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=$-1,n.match_available=0,e.next_in=l,e.input=f,e.avail_in=s,n.wrap=a,ot}at.deflateInit=T1;at.deflateInit2=jc;at.deflateReset=Hc;at.deflateResetKeep=Zc;at.deflateSetHeader=S1;at.deflate=C1;at.deflateEnd=A1;at.deflateSetDictionary=P1;at.deflateInfo="pako deflate (from Nodeca project)"});var bs=K(Nr=>{"use strict";var so=mt(),Wc=!0,Xc=!0;try{String.fromCharCode.apply(null,[0])}catch{Wc=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Xc=!1}var Pn=new so.Buf8(256);for(yt=0;yt<256;yt++)Pn[yt]=yt>=252?6:yt>=248?5:yt>=240?4:yt>=224?3:yt>=192?2:1;var yt;Pn[254]=Pn[254]=1;Nr.string2buf=function(e){var t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new so.Buf8(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|r&63):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|r&63):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|r&63);return t};function Kc(e,t){if(t<65534&&(e.subarray&&Xc||!e.subarray&&Wc))return String.fromCharCode.apply(null,so.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}Nr.buf2binstring=function(e){return Kc(e,e.length)};Nr.binstring2buf=function(e){for(var t=new so.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};Nr.buf2string=function(e,t){var r,n,i,o,a=t||e.length,s=new Array(a*2);for(n=0,r=0;r<a;){if(i=e[r++],i<128){s[n++]=i;continue}if(o=Pn[i],o>4){s[n++]=65533,r+=o-1;continue}for(i&=o===2?31:o===3?15:7;o>1&&r<a;)i=i<<6|e[r++]&63,o--;if(o>1){s[n++]=65533;continue}i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|i&1023)}return Kc(s,n)};Nr.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Pn[e[r]]>t?r:t}});var ys=K((D5,Qc)=>{"use strict";function k1(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}Qc.exports=k1});var ru=K(Fn=>{"use strict";var kn=Yc(),Mn=mt(),vs=bs(),ws=eo(),M1=ys(),tu=Object.prototype.toString,F1=0,xs=4,zr=0,Jc=1,eu=2,L1=-1,I1=0,O1=8;function er(e){if(!(this instanceof er))return new er(e);this.options=Mn.assign({level:L1,method:O1,chunkSize:16384,windowBits:15,memLevel:8,strategy:I1,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new M1,this.strm.avail_out=0;var r=kn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==zr)throw new Error(ws[r]);if(t.header&&kn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=vs.string2buf(t.dictionary):tu.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=kn.deflateSetDictionary(this.strm,n),r!==zr)throw new Error(ws[r]);this._dict_set=!0}}er.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;o=t===~~t?t:t===!0?xs:F1,typeof e=="string"?r.input=vs.string2buf(e):tu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Mn.Buf8(n),r.next_out=0,r.avail_out=n),i=kn.deflate(r,o),i!==Jc&&i!==zr)return this.onEnd(i),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===xs||o===eu))&&(this.options.to==="string"?this.onData(vs.buf2binstring(Mn.shrinkBuf(r.output,r.next_out))):this.onData(Mn.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&i!==Jc);return o===xs?(i=kn.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===zr):(o===eu&&(this.onEnd(zr),r.avail_out=0),!0)};er.prototype.onData=function(e){this.chunks.push(e)};er.prototype.onEnd=function(e){e===zr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Mn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function _s(e,t){var r=new er(t);if(r.push(e,!0),r.err)throw r.msg||ws[r.err];return r.result}function R1(e,t){return t=t||{},t.raw=!0,_s(e,t)}function B1(e,t){return t=t||{},t.gzip=!0,_s(e,t)}Fn.Deflate=er;Fn.deflate=_s;Fn.deflateRaw=R1;Fn.gzip=B1});var iu=K((z5,nu)=>{"use strict";var fo=30,D1=12;nu.exports=function(t,r){var n,i,o,a,s,l,f,c,u,d,h,g,x,T,_,v,M,L,I,B,N,p,m,b,y;n=t.state,i=t.next_in,b=t.input,o=i+(t.avail_in-5),a=t.next_out,y=t.output,s=a-(r-t.avail_out),l=a+(t.avail_out-257),f=n.dmax,c=n.wsize,u=n.whave,d=n.wnext,h=n.window,g=n.hold,x=n.bits,T=n.lencode,_=n.distcode,v=(1<<n.lenbits)-1,M=(1<<n.distbits)-1;e:do{x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),L=T[g&v];t:for(;;){if(I=L>>>24,g>>>=I,x-=I,I=L>>>16&255,I===0)y[a++]=L&65535;else if(I&16){B=L&65535,I&=15,I&&(x<I&&(g+=b[i++]<<x,x+=8),B+=g&(1<<I)-1,g>>>=I,x-=I),x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),L=_[g&M];r:for(;;){if(I=L>>>24,g>>>=I,x-=I,I=L>>>16&255,I&16){if(N=L&65535,I&=15,x<I&&(g+=b[i++]<<x,x+=8,x<I&&(g+=b[i++]<<x,x+=8)),N+=g&(1<<I)-1,N>f){t.msg="invalid distance too far back",n.mode=fo;break e}if(g>>>=I,x-=I,I=a-s,N>I){if(I=N-I,I>u&&n.sane){t.msg="invalid distance too far back",n.mode=fo;break e}if(p=0,m=h,d===0){if(p+=c-I,I<B){B-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}}else if(d<I){if(p+=c+d-I,I-=d,I<B){B-=I;do y[a++]=h[p++];while(--I);if(p=0,d<B){I=d,B-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}}}else if(p+=d-I,I<B){B-=I;do y[a++]=h[p++];while(--I);p=a-N,m=y}for(;B>2;)y[a++]=m[p++],y[a++]=m[p++],y[a++]=m[p++],B-=3;B&&(y[a++]=m[p++],B>1&&(y[a++]=m[p++]))}else{p=a-N;do y[a++]=y[p++],y[a++]=y[p++],y[a++]=y[p++],B-=3;while(B>2);B&&(y[a++]=y[p++],B>1&&(y[a++]=y[p++]))}}else if(I&64){t.msg="invalid distance code",n.mode=fo;break e}else{L=_[(L&65535)+(g&(1<<I)-1)];continue r}break}}else if(I&64)if(I&32){n.mode=D1;break e}else{t.msg="invalid literal/length code",n.mode=fo;break e}else{L=T[(L&65535)+(g&(1<<I)-1)];continue t}break}}while(i<o&&a<l);B=x>>3,i-=B,x-=B<<3,g&=(1<<x)-1,t.next_in=i,t.next_out=a,t.avail_in=i<o?5+(o-i):5-(i-o),t.avail_out=a<l?257+(l-a):257-(a-l),n.hold=g,n.bits=x}});var uu=K((U5,cu)=>{"use strict";var ou=mt(),Ur=15,au=852,su=592,fu=0,Es=1,lu=2,N1=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],z1=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],U1=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],q1=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];cu.exports=function(t,r,n,i,o,a,s,l){var f=l.bits,c=0,u=0,d=0,h=0,g=0,x=0,T=0,_=0,v=0,M=0,L,I,B,N,p,m=null,b=0,y,w=new ou.Buf16(Ur+1),S=new ou.Buf16(Ur+1),P=null,E=0,C,k,A;for(c=0;c<=Ur;c++)w[c]=0;for(u=0;u<i;u++)w[r[n+u]]++;for(g=f,h=Ur;h>=1&&w[h]===0;h--);if(g>h&&(g=h),h===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d<h&&w[d]===0;d++);for(g<d&&(g=d),_=1,c=1;c<=Ur;c++)if(_<<=1,_-=w[c],_<0)return-1;if(_>0&&(t===fu||h!==1))return-1;for(S[1]=0,c=1;c<Ur;c++)S[c+1]=S[c]+w[c];for(u=0;u<i;u++)r[n+u]!==0&&(s[S[r[n+u]]++]=u);if(t===fu?(m=P=s,y=19):t===Es?(m=N1,b-=257,P=z1,E-=257,y=256):(m=U1,P=q1,y=-1),M=0,u=0,c=d,p=a,x=g,T=0,B=-1,v=1<<g,N=v-1,t===Es&&v>au||t===lu&&v>su)return 1;for(;;){C=c-T,s[u]<y?(k=0,A=s[u]):s[u]>y?(k=P[E+s[u]],A=m[b+s[u]]):(k=32+64,A=0),L=1<<c-T,I=1<<x,d=I;do I-=L,o[p+(M>>T)+I]=C<<24|k<<16|A|0;while(I!==0);for(L=1<<c-1;M&L;)L>>=1;if(L!==0?(M&=L-1,M+=L):M=0,u++,--w[c]===0){if(c===h)break;c=r[n+s[u]]}if(c>g&&(M&N)!==B){for(T===0&&(T=g),p+=d,x=c-T,_=1<<x;x+T<h&&(_-=w[x+T],!(_<=0));)x++,_<<=1;if(v+=1<<x,t===Es&&v>au||t===lu&&v>su)return 1;B=M&N,o[B]=g<<24|x<<16|p-a|0}}return M!==0&&(o[p+M]=c-T<<24|64<<16|0),l.bits=g,0}});var Hu=K(Ge=>{"use strict";var Ce=mt(),ks=us(),st=ds(),G1=iu(),Ln=uu(),V1=0,Du=1,Nu=2,du=4,$1=5,lo=6,tr=0,Z1=1,H1=2,Ie=-2,zu=-3,Ms=-4,j1=-5,hu=8,Uu=1,pu=2,gu=3,mu=4,bu=5,yu=6,xu=7,vu=8,wu=9,_u=10,ho=11,xt=12,Ss=13,Eu=14,Ts=15,Su=16,Tu=17,Cu=18,Au=19,co=20,uo=21,Pu=22,ku=23,Mu=24,Fu=25,Lu=26,Cs=27,Iu=28,Ou=29,Q=30,Fs=31,Y1=32,W1=852,X1=592,K1=15,Q1=K1;function Ru(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function J1(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Ce.Buf16(320),this.work=new Ce.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function qu(e){var t;return!e||!e.state?Ie:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Uu,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Ce.Buf32(W1),t.distcode=t.distdyn=new Ce.Buf32(X1),t.sane=1,t.back=-1,tr)}function Gu(e){var t;return!e||!e.state?Ie:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,qu(e))}function Vu(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ie:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Gu(e))}function $u(e,t){var r,n;return e?(n=new J1,e.state=n,n.window=null,r=Vu(e,t),r!==tr&&(e.state=null),r):Ie}function eb(e){return $u(e,Q1)}var Bu=!0,As,Ps;function tb(e){if(Bu){var t;for(As=new Ce.Buf32(512),Ps=new Ce.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ln(Du,e.lens,0,288,As,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ln(Nu,e.lens,0,32,Ps,0,e.work,{bits:5}),Bu=!1}e.lencode=As,e.lenbits=9,e.distcode=Ps,e.distbits=5}function Zu(e,t,r,n){var i,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Ce.Buf8(o.wsize)),n>=o.wsize?(Ce.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),Ce.arraySet(o.window,t,r-n,i,o.wnext),n-=i,n?(Ce.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}function rb(e,t){var r,n,i,o,a,s,l,f,c,u,d,h,g,x,T=0,_,v,M,L,I,B,N,p,m=new Ce.Buf8(4),b,y,w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ie;r=e.state,r.mode===xt&&(r.mode=Ss),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,u=s,d=l,p=tr;e:for(;;)switch(r.mode){case Uu:if(r.wrap===0){r.mode=Ss;break}for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.wrap&2&&f===35615){r.check=0,m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0),f=0,c=0,r.mode=pu;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=Q;break}if((f&15)!==hu){e.msg="unknown compression method",r.mode=Q;break}if(f>>>=4,c-=4,N=(f&15)+8,r.wbits===0)r.wbits=N;else if(N>r.wbits){e.msg="invalid window size",r.mode=Q;break}r.dmax=1<<N,e.adler=r.check=1,r.mode=f&512?_u:xt,f=0,c=0;break;case pu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.flags=f,(r.flags&255)!==hu){e.msg="unknown compression method",r.mode=Q;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Q;break}r.head&&(r.head.text=f>>8&1),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0,r.mode=gu;case gu:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.time=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,m[2]=f>>>16&255,m[3]=f>>>24&255,r.check=st(r.check,m,4,0)),f=0,c=0,r.mode=mu;case mu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.xflags=f&255,r.head.os=f>>8),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0,r.mode=bu;case bu:if(r.flags&1024){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length=f,r.head&&(r.head.extra_len=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=st(r.check,m,2,0)),f=0,c=0}else r.head&&(r.head.extra=null);r.mode=yu;case yu:if(r.flags&1024&&(h=r.length,h>s&&(h=s),h&&(r.head&&(N=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Ce.arraySet(r.head.extra,n,o,h,N)),r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,r.length-=h),r.length))break e;r.length=0,r.mode=xu;case xu:if(r.flags&2048){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.name+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=vu;case vu:if(r.flags&4096){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.comment+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=st(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.comment=null);r.mode=wu;case wu:if(r.flags&512){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Q;break}f=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=xt;break;case _u:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}e.adler=r.check=Ru(f),f=0,c=0,r.mode=ho;case ho:if(r.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,H1;e.adler=r.check=1,r.mode=xt;case xt:if(t===$1||t===lo)break e;case Ss:if(r.last){f>>>=c&7,c-=c&7,r.mode=Cs;break}for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}switch(r.last=f&1,f>>>=1,c-=1,f&3){case 0:r.mode=Eu;break;case 1:if(tb(r),r.mode=co,t===lo){f>>>=2,c-=2;break e}break;case 2:r.mode=Tu;break;case 3:e.msg="invalid block type",r.mode=Q}f>>>=2,c-=2;break;case Eu:for(f>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if((f&65535)!==(f>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Q;break}if(r.length=f&65535,f=0,c=0,r.mode=Ts,t===lo)break e;case Ts:r.mode=Su;case Su:if(h=r.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;Ce.arraySet(i,n,o,h,a),s-=h,o+=h,l-=h,a+=h,r.length-=h;break}r.mode=xt;break;case Tu:for(;c<14;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.nlen=(f&31)+257,f>>>=5,c-=5,r.ndist=(f&31)+1,f>>>=5,c-=5,r.ncode=(f&15)+4,f>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Q;break}r.have=0,r.mode=Cu;case Cu:for(;r.have<r.ncode;){for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.lens[w[r.have++]]=f&7,f>>>=3,c-=3}for(;r.have<19;)r.lens[w[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,b={bits:r.lenbits},p=Ln(V1,r.lens,0,19,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid code lengths set",r.mode=Q;break}r.have=0,r.mode=Au;case Au:for(;r.have<r.nlen+r.ndist;){for(;T=r.lencode[f&(1<<r.lenbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(M<16)f>>>=_,c-=_,r.lens[r.have++]=M;else{if(M===16){for(y=_+2;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f>>>=_,c-=_,r.have===0){e.msg="invalid bit length repeat",r.mode=Q;break}N=r.lens[r.have-1],h=3+(f&3),f>>>=2,c-=2}else if(M===17){for(y=_+3;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=_,c-=_,N=0,h=3+(f&7),f>>>=3,c-=3}else{for(y=_+7;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=_,c-=_,N=0,h=11+(f&127),f>>>=7,c-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Q;break}for(;h--;)r.lens[r.have++]=N}}if(r.mode===Q)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Q;break}if(r.lenbits=9,b={bits:r.lenbits},p=Ln(Du,r.lens,0,r.nlen,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid literal/lengths set",r.mode=Q;break}if(r.distbits=6,r.distcode=r.distdyn,b={bits:r.distbits},p=Ln(Nu,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,b),r.distbits=b.bits,p){e.msg="invalid distances set",r.mode=Q;break}if(r.mode=co,t===lo)break e;case co:r.mode=uo;case uo:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,G1(e,d),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,r.mode===xt&&(r.back=-1);break}for(r.back=0;T=r.lencode[f&(1<<r.lenbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(v&&!(v&240)){for(L=_,I=v,B=M;T=r.lencode[B+((f&(1<<L+I)-1)>>L)],_=T>>>24,v=T>>>16&255,M=T&65535,!(L+_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=L,c-=L,r.back+=L}if(f>>>=_,c-=_,r.back+=_,r.length=M,v===0){r.mode=Lu;break}if(v&32){r.back=-1,r.mode=xt;break}if(v&64){e.msg="invalid literal/length code",r.mode=Q;break}r.extra=v&15,r.mode=Pu;case Pu:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ku;case ku:for(;T=r.distcode[f&(1<<r.distbits)-1],_=T>>>24,v=T>>>16&255,M=T&65535,!(_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(!(v&240)){for(L=_,I=v,B=M;T=r.distcode[B+((f&(1<<L+I)-1)>>L)],_=T>>>24,v=T>>>16&255,M=T&65535,!(L+_<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=L,c-=L,r.back+=L}if(f>>>=_,c-=_,r.back+=_,v&64){e.msg="invalid distance code",r.mode=Q;break}r.offset=M,r.extra=v&15,r.mode=Mu;case Mu:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.offset+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Q;break}r.mode=Fu;case Fu:if(l===0)break e;if(h=d-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Q;break}h>r.wnext?(h-=r.wnext,g=r.wsize-h):g=r.wnext-h,h>r.length&&(h=r.length),x=r.window}else x=i,g=a-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do i[a++]=x[g++];while(--h);r.length===0&&(r.mode=uo);break;case Lu:if(l===0)break e;i[a++]=r.length,l--,r.mode=uo;break;case Cs:if(r.wrap){for(;c<32;){if(s===0)break e;s--,f|=n[o++]<<c,c+=8}if(d-=l,e.total_out+=d,r.total+=d,d&&(e.adler=r.check=r.flags?st(r.check,i,d,a-d):ks(r.check,i,d,a-d)),d=l,(r.flags?f:Ru(f))!==r.check){e.msg="incorrect data check",r.mode=Q;break}f=0,c=0}r.mode=Iu;case Iu:if(r.wrap&&r.flags){for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Q;break}f=0,c=0}r.mode=Ou;case Ou:p=Z1;break e;case Q:p=zu;break e;case Fs:return Ms;case Y1:default:return Ie}return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,(r.wsize||d!==e.avail_out&&r.mode<Q&&(r.mode<Cs||t!==du))&&Zu(e,e.output,e.next_out,d-e.avail_out)?(r.mode=Fs,Ms):(u-=e.avail_in,d-=e.avail_out,e.total_in+=u,e.total_out+=d,r.total+=d,r.wrap&&d&&(e.adler=r.check=r.flags?st(r.check,i,d,e.next_out-d):ks(r.check,i,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===xt?128:0)+(r.mode===co||r.mode===Ts?256:0),(u===0&&d===0||t===du)&&p===tr&&(p=j1),p)}function nb(e){if(!e||!e.state)return Ie;var t=e.state;return t.window&&(t.window=null),e.state=null,tr}function ib(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Ie:(r.head=t,t.done=!1,tr)}function ob(e,t){var r=t.length,n,i,o;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==ho)?Ie:n.mode===ho&&(i=1,i=ks(i,t,r,0),i!==n.check)?zu:(o=Zu(e,t,r,r),o?(n.mode=Fs,Ms):(n.havedict=1,tr))}Ge.inflateReset=Gu;Ge.inflateReset2=Vu;Ge.inflateResetKeep=qu;Ge.inflateInit=eb;Ge.inflateInit2=$u;Ge.inflate=rb;Ge.inflateEnd=nb;Ge.inflateGetHeader=ib;Ge.inflateSetDictionary=ob;Ge.inflateInfo="pako inflate (from Nodeca project)"});var Ls=K((G5,ju)=>{"use strict";ju.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Wu=K((V5,Yu)=>{"use strict";function ab(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Yu.exports=ab});var Ku=K(On=>{"use strict";var qr=Hu(),In=mt(),po=bs(),oe=Ls(),Is=eo(),sb=ys(),fb=Wu(),Xu=Object.prototype.toString;function rr(e){if(!(this instanceof rr))return new rr(e);this.options=In.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new sb,this.strm.avail_out=0;var r=qr.inflateInit2(this.strm,t.windowBits);if(r!==oe.Z_OK)throw new Error(Is[r]);if(this.header=new fb,qr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=po.string2buf(t.dictionary):Xu.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=qr.inflateSetDictionary(this.strm,t.dictionary),r!==oe.Z_OK)))throw new Error(Is[r])}rr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s,l,f,c=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?oe.Z_FINISH:oe.Z_NO_FLUSH,typeof e=="string"?r.input=po.binstring2buf(e):Xu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new In.Buf8(n),r.next_out=0,r.avail_out=n),o=qr.inflate(r,oe.Z_NO_FLUSH),o===oe.Z_NEED_DICT&&i&&(o=qr.inflateSetDictionary(this.strm,i)),o===oe.Z_BUF_ERROR&&c===!0&&(o=oe.Z_OK,c=!1),o!==oe.Z_STREAM_END&&o!==oe.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===oe.Z_STREAM_END||r.avail_in===0&&(a===oe.Z_FINISH||a===oe.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=po.utf8border(r.output,r.next_out),l=r.next_out-s,f=po.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&In.arraySet(r.output,r.output,s,l,0),this.onData(f)):this.onData(In.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(c=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==oe.Z_STREAM_END);return o===oe.Z_STREAM_END&&(a=oe.Z_FINISH),a===oe.Z_FINISH?(o=qr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===oe.Z_OK):(a===oe.Z_SYNC_FLUSH&&(this.onEnd(oe.Z_OK),r.avail_out=0),!0)};rr.prototype.onData=function(e){this.chunks.push(e)};rr.prototype.onEnd=function(e){e===oe.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=In.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Os(e,t){var r=new rr(t);if(r.push(e,!0),r.err)throw r.msg||Is[r.err];return r.result}function lb(e,t){return t=t||{},t.raw=!0,Os(e,t)}On.Inflate=rr;On.inflate=Os;On.inflateRaw=lb;On.ungzip=Os});var ed=K((Z5,Ju)=>{"use strict";var cb=mt().assign,ub=ru(),db=Ku(),hb=Ls(),Qu={};cb(Qu,ub,db,hb);Ju.exports=Qu});var td=K(()=>{});var rd=K(Rs=>{Rs.read=function(e,t,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,f=l>>1,c=-7,u=r?i-1:0,d=r?-1:1,h=e[t+u];for(u+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=o*256+e[t+u],u+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+e[t+u],u+=d,c-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(h?-1:1)*a*Math.pow(2,o-n)};Rs.write=function(e,t,r,n,i,o){var a,s,l,f=o*8-i-1,c=(1<<f)-1,u=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,g=n?1:-1,x=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+u>=1?t+=d/l:t+=d*Math.pow(2,1-u),t*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*l-1)*Math.pow(2,i),a=a+u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=s&255,h+=g,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;e[r+h]=a&255,h+=g,a/=256,f-=8);e[r+h-g]|=x*128}});var fd=K((l7,sd)=>{"use strict";sd.exports=Y;var mo=rd();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 Bs=(1<<16)*(1<<16),nd=1/Bs,pb=12,ad=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");Y.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=bo(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=od(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=bo(this.buf,this.pos)+bo(this.buf,this.pos+4)*Bs;return this.pos+=8,e},readSFixed64:function(){var e=bo(this.buf,this.pos)+od(this.buf,this.pos+4)*Bs;return this.pos+=8,e},readFloat:function(){var e=mo.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=mo.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,gb(r,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>=pb&&ad?kb(this.buf,t,e):Pb(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 r=wt(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Y.Bytes)return e.push(this.readSVarint());var t=wt(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=wt(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=wt(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=wt(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=wt(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=wt(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=wt(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=wt(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 r=new Uint8Array(t);r.set(this.buf),this.buf=r,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),Zr(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Zr(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Zr(this.buf,e&-1,this.pos),Zr(this.buf,Math.floor(e*nd),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Zr(this.buf,e&-1,this.pos),Zr(this.buf,Math.floor(e*nd),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){mb(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=Mb(this.buf,e,this.pos);var r=this.pos-t;r>=128&&id(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),mo.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),mo.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 r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&id(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,Y.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,xb,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,vb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Eb,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,wb,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,_b,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Sb,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Tb,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Cb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Ab,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 gb(e,t,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return $r(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function wt(e){return e.type===Y.Bytes?e.readVarint()+e.pos:e.pos+1}function $r(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function mb(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),bb(r,n,t),yb(n,t)}function bb(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function yb(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((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 id(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function xb(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function vb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function wb(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function _b(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Eb(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Sb(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Tb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Cb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Ab(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function bo(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function Zr(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function od(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Pb(e,t,r){for(var n="",i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var l,f,c;s===1?o<128&&(a=o):s===2?(l=e[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=e[i+1],f=e[i+2],(l&192)===128&&(f&192)===128&&(a=(o&15)<<12|(l&63)<<6|f&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=e[i+1],f=e[i+2],c=e[i+3],(l&192)===128&&(f&192)===128&&(c&192)===128&&(a=(o&15)<<18|(l&63)<<12|(f&63)<<6|c&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}function kb(e,t,r){return ad.decode(e.subarray(t,r))}function Mb(e,t,r){for(var n=0,i,o;n<t.length;n++){if(i=t.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):o=i;continue}else o&&(e[r++]=239,e[r++]=191,e[r++]=189,o=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=i&63|128)}return r}});var Qd=K((E4,Zs)=>{"use strict";Zs.exports=Oo;Zs.exports.default=Oo;function Oo(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,o=Wd(e,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;var s,l,f,c,u,d,h;if(n&&(o=uy(e,t,o,r)),e.length>80*r){s=f=e[0],l=c=e[1];for(var g=r;g<i;g+=r)u=e[g],d=e[g+1],u<s&&(s=u),d<l&&(l=d),u>f&&(f=u),d>c&&(c=d);h=Math.max(f-s,c-l),h=h!==0?32767/h:0}return fi(o,a,r,s,l,h,0),a}function Wd(e,t,r,n,i){var o,a;if(i===$s(e,t,r,n)>0)for(o=t;o<r;o+=n)a=Yd(o,e[o],e[o+1],a);else for(o=r-n;o>=t;o-=n)a=Yd(o,e[o],e[o+1],a);return a&&Ro(a,a.next)&&(ci(a),a=a.next),a}function lr(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(Ro(r,r.next)||ee(r.prev,r,r.next)===0)){if(ci(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function fi(e,t,r,n,i,o,a){if(e){!a&&o&&my(e,n,i,o);for(var s=e,l,f;e.prev!==e.next;){if(l=e.prev,f=e.next,o?fy(e,n,i,o):sy(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(f.i/r|0),ci(e),e=f.next,s=f.next;continue}if(e=f,e===s){a?a===1?(e=ly(lr(e),t,r),fi(e,t,r,n,i,o,2)):a===2&&cy(e,t,r,n,i,o):fi(lr(e),t,r,n,i,o,1);break}}}}function sy(e){var t=e.prev,r=e,n=e.next;if(ee(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,a=n.x,s=t.y,l=r.y,f=n.y,c=i<o?i<a?i:a:o<a?o:a,u=s<l?s<f?s:f:l<f?l:f,d=i>o?i>a?i:a:o>a?o:a,h=s>l?s>f?s:f:l>f?l:f,g=n.next;g!==t;){if(g.x>=c&&g.x<=d&&g.y>=u&&g.y<=h&&Yr(i,s,o,l,a,f,g.x,g.y)&&ee(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function fy(e,t,r,n){var i=e.prev,o=e,a=e.next;if(ee(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,f=a.x,c=i.y,u=o.y,d=a.y,h=s<l?s<f?s:f:l<f?l:f,g=c<u?c<d?c:d:u<d?u:d,x=s>l?s>f?s:f:l>f?l:f,T=c>u?c>d?c:d:u>d?u:d,_=Gs(h,g,t,r,n),v=Gs(x,T,t,r,n),M=e.prevZ,L=e.nextZ;M&&M.z>=_&&L&&L.z<=v;){if(M.x>=h&&M.x<=x&&M.y>=g&&M.y<=T&&M!==i&&M!==a&&Yr(s,c,l,u,f,d,M.x,M.y)&&ee(M.prev,M,M.next)>=0||(M=M.prevZ,L.x>=h&&L.x<=x&&L.y>=g&&L.y<=T&&L!==i&&L!==a&&Yr(s,c,l,u,f,d,L.x,L.y)&&ee(L.prev,L,L.next)>=0))return!1;L=L.nextZ}for(;M&&M.z>=_;){if(M.x>=h&&M.x<=x&&M.y>=g&&M.y<=T&&M!==i&&M!==a&&Yr(s,c,l,u,f,d,M.x,M.y)&&ee(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;L&&L.z<=v;){if(L.x>=h&&L.x<=x&&L.y>=g&&L.y<=T&&L!==i&&L!==a&&Yr(s,c,l,u,f,d,L.x,L.y)&&ee(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function ly(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!Ro(i,o)&&Xd(i,n,n.next,o)&&li(i,o)&&li(o,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),ci(n),ci(n.next),n=e=o),n=n.next}while(n!==e);return lr(n)}function cy(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&xy(a,s)){var l=Kd(a,s);a=lr(a,a.next),l=lr(l,l.next),fi(a,t,r,n,i,o,0),fi(l,t,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==e)}function uy(e,t,r,n){var i=[],o,a,s,l,f;for(o=0,a=t.length;o<a;o++)s=t[o]*n,l=o<a-1?t[o+1]*n:e.length,f=Wd(e,s,l,n,!1),f===f.next&&(f.steiner=!0),i.push(yy(f));for(i.sort(dy),o=0;o<i.length;o++)r=hy(i[o],r);return r}function dy(e,t){return e.x-t.x}function hy(e,t){var r=py(e,t);if(!r)return t;var n=Kd(r,e);return lr(n,n.next),lr(r,r.next)}function py(e,t){var r=t,n=e.x,i=e.y,o=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>o&&(o=s,a=r.x<r.next.x?r:r.next,s===n))return a}r=r.next}while(r!==t);if(!a)return null;var l=a,f=a.x,c=a.y,u=1/0,d;r=a;do n>=r.x&&r.x>=f&&n!==r.x&&Yr(i<c?n:o,i,f,c,i<c?o:n,i,r.x,r.y)&&(d=Math.abs(i-r.y)/(n-r.x),li(r,e)&&(d<u||d===u&&(r.x>a.x||r.x===a.x&&gy(a,r)))&&(a=r,u=d)),r=r.next;while(r!==l);return a}function gy(e,t){return ee(e.prev,e,t.prev)<0&&ee(t.next,e,e.next)<0}function my(e,t,r,n){var i=e;do i.z===0&&(i.z=Gs(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,by(i)}function by(e){var t,r,n,i,o,a,s,l,f=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t<f&&(s++,n=n.nextZ,!!n);t++);for(l=f;s>0||l>0&&n;)s!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,f*=2}while(a>1);return e}function Gs(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|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 yy(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function Yr(e,t,r,n,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function xy(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!vy(e,t)&&(li(e,t)&&li(t,e)&&wy(e,t)&&(ee(e.prev,e,t.prev)||ee(e,t.prev,t))||Ro(e,t)&&ee(e.prev,e,e.next)>0&&ee(t.prev,t,t.next)>0)}function ee(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Ro(e,t){return e.x===t.x&&e.y===t.y}function Xd(e,t,r,n){var i=Io(ee(e,t,r)),o=Io(ee(e,t,n)),a=Io(ee(r,n,e)),s=Io(ee(r,n,t));return!!(i!==o&&a!==s||i===0&&Lo(e,r,t)||o===0&&Lo(e,n,t)||a===0&&Lo(r,e,n)||s===0&&Lo(r,t,n))}function Lo(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Io(e){return e>0?1:e<0?-1:0}function vy(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Xd(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function li(e,t){return ee(e.prev,e,e.next)<0?ee(e,t,e.next)>=0&&ee(e,e.prev,t)>=0:ee(e,t,e.prev)<0||ee(e,e.next,t)<0}function wy(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function Kd(e,t){var r=new Vs(e.i,e.x,e.y),n=new Vs(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Yd(e,t,r,n){var i=new Vs(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ci(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)}function Vs(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Oo.deviation=function(e,t,r,n){var i=t&&t.length,o=i?t[0]*r:e.length,a=Math.abs($s(e,0,o,r));if(i)for(var s=0,l=t.length;s<l;s++){var f=t[s]*r,c=s<l-1?t[s+1]*r:e.length;a-=Math.abs($s(e,f,c,r))}var u=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,h=n[s+1]*r,g=n[s+2]*r;u+=Math.abs((e[d]-e[g])*(e[h+1]-e[d+1])-(e[d]-e[h])*(e[g+1]-e[d+1]))}return a===0&&u===0?0:Math.abs((u-a)/a)};function $s(e,t,r,n){for(var i=0,o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}Oo.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[i][o][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}});var oh=K((P4,ih)=>{ih.exports=globalThis.deck});var Cr={};Va(Cr,{carto:()=>Q_});var Ua={};Va(Ua,{BASEMAP:()=>bg,CARTO_LAYERS:()=>K_,CARTO_SOURCES:()=>Xp,CartoAPIError:()=>Sr,ClusterTileLayer:()=>jn,H3TileLayer:()=>sr,HeatmapTileLayer:()=>ei,LayerFactory:()=>vl,PointLabelLayer:()=>ni,QuadbinTileLayer:()=>fr,RasterTileLayer:()=>si,SOURCE_DEFAULTS:()=>Oi,VectorTileLayer:()=>Xr,_GOOGLE_BASEMAPS:()=>Da,_QuadbinLayer:()=>Eo,_RasterLayer:()=>Fo,_STYLE_LAYER_GROUPS:()=>gl,_SpatialIndexTileLayer:()=>Hr,_applyLayerGroupFilters:()=>Na,_fetchStyle:()=>za,_getStyleUrl:()=>Qe,boundaryQuerySource:()=>il,boundaryTableSource:()=>ol,colorBins:()=>bl,colorCategories:()=>yl,colorContinuous:()=>xl,fetchBasemapProps:()=>_g,fetchMap:()=>vg,h3QuerySource:()=>Ta,h3TableSource:()=>Ca,h3TilesetSource:()=>fl,quadbinQuerySource:()=>Pa,quadbinTableSource:()=>ka,quadbinTilesetSource:()=>ll,query:()=>Kp,rasterSource:()=>Ma,vectorQuerySource:()=>Fa,vectorTableSource:()=>La,vectorTilesetSource:()=>Ia});var yd=q(Mt(),1),xd=q(gt(),1),vd=q(pn(),1);function $a(e,t){let r=t?.globalFeatureId;return r!==void 0?Mg(e,r):Fg(e,t?.type)}function Mg(e,t){let r=Cl(e);for(let n of r){let i=0,o=n.featureIds.value[0];for(let a=0;a<n.featureIds.value.length;a++){let s=n.featureIds.value[a];if(s!==o){if(t===n.globalFeatureIds.value[i])return Vi(n,i,a);i=a,o=s}}if(t===n.globalFeatureIds.value[i])return Vi(n,i,n.featureIds.value.length)}throw new Error(`featureId:${t} not found`)}function Fg(e,t){let r=Cl(e,t);return Lg(r)}function Tl(e,t,r){switch(e.type){case"Point":return Bg(e,t,r);case"LineString":return Rg(e,t,r);case"Polygon":return Al(e,t,r);default:let n=e;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function Cl(e,t){let r=[];return e.points&&(e.points.type="Point",r.push(e.points)),e.lines&&(e.lines.type="LineString",r.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",r.push(e.polygons)),r}function Lg(e){let t=[];for(let r of e){if(r.featureIds.value.length===0)continue;let n=0,i=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let a=r.featureIds.value[o];a!==i&&(t.push(Vi(r,n,o)),n=o,i=a)}t.push(Vi(r,n,r.featureIds.value.length))}return t}function Vi(e,t,r){let n=Tl(e,t,r),i=Og(e,t,r),o=Ig(e,t,r);return{type:"Feature",geometry:n,properties:i,...o}}function Ig(e,t=0,r){return e.fields&&e.fields[e.featureIds.value[t]]}function Og(e,t=0,r){let n=Object.assign({},e.properties[e.featureIds.value[t]]);for(let i in e.numericProps)n[i]=e.numericProps[i].value[t];return n}function Al(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.polygonIndices.value.filter(l=>l>=t&&l<=r),o=e.primitivePolygonIndices.value.filter(l=>l>=t&&l<=r);if(!(i.length>2)){let l=[];for(let f=0;f<o.length-1;f++){let c=o[f],u=o[f+1],d=$i(n,c,u);l.push(d)}return{type:"Polygon",coordinates:l}}let s=[];for(let l=0;l<i.length-1;l++){let f=i[l],c=i[l+1],u=Al(e,f,c).coordinates;s.push(u)}return{type:"MultiPolygon",coordinates:s}}function Rg(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.pathIndices.value.filter(s=>s>=t&&s<=r);if(!(i.length>2))return{type:"LineString",coordinates:$i(n,i[0],i[1])};let a=[];for(let s=0;s<i.length-1;s++){let l=$i(n,i[s],i[s+1]);a.push(l)}return{type:"MultiLineString",coordinates:a}}function Bg(e,t,r){let{positions:n}=e,i=$i(n,t,r);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function $i(e,t,r){t=t||0,r=r||e.value.length/e.size;let n=[];for(let i=t;i<r;i++){let o=Array();for(let a=i*e.size;a<(i+1)*e.size;a++)o.push(Number(e.value[a]));n.push(o)}return n}var Vn=q(Se(),1);var dm=q(Gl(),1);var jt=Math.PI,Jg=jt/4,h3=jt/180,Vl=180/jt,$l=512;function Te(e){let[t,r]=e,n=t/$l*(2*jt)-jt,i=2*(Math.atan(Math.exp(r/$l*(2*jt)-jt))-Jg);return[n*Vl,i*Vl]}var w3=Math.PI/180;var jl=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],Yl=[0n,1n,2n,4n,8n,16n];function Wl(e){return BigInt(`0x${e}`)}function gn(e){return e.toString(16)}function Xl(e){if(e.z<0||e.z>26)throw new Error("Wrong zoom");let t=BigInt(e.z),r=BigInt(e.x)<<32n-t,n=BigInt(e.y)<<32n-t;for(let o=0;o<5;o++){let a=Yl[5-o],s=jl[4-o];r=(r|r<<a)&s,n=(n|n<<a)&s}return 0x4000000000000000n|1n<<59n|t<<52n|(r|n<<1n)>>12n|0xfffffffffffffn>>t*2n}function Hi(e){let t=e>>59n&7n,r=e>>57n&3n,n=e>>52n&0x1fn,i=(e&0xfffffffffffffn)<<12n;if(t!==1n&&r!==0n)throw new Error("Wrong mode");let o=i,a=i>>1n;for(let s=0;s<6;s++){let l=Yl[s],f=jl[s];o=(o|o>>l)&f,a=(a|a>>l)&f}return o=o>>32n-n,a=a>>32n-n,{z:Number(n),x:Number(o),y:Number(a)}}function mn(e){return e>>52n&0x1fn}function ji(e){let t=mn(e)-1n;return e&~(0x1fn<<52n)|t<<52n|0xfffffffffffffn>>t*2n}var Wi=q(Yt(),1),ec=q(Se(),1);var Ql=q(Se(),1);function Me(e,t){Ql.log.assert(e,t)}function Jl(e,t){let{properties:r,numericProps:n}=e;return new Proxy(r[t]||{},{get(i,o){return o in n?n[o].value[t]:i[o]},has(i,o){return o in n||o in i},ownKeys(i){return[...Object.keys(n),...Reflect.ownKeys(i)]},getOwnPropertyDescriptor(i,o){return{enumerable:!0,configurable:!0}}})}function Ft(e,t){return`https://unpkg.com/@deck.gl/carto@${t}/dist/${e}-worker.js`}var bn=new Uint16Array,Wa={positions:{value:new Float32Array,size:2},properties:[],numericProps:{},featureIds:{value:bn,size:1},globalFeatureIds:{value:bn,size:1}};function Yi(){return{shape:"binary-feature-collection",points:{type:"Point",...Wa},lines:{type:"LineString",pathIndices:{value:bn,size:1},...Wa},polygons:{type:"Polygon",polygonIndices:{value:bn,size:1},primitivePolygonIndices:{value:bn,size:1},...Wa}}}function yn(e,t,r,n,i,o=2){return{type:"Point",positions:{value:new Float32Array(e),size:o},featureIds:{value:new Uint16Array(t),size:1},globalFeatureIds:{value:new Uint32Array(r),size:1},numericProps:n,properties:i}}function Xa(e,t){let r={};return t&&Object.keys(t).forEach(n=>{r[n]={value:new Float32Array(e),size:1}}),r}function Ka(e,t,r,n){Object.keys(e).forEach(i=>{t[i].value[n]=e[i].value[r]})}function tc(e,t,r,n=[],i,o,a="quadbin"){if(!e.content)return!1;e.userData||(e.userData={});let s=t.get(r)?.[0];if(s){if(n.every(f=>f.name in s))return!1;t.clear()}let l={};for(let f of e.content){let c=f.id,u=typeof i=="function"?i(f,{}):i;for(let T=0;T<r-1;T++)if(a==="h3"){let _=(0,Wi.getResolution)(c);c=(0,Wi.cellToParent)(c,Math.max(0,_-1))}else c=ji(c);let d=String(c);if(!(d in l)){l[d]={id:c,count:0,position:[0,0]};for(let{name:T,aggregation:_}of n)_==="any"?l[d][T]=f.properties[T]:l[d][T]=0}let h=l[d].count;l[d].count+=typeof o=="function"?o(f,{}):o;let g=l[d].count,x=g-h;l[d].position[0]=(h*l[d].position[0]+x*u[0])/g,l[d].position[1]=(h*l[d].position[1]+x*u[1])/g;for(let{name:T,aggregation:_}of n){let v=l[d][T],M=f.properties[T];_==="average"?l[d][T]=(h*v+x*M)/g:_==="count"||_==="sum"?l[d][T]=v+M:_==="max"?l[d][T]=Math.max(v,M):_==="min"&&(l[d][T]=Math.min(v,M))}}return t.set(r,Object.values(l)),!0}function rc(e){let t=[],r=["any","average","count","min","max","sum"];for(let n of Object.keys(e.content[0].properties)){let i=n.split("_").pop().toLowerCase();r.includes(i)||(ec.log.warn(`No valid aggregation present in ${n} property`)(),i="any"),t.push({name:n,aggregation:i})}return t}function nc(e,t){let r={};for(let{name:n,aggregation:i}of t)if(r[n]={min:1/0,max:-1/0},i!=="any")for(let o of e)r[n].min=Math.min(r[n].min,o[n]),r[n].max=Math.max(r[n].max,o[n]);return r}function ic(e){let t=new Float32Array(e.length*2),r=new Uint16Array(e.length);for(let n=0;n<e.length;n++)t.set(e[n].position,2*n),r[n]=n;return{...Yi(),points:yn(t,r,r,{},e)}}var oc=q(gt(),1);var tt=class extends oc._Tileset2D{getTileIndices(t){return super.getTileIndices(t).map(Xl).map(r=>({q:r,i:gn(r)}))}getTileId({q:t,i:r}){return r||gn(t)}getTileMetadata({q:t}){return super.getTileMetadata(Hi(t))}getTileZoom({q:t}){return Number(mn(t))}getParentIndex({q:t}){return{q:ji(t)}}};var sc=q(gt(),1),ie=q(Yt(),1),ac=85.051128;function fc({west:e,north:t,east:r,south:n},i,o=1){let l=[[t,r],[n,r],[n,e],[t,e]].map(u=>(0,ie.latLngToCell)(u[0],u[1],i)).map(u=>Math.max(...(0,ie.originToDirectedEdges)(u).map(d=>(0,ie.edgeLength)(d,ie.UNITS.rads)))*180/Math.PI),f=Math.max(...l)*o,c=Math.min(180,f/Math.cos((t+n)/2*Math.PI/180));return{north:Math.min(t+f,ac),east:r+c,south:Math.max(n-f,-ac),west:e-c}}function lc({west:e,north:t,east:r,south:n},i){let o=Math.abs(r-e);if(o>180){let s=Math.ceil(o/180),l=[];for(let f=0;f<s;f++){let c=e+f*180,u=Math.min(c+179.9999999,r);l=l.concat(lc({west:c,north:t,east:u,south:n},i))}return[...new Set(l)]}return(0,ie.polygonToCells)([[t,r],[n,r],[n,e],[t,e],[t,r]],i)}function hm(e){let t=(0,ie.cellToBoundary)(e),r=t.map(f=>f[0]),n=t.map(f=>f[1]),i=Math.min(...n),o=Math.min(...r),a=Math.max(...n),s=Math.max(...r);return fc({west:i,south:o,east:a,north:s},(0,ie.getResolution)(e),.12)}var pm=2;function Pr(e,t){let r=Math.log2(t/512),n=2/3*(e.zoom-r),i=Math.log(1/Math.cos(Math.PI*e.latitude/180));return Math.max(0,Math.floor(n+i-pm))}var Lt=class extends sc._Tileset2D{getTileIndices({viewport:t,minZoom:r,maxZoom:n}){if(t.latitude===void 0)return[];let[i,o,a,s]=t.getBounds(),{tileSize:l}=this.opts,f=Pr(t,l),c;if(typeof r=="number"&&Number.isFinite(r)&&f<r)return[];if(typeof n=="number"&&Number.isFinite(n)&&f>n){f=n;let u=(0,ie.latLngToCell)(t.latitude,t.longitude,n);c=(0,ie.gridDisk)(u,1)}else{let u=fc({west:i,north:s,east:a,south:o},f);c=lc(u,f)}return c.map(u=>({i:u}))}getTileId({i:t}){return t}getTileMetadata({i:t}){return{bbox:hm(t)}}getTileZoom({i:t}){return(0,ie.getResolution)(t)}getParentIndex(t){let r=(0,ie.getResolution)(t.i);return{i:(0,ie.cellToParent)(t.i,r-1)}}};var cc=512;function Qa(e){let{x:t,y:r,z:n}=Hi(e),i=cc/(1<<n);return[t*i,cc-r*i,i]}function gm(e,t){let[r,n,i]=Qa(e);return[[r,n],[r+t*i,n-t*i]]}function Xi(e,t=1){let[r,n]=gm(e,t),[i,o]=Te(r),[a,s]=Te(n);return[a,o,a,s,i,s,i,o,a,o]}var xo=q(Yt(),1);var rt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},mm=rt.self||rt.window||rt.global||{},bm=rt.window||rt.self||rt.global||{},ym=rt.global||rt.self||rt.window||{},xm=rt.document||{};var kr=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var uc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),vm=uc&&parseFloat(uc[1])||0;function Ja(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function dc(...e){return wm(e)}function wm(e){let t=e.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=t.reduce((o,a)=>o+a.byteLength,0),n=new Uint8Array(r),i=0;for(let o of t)n.set(o,i),i+=o.byteLength;return n.buffer}async function es(e){let t=[];for await(let r of e)t.push(r);return dc(...t)}function hc(e){return e&&typeof e=="object"&&e.isBuffer}function Mr(e){if(hc(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Fr(e){return t=>new Promise((r,n)=>e(t,(i,o)=>i?n(i):r(o)))}var Ki=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){Ja(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return es(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var nr=q(ed(),1),vt=q(td(),1),go=class extends Ki{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!kr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Fr(vt.default.gzip)(t):await Fr(vt.default.deflate)(t);return Mr(r)}return this.compressSync(t)}async decompress(t){if(!kr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Fr(vt.default.gunzip)(t):await Fr(vt.default.inflate)(t);return Mr(r)}return this.decompressSync(t)}compressSync(t){if(!kr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gzipSync(t):vt.default.deflateSync(t);return Mr(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?nr.default.deflateRaw:nr.default.deflate)(n,r).buffer}decompressSync(t){if(!kr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gunzipSync(t):vt.default.inflateSync(t);return Mr(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?nr.default.inflateRaw:nr.default.inflate)(n,r).buffer}async*compressBatches(t){let r=this.options?.deflate||{},n=new nr.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new nr.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let a of r){let s=new Uint8Array(a);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var Rn=class extends go{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(t){super({...t,deflate:{...t?.gzip,gzip:!0}})}};function ir(e,t,r,n){let i=t.type===2?t.readVarint()+t.pos:t.pos+1,o=t.buf.buffer.slice(t.pos,i);if(n?.compression==="gzip"){let s=new Rn().decompressSync(o);r.value=new e(s)}else r.value=new e(o);return t.pos=i,r.value}var Bn=class{static read(t,r){return t.readFields(Bn._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=n.readString())}},Ve=class{static read(t,r){return t.readFields(Ve._readField,{},r)}static _readField(t,r,n){if(t===1){let{key:i,value:o}=Bn.read(n,n.readVarint()+n.pos);r[i]=o}}},or=class{static read(t,r){let{value:n,size:i}=t.readFields(or._readField,{value:[],size:0},r);return{value:n,size:i}}static _readField(t,r,n){t===1?ir(Float64Array,n,r):t===2&&(r.size=n.readVarint(!0))}},ye=class{static read(t,r){let{value:n,size:i}=t.readFields(ye._readField,{value:[],size:0},r);return{value:new Uint32Array(n),size:i}}static _readField(t,r,n){t===1?n.readPackedVarint(r.value):t===2&&(r.size=n.readVarint(!0))}},ar=class{static read(t,r){return t.readFields(ar._readField,{id:0},r)}static _readField(t,r,n){t===1&&(r.id=n.readVarint())}},Dn=class{static read(t,r){return t.readFields(Dn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&ir(Float64Array,n,r)}},$e=class{static read(t,r){return t.readFields($e._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=Dn.read(n,n.readVarint()+n.pos))}},Nn=class{static read(t,r){return t.readFields(Nn._readField,{positions:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=or.read(n,n.readVarint()+n.pos);else if(t===2)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===5){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===6&&r.fields.push(ar.read(n,n.readVarint()+n.pos))}},zn=class{static read(t,r){return t.readFields(zn._readField,{positions:null,pathIndices:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=or.read(n,n.readVarint()+n.pos);else if(t===2)r.pathIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===6){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===7&&r.fields.push(ar.read(n,n.readVarint()+n.pos))}},Un=class{static read(t,r){return t.readFields(Un._readField,{positions:null,polygonIndices:null,globalFeatureIds:null,featureIds:null,primitivePolygonIndices:null,triangles:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=or.read(n,n.readVarint()+n.pos);else if(t===2)r.polygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.primitivePolygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===6)r.triangles=ye.read(n,n.readVarint()+n.pos);else if(t===7)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===8){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===9&&r.fields.push(ar.read(n,n.readVarint()+n.pos))}},Gr=class{static read(t,r){return t.readFields(Gr._readField,{points:null,lines:null,polygons:null},r)}static _readField(t,r,n){t===1?r.points=Nn.read(n,n.readVarint()+n.pos):t===2?r.lines=zn.read(n,n.readVarint()+n.pos):t===3&&(r.polygons=Un.read(n,n.readVarint()+n.pos))}};var qn=class{static read(t,r){return t.readFields(qn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&ir(BigUint64Array,n,r)}},Gn=class{static read(t,r){return t.readFields(Gn._readField,{indices:null,properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.indices=qn.read(n,n.readVarint()+n.pos);else if(t===2)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===3){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}},Vr=class{static read(t,r){return t.readFields(Vr._readField,{scheme:0,cells:null},r)}static _readField(t,r,n){t===1?r.scheme=n.readVarint():t===2&&(r.cells=Gn.read(n,n.readVarint()+n.pos))}};var ld=q(fd(),1);function zt(e,t){let r=new ld.default(e);return t.read(r)}function cd(e){let{cells:t,scheme:r}=e,n=t.indices.value.length,i=[];for(let o=0;o<n;o++){let a=r==="h3"?gn(t.indices.value[o]):t.indices.value[o],s={...t.properties[o]};for(let l of Object.keys(t.numericProps))s[l]=t.numericProps[l].value[o];i.push({id:a,properties:s})}return i}var dd="9.2.2",hd="cartoSpatialTile",Fb={cartoSpatialTile:{scheme:"quadbin",workerUrl:Ft(hd,dd)}},Lb={name:"CARTO Spatial Tile",version:dd,id:hd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-spatial-tile"],category:"geometry",parse:async(e,t)=>ud(e,t),parseSync:ud,worker:!0,options:Fb};function ud(e,t){if(!e)return null;let r=zt(e,Vr),{cells:n}=r,i=t?.cartoSpatialTile?.scheme;return cd({cells:n,scheme:i})}var yo=Lb;var pd=q(Se(),1),gd=q(Se(),1);function Ze(e,t,r=0){if(!e)return t;if(!t)return e;if(r>10)return t;let n={...e};for(let i in t){let o=t[i];o===e||o===t||(typeof o=="object"&&o!==null?n[i]=Ze(e[i],o,r+1):n[i]=o)}return n}function md(e,t){let r={};for(let{geoid:n,...i}of t.properties)n in r?pd.log.warn("Duplicate geoid key in boundary mapping, using first occurance")():r[n]=i;for(let n of["points","lines","polygons"]){let i=e[n];if(i.positions.value.length===0)continue;i.properties=i.properties.map(({geoid:f})=>r[f]);let{positions:o,globalFeatureIds:a}=i,s=null;n==="lines"&&(s=i.pathIndices.value),n==="polygons"&&(s=i.polygonIndices.value);let l=o.value.length/o.size;for(let f in t.numericProps){let c=t.numericProps[f].value,u=c.constructor,d=new u(l);if(i.numericProps[f]={value:d,size:1},s)for(let h=0;h<s.length-1;h++){let g=s[h],x=s[h+1],T=a.value[g];d.fill(c[T],g,x)}else for(let h=0;h<l;h++){let g=a.value[h];d[h]=c[g]}}}return e}var Ae={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="object"&&Array.isArray(e.tiles)&&e.tiles.every(r=>typeof r=="string"),equal:(e,t)=>(0,gd._deepEqual)(e,t,2),async:!0};(0,vd.registerLoaders)([yo]);function bd(e){if(e===Lt)return"h3";if(e===tt)return"quadbin";throw new Error("Invalid tileset class")}var wd={data:Ae,clusterLevel:{type:"number",value:5,min:1},getPosition:{type:"accessor",value:({id:e})=>{if(typeof e=="string"){let[t,r]=(0,xo.cellToLatLng)(e);return[r,t]}return Xi(e,.5).slice(2,4)}},getWeight:{type:"accessor",value:1},refinementStrategy:"no-overlap",tileSize:512},$n=class extends xd.TileLayer{initializeState(){super.initializeState(),this.state.aggregationCache=new WeakMap,this.state.scheme=bd(this.props.TilesetClass)}updateState(t){let{props:r}=t,n=bd(r.TilesetClass);this.state.scheme!==n&&(this.setState({scheme:n,tileset:null}),this.state.aggregationCache=new WeakMap),super.updateState(t)}renderLayers(){let t=this.state.tileset?.tiles.filter(h=>h.isLoaded&&h.content&&this.state.tileset.isTileVisible(h));if(!t?.length||!this.state.tileset)return null;t.sort((h,g)=>g.zoom-h.zoom);let{getPosition:r,getWeight:n}=this.props,{aggregationCache:i,scheme:o}=this.state,a=o==="h3",s=rc(t[0]),l=[],f=!1,c=this._getAggregationLevels(t);for(let h of t){let g=i.get(h.content);g||(g=new Map,i.set(h.content,g));let x=tc(h,g,c,s,r,n,a?"h3":"quadbin");f||(f=x),l.push(...g.get(c))}l.sort((h,g)=>Number(g.count-h.count));let u=l?.map(h=>h.id);if(f||(f=!(0,Vn._deepEqual)(u,this.state.clusterIds,1)),this.setState({clusterIds:u}),f){let h=nc(l,s),g=ic(l);g.points.attributes={stats:h},this.setState({data:g})}let d={...this.props,id:"clusters",data:this.state.data,dataComparator:(h,g)=>{let x=h?.points?.properties?.map(_=>_.id),T=g?.points?.properties?.map(_=>_.id);return(0,Vn._deepEqual)(x,T,1)}};return new yd.GeoJsonLayer(this.getSubLayerProps(d))}getPickingInfo(t){let r=t.info;if(r.index!==-1){let{data:n}=t.sourceLayer.props;r.object=$a(n,{globalFeatureId:r.index})}return r}_updateAutoHighlight(t){for(let r of this.getSubLayers())r.updateAutoHighlight(t)}filterSubLayer(){return!0}_getAggregationLevels(t){let r=this.state.scheme==="h3",n=t[0],i,o;r?(i=(0,xo.getResolution)(n.id),o=Pr(this.context.viewport,this.state.tileset.opts.tileSize)):(i=n.zoom,o=this.context.viewport.zoom);let a=Math.round(o-i);return Math.round(this.props.clusterLevel)-a}};$n.layerName="ClusterGeoJsonLayer";$n.defaultProps=wd;var Zn=class extends Vn.CompositeLayer{getLoadOptions(){let t=this.props.data,r=t&&"scheme"in t?t.scheme:"quadbin";return Ze(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:r}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,maxresolution:n}=t,o=t&&"scheme"in t&&t.scheme==="h3"?Lt:tt;return[new $n(this.props,{id:`cluster-geojson-layer-${this.props.id}`,data:r,TilesetClass:o,maxZoom:n,loadOptions:this.getLoadOptions()})]}};Zn.layerName="ClusterTileLayer";Zn.defaultProps=wd;var jn=Zn;var Sd=q(Se(),1),Ds=q(gt(),1);var _d=q(pn(),1);var Ed=q(gt(),1);(0,_d.registerLoaders)([yo]);function Ib(e){return e!=null&&e!==""}var Ob={tileSize:512},Yn=class extends Ed.TileLayer{_updateAutoHighlight(t){let{hoveredFeatureId:r}=this.state,n=t.object,i=null;if(n&&(i=n.id),r!==i){let{highlightColor:o}=this.props;typeof o=="function"&&(o=o(t)),this.setState({highlightColor:o,hoveredFeatureId:i})}}getSubLayerPropsByTile(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(t){let{hoveredFeatureId:r}=this.state,n=t.content;return!Ib(r)||!Array.isArray(n)||!this._featureInTile(t,r)?-1:n.findIndex(o=>o.id===r)}_featureInTile(t,r){let n=this.state.tileset,i=n.getTileZoom(t.index),o=t.index.q?"q":"i",a={[o]:r},s=n.getTileZoom(a);for(;!(s<=i);)a=n.getParentIndex(a),s=n.getTileZoom(a);return a[o]===t.index[o]}};Yn.layerName="SpatialIndexTileLayer";Yn.defaultProps=Ob;var Hr=Yn;var Rb=e=>{let{data:t}=e,{index:r}=e.tile;return!t||!t.length?null:new Ds.H3HexagonLayer(e,{getHexagon:n=>n.id,centerHexagon:r,highPrecision:!0})},Bb={data:Ae,tileSize:512},Wn=class extends Sd.CompositeLayer{initializeState(){Ds.H3HexagonLayer._checkH3Lib()}getLoadOptions(){let t=this.props.data;return Ze(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:"h3"}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r}=t,{minresolution:n,maxresolution:i}=t;this.props.minZoom&&(n=Math.max(n,Pr({zoom:this.props.minZoom,latitude:0},this.props.tileSize))),this.props.maxZoom&&(i=Math.min(i,Pr({zoom:this.props.maxZoom,latitude:0},this.props.tileSize)));let o=this.getSubLayerClass("spatial-index-tile",Hr);return new o(this.props,{id:`h3-tile-layer-${this.props.id}`,data:r,TilesetClass:Lt,renderSubLayers:Rb,minZoom:n,maxZoom:i,loadOptions:this.getLoadOptions()})}};Wn.layerName="H3TileLayer";Wn.defaultProps=Bb;var sr=Wn;var To=q(Yt(),1),Co=q(Se(),1),Pd=q(Mt(),1);var Db=`uniform heatmapUniforms {
|
|
8
8
|
vec2 colorDomain;
|
|
9
9
|
vec2 delta;
|
|
10
10
|
float intensity;
|
|
@@ -166,7 +166,7 @@ vColor = vec4(color.rgb, color.a * layer.opacity);
|
|
|
166
166
|
}
|
|
167
167
|
DECKGL_FILTER_COLOR(vColor, geometry);
|
|
168
168
|
}
|
|
169
|
-
`;var Qb={...Us.ColumnLayer.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]},Mo=class extends _o(Us.ColumnLayer){getShaders(){let t=super.getShaders(),r=this.props.data,n=r.data.blockSize??Math.sqrt(r.length);return{...t,defines:{...t.defines,BLOCK_WIDTH:n},vs:Rd}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}};Mo.layerName="RasterColumnLayer";function Jb(e,t){return e.data===t.data&&e.length===t.length}var ii=class extends Bd.CompositeLayer{renderLayers(){let{data:t,getElevation:r,getFillColor:n,getLineColor:i,getLineWidth:o,tileIndex:a,updateTriggers:s}=this.props;if(!t||!a)return null;let l=t.blockSize??0,[f,c,u]=Qa(a),d=[f,c],h=u/l,g=this.getSubLayerClass("column",Mo),{highlightedObjectIndex:x,highlightColor:T}=this.state;return new g(this.props,this.getSubLayerProps({id:"cell",updateTriggers:s,getElevation:this.getSubLayerAccessor(r),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(o)}),{data:{data:t,length:l*l},dataComparator:Jb,offset:d,lineWidthScale:h,highlightedObjectIndex:x,highlightColor:T})}getSubLayerAccessor(t){return typeof t!="function"?super.getSubLayerAccessor(t):(r,n)=>{let{data:i,index:o}=n,a=i.data,s=Jl(a.cells,o);return t({properties:s},n)}}getPickingInfo(t){let r=super.getPickingInfo(t);return r.index!==-1&&(r.object=this.getSubLayerAccessor(n=>n)(void 0,{data:this.props,index:r.index})),r}_updateAutoHighlight(t){let{highlightedObjectIndex:r}=this.state,n=-1;if(t.index!==-1&&(n=t.index),r!==n){let{highlightColor:i}=this.props;typeof i=="function"&&(i=i(t)),this.setState({highlightColor:i,highlightedObjectIndex:n})}}};ii.layerName="RasterLayer";ii.defaultProps=Qb;var Fo=ii;var Gd=q(gt(),1);var Vd=q(pn(),1);var ey={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array},oi=class{static read(t,r){return t.readFields(oi._readField,{name:"",type:"",data:null},r)}static _readField(t,r,n){if(t===1)r.name=n.readString();else if(t===2)r.type=n.readString();else if(t===3){let i=ey[r.type];if(!i)throw Error(`Invalid data type: ${r.type}`);r.data={};let{compression:o}=Ut;ir(i,n,r.data,{compression:o})}}},Ut=class{static read(t,r){return t.readFields(Ut._readField,{blockSize:0,bands:[]},r)}static _readField(t,r,n){t===1?r.blockSize=n.readVarint():t===2&&r.bands.push(oi.read(n,n.readVarint()+n.pos))}};var Nd="9.2.0",zd="cartoRasterTile",ty={cartoRasterTile:{metadata:null,workerUrl:Ft(zd,Nd)}},ry={name:"CARTO Raster Tile",version:Nd,id:zd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(e,t)=>Dd(e,t),parseSync:Dd,worker:!0,options:ty};function Dd(e,t){let r=t?.cartoRasterTile?.metadata;if(!e||!r)return null;Ut.compression=r.compression;let n=zt(e,Ut),{bands:i,blockSize:o}=n,a={};for(let s=0;s<i.length;s++){let{name:l,data:f}=i[s];a[l]=f}return{blockSize:o,cells:{numericProps:a,properties:[]}}}var Ud=ry;(0,Vd.registerLoaders)([Ud]);var ny=e=>{let t=e.tile?.index?.q;return t?new Fo(e,{tileIndex:t}):null},iy={data:Ae,refinementStrategy:"no-overlap",tileSize:512},qs=class extends Xn(Gd.TileLayer,Td){filterSubLayer(t){let{tile:r}=t.layer.props;return r?super.filterSubLayer(t):!0}},ai=class extends qd.CompositeLayer{getLoadOptions(){let t=this.props.data;return Ze(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,minzoom:n,maxzoom:i,raster_metadata:o}=t,a=this.getSubLayerClass("tile",qs),s=this.getLoadOptions();return new a(this.props,{id:`raster-tile-layer-${this.props.id}`,data:r,TilesetClass:tt,renderSubLayers:ny,minZoom:n,maxZoom:i,loadOptions:{...s,cartoRasterTile:{...s?.cartoRasterTile,metadata:o}}})}};ai.layerName="RasterTileLayer";ai.defaultProps=iy;var si=ai;var lh=q(pn(),1);var jr=class{static read(t,r){return t.readFields(jr._readField,{properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===2){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}};var Zd="9.2.0",Hd="cartoPropertiesTile",oy={cartoPropertiesTile:{workerUrl:Ft(Hd,Zd)}},ay={name:"CARTO Properties Tile",version:Zd,id:Hd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-properties-tile"],category:"geometry",worker:!0,parse:async(e,t)=>$d(e,t),parseSync:$d,options:oy};function $d(e,t){return e?zt(e,jr):null}var jd=ay;var eh=q(Qd(),1);var th="9.2.0",rh="cartoVectorTile",_y={cartoVectorTile:{workerUrl:Ft(rh,th)}},Ey={name:"CARTO Vector Tile",version:th,id:rh,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(e,t)=>Jd(e,t),parseSync:Jd,worker:!0,options:_y};function Sy(e,t,{startPosition:r,endPosition:n,indices:i}){let o=e.positions.size,a=r*o,s=n*o,l=e.positions.value.subarray(a,s),f=i.slice(1).map(u=>u-r),c=(0,eh.default)(l,f,o);for(let u=0,d=c.length;u<d;++u)t.push(r+c[u])}function Ty(e){let{polygonIndices:t,primitivePolygonIndices:r}=e,n=[],i=0;for(let o=0;o<t.value.length-1;o++){let a=t.value[o],s=t.value[o+1],l=r.value.indexOf(s),f=r.value.subarray(i,l);i=l,Sy(e,n,{startPosition:a,endPosition:s,indices:f})}e.triangles={value:new Uint32Array(n),size:1}}function Jd(e,t){if(!e)return null;let r=zt(e,Gr);return r.polygons&&!r.polygons.triangles&&Ty(r.polygons),r}var nh=Ey;var Bo=q(oh(),1),Wr=q(gt(),1),ch=q(Mt(),1);function ah(e,t){let r=t?t in e.numericProps:!1,n=new Map;for(let c=0;c<e.pathIndices.value.length-1;c++){let u=e.pathIndices.value[c],d=e.featureIds.value[u],h;t===void 0?h=d:r?h=e.numericProps[t].value[u]:e.properties[d]&&t in e.properties[d]?h=e.properties[d][t]:h=void 0;let g=Fy(e,c);(!n.has(h)||g>n.get(h).length)&&n.set(h,{index:c,length:g})}let i=[],o=[],a=[],s=[],l=Xa(n.size,e.numericProps),f=0;for(let[c,{index:u}]of n){let d=Ly(e,u);i.push(...d);let h=e.pathIndices.value[u],g=e.featureIds.value[h];a.push(f),o.push(e.properties[g]),s.push(e.globalFeatureIds.value[h]),Ka(e.numericProps,l,h,f),f++}return yn(i,a,s,l,o)}function sh(e,t,r){let{west:n,south:i,east:o,north:a}=t,l=(o-n)*(a-i)*1e-4,f=[],c=[],u=[],d=[],h=Xa(e.polygonIndices.value.length-1,e.numericProps),g=0,x=0,{extruded:T}=r;for(let _=0;_<e.polygonIndices.value.length-1;_++){let v=e.polygonIndices.value[_],M=e.polygonIndices.value[_+1];if(Cy(e,_)<l)continue;let L=ky(e,_),I=-1,B=[0,0],N=!1;for(;x<e.triangles.value.length;){let m=e.triangles.value[x];if(m>=M)break;if(N){x+=3;continue}let b=e.triangles.value[x+1],y=e.triangles.value[x+2],w=e.positions.value.subarray(m*e.positions.size,m*e.positions.size+e.positions.size),S=e.positions.value.subarray(b*e.positions.size,b*e.positions.size+e.positions.size),P=e.positions.value.subarray(y*e.positions.size,y*e.positions.size+e.positions.size);if(Py(L,w,S,P))N=!0;else{let E=fh(w,S,P);E>I&&(I=E,B=[(w[0]+S[0]+P[0])/3,(w[1]+S[1]+P[1])/3])}x+=3}let p=N?L:B;if(Ay(p,t)){f.push(...p);let m=e.featureIds.value[v];if(T){let b=r.getElevation(void 0,{data:e,index:m});f.push(b*r.elevationScale)}c.push(e.properties[m]),u.push(g),d.push(e.globalFeatureIds.value[v]),Ka(e.numericProps,h,v,g),g++}}return e.numericProps&&Object.keys(h).forEach(_=>{h[_].value=h[_].value.slice(0,g)}),yn(f,u,d,h,c,T?3:2)}function Cy(e,t){let{positions:{value:r,size:n},polygonIndices:{value:i},triangles:{value:o}}=e,a=i[t],s=i[t+1],l=0,f=0;for(;f<o.length&&!(o[f]>=a);)f+=3;for(;f<o.length;){let c=o[f];if(c>=s)break;let u=o[f+1],d=o[f+2],h=r.subarray(c*n,c*n+n),g=r.subarray(u*n,u*n+n),x=r.subarray(d*n,d*n+n);l+=fh(h,g,x),f+=3}return l}function Ay([e,t],{west:r,east:n,south:i,north:o}){return e>=r&&e<n&&t>=i&&t<o}function Py(e,t,r,n){let i=Math.abs((r[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(r[1]-t[1]))/2,o=Math.abs((t[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(t[1]-e[1]))/2,a=Math.abs((r[0]-e[0])*(n[1]-e[1])-(n[0]-e[0])*(r[1]-e[1]))/2,s=Math.abs((n[0]-e[0])*(t[1]-e[1])-(t[0]-e[0])*(n[1]-e[1]))/2;return Math.abs(i-(o+a+s))<1e-10}function fh([e,t],[r,n],[i,o]){return Math.abs((e*(n-o)+r*(o-t)+i*(t-n))/2)}function ky(e,t){let{positions:{value:r,size:n}}=e,i=n*e.polygonIndices.value[t],o=n*e.polygonIndices.value[t+1],a=1/0,s=1/0,l=-1/0,f=-1/0;for(let c=i;c<o;c+=n){let[u,d]=r.subarray(c,c+2);a=Math.min(a,u),s=Math.min(s,d),l=Math.max(l,u),f=Math.max(f,d)}return[(a+l)/2,(s+f)/2]}function My(e,t){let{positions:{value:r}}=e,[n,i,o,a]=r.subarray(t,t+4);return Math.sqrt(Math.pow(o-n,2)+Math.pow(a-i,2))}function Fy(e,t){let{positions:{size:r}}=e,n=r*e.pathIndices.value[t],i=r*e.pathIndices.value[t+1],o=0;for(let a=n;a<i;a+=r)o+=My(e,a);return o}function Ly(e,t){let{positions:{value:r},pathIndices:{value:n}}=e,i=n[t]*2,a=(n[t+1]*2-i)/2;if(a===2){let[l,f,c,u]=r.subarray(i,i+4);return[(l+c)/2,(f+u)/2]}let s=i+Math.floor(a/2)*2;return[r[s],r[s+1]]}(0,lh.registerLoaders)([jd,nh]);var Iy={...Wr.MVTLayer.defaultProps,autoLabels:!1,data:Ae,dataComparator:Ae.equal,tileSize:512},ui=class extends Wr.MVTLayer{constructor(...t){super(...t)}initializeState(){super.initializeState(),this.setState({binary:!0})}updateState(t){let{props:r}=t;if(r.data){super.updateState(t);let i=new URL(r.data.tiles[0]).searchParams.get("formatTiles")==="mvt";this.setState({mvt:i})}}getLoadOptions(){let t=this.props.data;return Ze(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},gis:{format:"binary"}})}async getTileData(t){let r=this.props.data,{tiles:n,properties_tiles:i}=r,o=(0,Wr._getURLFromTemplate)(n,t);if(!o)return Promise.reject("Invalid URL");let a=this.getLoadOptions(),{fetch:s}=this.props,{signal:l}=t,f=s(o,{propName:"data",layer:this,loadOptions:a,signal:l});if(!i)return await f;let c=(0,Wr._getURLFromTemplate)(i,t);if(!c)return Promise.reject("Invalid properties URL");let u=s(c,{propName:"data",layer:this,loadOptions:a,signal:l}),[d,h]=await Promise.all([f,u]);return d?h?md(d,h):d:null}renderSubLayers(t){if(t.data===null)return null;let r=t.tile.bbox,n=[],i={"points-text":{type:ni,...t?._subLayerProps?.["points-text"],extensions:[new Bo.CollisionFilterExtension,...t.extensions||[],...t?._subLayerProps?.["points-text"]?.extensions||[]]}};if(this.state.mvt)n.push(super.renderSubLayers(t));else{let{west:o,south:a,east:s,north:l}=r,f=[new Bo.ClipExtension,...t.extensions||[]],c={clipBounds:[o,a,s,l]},u=h=>({[h]:{...c,...t?._subLayerProps?.[h],extensions:[...f,...t?._subLayerProps?.[h]?.extensions||[]]}}),d={...t,data:{...t.data,tileBbox:r},autoHighlight:!1,_subLayerProps:{...t._subLayerProps,...i,...u("polygons-fill"),...u("polygons-stroke"),...u("linestrings")}};n.push(new ch.GeoJsonLayer(d))}if(n[0]&&t.autoLabels){let o=Yi();t.data.lines&&t.data.lines.positions.value.length>0&&(o.points=ah(t.data.lines,typeof t.autoLabels=="object"?t.autoLabels.uniqueIdProperty:void 0)),t.data.polygons&&t.data.polygons.positions.value.length>0&&(o.points=sh(t.data.polygons,r,t)),n.push(n[0].clone({id:`${t.id}-labels`,data:o,pickable:!1,autoHighlight:!1}))}return n}renderLayers(){let t=super.renderLayers();if(!this.props.autoLabels)return t;let r=t.flat().filter(Boolean);return r.sort((n,i)=>{let o=n.id.includes("labels"),a=i.id.includes("labels");return o&&!a?1:!o&&a?-1:0}),r.map(n=>n.id.includes("labels")?n.clone({highlightedObjectIndex:-1}):n)}_isWGS84(){return this.state.mvt?super._isWGS84():!0}};ui.layerName="VectorTileLayer";ui.defaultProps=Iy;var Xr=ui;var Oy=Math.PI/180,Ry=180/Math.PI;function mh(e){var t=uh(e[0]+1,e[2]),r=uh(e[0],e[2]),n=dh(e[1]+1,e[2]),i=dh(e[1],e[2]);return[r,n,t,i]}function By(e){var t=mh(e),r={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r}function uh(e,t){return e/Math.pow(2,t)*360-180}function dh(e,t){var r=Math.PI-2*Math.PI*e/Math.pow(2,t);return Ry*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))}function Hs(e,t,r){var n=_h(e,t,r);return n[0]=Math.floor(n[0]),n[1]=Math.floor(n[1]),n}function bh(e){return[[e[0]*2,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2+1,e[2]+1],[e[0]*2,e[1]*2+1,e[2]+1]]}function yh(e){return e[0]%2===0&&e[1]%2===0?[e[0]/2,e[1]/2,e[2]-1]:e[0]%2===0&&!e[1]%2===0?[e[0]/2,(e[1]-1)/2,e[2]-1]:!e[0]%2===0&&e[1]%2===0?[(e[0]-1)/2,e[1]/2,e[2]-1]:[(e[0]-1)/2,(e[1]-1)/2,e[2]-1]}function xh(e){return bh(yh(e))}function Dy(e,t){for(var r=xh(e),n=0;n<r.length;n++)if(!vh(t,r[n]))return!1;return!0}function vh(e,t){for(var r=0;r<e.length;r++)if(wh(e[r],t))return!0;return!1}function wh(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ny(e){for(var t="",r=e[2];r>0;r--){var n=0,i=1<<r-1;e[0]&i&&n++,e[1]&i&&(n+=2),t+=n.toString()}return t}function zy(e){for(var t=0,r=0,n=e.length,i=n;i>0;i--){var o=1<<i-1;switch(e[n-i]){case"0":break;case"1":t|=o;break;case"2":r|=o;break;case"3":t|=o,r|=o;break}}return[t,r,n]}function Uy(e){var t=Hs(e[0],e[1],32),r=Hs(e[2],e[3],32),n=[t[0],t[1],r[0],r[1]],i=qy(n);if(i===0)return[0,0,0];var o=n[0]>>>32-i,a=n[1]>>>32-i;return[o,a,i]}function qy(e){for(var t=28,r=0;r<t;r++){var n=1<<32-(r+1);if((e[0]&n)!=(e[2]&n)||(e[1]&n)!=(e[3]&n))return r}return t}function _h(e,t,r){var n=Math.sin(t*Oy),i=Math.pow(2,r),o=i*(e/360+.5),a=i*(.5-.25*Math.log((1+n)/(1-n))/Math.PI);return[o,a,r]}var Do={tileToGeoJSON:By,tileToBBOX:mh,getChildren:bh,getParent:yh,getSiblings:xh,hasTile:vh,hasSiblings:Dy,tilesEqual:wh,tileToQuadkey:Ny,quadkeyToTile:zy,pointToTile:Hs,bboxToTile:Uy,pointToTileFraction:_h},Gy=Vy;function Vy(e,t){var r,n,i=e.coordinates,o=t.max_zoom,a={},s=[];if(e.type==="Point")return[Do.pointToTile(i[0],i[1],o)];if(e.type==="MultiPoint")for(r=0;r<i.length;r++)n=Do.pointToTile(i[r][0],i[r][1],o),a[He(n[0],n[1],n[2])]=!0;else if(e.type==="LineString")js(a,i,o);else if(e.type==="MultiLineString")for(r=0;r<i.length;r++)js(a,i[r],o);else if(e.type==="Polygon")hh(a,s,i,o);else if(e.type==="MultiPolygon")for(r=0;r<i.length;r++)hh(a,s,i[r],o);else throw new Error("Geometry type not implemented");if(t.min_zoom!==o){var l=s.length;for(ph(a,s),r=0;r<l;r++){var f=s[r];a[He(f[0],f[1],f[2])]=!0}return $y(a,s,t)}return ph(a,s),s}function $y(e,t,r){for(var n=[],i=r.max_zoom;i>r.min_zoom;i--){for(var o={},a=[],s=0;s<t.length;s++){var l=t[s];if(l[0]%2===0&&l[1]%2===0){var f=He(l[0]+1,l[1],i),c=He(l[0],l[1]+1,i),u=He(l[0]+1,l[1]+1,i);if(e[f]&&e[c]&&e[u]){e[He(l[0],l[1],l[2])]=!1,e[f]=!1,e[c]=!1,e[u]=!1;var d=[l[0]/2,l[1]/2,i-1];i-1===r.min_zoom?n.push(d):(o[He(l[0]/2,l[1]/2,i-1)]=!0,a.push(d))}}}for(s=0;s<t.length;s++)l=t[s],e[He(l[0],l[1],l[2])]&&n.push(l);e=o,t=a}return n}function hh(e,t,r,n){for(var i=[],o=0;o<r.length;o++){var a=[];js(e,r[o],n,a);for(var s=0,l=a.length,f=l-1;s<l;f=s++){var c=(s+1)%l,u=a[s][1];(u>a[f][1]||u>a[c][1])&&(u<a[f][1]||u<a[c][1])&&u!==a[c][1]&&i.push(a[s])}}for(i.sort(Zy),o=0;o<i.length;o+=2){u=i[o][1];for(var d=i[o][0]+1;d<i[o+1][0];d++){var h=He(d,u,n);e[h]||t.push([d,u,n])}}}function Zy(e,t){return e[1]-t[1]||e[0]-t[0]}function js(e,t,r,n){for(var i,o,a=0;a<t.length-1;a++){var s=Do.pointToTileFraction(t[a][0],t[a][1],r),l=Do.pointToTileFraction(t[a+1][0],t[a+1][1],r),f=s[0],c=s[1],u=l[0],d=l[1],h=u-f,g=d-c;if(!(g===0&&h===0)){var x=h>0?1:-1,T=g>0?1:-1,_=Math.floor(f),v=Math.floor(c),M=h===0?1/0:Math.abs(((h>0?1:0)+_-f)/h),L=g===0?1/0:Math.abs(((g>0?1:0)+v-c)/g),I=Math.abs(x/h),B=Math.abs(T/g);for((_!==i||v!==o)&&(e[He(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v);M<1||L<1;)M<L?(M+=I,_+=x):(L+=B,v+=T),e[He(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v}}n&&v===n[0][1]&&n.pop()}function ph(e,t){for(var r=Object.keys(e),n=0;n<r.length;n++)t.push(Hy(+r[n]))}function He(e,t,r){var n=2*(1<<r);return(n*t+e)*32+r}function Hy(e){var t=e%32,r=2*(1<<t),n=(e-t)/32,i=n%r,o=(n-i)/r%r;return[i,o,t]}var Eh=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],Sh=[0n,1n,2n,4n,8n,16n],gh=512;function jy(e){let{x:t,y:r,z:n}=Ws(e),i=gh/(1<<n);return[t*i,gh-r*i,i]}function Yy(e,t){let[r,n,i]=jy(e);return[[r,n],[r+t*i,n-t*i]]}function Wy(e,t=1){let[r,n]=Yy(e,t),[i,o]=Te(r),[a,s]=Te(n);return[a,o,a,s,i,s,i,o,a,o]}function Ys(e){if(e.z<0||e.z>26)throw new Error("Wrong zoom");let t=BigInt(e.z),r=BigInt(e.x)<<32n-t,n=BigInt(e.y)<<32n-t;for(let o=0;o<5;o++){let a=Sh[5-o],s=Eh[4-o];r=(r|r<<a)&s,n=(n|n<<a)&s}return 0x4000000000000000n|1n<<59n|t<<52n|(r|n<<1n)>>12n|0xfffffffffffffn>>t*2n}function Ws(e){let t=e>>59n&7n,r=e>>57n&3n,n=e>>52n&0x1fn,i=(e&0xfffffffffffffn)<<12n;if(t!==1n&&r!==0n)throw new Error("Wrong mode");let o=i,a=i>>1n;for(let s=0;s<6;s++){let l=Sh[s],f=Eh[s];o=(o|o>>l)&f,a=(a|a>>l)&f}return o=o>>32n-n,a=a>>32n-n,{z:Number(n),x:Number(o),y:Number(a)}}function No(e){return e>>52n&0x1fn}function Th(e,t){let r=Number(t);return Gy(e,{min_zoom:r,max_zoom:r}).map(([n,i,o])=>Ys({x:n,y:i,z:o}))}function Ch(e){let t=Wy(e);return{type:"Polygon",coordinates:[[[t[0],t[1]],[t[2],t[3]],[t[4],t[5]],[t[6],t[7]],[t[0],t[1]]]]}}var Zf=q(Yt(),1);var Dp=q(Yt(),1);var Xs=class{add(t,r,n){if(typeof arguments[0]!="string")for(let i in arguments[0])this.add(i,arguments[0][i],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(i){this[i]=this[i]||[],r&&this[i][n?"unshift":"push"](r)},this)}run(t,r){this[t]=this[t]||[],this[t].forEach(function(n){n.call(r&&r.context?r.context:r,r)})}},Ks=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(r=>{if(typeof r!="object"||!r.name||!r.init)throw new Error("Invalid JSEP plugin format");this.registered[r.name]||(r.init(this.jsep),this.registered[r.name]=r)})}},F=class{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+F.version}static addUnaryOp(t){return F.max_unop_len=Math.max(t.length,F.max_unop_len),F.unary_ops[t]=1,F}static addBinaryOp(t,r,n){return F.max_binop_len=Math.max(t.length,F.max_binop_len),F.binary_ops[t]=r,n?F.right_associative.add(t):F.right_associative.delete(t),F}static addIdentifierChar(t){return F.additional_identifier_chars.add(t),F}static addLiteral(t,r){return F.literals[t]=r,F}static removeUnaryOp(t){return delete F.unary_ops[t],t.length===F.max_unop_len&&(F.max_unop_len=F.getMaxKeyLen(F.unary_ops)),F}static removeAllUnaryOps(){return F.unary_ops={},F.max_unop_len=0,F}static removeIdentifierChar(t){return F.additional_identifier_chars.delete(t),F}static removeBinaryOp(t){return delete F.binary_ops[t],t.length===F.max_binop_len&&(F.max_binop_len=F.getMaxKeyLen(F.binary_ops)),F.right_associative.delete(t),F}static removeAllBinaryOps(){return F.binary_ops={},F.max_binop_len=0,F}static removeLiteral(t){return delete F.literals[t],F}static removeAllLiterals(){return F.literals={},F}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new F(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(r=>r.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return F.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!F.binary_ops[String.fromCharCode(t)]||F.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return F.isIdentifierStart(t)||F.isDecimalDigit(t)}throwError(t){let r=new Error(t+" at character "+this.index);throw r.index=this.index,r.description=t,r}runHook(t,r){if(F.hooks[t]){let n={context:this,node:r};return F.hooks.run(t,n),n.node}return r}searchHook(t){if(F.hooks[t]){let r={context:this};return F.hooks[t].find(function(n){return n.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let t=this.code;for(;t===F.SPACE_CODE||t===F.TAB_CODE||t===F.LF_CODE||t===F.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),r=t.length===1?t[0]:{type:F.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r=[],n,i;for(;this.index<this.expr.length;)if(n=this.code,n===F.SEMCOL_CODE||n===F.COMMA_CODE)this.index++;else if(i=this.gobbleExpression())r.push(i);else if(this.index<this.expr.length){if(n===t)break;this.throwError('Unexpected "'+this.char+'"')}return r}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,F.max_binop_len),r=t.length;for(;r>0;){if(F.binary_ops.hasOwnProperty(t)&&(!F.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!F.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=r,t;t=t.substr(0,--r)}return!1}gobbleBinaryExpression(){let t,r,n,i,o,a,s,l,f;if(a=this.gobbleToken(),!a||(r=this.gobbleBinaryOp(),!r))return a;for(o={value:r,prec:F.binaryPrecedence(r),right_a:F.right_associative.has(r)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+r),i=[a,o,s];r=this.gobbleBinaryOp();){if(n=F.binaryPrecedence(r),n===0){this.index-=r.length;break}o={value:r,prec:n,right_a:F.right_associative.has(r)},f=r;let c=u=>o.right_a&&u.right_a?n>u.prec:n<=u.prec;for(;i.length>2&&c(i[i.length-2]);)s=i.pop(),r=i.pop().value,a=i.pop(),t={type:F.BINARY_EXP,operator:r,left:a,right:s},i.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+f),i.push(o,t)}for(l=i.length-1,t=i[l];l>1;)t={type:F.BINARY_EXP,operator:i[l-1].value,left:i[l-2],right:t},l-=2;return t}gobbleToken(){let t,r,n,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"),i)return this.runHook("after-token",i);if(t=this.code,F.isDecimalDigit(t)||t===F.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===F.SQUOTE_CODE||t===F.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(t===F.OBRACK_CODE)i=this.gobbleArray();else{for(r=this.expr.substr(this.index,F.max_unop_len),n=r.length;n>0;){if(F.unary_ops.hasOwnProperty(r)&&(!F.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!F.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=n;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:F.UNARY_EXP,operator:r,argument:o,prefix:!0})}r=r.substr(0,--n)}F.isIdentifierStart(t)?(i=this.gobbleIdentifier(),F.literals.hasOwnProperty(i.name)?i={type:F.LITERAL,value:F.literals[i.name],raw:i.name}:i.name===F.this_str&&(i={type:F.THIS_EXP})):t===F.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let r=this.code;for(;r===F.PERIOD_CODE||r===F.OBRACK_CODE||r===F.OPAREN_CODE||r===F.QUMARK_CODE;){let n;if(r===F.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==F.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===F.OBRACK_CODE?(t={type:F.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),r=this.code,r!==F.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===F.OPAREN_CODE?t={type:F.CALL_EXP,arguments:this.gobbleArguments(F.CPAREN_CODE),callee:t}:(r===F.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),t={type:F.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),n&&(t.optional=!0),this.gobbleSpaces(),r=this.code}return t}gobbleNumericLiteral(){let t="",r,n;for(;F.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===F.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);F.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(r=this.char,r==="e"||r==="E"){for(t+=this.expr.charAt(this.index++),r=this.char,(r==="+"||r==="-")&&(t+=this.expr.charAt(this.index++));F.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);F.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return n=this.code,F.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(n===F.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===F.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:F.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",r=this.index,n=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===n){i=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=`
|
|
169
|
+
`;var Qb={...Us.ColumnLayer.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]},Mo=class extends _o(Us.ColumnLayer){getShaders(){let t=super.getShaders(),r=this.props.data,n=r.data.blockSize??Math.sqrt(r.length);return{...t,defines:{...t.defines,BLOCK_WIDTH:n},vs:Rd}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}};Mo.layerName="RasterColumnLayer";function Jb(e,t){return e.data===t.data&&e.length===t.length}var ii=class extends Bd.CompositeLayer{renderLayers(){let{data:t,getElevation:r,getFillColor:n,getLineColor:i,getLineWidth:o,tileIndex:a,updateTriggers:s}=this.props;if(!t||!a)return null;let l=t.blockSize??0,[f,c,u]=Qa(a),d=[f,c],h=u/l,g=this.getSubLayerClass("column",Mo),{highlightedObjectIndex:x,highlightColor:T}=this.state;return new g(this.props,this.getSubLayerProps({id:"cell",updateTriggers:s,getElevation:this.getSubLayerAccessor(r),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(o)}),{data:{data:t,length:l*l},dataComparator:Jb,offset:d,lineWidthScale:h,highlightedObjectIndex:x,highlightColor:T})}getSubLayerAccessor(t){return typeof t!="function"?super.getSubLayerAccessor(t):(r,n)=>{let{data:i,index:o}=n,a=i.data,s=Jl(a.cells,o);return t({properties:s},n)}}getPickingInfo(t){let r=super.getPickingInfo(t);return r.index!==-1&&(r.object=this.getSubLayerAccessor(n=>n)(void 0,{data:this.props,index:r.index})),r}_updateAutoHighlight(t){let{highlightedObjectIndex:r}=this.state,n=-1;if(t.index!==-1&&(n=t.index),r!==n){let{highlightColor:i}=this.props;typeof i=="function"&&(i=i(t)),this.setState({highlightColor:i,highlightedObjectIndex:n})}}};ii.layerName="RasterLayer";ii.defaultProps=Qb;var Fo=ii;var Gd=q(gt(),1);var Vd=q(pn(),1);var ey={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array},oi=class{static read(t,r){return t.readFields(oi._readField,{name:"",type:"",data:null},r)}static _readField(t,r,n){if(t===1)r.name=n.readString();else if(t===2)r.type=n.readString();else if(t===3){let i=ey[r.type];if(!i)throw Error(`Invalid data type: ${r.type}`);r.data={};let{compression:o}=Ut;ir(i,n,r.data,{compression:o})}}},Ut=class{static read(t,r){return t.readFields(Ut._readField,{blockSize:0,bands:[]},r)}static _readField(t,r,n){t===1?r.blockSize=n.readVarint():t===2&&r.bands.push(oi.read(n,n.readVarint()+n.pos))}};var Nd="9.2.2",zd="cartoRasterTile",ty={cartoRasterTile:{metadata:null,workerUrl:Ft(zd,Nd)}},ry={name:"CARTO Raster Tile",version:Nd,id:zd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(e,t)=>Dd(e,t),parseSync:Dd,worker:!0,options:ty};function Dd(e,t){let r=t?.cartoRasterTile?.metadata;if(!e||!r)return null;Ut.compression=r.compression;let n=zt(e,Ut),{bands:i,blockSize:o}=n,a={};for(let s=0;s<i.length;s++){let{name:l,data:f}=i[s];a[l]=f}return{blockSize:o,cells:{numericProps:a,properties:[]}}}var Ud=ry;(0,Vd.registerLoaders)([Ud]);var ny=e=>{let t=e.tile?.index?.q;return t?new Fo(e,{tileIndex:t}):null},iy={data:Ae,refinementStrategy:"no-overlap",tileSize:512},qs=class extends Xn(Gd.TileLayer,Td){filterSubLayer(t){let{tile:r}=t.layer.props;return r?super.filterSubLayer(t):!0}},ai=class extends qd.CompositeLayer{getLoadOptions(){let t=this.props.data;return Ze(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,minzoom:n,maxzoom:i,raster_metadata:o}=t,a=this.getSubLayerClass("tile",qs),s=this.getLoadOptions();return new a(this.props,{id:`raster-tile-layer-${this.props.id}`,data:r,TilesetClass:tt,renderSubLayers:ny,minZoom:n,maxZoom:i,loadOptions:{...s,cartoRasterTile:{...s?.cartoRasterTile,metadata:o}}})}};ai.layerName="RasterTileLayer";ai.defaultProps=iy;var si=ai;var lh=q(pn(),1);var jr=class{static read(t,r){return t.readFields(jr._readField,{properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===2){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}};var Zd="9.2.2",Hd="cartoPropertiesTile",oy={cartoPropertiesTile:{workerUrl:Ft(Hd,Zd)}},ay={name:"CARTO Properties Tile",version:Zd,id:Hd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-properties-tile"],category:"geometry",worker:!0,parse:async(e,t)=>$d(e,t),parseSync:$d,options:oy};function $d(e,t){return e?zt(e,jr):null}var jd=ay;var eh=q(Qd(),1);var th="9.2.2",rh="cartoVectorTile",_y={cartoVectorTile:{workerUrl:Ft(rh,th)}},Ey={name:"CARTO Vector Tile",version:th,id:rh,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(e,t)=>Jd(e,t),parseSync:Jd,worker:!0,options:_y};function Sy(e,t,{startPosition:r,endPosition:n,indices:i}){let o=e.positions.size,a=r*o,s=n*o,l=e.positions.value.subarray(a,s),f=i.slice(1).map(u=>u-r),c=(0,eh.default)(l,f,o);for(let u=0,d=c.length;u<d;++u)t.push(r+c[u])}function Ty(e){let{polygonIndices:t,primitivePolygonIndices:r}=e,n=[],i=0;for(let o=0;o<t.value.length-1;o++){let a=t.value[o],s=t.value[o+1],l=r.value.indexOf(s),f=r.value.subarray(i,l);i=l,Sy(e,n,{startPosition:a,endPosition:s,indices:f})}e.triangles={value:new Uint32Array(n),size:1}}function Jd(e,t){if(!e)return null;let r=zt(e,Gr);return r.polygons&&!r.polygons.triangles&&Ty(r.polygons),r}var nh=Ey;var Bo=q(oh(),1),Wr=q(gt(),1),ch=q(Mt(),1);function ah(e,t){let r=t?t in e.numericProps:!1,n=new Map;for(let c=0;c<e.pathIndices.value.length-1;c++){let u=e.pathIndices.value[c],d=e.featureIds.value[u],h;t===void 0?h=d:r?h=e.numericProps[t].value[u]:e.properties[d]&&t in e.properties[d]?h=e.properties[d][t]:h=void 0;let g=Fy(e,c);(!n.has(h)||g>n.get(h).length)&&n.set(h,{index:c,length:g})}let i=[],o=[],a=[],s=[],l=Xa(n.size,e.numericProps),f=0;for(let[c,{index:u}]of n){let d=Ly(e,u);i.push(...d);let h=e.pathIndices.value[u],g=e.featureIds.value[h];a.push(f),o.push(e.properties[g]),s.push(e.globalFeatureIds.value[h]),Ka(e.numericProps,l,h,f),f++}return yn(i,a,s,l,o)}function sh(e,t,r){let{west:n,south:i,east:o,north:a}=t,l=(o-n)*(a-i)*1e-4,f=[],c=[],u=[],d=[],h=Xa(e.polygonIndices.value.length-1,e.numericProps),g=0,x=0,{extruded:T}=r;for(let _=0;_<e.polygonIndices.value.length-1;_++){let v=e.polygonIndices.value[_],M=e.polygonIndices.value[_+1];if(Cy(e,_)<l)continue;let L=ky(e,_),I=-1,B=[0,0],N=!1;for(;x<e.triangles.value.length;){let m=e.triangles.value[x];if(m>=M)break;if(N){x+=3;continue}let b=e.triangles.value[x+1],y=e.triangles.value[x+2],w=e.positions.value.subarray(m*e.positions.size,m*e.positions.size+e.positions.size),S=e.positions.value.subarray(b*e.positions.size,b*e.positions.size+e.positions.size),P=e.positions.value.subarray(y*e.positions.size,y*e.positions.size+e.positions.size);if(Py(L,w,S,P))N=!0;else{let E=fh(w,S,P);E>I&&(I=E,B=[(w[0]+S[0]+P[0])/3,(w[1]+S[1]+P[1])/3])}x+=3}let p=N?L:B;if(Ay(p,t)){f.push(...p);let m=e.featureIds.value[v];if(T){let b=r.getElevation(void 0,{data:e,index:m});f.push(b*r.elevationScale)}c.push(e.properties[m]),u.push(g),d.push(e.globalFeatureIds.value[v]),Ka(e.numericProps,h,v,g),g++}}return e.numericProps&&Object.keys(h).forEach(_=>{h[_].value=h[_].value.slice(0,g)}),yn(f,u,d,h,c,T?3:2)}function Cy(e,t){let{positions:{value:r,size:n},polygonIndices:{value:i},triangles:{value:o}}=e,a=i[t],s=i[t+1],l=0,f=0;for(;f<o.length&&!(o[f]>=a);)f+=3;for(;f<o.length;){let c=o[f];if(c>=s)break;let u=o[f+1],d=o[f+2],h=r.subarray(c*n,c*n+n),g=r.subarray(u*n,u*n+n),x=r.subarray(d*n,d*n+n);l+=fh(h,g,x),f+=3}return l}function Ay([e,t],{west:r,east:n,south:i,north:o}){return e>=r&&e<n&&t>=i&&t<o}function Py(e,t,r,n){let i=Math.abs((r[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(r[1]-t[1]))/2,o=Math.abs((t[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(t[1]-e[1]))/2,a=Math.abs((r[0]-e[0])*(n[1]-e[1])-(n[0]-e[0])*(r[1]-e[1]))/2,s=Math.abs((n[0]-e[0])*(t[1]-e[1])-(t[0]-e[0])*(n[1]-e[1]))/2;return Math.abs(i-(o+a+s))<1e-10}function fh([e,t],[r,n],[i,o]){return Math.abs((e*(n-o)+r*(o-t)+i*(t-n))/2)}function ky(e,t){let{positions:{value:r,size:n}}=e,i=n*e.polygonIndices.value[t],o=n*e.polygonIndices.value[t+1],a=1/0,s=1/0,l=-1/0,f=-1/0;for(let c=i;c<o;c+=n){let[u,d]=r.subarray(c,c+2);a=Math.min(a,u),s=Math.min(s,d),l=Math.max(l,u),f=Math.max(f,d)}return[(a+l)/2,(s+f)/2]}function My(e,t){let{positions:{value:r}}=e,[n,i,o,a]=r.subarray(t,t+4);return Math.sqrt(Math.pow(o-n,2)+Math.pow(a-i,2))}function Fy(e,t){let{positions:{size:r}}=e,n=r*e.pathIndices.value[t],i=r*e.pathIndices.value[t+1],o=0;for(let a=n;a<i;a+=r)o+=My(e,a);return o}function Ly(e,t){let{positions:{value:r},pathIndices:{value:n}}=e,i=n[t]*2,a=(n[t+1]*2-i)/2;if(a===2){let[l,f,c,u]=r.subarray(i,i+4);return[(l+c)/2,(f+u)/2]}let s=i+Math.floor(a/2)*2;return[r[s],r[s+1]]}(0,lh.registerLoaders)([jd,nh]);var Iy={...Wr.MVTLayer.defaultProps,autoLabels:!1,data:Ae,dataComparator:Ae.equal,tileSize:512},ui=class extends Wr.MVTLayer{constructor(...t){super(...t)}initializeState(){super.initializeState(),this.setState({binary:!0})}updateState(t){let{props:r}=t;if(r.data){super.updateState(t);let i=new URL(r.data.tiles[0]).searchParams.get("formatTiles")==="mvt";this.setState({mvt:i})}}getLoadOptions(){let t=this.props.data;return Ze(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},gis:{format:"binary"}})}async getTileData(t){let r=this.props.data,{tiles:n,properties_tiles:i}=r,o=(0,Wr._getURLFromTemplate)(n,t);if(!o)return Promise.reject("Invalid URL");let a=this.getLoadOptions(),{fetch:s}=this.props,{signal:l}=t,f=s(o,{propName:"data",layer:this,loadOptions:a,signal:l});if(!i)return await f;let c=(0,Wr._getURLFromTemplate)(i,t);if(!c)return Promise.reject("Invalid properties URL");let u=s(c,{propName:"data",layer:this,loadOptions:a,signal:l}),[d,h]=await Promise.all([f,u]);return d?h?md(d,h):d:null}renderSubLayers(t){if(t.data===null)return null;let r=t.tile.bbox,n=[],i={"points-text":{type:ni,...t?._subLayerProps?.["points-text"],extensions:[new Bo.CollisionFilterExtension,...t.extensions||[],...t?._subLayerProps?.["points-text"]?.extensions||[]]}};if(this.state.mvt)n.push(super.renderSubLayers(t));else{let{west:o,south:a,east:s,north:l}=r,f=[new Bo.ClipExtension,...t.extensions||[]],c={clipBounds:[o,a,s,l]},u=h=>({[h]:{...c,...t?._subLayerProps?.[h],extensions:[...f,...t?._subLayerProps?.[h]?.extensions||[]]}}),d={...t,data:{...t.data,tileBbox:r},autoHighlight:!1,_subLayerProps:{...t._subLayerProps,...i,...u("polygons-fill"),...u("polygons-stroke"),...u("linestrings")}};n.push(new ch.GeoJsonLayer(d))}if(n[0]&&t.autoLabels){let o=Yi();t.data.lines&&t.data.lines.positions.value.length>0&&(o.points=ah(t.data.lines,typeof t.autoLabels=="object"?t.autoLabels.uniqueIdProperty:void 0)),t.data.polygons&&t.data.polygons.positions.value.length>0&&(o.points=sh(t.data.polygons,r,t)),n.push(n[0].clone({id:`${t.id}-labels`,data:o,pickable:!1,autoHighlight:!1}))}return n}renderLayers(){let t=super.renderLayers();if(!this.props.autoLabels)return t;let r=t.flat().filter(Boolean);return r.sort((n,i)=>{let o=n.id.includes("labels"),a=i.id.includes("labels");return o&&!a?1:!o&&a?-1:0}),r.map(n=>n.id.includes("labels")?n.clone({highlightedObjectIndex:-1}):n)}_isWGS84(){return this.state.mvt?super._isWGS84():!0}};ui.layerName="VectorTileLayer";ui.defaultProps=Iy;var Xr=ui;var Oy=Math.PI/180,Ry=180/Math.PI;function mh(e){var t=uh(e[0]+1,e[2]),r=uh(e[0],e[2]),n=dh(e[1]+1,e[2]),i=dh(e[1],e[2]);return[r,n,t,i]}function By(e){var t=mh(e),r={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r}function uh(e,t){return e/Math.pow(2,t)*360-180}function dh(e,t){var r=Math.PI-2*Math.PI*e/Math.pow(2,t);return Ry*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))}function Hs(e,t,r){var n=_h(e,t,r);return n[0]=Math.floor(n[0]),n[1]=Math.floor(n[1]),n}function bh(e){return[[e[0]*2,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2+1,e[2]+1],[e[0]*2,e[1]*2+1,e[2]+1]]}function yh(e){return e[0]%2===0&&e[1]%2===0?[e[0]/2,e[1]/2,e[2]-1]:e[0]%2===0&&!e[1]%2===0?[e[0]/2,(e[1]-1)/2,e[2]-1]:!e[0]%2===0&&e[1]%2===0?[(e[0]-1)/2,e[1]/2,e[2]-1]:[(e[0]-1)/2,(e[1]-1)/2,e[2]-1]}function xh(e){return bh(yh(e))}function Dy(e,t){for(var r=xh(e),n=0;n<r.length;n++)if(!vh(t,r[n]))return!1;return!0}function vh(e,t){for(var r=0;r<e.length;r++)if(wh(e[r],t))return!0;return!1}function wh(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ny(e){for(var t="",r=e[2];r>0;r--){var n=0,i=1<<r-1;e[0]&i&&n++,e[1]&i&&(n+=2),t+=n.toString()}return t}function zy(e){for(var t=0,r=0,n=e.length,i=n;i>0;i--){var o=1<<i-1;switch(e[n-i]){case"0":break;case"1":t|=o;break;case"2":r|=o;break;case"3":t|=o,r|=o;break}}return[t,r,n]}function Uy(e){var t=Hs(e[0],e[1],32),r=Hs(e[2],e[3],32),n=[t[0],t[1],r[0],r[1]],i=qy(n);if(i===0)return[0,0,0];var o=n[0]>>>32-i,a=n[1]>>>32-i;return[o,a,i]}function qy(e){for(var t=28,r=0;r<t;r++){var n=1<<32-(r+1);if((e[0]&n)!=(e[2]&n)||(e[1]&n)!=(e[3]&n))return r}return t}function _h(e,t,r){var n=Math.sin(t*Oy),i=Math.pow(2,r),o=i*(e/360+.5),a=i*(.5-.25*Math.log((1+n)/(1-n))/Math.PI);return[o,a,r]}var Do={tileToGeoJSON:By,tileToBBOX:mh,getChildren:bh,getParent:yh,getSiblings:xh,hasTile:vh,hasSiblings:Dy,tilesEqual:wh,tileToQuadkey:Ny,quadkeyToTile:zy,pointToTile:Hs,bboxToTile:Uy,pointToTileFraction:_h},Gy=Vy;function Vy(e,t){var r,n,i=e.coordinates,o=t.max_zoom,a={},s=[];if(e.type==="Point")return[Do.pointToTile(i[0],i[1],o)];if(e.type==="MultiPoint")for(r=0;r<i.length;r++)n=Do.pointToTile(i[r][0],i[r][1],o),a[He(n[0],n[1],n[2])]=!0;else if(e.type==="LineString")js(a,i,o);else if(e.type==="MultiLineString")for(r=0;r<i.length;r++)js(a,i[r],o);else if(e.type==="Polygon")hh(a,s,i,o);else if(e.type==="MultiPolygon")for(r=0;r<i.length;r++)hh(a,s,i[r],o);else throw new Error("Geometry type not implemented");if(t.min_zoom!==o){var l=s.length;for(ph(a,s),r=0;r<l;r++){var f=s[r];a[He(f[0],f[1],f[2])]=!0}return $y(a,s,t)}return ph(a,s),s}function $y(e,t,r){for(var n=[],i=r.max_zoom;i>r.min_zoom;i--){for(var o={},a=[],s=0;s<t.length;s++){var l=t[s];if(l[0]%2===0&&l[1]%2===0){var f=He(l[0]+1,l[1],i),c=He(l[0],l[1]+1,i),u=He(l[0]+1,l[1]+1,i);if(e[f]&&e[c]&&e[u]){e[He(l[0],l[1],l[2])]=!1,e[f]=!1,e[c]=!1,e[u]=!1;var d=[l[0]/2,l[1]/2,i-1];i-1===r.min_zoom?n.push(d):(o[He(l[0]/2,l[1]/2,i-1)]=!0,a.push(d))}}}for(s=0;s<t.length;s++)l=t[s],e[He(l[0],l[1],l[2])]&&n.push(l);e=o,t=a}return n}function hh(e,t,r,n){for(var i=[],o=0;o<r.length;o++){var a=[];js(e,r[o],n,a);for(var s=0,l=a.length,f=l-1;s<l;f=s++){var c=(s+1)%l,u=a[s][1];(u>a[f][1]||u>a[c][1])&&(u<a[f][1]||u<a[c][1])&&u!==a[c][1]&&i.push(a[s])}}for(i.sort(Zy),o=0;o<i.length;o+=2){u=i[o][1];for(var d=i[o][0]+1;d<i[o+1][0];d++){var h=He(d,u,n);e[h]||t.push([d,u,n])}}}function Zy(e,t){return e[1]-t[1]||e[0]-t[0]}function js(e,t,r,n){for(var i,o,a=0;a<t.length-1;a++){var s=Do.pointToTileFraction(t[a][0],t[a][1],r),l=Do.pointToTileFraction(t[a+1][0],t[a+1][1],r),f=s[0],c=s[1],u=l[0],d=l[1],h=u-f,g=d-c;if(!(g===0&&h===0)){var x=h>0?1:-1,T=g>0?1:-1,_=Math.floor(f),v=Math.floor(c),M=h===0?1/0:Math.abs(((h>0?1:0)+_-f)/h),L=g===0?1/0:Math.abs(((g>0?1:0)+v-c)/g),I=Math.abs(x/h),B=Math.abs(T/g);for((_!==i||v!==o)&&(e[He(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v);M<1||L<1;)M<L?(M+=I,_+=x):(L+=B,v+=T),e[He(_,v,r)]=!0,n&&v!==o&&n.push([_,v]),i=_,o=v}}n&&v===n[0][1]&&n.pop()}function ph(e,t){for(var r=Object.keys(e),n=0;n<r.length;n++)t.push(Hy(+r[n]))}function He(e,t,r){var n=2*(1<<r);return(n*t+e)*32+r}function Hy(e){var t=e%32,r=2*(1<<t),n=(e-t)/32,i=n%r,o=(n-i)/r%r;return[i,o,t]}var Eh=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],Sh=[0n,1n,2n,4n,8n,16n],gh=512;function jy(e){let{x:t,y:r,z:n}=Ws(e),i=gh/(1<<n);return[t*i,gh-r*i,i]}function Yy(e,t){let[r,n,i]=jy(e);return[[r,n],[r+t*i,n-t*i]]}function Wy(e,t=1){let[r,n]=Yy(e,t),[i,o]=Te(r),[a,s]=Te(n);return[a,o,a,s,i,s,i,o,a,o]}function Ys(e){if(e.z<0||e.z>26)throw new Error("Wrong zoom");let t=BigInt(e.z),r=BigInt(e.x)<<32n-t,n=BigInt(e.y)<<32n-t;for(let o=0;o<5;o++){let a=Sh[5-o],s=Eh[4-o];r=(r|r<<a)&s,n=(n|n<<a)&s}return 0x4000000000000000n|1n<<59n|t<<52n|(r|n<<1n)>>12n|0xfffffffffffffn>>t*2n}function Ws(e){let t=e>>59n&7n,r=e>>57n&3n,n=e>>52n&0x1fn,i=(e&0xfffffffffffffn)<<12n;if(t!==1n&&r!==0n)throw new Error("Wrong mode");let o=i,a=i>>1n;for(let s=0;s<6;s++){let l=Sh[s],f=Eh[s];o=(o|o>>l)&f,a=(a|a>>l)&f}return o=o>>32n-n,a=a>>32n-n,{z:Number(n),x:Number(o),y:Number(a)}}function No(e){return e>>52n&0x1fn}function Th(e,t){let r=Number(t);return Gy(e,{min_zoom:r,max_zoom:r}).map(([n,i,o])=>Ys({x:n,y:i,z:o}))}function Ch(e){let t=Wy(e);return{type:"Polygon",coordinates:[[[t[0],t[1]],[t[2],t[3]],[t[4],t[5]],[t[6],t[7]],[t[0],t[1]]]]}}var Zf=q(Yt(),1);var Dp=q(Yt(),1);var Xs=class{add(t,r,n){if(typeof arguments[0]!="string")for(let i in arguments[0])this.add(i,arguments[0][i],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(i){this[i]=this[i]||[],r&&this[i][n?"unshift":"push"](r)},this)}run(t,r){this[t]=this[t]||[],this[t].forEach(function(n){n.call(r&&r.context?r.context:r,r)})}},Ks=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(r=>{if(typeof r!="object"||!r.name||!r.init)throw new Error("Invalid JSEP plugin format");this.registered[r.name]||(r.init(this.jsep),this.registered[r.name]=r)})}},F=class{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+F.version}static addUnaryOp(t){return F.max_unop_len=Math.max(t.length,F.max_unop_len),F.unary_ops[t]=1,F}static addBinaryOp(t,r,n){return F.max_binop_len=Math.max(t.length,F.max_binop_len),F.binary_ops[t]=r,n?F.right_associative.add(t):F.right_associative.delete(t),F}static addIdentifierChar(t){return F.additional_identifier_chars.add(t),F}static addLiteral(t,r){return F.literals[t]=r,F}static removeUnaryOp(t){return delete F.unary_ops[t],t.length===F.max_unop_len&&(F.max_unop_len=F.getMaxKeyLen(F.unary_ops)),F}static removeAllUnaryOps(){return F.unary_ops={},F.max_unop_len=0,F}static removeIdentifierChar(t){return F.additional_identifier_chars.delete(t),F}static removeBinaryOp(t){return delete F.binary_ops[t],t.length===F.max_binop_len&&(F.max_binop_len=F.getMaxKeyLen(F.binary_ops)),F.right_associative.delete(t),F}static removeAllBinaryOps(){return F.binary_ops={},F.max_binop_len=0,F}static removeLiteral(t){return delete F.literals[t],F}static removeAllLiterals(){return F.literals={},F}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new F(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(r=>r.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return F.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!F.binary_ops[String.fromCharCode(t)]||F.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return F.isIdentifierStart(t)||F.isDecimalDigit(t)}throwError(t){let r=new Error(t+" at character "+this.index);throw r.index=this.index,r.description=t,r}runHook(t,r){if(F.hooks[t]){let n={context:this,node:r};return F.hooks.run(t,n),n.node}return r}searchHook(t){if(F.hooks[t]){let r={context:this};return F.hooks[t].find(function(n){return n.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let t=this.code;for(;t===F.SPACE_CODE||t===F.TAB_CODE||t===F.LF_CODE||t===F.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),r=t.length===1?t[0]:{type:F.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r=[],n,i;for(;this.index<this.expr.length;)if(n=this.code,n===F.SEMCOL_CODE||n===F.COMMA_CODE)this.index++;else if(i=this.gobbleExpression())r.push(i);else if(this.index<this.expr.length){if(n===t)break;this.throwError('Unexpected "'+this.char+'"')}return r}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,F.max_binop_len),r=t.length;for(;r>0;){if(F.binary_ops.hasOwnProperty(t)&&(!F.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!F.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=r,t;t=t.substr(0,--r)}return!1}gobbleBinaryExpression(){let t,r,n,i,o,a,s,l,f;if(a=this.gobbleToken(),!a||(r=this.gobbleBinaryOp(),!r))return a;for(o={value:r,prec:F.binaryPrecedence(r),right_a:F.right_associative.has(r)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+r),i=[a,o,s];r=this.gobbleBinaryOp();){if(n=F.binaryPrecedence(r),n===0){this.index-=r.length;break}o={value:r,prec:n,right_a:F.right_associative.has(r)},f=r;let c=u=>o.right_a&&u.right_a?n>u.prec:n<=u.prec;for(;i.length>2&&c(i[i.length-2]);)s=i.pop(),r=i.pop().value,a=i.pop(),t={type:F.BINARY_EXP,operator:r,left:a,right:s},i.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+f),i.push(o,t)}for(l=i.length-1,t=i[l];l>1;)t={type:F.BINARY_EXP,operator:i[l-1].value,left:i[l-2],right:t},l-=2;return t}gobbleToken(){let t,r,n,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"),i)return this.runHook("after-token",i);if(t=this.code,F.isDecimalDigit(t)||t===F.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===F.SQUOTE_CODE||t===F.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(t===F.OBRACK_CODE)i=this.gobbleArray();else{for(r=this.expr.substr(this.index,F.max_unop_len),n=r.length;n>0;){if(F.unary_ops.hasOwnProperty(r)&&(!F.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!F.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=n;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:F.UNARY_EXP,operator:r,argument:o,prefix:!0})}r=r.substr(0,--n)}F.isIdentifierStart(t)?(i=this.gobbleIdentifier(),F.literals.hasOwnProperty(i.name)?i={type:F.LITERAL,value:F.literals[i.name],raw:i.name}:i.name===F.this_str&&(i={type:F.THIS_EXP})):t===F.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let r=this.code;for(;r===F.PERIOD_CODE||r===F.OBRACK_CODE||r===F.OPAREN_CODE||r===F.QUMARK_CODE;){let n;if(r===F.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==F.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===F.OBRACK_CODE?(t={type:F.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),r=this.code,r!==F.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===F.OPAREN_CODE?t={type:F.CALL_EXP,arguments:this.gobbleArguments(F.CPAREN_CODE),callee:t}:(r===F.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),t={type:F.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),n&&(t.optional=!0),this.gobbleSpaces(),r=this.code}return t}gobbleNumericLiteral(){let t="",r,n;for(;F.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===F.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);F.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(r=this.char,r==="e"||r==="E"){for(t+=this.expr.charAt(this.index++),r=this.char,(r==="+"||r==="-")&&(t+=this.expr.charAt(this.index++));F.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);F.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return n=this.code,F.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(n===F.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===F.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:F.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",r=this.index,n=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===n){i=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=`
|
|
170
170
|
`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=o}else t+=o}return i||this.throwError('Unclosed quote after "'+t+'"'),{type:F.LITERAL,value:t,raw:this.expr.substring(r,this.index)}}gobbleIdentifier(){let t=this.code,r=this.index;for(F.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,F.isIdentifierPart(t));)this.index++;return{type:F.IDENTIFIER,name:this.expr.slice(r,this.index)}}gobbleArguments(t){let r=[],n=!1,i=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){n=!0,this.index++,t===F.CPAREN_CODE&&i&&i>=r.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===F.COMMA_CODE){if(this.index++,i++,i!==r.length){if(t===F.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===F.CBRACK_CODE)for(let a=r.length;a<i;a++)r.push(null)}}else if(r.length!==i&&i!==0)this.throwError("Expected comma");else{let a=this.gobbleExpression();(!a||a.type===F.COMPOUND)&&this.throwError("Expected comma"),r.push(a)}}return n||this.throwError("Expected "+String.fromCharCode(t)),r}gobbleGroup(){this.index++;let t=this.gobbleExpressions(F.CPAREN_CODE);if(this.code===F.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:F.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:F.ARRAY_EXP,elements:this.gobbleArguments(F.CBRACK_CODE)}}},Xy=new Xs;Object.assign(F,{hooks:Xy,plugins:new Ks(F),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});F.max_unop_len=F.getMaxKeyLen(F.unary_ops);F.max_binop_len=F.getMaxKeyLen(F.binary_ops);var Kr=e=>new F(e).parse(),Ky=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(F).filter(e=>!Ky.includes(e)&&Kr[e]===void 0).forEach(e=>{Kr[e]=F[e]});Kr.Jsep=F;var Qy="ConditionalExpression",Jy={name:"ternary",init(e){e.hooks.add("after-expression",function(r){if(r.node&&this.code===e.QUMARK_CODE){this.index++;let n=r.node,i=this.gobbleExpression();if(i||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),r.node={type:Qy,test:n,consequent:i,alternate:o},n.operator&&e.binary_ops[n.operator]<=.9){let a=n;for(;a.right.operator&&e.binary_ops[a.right.operator]<=.9;)a=a.right;r.node.test=a.right,a.right=r.node,r.node=n}}else this.throwError("Expected :")}})}};Kr.plugins.register(Jy);function ft(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Qs(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zo(e){let t,r,n;e.length!==2?(t=ft,r=(s,l)=>ft(e(s),l),n=(s,l)=>e(s)-l):(t=e===ft||e===Qs?e:ex,r=e,n=e);function i(s,l,f=0,c=s.length){if(f<c){if(t(l,l)!==0)return c;do{let u=f+c>>>1;r(s[u],l)<0?f=u+1:c=u}while(f<c)}return f}function o(s,l,f=0,c=s.length){if(f<c){if(t(l,l)!==0)return c;do{let u=f+c>>>1;r(s[u],l)<=0?f=u+1:c=u}while(f<c)}return f}function a(s,l,f=0,c=s.length){let u=i(s,l,f,c-1);return u>f&&n(s[u-1],l)>-n(s[u],l)?u-1:u}return{left:i,center:a,right:o}}function ex(){return 0}function di(e){return e===null?NaN:+e}var Ah=zo(ft),Ph=Ah.right,tx=Ah.left,rx=zo(di).center,_t=Ph;var Qr=class extends Map{constructor(t,r=ox){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(let[n,i]of t)this.set(n,i)}get(t){return super.get(kh(this,t))}has(t){return super.has(kh(this,t))}set(t,r){return super.set(nx(this,t),r)}delete(t){return super.delete(ix(this,t))}};function kh({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):r}function nx({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function ix({_intern:e,_key:t},r){let n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function ox(e){return e!==null&&typeof e=="object"?e.valueOf():e}var ax=Math.sqrt(50),sx=Math.sqrt(10),fx=Math.sqrt(2);function Uo(e,t,r){let n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),a=o>=ax?10:o>=sx?5:o>=fx?2:1,s,l,f;return i<0?(f=Math.pow(10,-i)/a,s=Math.round(e*f),l=Math.round(t*f),s/f<e&&++s,l/f>t&&--l,f=-f):(f=Math.pow(10,i)*a,s=Math.round(e/f),l=Math.round(t/f),s*f<e&&++s,l*f>t&&--l),l<s&&.5<=r&&r<2?Uo(e,t,r*2):[s,l,f]}function cr(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];let n=t<e,[i,o,a]=n?Uo(t,e,r):Uo(e,t,r);if(!(o>=i))return[];let s=o-i+1,l=new Array(s);if(n)if(a<0)for(let f=0;f<s;++f)l[f]=(o-f)/-a;else for(let f=0;f<s;++f)l[f]=(o-f)*a;else if(a<0)for(let f=0;f<s;++f)l[f]=(i+f)/-a;else for(let f=0;f<s;++f)l[f]=(i+f)*a;return l}function hi(e,t,r){return t=+t,e=+e,r=+r,Uo(e,t,r)[2]}function Js(e,t,r){t=+t,e=+e,r=+r;let n=t<e,i=n?hi(t,e,r):hi(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function ef(e,t,r=di){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),a=+r(e[o],o,e),s=+r(e[o+1],o+1,e);return a+(s-a)*(i-o)}}function qo(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n<i;)o[n]=e+n*r;return o}function ue(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var tf=Symbol("implicit");function ur(){var e=new Qr,t=[],r=[],n=tf;function i(o){let a=e.get(o);if(a===void 0){if(n!==tf)return n;e.set(o,a=t.push(o)-1)}return r[a%r.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Qr;for(let a of o)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return ur(t,r).unknown(n)},ue.apply(i,arguments),i}function Go(){var e=ur().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,o,a,s=!1,l=0,f=0,c=.5;delete e.unknown;function u(){var d=t().length,h=i<n,g=h?i:n,x=h?n:i;o=(x-g)/Math.max(1,d-l+f*2),s&&(o=Math.floor(o)),g+=(x-g-o*(d-l))*c,a=o*(1-l),s&&(g=Math.round(g),a=Math.round(a));var T=qo(d).map(function(_){return g+o*_});return r(h?T.reverse():T)}return e.domain=function(d){return arguments.length?(t(d),u()):t()},e.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,u()):[n,i]},e.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,s=!0,u()},e.bandwidth=function(){return a},e.step=function(){return o},e.round=function(d){return arguments.length?(s=!!d,u()):s},e.padding=function(d){return arguments.length?(l=Math.min(1,f=+d),u()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),u()):l},e.paddingOuter=function(d){return arguments.length?(f=+d,u()):f},e.align=function(d){return arguments.length?(c=Math.max(0,Math.min(1,d)),u()):c},e.copy=function(){return Go(t(),[n,i]).round(s).paddingInner(l).paddingOuter(f).align(c)},ue.apply(u(),arguments)}function Mh(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Mh(t())},e}function rf(){return Mh(Go.apply(null,arguments).paddingInner(1))}function Vo(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function nf(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function mi(){}var pi=.7,Ho=1/pi,Jr="\\s*([+-]?\\d+)\\s*",gi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",lt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lx=/^#([0-9a-f]{3,8})$/,cx=new RegExp(`^rgb\\(${Jr},${Jr},${Jr}\\)$`),ux=new RegExp(`^rgb\\(${lt},${lt},${lt}\\)$`),dx=new RegExp(`^rgba\\(${Jr},${Jr},${Jr},${gi}\\)$`),hx=new RegExp(`^rgba\\(${lt},${lt},${lt},${gi}\\)$`),px=new RegExp(`^hsl\\(${gi},${lt},${lt}\\)$`),gx=new RegExp(`^hsla\\(${gi},${lt},${lt},${gi}\\)$`),Fh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Vo(mi,qt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Lh,formatHex:Lh,formatHex8:mx,formatHsl:bx,formatRgb:Ih,toString:Ih});function Lh(){return this.rgb().formatHex()}function mx(){return this.rgb().formatHex8()}function bx(){return zh(this).formatHsl()}function Ih(){return this.rgb().formatRgb()}function qt(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=lx.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Oh(t):r===3?new xe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?$o(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?$o(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=cx.exec(e))?new xe(t[1],t[2],t[3],1):(t=ux.exec(e))?new xe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dx.exec(e))?$o(t[1],t[2],t[3],t[4]):(t=hx.exec(e))?$o(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=px.exec(e))?Dh(t[1],t[2]/100,t[3]/100,1):(t=gx.exec(e))?Dh(t[1],t[2]/100,t[3]/100,t[4]):Fh.hasOwnProperty(e)?Oh(Fh[e]):e==="transparent"?new xe(NaN,NaN,NaN,0):null}function Oh(e){return new xe(e>>16&255,e>>8&255,e&255,1)}function $o(e,t,r,n){return n<=0&&(e=t=r=NaN),new xe(e,t,r,n)}function yx(e){return e instanceof mi||(e=qt(e)),e?(e=e.rgb(),new xe(e.r,e.g,e.b,e.opacity)):new xe}function en(e,t,r,n){return arguments.length===1?yx(e):new xe(e,t,r,n??1)}function xe(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Vo(xe,en,nf(mi,{brighter(e){return e=e==null?Ho:Math.pow(Ho,e),new xe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pi:Math.pow(pi,e),new xe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xe(hr(this.r),hr(this.g),hr(this.b),jo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Rh,formatHex:Rh,formatHex8:xx,formatRgb:Bh,toString:Bh}));function Rh(){return`#${dr(this.r)}${dr(this.g)}${dr(this.b)}`}function xx(){return`#${dr(this.r)}${dr(this.g)}${dr(this.b)}${dr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Bh(){let e=jo(this.opacity);return`${e===1?"rgb(":"rgba("}${hr(this.r)}, ${hr(this.g)}, ${hr(this.b)}${e===1?")":`, ${e})`}`}function jo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dr(e){return e=hr(e),(e<16?"0":"")+e.toString(16)}function Dh(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new je(e,t,r,n)}function zh(e){if(e instanceof je)return new je(e.h,e.s,e.l,e.opacity);if(e instanceof mi||(e=qt(e)),!e)return new je;if(e instanceof je)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(r-n)/s+(r<n)*6:r===o?a=(n-t)/s+2:a=(t-r)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new je(a,s,l,e.opacity)}function Uh(e,t,r,n){return arguments.length===1?zh(e):new je(e,t,r,n??1)}function je(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Vo(je,Uh,nf(mi,{brighter(e){return e=e==null?Ho:Math.pow(Ho,e),new je(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pi:Math.pow(pi,e),new je(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new xe(of(e>=240?e-240:e+120,i,n),of(e,i,n),of(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new je(Nh(this.h),Zo(this.s),Zo(this.l),jo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=jo(this.opacity);return`${e===1?"hsl(":"hsla("}${Nh(this.h)}, ${Zo(this.s)*100}%, ${Zo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Nh(e){return e=(e||0)%360,e<0?e+360:e}function Zo(e){return Math.max(0,Math.min(1,e||0))}function of(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}function af(e,t,r,n,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*r+(1+3*e+3*o-3*a)*n+a*i)/6}function qh(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],o=e[n+1],a=n>0?e[n-1]:2*i-o,s=n<t-1?e[n+2]:2*o-i;return af((r-n/t)*t,a,i,o,s)}}function Gh(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],o=e[n%t],a=e[(n+1)%t],s=e[(n+2)%t];return af((r-n/t)*t,i,o,a,s)}}var bi=e=>()=>e;function vx(e,t){return function(r){return e+r*t}}function wx(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Vh(e){return(e=+e)==1?Yo:function(t,r){return r-t?wx(t,r,e):bi(isNaN(t)?r:t)}}function Yo(e,t){var r=t-e;return r?vx(e,r):bi(isNaN(e)?t:e)}var sf=function e(t){var r=Vh(t);function n(i,o){var a=r((i=en(i)).r,(o=en(o)).r),s=r(i.g,o.g),l=r(i.b,o.b),f=Yo(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=f(c),i+""}}return n.gamma=e,n}(1);function $h(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),o=new Array(r),a,s;for(a=0;a<r;++a)s=en(t[a]),n[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return n=e(n),i=e(i),o=e(o),s.opacity=1,function(l){return s.r=n(l),s.g=i(l),s.b=o(l),s+""}}}var D9=$h(qh),N9=$h(Gh);function Zh(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;i<r;++i)n[i]=e[i]*(1-o)+t[i]*o;return n}}function Hh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function jh(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),o=new Array(r),a;for(a=0;a<n;++a)i[a]=pr(e[a],t[a]);for(;a<r;++a)o[a]=t[a];return function(s){for(a=0;a<n;++a)o[a]=i[a](s);return o}}function Yh(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Gt(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Wh(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=pr(e[i],t[i]):n[i]=t[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var lf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ff=new RegExp(lf.source,"g");function _x(e){return function(){return e}}function Ex(e){return function(t){return e(t)+""}}function Xh(e,t){var r=lf.lastIndex=ff.lastIndex=0,n,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(n=lf.exec(e))&&(i=ff.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Gt(n,i)})),r=ff.lastIndex;return r<t.length&&(o=t.slice(r),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?Ex(l[0].x):_x(t):(t=l.length,function(f){for(var c=0,u;c<t;++c)s[(u=l[c]).i]=u.x(f);return s.join("")})}function pr(e,t){var r=typeof t,n;return t==null||r==="boolean"?bi(t):(r==="number"?Gt:r==="string"?(n=qt(t))?(t=n,sf):Xh:t instanceof qt?sf:t instanceof Date?Yh:Hh(t)?Zh:Array.isArray(t)?jh:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Wh:Gt)(e,t)}function cf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function uf(e){return function(){return e}}function df(e){return+e}var Kh=[0,1];function Ye(e){return e}function hf(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:uf(isNaN(t)?NaN:.5)}function Sx(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Tx(e,t,r){var n=e[0],i=e[1],o=t[0],a=t[1];return i<n?(n=hf(i,n),o=r(a,o)):(n=hf(n,i),o=r(o,a)),function(s){return o(n(s))}}function Cx(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),o=new Array(n),a=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<n;)i[a]=hf(e[a],e[a+1]),o[a]=r(t[a],t[a+1]);return function(s){var l=_t(e,s,1,n)-1;return o[l](i[l](s))}}function tn(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function yi(){var e=Kh,t=Kh,r=pr,n,i,o,a=Ye,s,l,f;function c(){var d=Math.min(e.length,t.length);return a!==Ye&&(a=Sx(e[0],e[d-1])),s=d>2?Cx:Tx,l=f=null,u}function u(d){return d==null||isNaN(d=+d)?o:(l||(l=s(e.map(n),t,r)))(n(a(d)))}return u.invert=function(d){return a(i((f||(f=s(t,e.map(n),Gt)))(d)))},u.domain=function(d){return arguments.length?(e=Array.from(d,df),c()):e.slice()},u.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},u.rangeRound=function(d){return t=Array.from(d),r=cf,c()},u.clamp=function(d){return arguments.length?(a=d?!0:Ye,c()):a!==Ye},u.interpolate=function(d){return arguments.length?(r=d,c()):r},u.unknown=function(d){return arguments.length?(o=d,u):o},function(d,h){return n=d,i=h,c()}}function pf(){return yi()(Ye,Ye)}function Qh(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function gr(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ct(e){return e=gr(Math.abs(e)),e?e[1]:NaN}function Jh(e,t){return function(r,n){for(var i=r.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function e0(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Ax=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ut(e){if(!(t=Ax.exec(e)))throw new Error("invalid format: "+e);var t;return new Wo({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ut.prototype=Wo.prototype;function Wo(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Wo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function t0(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var gf;function r0(e,t){var r=gr(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(gf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=n.length;return o===a?n:o>a?n+new Array(o-a+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+gr(e,Math.max(0,t+o-1))[0]}function mf(e,t){var r=gr(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var bf={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Qh,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>mf(e*100,t),r:mf,s:r0,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function yf(e){return e}var n0=Array.prototype.map,i0=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function o0(e){var t=e.grouping===void 0||e.thousands===void 0?yf:Jh(n0.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?yf:e0(n0.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"\u2212":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function f(u){u=ut(u);var d=u.fill,h=u.align,g=u.sign,x=u.symbol,T=u.zero,_=u.width,v=u.comma,M=u.precision,L=u.trim,I=u.type;I==="n"?(v=!0,I="g"):bf[I]||(M===void 0&&(M=12),L=!0,I="g"),(T||d==="0"&&h==="=")&&(T=!0,d="0",h="=");var B=x==="$"?r:x==="#"&&/[boxX]/.test(I)?"0"+I.toLowerCase():"",N=x==="$"?n:/[%p]/.test(I)?a:"",p=bf[I],m=/[defgprs%]/.test(I);M=M===void 0?6:/[gprs]/.test(I)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function b(y){var w=B,S=N,P,E,C;if(I==="c")S=p(y)+S,y="";else{y=+y;var k=y<0||1/y<0;if(y=isNaN(y)?l:p(Math.abs(y),M),L&&(y=t0(y)),k&&+y==0&&g!=="+"&&(k=!1),w=(k?g==="("?g:s:g==="-"||g==="("?"":g)+w,S=(I==="s"?i0[8+gf/3]:"")+S+(k&&g==="("?")":""),m){for(P=-1,E=y.length;++P<E;)if(C=y.charCodeAt(P),48>C||C>57){S=(C===46?i+y.slice(P+1):y.slice(P))+S,y=y.slice(0,P);break}}}v&&!T&&(y=t(y,1/0));var A=w.length+y.length+S.length,O=A<_?new Array(_-A+1).join(d):"";switch(v&&T&&(y=t(O+y,O.length?_-S.length:1/0),O=""),h){case"<":y=w+y+S+O;break;case"=":y=w+O+y+S;break;case"^":y=O.slice(0,A=O.length>>1)+w+y+S+O.slice(A);break;default:y=O+w+y+S;break}return o(y)}return b.toString=function(){return u+""},b}function c(u,d){var h=f((u=ut(u),u.type="f",u)),g=Math.max(-8,Math.min(8,Math.floor(ct(d)/3)))*3,x=Math.pow(10,-g),T=i0[8+g/3];return function(_){return h(x*_)+T}}return{format:f,formatPrefix:c}}var Xo,Et,Ko;xf({thousands:",",grouping:[3],currency:["$",""]});function xf(e){return Xo=o0(e),Et=Xo.format,Ko=Xo.formatPrefix,Xo}function vf(e){return Math.max(0,-ct(Math.abs(e)))}function wf(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ct(t)/3)))*3-ct(Math.abs(e)))}function _f(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ct(t)-ct(e))+1}function Ef(e,t,r,n){var i=Js(e,t,r),o;switch(n=ut(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=wf(i,a))&&(n.precision=o),Ko(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=_f(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=vf(i))&&(n.precision=o-(n.type==="%")*2);break}}return Et(n)}function xi(e){var t=e.domain;return e.ticks=function(r){var n=t();return cr(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Ef(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,a=n[i],s=n[o],l,f,c=10;for(s<a&&(f=a,a=s,s=f,f=i,i=o,o=f);c-- >0;){if(f=hi(a,s,r),f===l)return n[i]=a,n[o]=s,t(n);if(f>0)a=Math.floor(a/f)*f,s=Math.ceil(s/f)*f;else if(f<0)a=Math.ceil(a*f)/f,s=Math.floor(s*f)/f;else break;l=f}return e},e}function mr(){var e=pf();return e.copy=function(){return tn(e,mr())},ue.apply(e,arguments),xi(e)}function Sf(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],a;return o<i&&(a=r,r=n,n=a,a=i,i=o,o=a),e[r]=t.floor(i),e[n]=t.ceil(o),e}function a0(e){return Math.log(e)}function s0(e){return Math.exp(e)}function Px(e){return-Math.log(-e)}function kx(e){return-Math.exp(-e)}function Mx(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Fx(e){return e===10?Mx:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Lx(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function f0(e){return(t,r)=>-e(-t,r)}function Ix(e){let t=e(a0,s0),r=t.domain,n=10,i,o;function a(){return i=Lx(n),o=Fx(n),r()[0]<0?(i=f0(i),o=f0(o),e(Px,kx)):e(a0,s0),t}return t.base=function(s){return arguments.length?(n=+s,a()):n},t.domain=function(s){return arguments.length?(r(s),a()):r()},t.ticks=s=>{let l=r(),f=l[0],c=l[l.length-1],u=c<f;u&&([f,c]=[c,f]);let d=i(f),h=i(c),g,x,T=s==null?10:+s,_=[];if(!(n%1)&&h-d<T){if(d=Math.floor(d),h=Math.ceil(h),f>0){for(;d<=h;++d)for(g=1;g<n;++g)if(x=d<0?g/o(-d):g*o(d),!(x<f)){if(x>c)break;_.push(x)}}else for(;d<=h;++d)for(g=n-1;g>=1;--g)if(x=d>0?g/o(-d):g*o(d),!(x<f)){if(x>c)break;_.push(x)}_.length*2<T&&(_=cr(f,c,T))}else _=cr(d,h,Math.min(h-d,T)).map(o);return u?_.reverse():_},t.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=ut(l)).precision==null&&(l.trim=!0),l=Et(l)),s===1/0)return l;let f=Math.max(1,n*s/t.ticks().length);return c=>{let u=c/o(Math.round(i(c)));return u*n<n-.5&&(u*=n),u<=f?l(c):""}},t.nice=()=>r(Sf(r(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function vi(){let e=Ix(yi()).domain([1,10]);return e.copy=()=>tn(e,vi()).base(e.base()),ue.apply(e,arguments),e}function l0(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Ox(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Rx(e){return e<0?-e*e:e*e}function Bx(e){var t=e(Ye,Ye),r=1;function n(){return r===1?e(Ye,Ye):r===.5?e(Ox,Rx):e(l0(r),l0(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},xi(t)}function Qo(){var e=Bx(yi());return e.copy=function(){return tn(e,Qo()).exponent(e.exponent())},ue.apply(e,arguments),e}function Tf(){return Qo.apply(null,arguments).exponent(.5)}function wi(){var e=[],t=[],r=[],n;function i(){var a=0,s=Math.max(1,t.length);for(r=new Array(s-1);++a<s;)r[a-1]=ef(e,a/s);return o}function o(a){return a==null||isNaN(a=+a)?n:t[_t(r,a)]}return o.invertExtent=function(a){var s=t.indexOf(a);return s<0?[NaN,NaN]:[s>0?r[s-1]:e[0],s<r.length?r[s]:e[e.length-1]]},o.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(ft),i()},o.range=function(a){return arguments.length?(t=Array.from(a),i()):t.slice()},o.unknown=function(a){return arguments.length?(n=a,o):n},o.quantiles=function(){return r.slice()},o.copy=function(){return wi().domain(e).range(t).unknown(n)},ue.apply(o,arguments)}function _i(){var e=0,t=1,r=1,n=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[_t(n,l,0,r)]:o}function s(){var l=-1;for(n=new Array(r);++l<r;)n[l]=((l+1)*t-(l-r)*e)/(r+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,s()):[e,t]},a.range=function(l){return arguments.length?(r=(i=Array.from(l)).length-1,s()):i.slice()},a.invertExtent=function(l){var f=i.indexOf(l);return f<0?[NaN,NaN]:f<1?[e,n[0]]:f>=r?[n[r-1],t]:[n[f-1],n[f]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return n.slice()},a.copy=function(){return _i().domain([e,t]).range(i).unknown(o)},ue.apply(xi(a),arguments)}function br(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[_t(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return br().domain(e).range(t).unknown(r)},ue.apply(i,arguments)}var k6={},Dx=Object.create,Wf=Object.defineProperty,Nx=Object.getOwnPropertyDescriptor,np=Object.getOwnPropertyNames,zx=Object.getPrototypeOf,Ux=Object.prototype.hasOwnProperty,qx=(e,t,r)=>t in e?Wf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gx=(e,t)=>function(){return t||(0,e[np(e)[0]])((t={exports:{}}).exports,t),t.exports},Vx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of np(t))!Ux.call(e,i)&&i!==r&&Wf(e,i,{get:()=>t[i],enumerable:!(n=Nx(t,i))||n.enumerable});return e},$x=(e,t,r)=>(r=e!=null?Dx(zx(e)):{},Vx(t||!e||!e.__esModule?Wf(r,"default",{value:e,enumerable:!0}):r,e)),D=(e,t,r)=>qx(e,typeof t!="symbol"?t+"":t,r),Zx=Gx({"node_modules/thenby/thenBy.module.js"(e,t){"use strict";t.exports=function(){function r(a){return a}function n(a){return typeof a=="string"?a.toLowerCase():a}function i(a,s){if(s=typeof s=="object"?s:{direction:s},typeof a!="function"){var l=a;a=function(h){return h[l]?h[l]:""}}if(a.length===1){var f=a,c=s.ignoreCase?n:r,u=s.cmp||function(h,g){return h<g?-1:h>g?1:0};a=function(h,g){return u(c(f(h)),c(f(g)))}}let d={"-1":"",desc:""};return s.direction in d?function(h,g){return-a(h,g)}:a}function o(a,s){var l=typeof this=="function"&&!this.firstBy?this:!1,f=i(a,s),c=l?function(u,d){return l(u,d)||f(u,d)}:f;return c.thenBy=o,c}return o.firstBy=o,o}()}}),Hx="deck-gl-carto";function Di(){return Hx}var Xf=(e=>(e.IN="in",e.BETWEEN="between",e.CLOSED_OPEN="closed_open",e.TIME="time",e.STRING_SEARCH="stringSearch",e))(Xf||{}),ip=(e=>(e.V1="v1",e.V2="v2",e.V3="v3",e))(ip||{}),Kf="https://gcp-us-east1.api.carto.com";var op=(e=>(e.H3="h3",e.QUADBIN="quadbin",e))(op||{});var jx=Object.freeze({h3:["h3","hex","h3id","hex_id","h3hex"],quadbin:["quadbin"]}),De={Count:"count",Avg:"avg",Min:"min",Max:"max",Sum:"sum",Custom:"custom"};function ap(e){return e.map(t=>t[0]===void 0||t[0]===null?[Number.MIN_SAFE_INTEGER,t[1]]:t[1]===void 0||t[1]===null?[t[0],Number.MAX_SAFE_INTEGER]:t)}var Yx={in:Wx,between:sp,time:Xx,closed_open:Kx,stringSearch:Qx};function Wx(e,t){return e.includes(t)}function sp(e,t){let r=n=>{let[i,o]=n;return t>=i&&t<=o};return ap(e).some(r)}function Xx(e,t){let r=new Date(t).getTime();if(isFinite(r))return sp(e,r);throw new Error("Column used to filter by time isn't well formatted.")}function Kx(e,t){let r=n=>{let[i,o]=n;return t>=i&&t<o};return ap(e).some(r)}function Qx(e,t,r={}){let n=c0(t,r),i=r.useRegExp?e:e.map(a=>{let s=tv(c0(a,r));return r.mustStart&&(s=`^${s}`),r.mustEnd&&(s=`${s}$`),s}),o=new RegExp(i.join("|"),r.caseSensitive?"g":"gi");return!!n.match(o)}var Jx=/[.*+?^${}()|[\]\\]/g,ev=/\p{Diacritic}/gu;function tv(e){return e.replace(Jx,"\\$&")}function c0(e,t){let r=String(e);return t.keepSpecialCharacters||(r=r.normalize("NFD").replace(ev,"")),r}var rv={and:"every",or:"some"};function nv(e,t,r,n){let i=rv[n];return e[i](o=>{let a=t[o],s=Object.keys(a);return!r||r[o]===null||r[o]===void 0?!1:s.every(l=>{let f=Yx[l];if(!f)throw new Error(`"${l}" filter is not implemented.`);return f(a[l].values,r[o],a[l].params)})})}function iv({filters:e={},type:t="boolean",filtersLogicalOperator:r="and"}){let n=Object.keys(e);return n.length?i=>{let o=i.properties||i,a=nv(n,e,o,r);return t==="number"?Number(a):a}:()=>t==="number"?1:!0}function ov(e,t,r){return Object.keys(t).length?e.filter(iv({filters:t,filtersLogicalOperator:r})):e}var W=11102230246251565e-32,de=134217729,av=(3+8*W)*W;function Cf(e,t,r,n,i){let o,a,s,l,f=t[0],c=n[0],u=0,d=0;c>f==c>-f?(o=f,f=t[++u]):(o=c,c=n[++d]);let h=0;if(u<e&&d<r)for(c>f==c>-f?(a=f+o,s=o-(a-f),f=t[++u]):(a=c+o,s=o-(a-c),c=n[++d]),o=a,s!==0&&(i[h++]=s);u<e&&d<r;)c>f==c>-f?(a=o+f,l=a-o,s=o-(a-l)+(f-l),f=t[++u]):(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=n[++d]),o=a,s!==0&&(i[h++]=s);for(;u<e;)a=o+f,l=a-o,s=o-(a-l)+(f-l),f=t[++u],o=a,s!==0&&(i[h++]=s);for(;d<r;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=n[++d],o=a,s!==0&&(i[h++]=s);return(o!==0||h===0)&&(i[h++]=o),h}function sv(e,t){let r=t[0];for(let n=1;n<e;n++)r+=t[n];return r}function R(e){return new Float64Array(e)}var fv=(3+16*W)*W,lv=(2+12*W)*W,cv=(9+64*W)*W*W,rn=R(4),u0=R(8),d0=R(12),h0=R(16),me=R(4);function uv(e,t,r,n,i,o,a){let s,l,f,c,u,d,h,g,x,T,_,v,M,L,I,B,N,p,m=e-i,b=r-i,y=t-o,w=n-o;L=m*w,d=de*m,h=d-(d-m),g=m-h,d=de*w,x=d-(d-w),T=w-x,I=g*T-(L-h*x-g*x-h*T),B=y*b,d=de*y,h=d-(d-y),g=y-h,d=de*b,x=d-(d-b),T=b-x,N=g*T-(B-h*x-g*x-h*T),_=I-N,u=I-_,rn[0]=I-(_+u)+(u-N),v=L+_,u=v-L,M=L-(v-u)+(_-u),_=M-B,u=M-_,rn[1]=M-(_+u)+(u-B),p=v+_,u=p-v,rn[2]=v-(p-u)+(_-u),rn[3]=p;let S=sv(4,rn),P=lv*a;if(S>=P||-S>=P||(u=e-m,s=e-(m+u)+(u-i),u=r-b,f=r-(b+u)+(u-i),u=t-y,l=t-(y+u)+(u-o),u=n-w,c=n-(w+u)+(u-o),s===0&&l===0&&f===0&&c===0)||(P=cv*a+av*Math.abs(S),S+=m*c+w*s-(y*f+b*l),S>=P||-S>=P))return S;L=s*w,d=de*s,h=d-(d-s),g=s-h,d=de*w,x=d-(d-w),T=w-x,I=g*T-(L-h*x-g*x-h*T),B=l*b,d=de*l,h=d-(d-l),g=l-h,d=de*b,x=d-(d-b),T=b-x,N=g*T-(B-h*x-g*x-h*T),_=I-N,u=I-_,me[0]=I-(_+u)+(u-N),v=L+_,u=v-L,M=L-(v-u)+(_-u),_=M-B,u=M-_,me[1]=M-(_+u)+(u-B),p=v+_,u=p-v,me[2]=v-(p-u)+(_-u),me[3]=p;let E=Cf(4,rn,4,me,u0);L=m*c,d=de*m,h=d-(d-m),g=m-h,d=de*c,x=d-(d-c),T=c-x,I=g*T-(L-h*x-g*x-h*T),B=y*f,d=de*y,h=d-(d-y),g=y-h,d=de*f,x=d-(d-f),T=f-x,N=g*T-(B-h*x-g*x-h*T),_=I-N,u=I-_,me[0]=I-(_+u)+(u-N),v=L+_,u=v-L,M=L-(v-u)+(_-u),_=M-B,u=M-_,me[1]=M-(_+u)+(u-B),p=v+_,u=p-v,me[2]=v-(p-u)+(_-u),me[3]=p;let C=Cf(E,u0,4,me,d0);L=s*c,d=de*s,h=d-(d-s),g=s-h,d=de*c,x=d-(d-c),T=c-x,I=g*T-(L-h*x-g*x-h*T),B=l*f,d=de*l,h=d-(d-l),g=l-h,d=de*f,x=d-(d-f),T=f-x,N=g*T-(B-h*x-g*x-h*T),_=I-N,u=I-_,me[0]=I-(_+u)+(u-N),v=L+_,u=v-L,M=L-(v-u)+(_-u),_=M-B,u=M-_,me[1]=M-(_+u)+(u-B),p=v+_,u=p-v,me[2]=v-(p-u)+(_-u),me[3]=p;let k=Cf(C,d0,4,me,h0);return h0[k-1]}function dv(e,t,r,n,i,o){let a=(t-o)*(r-i),s=(e-i)*(n-o),l=a-s,f=Math.abs(a+s);return Math.abs(l)>=fv*f?l:-uv(e,t,r,n,i,o,f)}var US=(7+56*W)*W,qS=(3+28*W)*W,GS=(26+288*W)*W*W,VS=R(4),$S=R(4),ZS=R(4),HS=R(4),jS=R(4),YS=R(4),WS=R(4),XS=R(4),KS=R(4),QS=R(8),JS=R(8),eT=R(8),tT=R(4),rT=R(8),nT=R(8),iT=R(8),oT=R(12),aT=R(192),sT=R(192),fT=(10+96*W)*W,lT=(4+48*W)*W,cT=(44+576*W)*W*W,uT=R(4),dT=R(4),hT=R(4),pT=R(4),gT=R(4),mT=R(4),bT=R(4),yT=R(4),xT=R(8),vT=R(8),wT=R(8),_T=R(8),ET=R(8),ST=R(8),TT=R(8),CT=R(8),AT=R(8),PT=R(4),kT=R(4),MT=R(4),FT=R(8),LT=R(16),IT=R(16),OT=R(16),RT=R(32),BT=R(32),DT=R(48),NT=R(64),zT=R(1152),UT=R(1152),qT=(16+224*W)*W,GT=(5+72*W)*W,VT=(71+1408*W)*W*W,$T=R(4),ZT=R(4),HT=R(4),jT=R(4),YT=R(4),WT=R(4),XT=R(4),KT=R(4),QT=R(4),JT=R(4),eC=R(24),tC=R(24),rC=R(24),nC=R(24),iC=R(24),oC=R(24),aC=R(24),sC=R(24),fC=R(24),lC=R(24),cC=R(1152),uC=R(1152),dC=R(1152),hC=R(1152),pC=R(1152),gC=R(2304),mC=R(2304),bC=R(3456),yC=R(5760),xC=R(8),vC=R(8),wC=R(8),_C=R(16),EC=R(24),SC=R(48),TC=R(48),CC=R(96),AC=R(192),PC=R(384),kC=R(384),MC=R(384),FC=R(768),LC=R(96),IC=R(96),OC=R(96),RC=R(1152);function hv(e,t){var r,n,i=0,o,a,s,l,f,c,u,d=e[0],h=e[1],g=t.length;for(r=0;r<g;r++){n=0;var x=t[r],T=x.length-1;if(c=x[0],c[0]!==x[T][0]&&c[1]!==x[T][1])throw new Error("First and last coordinates in a ring must be the same");for(a=c[0]-d,s=c[1]-h,n;n<T;n++){if(u=x[n+1],l=u[0]-d,f=u[1]-h,s===0&&f===0){if(l<=0&&a>=0||a<=0&&l>=0)return 0}else if(f>=0&&s<=0||f<=0&&s>=0){if(o=dv(a,l,s,f,0,0),o===0)return 0;(o>0&&f>0&&s<=0||o<0&&f<=0&&s>0)&&i++}c=u,s=f,a=l}}return i%2!==0}var Pe=63710088e-1,BC={centimeters:Pe*100,centimetres:Pe*100,degrees:360/(2*Math.PI),feet:Pe*3.28084,inches:Pe*39.37,kilometers:Pe/1e3,kilometres:Pe/1e3,meters:Pe,metres:Pe,miles:Pe/1609.344,millimeters:Pe*1e3,millimetres:Pe*1e3,nauticalmiles:Pe/1852,radians:1,yards:Pe*1.0936};function _e(e,t,r={}){let n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function pv(e,t,r={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!p0(e[0])||!p0(e[1]))throw new Error("coordinates must contain numbers");return _e({type:"Point",coordinates:e},t,r)}function Qf(e,t,r={}){for(let i of e){if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(i[i.length-1].length!==i[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<i[i.length-1].length;o++)if(i[i.length-1][o]!==i[0][o])throw new Error("First and last Position are not equivalent.")}return _e({type:"Polygon",coordinates:e},t,r)}function fp(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return _e({type:"LineString",coordinates:e},t,r)}function Li(e,t={}){let r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function lp(e,t,r={}){return _e({type:"MultiLineString",coordinates:e},t,r)}function cp(e,t,r={}){return _e({type:"MultiPolygon",coordinates:e},t,r)}function p0(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function up(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return[...e.geometry.coordinates];if(e.type==="Point")return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Mi(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Pt(e){return e.type==="Feature"?e.geometry:e}function gv(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}function Ne(e,t,r={}){if(!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");let n=up(e),i=Pt(t),o=i.type,a=t.bbox,s=i.coordinates;if(a&&mv(n,a)===!1)return!1;o==="Polygon"&&(s=[s]);let l=!1;for(var f=0;f<s.length;++f){let c=hv(n,s[f]);if(c===0)return!r.ignoreBoundary;c&&(l=!0)}return l}function mv(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}var dp=class{constructor(e=[],t=bv){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,n=t[e];for(;e>0;){let i=e-1>>1,o=t[i];if(r(n,o)>=0)break;t[e]=o,e=i}t[e]=n}_down(e){let{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let o=(e<<1)+1,a=t[o],s=o+1;if(s<this.length&&r(t[s],a)<0&&(o=s,a=t[s]),r(a,i)>=0)break;t[e]=a,e=o}t[e]=i}};function bv(e,t){return e<t?-1:e>t?1:0}function hp(e,t){return e.p.x>t.p.x?1:e.p.x<t.p.x?-1:e.p.y!==t.p.y?e.p.y>t.p.y?1:-1:1}function yv(e,t){return e.rightSweepEvent.p.x>t.rightSweepEvent.p.x?1:e.rightSweepEvent.p.x<t.rightSweepEvent.p.x?-1:e.rightSweepEvent.p.y!==t.rightSweepEvent.p.y?e.rightSweepEvent.p.y<t.rightSweepEvent.p.y?1:-1:1}var g0=class{constructor(e,t,r,n){this.p={x:e[0],y:e[1]},this.featureId=t,this.ringId=r,this.eventId=n,this.otherEvent=null,this.isLeftEndpoint=null}isSamePoint(e){return this.p.x===e.p.x&&this.p.y===e.p.y}};function xv(e,t){if(e.type==="FeatureCollection"){let r=e.features;for(let n=0;n<r.length;n++)m0(r[n],t)}else m0(e,t)}var Jo=0,ea=0,ta=0;function m0(e,t){let r=e.type==="Feature"?e.geometry:e,n=r.coordinates;(r.type==="Polygon"||r.type==="MultiLineString")&&(n=[n]),r.type==="LineString"&&(n=[[n]]);for(let i=0;i<n.length;i++)for(let o=0;o<n[i].length;o++){let a=n[i][o][0],s=null;ea=ea+1;for(let l=0;l<n[i][o].length-1;l++){s=n[i][o][l+1];let f=new g0(a,Jo,ea,ta),c=new g0(s,Jo,ea,ta+1);f.otherEvent=c,c.otherEvent=f,hp(f,c)>0?(c.isLeftEndpoint=!0,f.isLeftEndpoint=!1):(f.isLeftEndpoint=!0,c.isLeftEndpoint=!1),t.push(f),t.push(c),a=s,ta=ta+1}}Jo=Jo+1}var vv=class{constructor(e){this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}};function wv(e,t){if(e===null||t===null||e.leftSweepEvent.ringId===t.leftSweepEvent.ringId&&(e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.rightSweepEvent)||e.leftSweepEvent.isSamePoint(t.leftSweepEvent)||e.leftSweepEvent.isSamePoint(t.rightSweepEvent)))return!1;let r=e.leftSweepEvent.p.x,n=e.leftSweepEvent.p.y,i=e.rightSweepEvent.p.x,o=e.rightSweepEvent.p.y,a=t.leftSweepEvent.p.x,s=t.leftSweepEvent.p.y,l=t.rightSweepEvent.p.x,f=t.rightSweepEvent.p.y,c=(f-s)*(i-r)-(l-a)*(o-n),u=(l-a)*(n-s)-(f-s)*(r-a),d=(i-r)*(n-s)-(o-n)*(r-a);if(c===0)return u===0&&d===0,!1;let h=u/c,g=d/c;if(h>=0&&h<=1&&g>=0&&g<=1){let x=r+h*(i-r),T=n+h*(o-n);return[x,T]}return!1}function _v(e,t){t=t||!1;let r=[],n=new dp([],yv);for(;e.length;){let i=e.pop();if(i.isLeftEndpoint){let o=new vv(i);for(let a=0;a<n.data.length;a++){let s=n.data[a];if(t&&s.leftSweepEvent.featureId===i.featureId)continue;let l=wv(o,s);l!==!1&&r.push(l)}n.push(o)}else i.isLeftEndpoint===!1&&n.pop()}return r}function Ev(e,t){let r=new dp([],hp);return xv(e,r),_v(r,t)}var Sv=Ev,Tv=Sv;function Jf(e,t,r={}){let{removeDuplicates:n=!0,ignoreSelfIntersections:i=!0}=r,o=[];e.type==="FeatureCollection"?o=o.concat(e.features):e.type==="Feature"?o.push(e):(e.type==="LineString"||e.type==="Polygon"||e.type==="MultiLineString"||e.type==="MultiPolygon")&&o.push(_e(e)),t.type==="FeatureCollection"?o=o.concat(t.features):t.type==="Feature"?o.push(t):(t.type==="LineString"||t.type==="Polygon"||t.type==="MultiLineString"||t.type==="MultiPolygon")&&o.push(_e(t));let a=Tv(Li(o),i),s=[];if(n){let l={};a.forEach(f=>{let c=f.join(",");l[c]||(l[c]=!0,s.push(f))})}else s=a;return Li(s.map(l=>pv(l)))}function pp(e,t,r){if(e!==null)for(var n,i,o,a,s,l,f,c=0,u=0,d,h=e.type,g=h==="FeatureCollection",x=h==="Feature",T=g?e.features.length:1,_=0;_<T;_++){f=g?e.features[_].geometry:x?e.geometry:e,d=f?f.type==="GeometryCollection":!1,s=d?f.geometries.length:1;for(var v=0;v<s;v++){var M=0,L=0;if(a=d?f.geometries[v]:f,a!==null){l=a.coordinates;var I=a.type;switch(c=r&&(I==="Polygon"||I==="MultiPolygon")?1:0,I){case null:break;case"Point":if(t(l,u,_,M,L)===!1)return!1;u++,M++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(t(l[n],u,_,M,L)===!1)return!1;u++,I==="MultiPoint"&&M++}I==="LineString"&&M++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(i=0;i<l[n].length-c;i++){if(t(l[n][i],u,_,M,L)===!1)return!1;u++}I==="MultiLineString"&&M++,I==="Polygon"&&L++}I==="Polygon"&&M++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(L=0,i=0;i<l[n].length;i++){for(o=0;o<l[n][i].length-c;o++){if(t(l[n][i][o],u,_,M,L)===!1)return!1;u++}L++}M++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(pp(a.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function gp(e,t){var r,n,i,o,a,s,l,f,c,u,d=0,h=e.type==="FeatureCollection",g=e.type==="Feature",x=h?e.features.length:1;for(r=0;r<x;r++){for(s=h?e.features[r].geometry:g?e.geometry:e,f=h?e.features[r].properties:g?e.properties:{},c=h?e.features[r].bbox:g?e.bbox:void 0,u=h?e.features[r].id:g?e.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,i=0;i<a;i++){if(o=l?s.geometries[i]:s,o===null){if(t(null,d,f,c,u)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,d,f,c,u)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],d,f,c,u)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}d++}}function ca(e,t){gp(e,function(r,n,i,o,a){var s=r===null?null:r.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return t(_e(r,i,{bbox:o,id:a}),n,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var f=0;f<r.coordinates.length;f++){var c=r.coordinates[f],u={type:l,coordinates:c};if(t(_e(u,i),n,f)===!1)return!1}})}function Bf(e,t={}){let r=Pt(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return Cv(r,t);case"MultiPolygon":return Av(r,t);default:throw new Error("invalid poly")}}function Cv(e,t={}){let n=Pt(e).coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{};return mp(n,i)}function Av(e,t={}){let n=Pt(e).coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{},o=[];return n.forEach(a=>{o.push(mp(a,i))}),Li(o)}function mp(e,t){return e.length>1?lp(e,t):fp(e[0],t)}function Pv(e,t,{ignoreSelfIntersections:r=!0}={ignoreSelfIntersections:!0}){let n=!0;return ca(e,i=>{ca(t,o=>{if(n===!1)return!1;n=kv(i.geometry,o.geometry,r)})}),n}function kv(e,t,r){switch(e.type){case"Point":switch(t.type){case"Point":return!Iv(e.coordinates,t.coordinates);case"LineString":return!b0(t,e);case"Polygon":return!Ne(e,t)}break;case"LineString":switch(t.type){case"Point":return!b0(e,t);case"LineString":return!Mv(e,t,r);case"Polygon":return!y0(t,e,r)}break;case"Polygon":switch(t.type){case"Point":return!Ne(t,e);case"LineString":return!y0(e,t,r);case"Polygon":return!Fv(t,e,r)}}return!1}function b0(e,t){for(let r=0;r<e.coordinates.length-1;r++)if(Lv(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}function Mv(e,t,r){return Jf(e,t,{ignoreSelfIntersections:r}).features.length>0}function y0(e,t,r){for(let i of t.coordinates)if(Ne(i,e))return!0;return Jf(t,Bf(e),{ignoreSelfIntersections:r}).features.length>0}function Fv(e,t,r){for(let i of e.coordinates[0])if(Ne(i,t))return!0;for(let i of t.coordinates[0])if(Ne(i,e))return!0;return Jf(Bf(e),Bf(t),{ignoreSelfIntersections:r}).features.length>0}function Lv(e,t,r){let n=r[0]-e[0],i=r[1]-e[1],o=t[0]-e[0],a=t[1]-e[1];return n*a-i*o!==0?!1:Math.abs(o)>=Math.abs(a)?o>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:a>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1]}function Iv(e,t){return e[0]===t[0]&&e[1]===t[1]}function Ov(e,t,{ignoreSelfIntersections:r=!0}={}){let n=!1;return ca(e,i=>{ca(t,o=>{if(n===!0)return!0;n=!Pv(i.geometry,o.geometry,{ignoreSelfIntersections:r})})}),n}var bp=Ov;function Rv({geojson:e,spatialFilter:t,uniqueIdProperty:r}){let n=0,i=new Map;if(!t)return[];for(let o of e.features){let a=r?o.properties[r]:++n;!i.has(a)&&bp(t,o)&&i.set(a,o.properties)}return Array.from(i.values())}var DC=1/Math.PI*180,NC=1/180*Math.PI,Bv={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Bv}};var zC=globalThis.mathgl.config;function Dv(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Df(e,t,r){return Dv(e)?e.map((n,i)=>Df(n,t[i],r)):r*t+(1-r)*e}function x0(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var Ke=Math.PI,yp=Ke/4,v0=Ke/180,w0=180/Ke,ua=512;function Nf(e){let[t,r]=e;x0(Number.isFinite(t)),x0(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");let n=t*v0,i=r*v0,o=ua*(n+Ke)/(2*Ke),a=ua*(Ke+Math.log(Math.tan(yp+i*.5)))/(2*Ke);return[o,a]}function Nv(e){let[t,r]=e,n=t/ua*(2*Ke)-Ke,i=2*(Math.atan(Math.exp(r/ua*(2*Ke)-Ke))-yp);return[n*w0,i*w0]}var UC=Math.PI/180,zv={Point:xp,MultiPoint:qv,LineString:vp,MultiLineString:Gv,Polygon:wp,MultiPolygon:Vv};function Uv(e,t){let[r,n,i,o]=t,a=Nf([r,o]),s=Nf([i,n]),l=[a,s];if(e.type==="GeometryCollection")throw new Error("Unsupported geometry type GeometryCollection");let f=zv[e.type],c=f(e.coordinates,l);return{...e,coordinates:c}}function xp([e,t],[r,n]){let i=Df(r[0],n[0],e),o=Df(r[1],n[1],t);return Nv([i,o])}function el(e,t){return e.map(r=>xp(r,t))}function qv(e,t){return el(e,t)}function vp(e,t){return el(e,t)}function Gv(e,t){return e.map(r=>vp(r,t))}function wp(e,t){return e.map(r=>el(r,t))}function Vv(e,t){return e.map(r=>wp(r,t))}function $v(e,t={}){let r=Number(e[0]),n=Number(e[1]),i=Number(e[2]),o=Number(e[3]);if(e.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");let a=[r,n];return Qf([[a,[i,n],[i,o],[r,o],a]],t.properties,{bbox:e,id:t.id})}var Zv=$v;function da(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;let r=[1/0,1/0,-1/0,-1/0];return pp(e,n=>{r[0]>n[0]&&(r[0]=n[0]),r[1]>n[1]&&(r[1]=n[1]),r[2]<n[0]&&(r[2]=n[0]),r[3]<n[1]&&(r[3]=n[1])}),r}function ha(e,t,r={}){let n=up(e),i=Mi(t);for(let o=0;o<i.length-1;o++){let a=!1;if(r.ignoreEndVertices&&(o===0&&(a="start"),o===i.length-2&&(a="end"),o===0&&o+1===i.length-1&&(a="both")),Hv(i[o],i[o+1],n,a,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}function Hv(e,t,r,n,i){let o=r[0],a=r[1],s=e[0],l=e[1],f=t[0],c=t[1],u=r[0]-s,d=r[1]-l,h=f-s,g=c-l,x=u*g-d*h;if(i!==null){if(Math.abs(x)>i)return!1}else if(x!==0)return!1;if(Math.abs(h)===Math.abs(g)&&Math.abs(h)===0)return n?!1:r[0]===e[0]&&r[1]===e[1];if(n){if(n==="start")return Math.abs(h)>=Math.abs(g)?h>0?s<o&&o<=f:f<=o&&o<s:g>0?l<a&&a<=c:c<=a&&a<l;if(n==="end")return Math.abs(h)>=Math.abs(g)?h>0?s<=o&&o<f:f<o&&o<=s:g>0?l<=a&&a<c:c<a&&a<=l;if(n==="both")return Math.abs(h)>=Math.abs(g)?h>0?s<o&&o<f:f<o&&o<s:g>0?l<a&&a<c:c<a&&a<l}else return Math.abs(h)>=Math.abs(g)?h>0?s<=o&&o<=f:f<=o&&o<=s:g>0?l<=a&&a<=c:c<=a&&a<=l;return!1}function jv(e,t){var r=Pt(e),n=Pt(t),i=r.type,o=n.type;switch(i){case"Point":switch(o){case"MultiPoint":return Yv(r,n);case"LineString":return ha(r,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Ne(r,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"MultiPoint":return Wv(r,n);case"LineString":return Xv(r,n);case"Polygon":case"MultiPolygon":return Kv(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"LineString":return Qv(r,n);case"Polygon":case"MultiPolygon":return Jv(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Polygon":case"MultiPolygon":return e2(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Yv(e,t){var r,n=!1;for(r=0;r<t.coordinates.length;r++)if(Ep(t.coordinates[r],e.coordinates)){n=!0;break}return n}function Wv(e,t){for(var r=0;r<e.coordinates.length;r++){for(var n=!1,i=0;i<t.coordinates.length;i++)Ep(e.coordinates[r],t.coordinates[i])&&(n=!0);if(!n)return!1}return!0}function Xv(e,t){for(var r=!1,n=0;n<e.coordinates.length;n++){if(!ha(e.coordinates[n],t))return!1;r||(r=ha(e.coordinates[n],t,{ignoreEndVertices:!0}))}return r}function Kv(e,t){for(var r=!0,n=!1,i=!1,o=0;o<e.coordinates.length;o++){if(i=Ne(e.coordinates[o],t),!i){r=!1;break}n||(i=Ne(e.coordinates[o],t,{ignoreBoundary:!0}))}return r&&i}function Qv(e,t){for(var r=0;r<e.coordinates.length;r++)if(!ha(e.coordinates[r],t))return!1;return!0}function Jv(e,t){var r=da(t),n=da(e);if(!_p(r,n))return!1;for(var i=!1,o=0;o<e.coordinates.length;o++){if(!Ne(e.coordinates[o],t))return!1;if(i||(i=Ne(e.coordinates[o],t,{ignoreBoundary:!0})),!i&&o<e.coordinates.length-1){var a=t2(e.coordinates[o],e.coordinates[o+1]);i=Ne(a,t,{ignoreBoundary:!0})}}return i}function e2(e,t){var r=da(e),n=da(t);if(!_p(n,r))return!1;for(var i=0;i<e.coordinates[0].length;i++)if(!Ne(e.coordinates[0][i],t))return!1;return!0}function _p(e,t){return!(e[0]>t[0]||e[2]<t[2]||e[1]>t[1]||e[3]<t[3])}function Ep(e,t){return e[0]===t[0]&&e[1]===t[1]}function t2(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var Sp=jv,r2=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Af=Math.ceil,Re=Math.floor,ve="[BigNumber Error] ",_0=ve+"Number primitive has more than 15 significant digits: ",We=1e14,G=14,Pf=9007199254740991,kf=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Vt=1e7,fe=1e9;function Tp(e){var t,r,n,i=v.prototype={constructor:v,toString:null,valueOf:null},o=new v(1),a=20,s=4,l=-7,f=21,c=-1e7,u=1e7,d=!1,h=1,g=0,x={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz",_=!0;function v(p,m){var b,y,w,S,P,E,C,k,A=this;if(!(A instanceof v))return new v(p,m);if(m==null){if(p&&p._isBigNumber===!0){A.s=p.s,!p.c||p.e>u?A.c=A.e=null:p.e<c?A.c=[A.e=0]:(A.e=p.e,A.c=p.c.slice());return}if((E=typeof p=="number")&&p*0==0){if(A.s=1/p<0?(p=-p,-1):1,p===~~p){for(S=0,P=p;P>=10;P/=10,S++);S>u?A.c=A.e=null:(A.e=S,A.c=[p]);return}k=String(p)}else{if(!r2.test(k=String(p)))return n(A,k,E);A.s=k.charCodeAt(0)==45?(k=k.slice(1),-1):1}(S=k.indexOf("."))>-1&&(k=k.replace(".","")),(P=k.search(/e/i))>0?(S<0&&(S=P),S+=+k.slice(P+1),k=k.substring(0,P)):S<0&&(S=k.length)}else{if(te(m,2,T.length,"Base"),m==10&&_)return A=new v(p),B(A,a+A.e+1,s);if(k=String(p),E=typeof p=="number"){if(p*0!=0)return n(A,k,E,m);if(A.s=1/p<0?(k=k.slice(1),-1):1,v.DEBUG&&k.replace(/^0\.0*|\./,"").length>15)throw Error(_0+p)}else A.s=k.charCodeAt(0)===45?(k=k.slice(1),-1):1;for(b=T.slice(0,m),S=P=0,C=k.length;P<C;P++)if(b.indexOf(y=k.charAt(P))<0){if(y=="."){if(P>S){S=C;continue}}else if(!w&&(k==k.toUpperCase()&&(k=k.toLowerCase())||k==k.toLowerCase()&&(k=k.toUpperCase()))){w=!0,P=-1,S=0;continue}return n(A,String(p),E,m)}E=!1,k=r(k,m,10,A.s),(S=k.indexOf("."))>-1?k=k.replace(".",""):S=k.length}for(P=0;k.charCodeAt(P)===48;P++);for(C=k.length;k.charCodeAt(--C)===48;);if(k=k.slice(P,++C)){if(C-=P,E&&v.DEBUG&&C>15&&(p>Pf||p!==Re(p)))throw Error(_0+A.s*p);if((S=S-P-1)>u)A.c=A.e=null;else if(S<c)A.c=[A.e=0];else{if(A.e=S,A.c=[],P=(S+1)%G,S<0&&(P+=G),P<C){for(P&&A.c.push(+k.slice(0,P)),C-=G;P<C;)A.c.push(+k.slice(P,P+=G));P=G-(k=k.slice(P)).length}else P-=C;for(;P--;k+="0");A.c.push(+k)}}else A.c=[A.e=0]}v.clone=Tp,v.ROUND_UP=0,v.ROUND_DOWN=1,v.ROUND_CEIL=2,v.ROUND_FLOOR=3,v.ROUND_HALF_UP=4,v.ROUND_HALF_DOWN=5,v.ROUND_HALF_EVEN=6,v.ROUND_HALF_CEIL=7,v.ROUND_HALF_FLOOR=8,v.EUCLID=9,v.config=v.set=function(p){var m,b;if(p!=null)if(typeof p=="object"){if(p.hasOwnProperty(m="DECIMAL_PLACES")&&(b=p[m],te(b,0,fe,m),a=b),p.hasOwnProperty(m="ROUNDING_MODE")&&(b=p[m],te(b,0,8,m),s=b),p.hasOwnProperty(m="EXPONENTIAL_AT")&&(b=p[m],b&&b.pop?(te(b[0],-fe,0,m),te(b[1],0,fe,m),l=b[0],f=b[1]):(te(b,-fe,fe,m),l=-(f=b<0?-b:b))),p.hasOwnProperty(m="RANGE"))if(b=p[m],b&&b.pop)te(b[0],-fe,-1,m),te(b[1],1,fe,m),c=b[0],u=b[1];else if(te(b,-fe,fe,m),b)c=-(u=b<0?-b:b);else throw Error(ve+m+" cannot be zero: "+b);if(p.hasOwnProperty(m="CRYPTO"))if(b=p[m],b===!!b)if(b)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))d=b;else throw d=!b,Error(ve+"crypto unavailable");else d=b;else throw Error(ve+m+" not true or false: "+b);if(p.hasOwnProperty(m="MODULO_MODE")&&(b=p[m],te(b,0,9,m),h=b),p.hasOwnProperty(m="POW_PRECISION")&&(b=p[m],te(b,0,fe,m),g=b),p.hasOwnProperty(m="FORMAT"))if(b=p[m],typeof b=="object")x=b;else throw Error(ve+m+" not an object: "+b);if(p.hasOwnProperty(m="ALPHABET"))if(b=p[m],typeof b=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(b))_=b.slice(0,10)=="0123456789",T=b;else throw Error(ve+m+" invalid: "+b)}else throw Error(ve+"Object expected: "+p);return{DECIMAL_PLACES:a,ROUNDING_MODE:s,EXPONENTIAL_AT:[l,f],RANGE:[c,u],CRYPTO:d,MODULO_MODE:h,POW_PRECISION:g,FORMAT:x,ALPHABET:T}},v.isBigNumber=function(p){if(!p||p._isBigNumber!==!0)return!1;if(!v.DEBUG)return!0;var m,b,y=p.c,w=p.e,S=p.s;e:if({}.toString.call(y)=="[object Array]"){if((S===1||S===-1)&&w>=-fe&&w<=fe&&w===Re(w)){if(y[0]===0){if(w===0&&y.length===1)return!0;break e}if(m=(w+1)%G,m<1&&(m+=G),String(y[0]).length==m){for(m=0;m<y.length;m++)if(b=y[m],b<0||b>=We||b!==Re(b))break e;if(b!==0)return!0}}}else if(y===null&&w===null&&(S===null||S===1||S===-1))return!0;throw Error(ve+"Invalid BigNumber: "+p)},v.maximum=v.max=function(){return L(arguments,-1)},v.minimum=v.min=function(){return L(arguments,1)},v.random=function(){var p=9007199254740992,m=Math.random()*p&2097151?function(){return Re(Math.random()*p)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(b){var y,w,S,P,E,C=0,k=[],A=new v(o);if(b==null?b=a:te(b,0,fe),P=Af(b/G),d)if(crypto.getRandomValues){for(y=crypto.getRandomValues(new Uint32Array(P*=2));C<P;)E=y[C]*131072+(y[C+1]>>>11),E>=9e15?(w=crypto.getRandomValues(new Uint32Array(2)),y[C]=w[0],y[C+1]=w[1]):(k.push(E%1e14),C+=2);C=P/2}else if(crypto.randomBytes){for(y=crypto.randomBytes(P*=7);C<P;)E=(y[C]&31)*281474976710656+y[C+1]*1099511627776+y[C+2]*4294967296+y[C+3]*16777216+(y[C+4]<<16)+(y[C+5]<<8)+y[C+6],E>=9e15?crypto.randomBytes(7).copy(y,C):(k.push(E%1e14),C+=7);C=P/7}else throw d=!1,Error(ve+"crypto unavailable");if(!d)for(;C<P;)E=m(),E<9e15&&(k[C++]=E%1e14);for(P=k[--C],b%=G,P&&b&&(E=kf[G-b],k[C]=Re(P/E)*E);k[C]===0;k.pop(),C--);if(C<0)k=[S=0];else{for(S=-1;k[0]===0;k.splice(0,1),S-=G);for(C=1,E=k[0];E>=10;E/=10,C++);C<G&&(S-=G-C)}return A.e=S,A.c=k,A}}(),v.sum=function(){for(var p=1,m=arguments,b=new v(m[0]);p<m.length;)b=b.plus(m[p++]);return b},r=function(){var p="0123456789";function m(b,y,w,S){for(var P,E=[0],C,k=0,A=b.length;k<A;){for(C=E.length;C--;E[C]*=y);for(E[0]+=S.indexOf(b.charAt(k++)),P=0;P<E.length;P++)E[P]>w-1&&(E[P+1]==null&&(E[P+1]=0),E[P+1]+=E[P]/w|0,E[P]%=w)}return E.reverse()}return function(b,y,w,S,P){var E,C,k,A,O,z,U,H,re=b.indexOf("."),ae=a,Z=s;for(re>=0&&(A=g,g=0,b=b.replace(".",""),H=new v(y),z=H.pow(b.length-re),g=A,H.c=m(St(Oe(z.c),z.e,"0"),10,w,p),H.e=H.c.length),U=m(b,y,w,P?(E=T,p):(E=p,T)),k=A=U.length;U[--A]==0;U.pop());if(!U[0])return E.charAt(0);if(re<0?--k:(z.c=U,z.e=k,z.s=S,z=t(z,H,ae,Z,w),U=z.c,O=z.r,k=z.e),C=k+ae+1,re=U[C],A=w/2,O=O||C<0||U[C+1]!=null,O=Z<4?(re!=null||O)&&(Z==0||Z==(z.s<0?3:2)):re>A||re==A&&(Z==4||O||Z==6&&U[C-1]&1||Z==(z.s<0?8:7)),C<1||!U[0])b=O?St(E.charAt(1),-ae,E.charAt(0)):E.charAt(0);else{if(U.length=C,O)for(--w;++U[--C]>w;)U[C]=0,C||(++k,U=[1].concat(U));for(A=U.length;!U[--A];);for(re=0,b="";re<=A;b+=E.charAt(U[re++]));b=St(b,k,E.charAt(0))}return b}}(),t=function(){function p(y,w,S){var P,E,C,k,A=0,O=y.length,z=w%Vt,U=w/Vt|0;for(y=y.slice();O--;)C=y[O]%Vt,k=y[O]/Vt|0,P=U*C+k*z,E=z*C+P%Vt*Vt+A,A=(E/S|0)+(P/Vt|0)+U*k,y[O]=E%S;return A&&(y=[A].concat(y)),y}function m(y,w,S,P){var E,C;if(S!=P)C=S>P?1:-1;else for(E=C=0;E<S;E++)if(y[E]!=w[E]){C=y[E]>w[E]?1:-1;break}return C}function b(y,w,S,P){for(var E=0;S--;)y[S]-=E,E=y[S]<w[S]?1:0,y[S]=E*P+y[S]-w[S];for(;!y[0]&&y.length>1;y.splice(0,1));}return function(y,w,S,P,E){var C,k,A,O,z,U,H,re,ae,Z,X,ce,Ui,qa,Ga,Je,hn,ke=y.s==w.s?1:-1,he=y.c,ne=w.c;if(!he||!he[0]||!ne||!ne[0])return new v(!y.s||!w.s||(he?ne&&he[0]==ne[0]:!ne)?NaN:he&&he[0]==0||!ne?ke*0:ke/0);for(re=new v(ke),ae=re.c=[],k=y.e-w.e,ke=S+k+1,E||(E=We,k=Be(y.e/G)-Be(w.e/G),ke=ke/G|0),A=0;ne[A]==(he[A]||0);A++);if(ne[A]>(he[A]||0)&&k--,ke<0)ae.push(1),O=!0;else{for(qa=he.length,Je=ne.length,A=0,ke+=2,z=Re(E/(ne[0]+1)),z>1&&(ne=p(ne,z,E),he=p(he,z,E),Je=ne.length,qa=he.length),Ui=Je,Z=he.slice(0,Je),X=Z.length;X<Je;Z[X++]=0);hn=ne.slice(),hn=[0].concat(hn),Ga=ne[0],ne[1]>=E/2&&Ga++;do{if(z=0,C=m(ne,Z,Je,X),C<0){if(ce=Z[0],Je!=X&&(ce=ce*E+(Z[1]||0)),z=Re(ce/Ga),z>1)for(z>=E&&(z=E-1),U=p(ne,z,E),H=U.length,X=Z.length;m(U,Z,H,X)==1;)z--,b(U,Je<H?hn:ne,H,E),H=U.length,C=1;else z==0&&(C=z=1),U=ne.slice(),H=U.length;if(H<X&&(U=[0].concat(U)),b(Z,U,X,E),X=Z.length,C==-1)for(;m(ne,Z,Je,X)<1;)z++,b(Z,Je<X?hn:ne,X,E),X=Z.length}else C===0&&(z++,Z=[0]);ae[A++]=z,Z[0]?Z[X++]=he[Ui]||0:(Z=[he[Ui]],X=1)}while((Ui++<qa||Z[0]!=null)&&ke--);O=Z[0]!=null,ae[0]||ae.splice(0,1)}if(E==We){for(A=1,ke=ae[0];ke>=10;ke/=10,A++);B(re,S+(re.e=A+k*G-1)+1,P,O)}else re.e=k,re.r=+O;return re}}();function M(p,m,b,y){var w,S,P,E,C;if(b==null?b=s:te(b,0,8),!p.c)return p.toString();if(w=p.c[0],P=p.e,m==null)C=Oe(p.c),C=y==1||y==2&&(P<=l||P>=f)?na(C,P):St(C,P,"0");else if(p=B(new v(p),m,b),S=p.e,C=Oe(p.c),E=C.length,y==1||y==2&&(m<=S||S<=l)){for(;E<m;C+="0",E++);C=na(C,S)}else if(m-=P,C=St(C,S,"0"),S+1>E){if(--m>0)for(C+=".";m--;C+="0");}else if(m+=S-E,m>0)for(S+1==E&&(C+=".");m--;C+="0");return p.s<0&&w?"-"+C:C}function L(p,m){for(var b,y,w=1,S=new v(p[0]);w<p.length;w++)y=new v(p[w]),(!y.s||(b=yr(S,y))===m||b===0&&S.s===m)&&(S=y);return S}function I(p,m,b){for(var y=1,w=m.length;!m[--w];m.pop());for(w=m[0];w>=10;w/=10,y++);return(b=y+b*G-1)>u?p.c=p.e=null:b<c?p.c=[p.e=0]:(p.e=b,p.c=m),p}n=function(){var p=/^(-?)0([xbo])(?=\w[\w.]*$)/i,m=/^([^.]+)\.$/,b=/^\.([^.]+)$/,y=/^-?(Infinity|NaN)$/,w=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(S,P,E,C){var k,A=E?P:P.replace(w,"");if(y.test(A))S.s=isNaN(A)?null:A<0?-1:1;else{if(!E&&(A=A.replace(p,function(O,z,U){return k=(U=U.toLowerCase())=="x"?16:U=="b"?2:8,!C||C==k?z:O}),C&&(k=C,A=A.replace(m,"$1").replace(b,"0.$1")),P!=A))return new v(A,k);if(v.DEBUG)throw Error(ve+"Not a"+(C?" base "+C:"")+" number: "+P);S.s=null}S.c=S.e=null}}();function B(p,m,b,y){var w,S,P,E,C,k,A,O=p.c,z=kf;if(O){e:{for(w=1,E=O[0];E>=10;E/=10,w++);if(S=m-w,S<0)S+=G,P=m,C=O[k=0],A=Re(C/z[w-P-1]%10);else if(k=Af((S+1)/G),k>=O.length)if(y){for(;O.length<=k;O.push(0));C=A=0,w=1,S%=G,P=S-G+1}else break e;else{for(C=E=O[k],w=1;E>=10;E/=10,w++);S%=G,P=S-G+w,A=P<0?0:Re(C/z[w-P-1]%10)}if(y=y||m<0||O[k+1]!=null||(P<0?C:C%z[w-P-1]),y=b<4?(A||y)&&(b==0||b==(p.s<0?3:2)):A>5||A==5&&(b==4||y||b==6&&(S>0?P>0?C/z[w-P]:0:O[k-1])%10&1||b==(p.s<0?8:7)),m<1||!O[0])return O.length=0,y?(m-=p.e+1,O[0]=z[(G-m%G)%G],p.e=-m||0):O[0]=p.e=0,p;if(S==0?(O.length=k,E=1,k--):(O.length=k+1,E=z[G-S],O[k]=P>0?Re(C/z[w-P]%z[P])*E:0),y)for(;;)if(k==0){for(S=1,P=O[0];P>=10;P/=10,S++);for(P=O[0]+=E,E=1;P>=10;P/=10,E++);S!=E&&(p.e++,O[0]==We&&(O[0]=1));break}else{if(O[k]+=E,O[k]!=We)break;O[k--]=0,E=1}for(S=O.length;O[--S]===0;O.pop());}p.e>u?p.c=p.e=null:p.e<c&&(p.c=[p.e=0])}return p}function N(p){var m,b=p.e;return b===null?p.toString():(m=Oe(p.c),m=b<=l||b>=f?na(m,b):St(m,b,"0"),p.s<0?"-"+m:m)}return i.absoluteValue=i.abs=function(){var p=new v(this);return p.s<0&&(p.s=1),p},i.comparedTo=function(p,m){return yr(this,new v(p,m))},i.decimalPlaces=i.dp=function(p,m){var b,y,w,S=this;if(p!=null)return te(p,0,fe),m==null?m=s:te(m,0,8),B(new v(S),p+S.e+1,m);if(!(b=S.c))return null;if(y=((w=b.length-1)-Be(this.e/G))*G,w=b[w])for(;w%10==0;w/=10,y--);return y<0&&(y=0),y},i.dividedBy=i.div=function(p,m){return t(this,new v(p,m),a,s)},i.dividedToIntegerBy=i.idiv=function(p,m){return t(this,new v(p,m),0,1)},i.exponentiatedBy=i.pow=function(p,m){var b,y,w,S,P,E,C,k,A,O=this;if(p=new v(p),p.c&&!p.isInteger())throw Error(ve+"Exponent not an integer: "+N(p));if(m!=null&&(m=new v(m)),E=p.e>14,!O.c||!O.c[0]||O.c[0]==1&&!O.e&&O.c.length==1||!p.c||!p.c[0])return A=new v(Math.pow(+N(O),E?p.s*(2-ra(p)):+N(p))),m?A.mod(m):A;if(C=p.s<0,m){if(m.c?!m.c[0]:!m.s)return new v(NaN);y=!C&&O.isInteger()&&m.isInteger(),y&&(O=O.mod(m))}else{if(p.e>9&&(O.e>0||O.e<-1||(O.e==0?O.c[0]>1||E&&O.c[1]>=24e7:O.c[0]<8e13||E&&O.c[0]<=9999975e7)))return S=O.s<0&&ra(p)?-0:0,O.e>-1&&(S=1/S),new v(C?1/S:S);g&&(S=Af(g/G+2))}for(E?(b=new v(.5),C&&(p.s=1),k=ra(p)):(w=Math.abs(+N(p)),k=w%2),A=new v(o);;){if(k){if(A=A.times(O),!A.c)break;S?A.c.length>S&&(A.c.length=S):y&&(A=A.mod(m))}if(w){if(w=Re(w/2),w===0)break;k=w%2}else if(p=p.times(b),B(p,p.e+1,1),p.e>14)k=ra(p);else{if(w=+N(p),w===0)break;k=w%2}O=O.times(O),S?O.c&&O.c.length>S&&(O.c.length=S):y&&(O=O.mod(m))}return y?A:(C&&(A=o.div(A)),m?A.mod(m):S?B(A,g,s,P):A)},i.integerValue=function(p){var m=new v(this);return p==null?p=s:te(p,0,8),B(m,m.e+1,p)},i.isEqualTo=i.eq=function(p,m){return yr(this,new v(p,m))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(p,m){return yr(this,new v(p,m))>0},i.isGreaterThanOrEqualTo=i.gte=function(p,m){return(m=yr(this,new v(p,m)))===1||m===0},i.isInteger=function(){return!!this.c&&Be(this.e/G)>this.c.length-2},i.isLessThan=i.lt=function(p,m){return yr(this,new v(p,m))<0},i.isLessThanOrEqualTo=i.lte=function(p,m){return(m=yr(this,new v(p,m)))===-1||m===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(p,m){var b,y,w,S,P=this,E=P.s;if(p=new v(p,m),m=p.s,!E||!m)return new v(NaN);if(E!=m)return p.s=-m,P.plus(p);var C=P.e/G,k=p.e/G,A=P.c,O=p.c;if(!C||!k){if(!A||!O)return A?(p.s=-m,p):new v(O?P:NaN);if(!A[0]||!O[0])return O[0]?(p.s=-m,p):new v(A[0]?P:s==3?-0:0)}if(C=Be(C),k=Be(k),A=A.slice(),E=C-k){for((S=E<0)?(E=-E,w=A):(k=C,w=O),w.reverse(),m=E;m--;w.push(0));w.reverse()}else for(y=(S=(E=A.length)<(m=O.length))?E:m,E=m=0;m<y;m++)if(A[m]!=O[m]){S=A[m]<O[m];break}if(S&&(w=A,A=O,O=w,p.s=-p.s),m=(y=O.length)-(b=A.length),m>0)for(;m--;A[b++]=0);for(m=We-1;y>E;){if(A[--y]<O[y]){for(b=y;b&&!A[--b];A[b]=m);--A[b],A[y]+=We}A[y]-=O[y]}for(;A[0]==0;A.splice(0,1),--k);return A[0]?I(p,A,k):(p.s=s==3?-1:1,p.c=[p.e=0],p)},i.modulo=i.mod=function(p,m){var b,y,w=this;return p=new v(p,m),!w.c||!p.s||p.c&&!p.c[0]?new v(NaN):!p.c||w.c&&!w.c[0]?new v(w):(h==9?(y=p.s,p.s=1,b=t(w,p,0,3),p.s=y,b.s*=y):b=t(w,p,0,h),p=w.minus(b.times(p)),!p.c[0]&&h==1&&(p.s=w.s),p)},i.multipliedBy=i.times=function(p,m){var b,y,w,S,P,E,C,k,A,O,z,U,H,re,ae,Z=this,X=Z.c,ce=(p=new v(p,m)).c;if(!X||!ce||!X[0]||!ce[0])return!Z.s||!p.s||X&&!X[0]&&!ce||ce&&!ce[0]&&!X?p.c=p.e=p.s=null:(p.s*=Z.s,!X||!ce?p.c=p.e=null:(p.c=[0],p.e=0)),p;for(y=Be(Z.e/G)+Be(p.e/G),p.s*=Z.s,C=X.length,O=ce.length,C<O&&(H=X,X=ce,ce=H,w=C,C=O,O=w),w=C+O,H=[];w--;H.push(0));for(re=We,ae=Vt,w=O;--w>=0;){for(b=0,z=ce[w]%ae,U=ce[w]/ae|0,P=C,S=w+P;S>w;)k=X[--P]%ae,A=X[P]/ae|0,E=U*k+A*z,k=z*k+E%ae*ae+H[S]+b,b=(k/re|0)+(E/ae|0)+U*A,H[S--]=k%re;H[S]=b}return b?++y:H.splice(0,1),I(p,H,y)},i.negated=function(){var p=new v(this);return p.s=-p.s||null,p},i.plus=function(p,m){var b,y=this,w=y.s;if(p=new v(p,m),m=p.s,!w||!m)return new v(NaN);if(w!=m)return p.s=-m,y.minus(p);var S=y.e/G,P=p.e/G,E=y.c,C=p.c;if(!S||!P){if(!E||!C)return new v(w/0);if(!E[0]||!C[0])return C[0]?p:new v(E[0]?y:w*0)}if(S=Be(S),P=Be(P),E=E.slice(),w=S-P){for(w>0?(P=S,b=C):(w=-w,b=E),b.reverse();w--;b.push(0));b.reverse()}for(w=E.length,m=C.length,w-m<0&&(b=C,C=E,E=b,m=w),w=0;m;)w=(E[--m]=E[m]+C[m]+w)/We|0,E[m]=We===E[m]?0:E[m]%We;return w&&(E=[w].concat(E),++P),I(p,E,P)},i.precision=i.sd=function(p,m){var b,y,w,S=this;if(p!=null&&p!==!!p)return te(p,1,fe),m==null?m=s:te(m,0,8),B(new v(S),p,m);if(!(b=S.c))return null;if(w=b.length-1,y=w*G+1,w=b[w]){for(;w%10==0;w/=10,y--);for(w=b[0];w>=10;w/=10,y++);}return p&&S.e+1>y&&(y=S.e+1),y},i.shiftedBy=function(p){return te(p,-Pf,Pf),this.times("1e"+p)},i.squareRoot=i.sqrt=function(){var p,m,b,y,w,S=this,P=S.c,E=S.s,C=S.e,k=a+4,A=new v("0.5");if(E!==1||!P||!P[0])return new v(!E||E<0&&(!P||P[0])?NaN:P?S:1/0);if(E=Math.sqrt(+N(S)),E==0||E==1/0?(m=Oe(P),(m.length+C)%2==0&&(m+="0"),E=Math.sqrt(+m),C=Be((C+1)/2)-(C<0||C%2),E==1/0?m="5e"+C:(m=E.toExponential(),m=m.slice(0,m.indexOf("e")+1)+C),b=new v(m)):b=new v(E+""),b.c[0]){for(C=b.e,E=C+k,E<3&&(E=0);;)if(w=b,b=A.times(w.plus(t(S,w,k,1))),Oe(w.c).slice(0,E)===(m=Oe(b.c)).slice(0,E))if(b.e<C&&--E,m=m.slice(E-3,E+1),m=="9999"||!y&&m=="4999"){if(!y&&(B(w,w.e+a+2,0),w.times(w).eq(S))){b=w;break}k+=4,E+=4,y=1}else{(!+m||!+m.slice(1)&&m.charAt(0)=="5")&&(B(b,b.e+a+2,1),p=!b.times(b).eq(S));break}}return B(b,b.e+a+1,s,p)},i.toExponential=function(p,m){return p!=null&&(te(p,0,fe),p++),M(this,p,m,1)},i.toFixed=function(p,m){return p!=null&&(te(p,0,fe),p=p+this.e+1),M(this,p,m)},i.toFormat=function(p,m,b){var y,w=this;if(b==null)p!=null&&m&&typeof m=="object"?(b=m,m=null):p&&typeof p=="object"?(b=p,p=m=null):b=x;else if(typeof b!="object")throw Error(ve+"Argument not an object: "+b);if(y=w.toFixed(p,m),w.c){var S,P=y.split("."),E=+b.groupSize,C=+b.secondaryGroupSize,k=b.groupSeparator||"",A=P[0],O=P[1],z=w.s<0,U=z?A.slice(1):A,H=U.length;if(C&&(S=E,E=C,C=S,H-=S),E>0&&H>0){for(S=H%E||E,A=U.substr(0,S);S<H;S+=E)A+=k+U.substr(S,E);C>0&&(A+=k+U.slice(S)),z&&(A="-"+A)}y=O?A+(b.decimalSeparator||"")+((C=+b.fractionGroupSize)?O.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(b.fractionGroupSeparator||"")):O):A}return(b.prefix||"")+y+(b.suffix||"")},i.toFraction=function(p){var m,b,y,w,S,P,E,C,k,A,O,z,U=this,H=U.c;if(p!=null&&(E=new v(p),!E.isInteger()&&(E.c||E.s!==1)||E.lt(o)))throw Error(ve+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+N(E));if(!H)return new v(U);for(m=new v(o),k=b=new v(o),y=C=new v(o),z=Oe(H),S=m.e=z.length-U.e-1,m.c[0]=kf[(P=S%G)<0?G+P:P],p=!p||E.comparedTo(m)>0?S>0?m:k:E,P=u,u=1/0,E=new v(z),C.c[0]=0;A=t(E,m,0,1),w=b.plus(A.times(y)),w.comparedTo(p)!=1;)b=y,y=w,k=C.plus(A.times(w=k)),C=w,m=E.minus(A.times(w=m)),E=w;return w=t(p.minus(b),y,0,1),C=C.plus(w.times(k)),b=b.plus(w.times(y)),C.s=k.s=U.s,S=S*2,O=t(k,y,S,s).minus(U).abs().comparedTo(t(C,b,S,s).minus(U).abs())<1?[k,y]:[C,b],u=P,O},i.toNumber=function(){return+N(this)},i.toPrecision=function(p,m){return p!=null&&te(p,1,fe),M(this,p,m,2)},i.toString=function(p){var m,b=this,y=b.s,w=b.e;return w===null?y?(m="Infinity",y<0&&(m="-"+m)):m="NaN":(p==null?m=w<=l||w>=f?na(Oe(b.c),w):St(Oe(b.c),w,"0"):p===10&&_?(b=B(new v(b),a+w+1,s),m=St(Oe(b.c),b.e,"0")):(te(p,2,T.length,"Base"),m=r(St(Oe(b.c),w,"0"),10,p,y,!0)),y<0&&b.c[0]&&(m="-"+m)),m},i.valueOf=i.toJSON=function(){return N(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&v.set(e),v}function Be(e){var t=e|0;return e>0||e===t?t:t-1}function Oe(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=G-t.length;r--;t="0"+t);o+=t}for(i=o.length;o.charCodeAt(--i)===48;);return o.slice(0,i+1||1)}function yr(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,l=e.e,f=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=l==f,!i||!o)return n?0:!i^r?1:-1;if(!n)return l>f^r?1:-1;for(s=(l=i.length)<(f=o.length)?l:f,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return l==f?0:l>f^r?1:-1}function te(e,t,r,n){if(e<t||e>r||e!==Re(e))throw Error(ve+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ra(e){var t=e.c.length-1;return Be(e.e/G)==t&&e.c[t]%2!=0}function na(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function St(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(n=e.length,++t>n){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var n2=Tp(),ht=n2,i2=class{constructor(e){D(this,"key"),D(this,"left",null),D(this,"right",null),this.key=e}},Ei=class extends i2{constructor(e){super(e)}},o2=class{constructor(){D(this,"size",0),D(this,"modificationCount",0),D(this,"splayCount",0)}splay(e){let t=this.root;if(t==null)return this.compare(e,e),-1;let r=null,n=null,i=null,o=null,a=t,s=this.compare,l;for(;;)if(l=s(a.key,e),l>0){let f=a.left;if(f==null||(l=s(f.key,e),l>0&&(a.left=f.right,f.right=a,a=f,f=a.left,f==null)))break;r==null?n=a:r.left=a,r=a,a=f}else if(l<0){let f=a.right;if(f==null||(l=s(f.key,e),l<0&&(a.right=f.left,f.left=a,a=f,f=a.right,f==null)))break;i==null?o=a:i.right=a,i=a,a=f}else break;return i!=null&&(i.right=a.left,a.left=o),r!=null&&(r.left=a.right,a.right=n),this.root!==a&&(this.root=a,this.splayCount++),l}splayMin(e){let t=e,r=t.left;for(;r!=null;){let n=r;t.left=n.right,n.right=t,t=n,r=t.left}return t}splayMax(e){let t=e,r=t.right;for(;r!=null;){let n=r;t.right=n.left,n.left=t,t=n,r=t.right}return t}_delete(e){if(this.root==null||this.splay(e)!=0)return null;let r=this.root,n=r,i=r.left;if(this.size--,i==null)this.root=r.right;else{let o=r.right;r=this.splayMax(i),r.right=o,this.root=r}return this.modificationCount++,n}addNewRoot(e,t){this.size++,this.modificationCount++;let r=this.root;if(r==null){this.root=e;return}t<0?(e.left=r,e.right=r.right,r.right=null):(e.right=r,e.left=r.left,r.left=null),this.root=e}_first(){let e=this.root;return e==null?null:(this.root=this.splayMin(e),this.root)}_last(){let e=this.root;return e==null?null:(this.root=this.splayMax(e),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(e){return this.validKey(e)&&this.splay(e)==0}defaultCompare(){return(e,t)=>e<t?-1:e>t?1:0}wrap(){return{getRoot:()=>this.root,setRoot:e=>{this.root=e},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:e=>{this.splayCount=e},splay:e=>this.splay(e),has:e=>this.has(e)}}},E0,S0,pa=class Ci extends o2{constructor(t,r){super(),D(this,"root",null),D(this,"compare"),D(this,"validKey"),D(this,E0,"[object Set]"),this.compare=t??this.defaultCompare(),this.validKey=r??(n=>n!=null&&n!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(let r of t)this.delete(r)}forEach(t){let r=this[Symbol.iterator](),n;for(;n=r.next(),!n.done;)t(n.value,n.value,this)}add(t){let r=this.splay(t);return r!=0&&this.addNewRoot(new Ei(t),r),this}addAndReturn(t){let r=this.splay(t);return r!=0&&this.addNewRoot(new Ei(t),r),this.root.key}addAll(t){for(let r of t)this.add(r)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<0)return this.root.key;let n=this.root.left;if(n==null)return null;let i=n.right;for(;i!=null;)n=i,i=n.right;return n.key}firstAfter(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>0)return this.root.key;let n=this.root.right;if(n==null)return null;let i=n.left;for(;i!=null;)n=i,i=n.left;return n.key}retainAll(t){let r=new Ci(this.compare,this.validKey),n=this.modificationCount;for(let i of t){if(n!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(i)&&this.splay(i)==0&&r.add(this.root.key)}r.size!=this.size&&(this.root=r.root,this.size=r.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){let r=new Ci(this.compare,this.validKey);for(let n of this)t.has(n)&&r.add(n);return r}difference(t){let r=new Ci(this.compare,this.validKey);for(let n of this)t.has(n)||r.add(n);return r}union(t){let r=this.clone();return r.addAll(t),r}clone(){let t=new Ci(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function r(i,o){let a,s;do{if(a=i.left,s=i.right,a!=null){let l=new Ei(a.key);o.left=l,r(a,l)}if(s!=null){let l=new Ei(s.key);o.right=l,i=s,o=l}}while(s!=null)}let n=new Ei(t.key);return r(t,n),n}toSet(){return this.clone()}entries(){return new s2(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(S0=Symbol.iterator,E0=Symbol.toStringTag,S0)](){return new a2(this.wrap())}},Cp=class{constructor(e){D(this,"tree"),D(this,"path",new Array),D(this,"modificationCount",null),D(this,"splayCount"),this.tree=e,this.splayCount=e.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;let e=this.path[this.path.length-1];return this.getValue(e)}rebuildPath(e){this.path.splice(0,this.path.length),this.tree.splay(e),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(e){for(;e!=null;)this.path.push(e),e=e.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let r=this.tree.getRoot();for(;r!=null;)this.path.push(r),r=r.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let e=this.path[this.path.length-1],t=e.right;if(t!=null){for(;t!=null;)this.path.push(t),t=t.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===e;)e=this.path.pop();return this.path.length>0}},a2=class extends Cp{getValue(e){return e.key}},s2=class extends Cp{getValue(e){return[e.key,e.key]}},Ap=e=>()=>e,zf=e=>{let t=e?(r,n)=>n.minus(r).abs().isLessThanOrEqualTo(e):Ap(!1);return(r,n)=>t(r,n)?0:r.comparedTo(n)};function f2(e){let t=e?(r,n,i,o,a)=>r.exponentiatedBy(2).isLessThanOrEqualTo(o.minus(n).exponentiatedBy(2).plus(a.minus(i).exponentiatedBy(2)).times(e)):Ap(!1);return(r,n,i)=>{let o=r.x,a=r.y,s=i.x,l=i.y,f=a.minus(l).times(n.x.minus(s)).minus(o.minus(s).times(n.y.minus(l)));return t(f,o,a,s,l)?0:f.comparedTo(0)}}var l2=e=>e,c2=e=>{if(e){let t=new pa(zf(e)),r=new pa(zf(e)),n=(o,a)=>a.addAndReturn(o),i=o=>({x:n(o.x,t),y:n(o.y,r)});return i({x:new ht(0),y:new ht(0)}),i}return l2},Uf=e=>({set:t=>{kt=Uf(t)},reset:()=>Uf(e),compare:zf(e),snap:c2(e),orient:f2(e)}),kt=Uf(),Si=(e,t)=>e.ll.x.isLessThanOrEqualTo(t.x)&&t.x.isLessThanOrEqualTo(e.ur.x)&&e.ll.y.isLessThanOrEqualTo(t.y)&&t.y.isLessThanOrEqualTo(e.ur.y),qf=(e,t)=>{if(t.ur.x.isLessThan(e.ll.x)||e.ur.x.isLessThan(t.ll.x)||t.ur.y.isLessThan(e.ll.y)||e.ur.y.isLessThan(t.ll.y))return null;let r=e.ll.x.isLessThan(t.ll.x)?t.ll.x:e.ll.x,n=e.ur.x.isLessThan(t.ur.x)?e.ur.x:t.ur.x,i=e.ll.y.isLessThan(t.ll.y)?t.ll.y:e.ll.y,o=e.ur.y.isLessThan(t.ur.y)?e.ur.y:t.ur.y;return{ll:{x:r,y:i},ur:{x:n,y:o}}},fa=(e,t)=>e.x.times(t.y).minus(e.y.times(t.x)),Pp=(e,t)=>e.x.times(t.x).plus(e.y.times(t.y)),ga=e=>Pp(e,e).sqrt(),u2=(e,t,r)=>{let n={x:t.x.minus(e.x),y:t.y.minus(e.y)},i={x:r.x.minus(e.x),y:r.y.minus(e.y)};return fa(i,n).div(ga(i)).div(ga(n))},d2=(e,t,r)=>{let n={x:t.x.minus(e.x),y:t.y.minus(e.y)},i={x:r.x.minus(e.x),y:r.y.minus(e.y)};return Pp(i,n).div(ga(i)).div(ga(n))},T0=(e,t,r)=>t.y.isZero()?null:{x:e.x.plus(t.x.div(t.y).times(r.minus(e.y))),y:r},C0=(e,t,r)=>t.x.isZero()?null:{x:r,y:e.y.plus(t.y.div(t.x).times(r.minus(e.x)))},h2=(e,t,r,n)=>{if(t.x.isZero())return C0(r,n,e.x);if(n.x.isZero())return C0(e,t,r.x);if(t.y.isZero())return T0(r,n,e.y);if(n.y.isZero())return T0(e,t,r.y);let i=fa(t,n);if(i.isZero())return null;let o={x:r.x.minus(e.x),y:r.y.minus(e.y)},a=fa(o,t).div(i),s=fa(o,n).div(i),l=e.x.plus(s.times(t.x)),f=r.x.plus(a.times(n.x)),c=e.y.plus(s.times(t.y)),u=r.y.plus(a.times(n.y)),d=l.plus(f).div(2),h=c.plus(u).div(2);return{x:d,y:h}},dt=class kp{constructor(t,r){D(this,"point"),D(this,"isLeft"),D(this,"segment"),D(this,"otherSE"),D(this,"consumedBy"),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=r}static compare(t,r){let n=kp.comparePoints(t.point,r.point);return n!==0?n:(t.point!==r.point&&t.link(r),t.isLeft!==r.isLeft?t.isLeft?1:-1:ma.compare(t.segment,r.segment))}static comparePoints(t,r){return t.x.isLessThan(r.x)?-1:t.x.isGreaterThan(r.x)?1:t.y.isLessThan(r.y)?-1:t.y.isGreaterThan(r.y)?1:0}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");let r=t.point.events;for(let n=0,i=r.length;n<i;n++){let o=r[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){let t=this.point.events.length;for(let r=0;r<t;r++){let n=this.point.events[r];if(n.segment.consumedBy===void 0)for(let i=r+1;i<t;i++){let o=this.point.events[i];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){let t=[];for(let r=0,n=this.point.events.length;r<n;r++){let i=this.point.events[r];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){let r=new Map,n=i=>{let o=i.otherSE;r.set(i,{sine:u2(this.point,t.point,o.point),cosine:d2(this.point,t.point,o.point)})};return(i,o)=>{r.has(i)||n(i),r.has(o)||n(o);let{sine:a,cosine:s}=r.get(i),{sine:l,cosine:f}=r.get(o);return a.isGreaterThanOrEqualTo(0)&&l.isGreaterThanOrEqualTo(0)?s.isLessThan(f)?1:s.isGreaterThan(f)?-1:0:a.isLessThan(0)&&l.isLessThan(0)?s.isLessThan(f)?-1:s.isGreaterThan(f)?1:0:l.isLessThan(a)?-1:l.isGreaterThan(a)?1:0}}},p2=class Gf{constructor(t){D(this,"events"),D(this,"poly"),D(this,"_isExteriorRing"),D(this,"_enclosingRing"),this.events=t;for(let r=0,n=t.length;r<n;r++)t[r].segment.ringOut=this;this.poly=null}static factory(t){let r=[];for(let n=0,i=t.length;n<i;n++){let o=t[n];if(!o.isInResult()||o.ringOut)continue;let a=null,s=o.leftSE,l=o.rightSE,f=[s],c=s.point,u=[];for(;a=s,s=l,f.push(s),s.point!==c;)for(;;){let d=s.getAvailableLinkedEvents();if(d.length===0){let x=f[0].point,T=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${x.x}, ${x.y}]. Last matching segment found ends at [${T.x}, ${T.y}].`)}if(d.length===1){l=d[0].otherSE;break}let h=null;for(let x=0,T=u.length;x<T;x++)if(u[x].point===s.point){h=x;break}if(h!==null){let x=u.splice(h)[0],T=f.splice(x.index);T.unshift(T[0].otherSE),r.push(new Gf(T.reverse()));continue}u.push({index:f.length,point:s.point});let g=s.getLeftmostComparator(a);l=d.sort(g)[0].otherSE;break}r.push(new Gf(f))}return r}getGeom(){let t=this.events[0].point,r=[t];for(let f=1,c=this.events.length-1;f<c;f++){let u=this.events[f].point,d=this.events[f+1].point;kt.orient(u,t,d)!==0&&(r.push(u),t=u)}if(r.length===1)return null;let n=r[0],i=r[1];kt.orient(n,t,i)===0&&r.shift(),r.push(r[0]);let o=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:r.length-1,s=this.isExteriorRing()?r.length:-1,l=[];for(let f=a;f!=s;f+=o)l.push([r[f].x.toNumber(),r[f].y.toNumber()]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){let t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,o=this.events.length;i<o;i++){let a=this.events[i];dt.compare(t,a)>0&&(t=a)}let r=t.segment.prevInResult(),n=r?r.prevInResult():null;for(;;){if(!r)return null;if(!n)return r.ringOut;if(n.ringOut!==r.ringOut)return n.ringOut?.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut?.enclosingRing();r=n.prevInResult(),n=r?r.prevInResult():null}}},A0=class{constructor(e){D(this,"exteriorRing"),D(this,"interiorRings"),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){let e=this.exteriorRing.getGeom();if(e===null)return null;let t=[e];for(let r=0,n=this.interiorRings.length;r<n;r++){let i=this.interiorRings[r].getGeom();i!==null&&t.push(i)}return t}},g2=class{constructor(e){D(this,"rings"),D(this,"polys"),this.rings=e,this.polys=this._composePolys(e)}getGeom(){let e=[];for(let t=0,r=this.polys.length;t<r;t++){let n=this.polys[t].getGeom();n!==null&&e.push(n)}return e}_composePolys(e){let t=[];for(let r=0,n=e.length;r<n;r++){let i=e[r];if(!i.poly)if(i.isExteriorRing())t.push(new A0(i));else{let o=i.enclosingRing();o?.poly||t.push(new A0(o)),o?.poly?.addInterior(i)}}return t}},m2=class{constructor(e,t=ma.compare){D(this,"queue"),D(this,"tree"),D(this,"segments"),this.queue=e,this.tree=new pa(t),this.segments=[]}process(e){let t=e.segment,r=[];if(e.consumedBy)return e.isLeft?this.queue.delete(e.otherSE):this.tree.delete(t),r;e.isLeft&&this.tree.add(t);let n=t,i=t;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do i=this.tree.firstAfter(i);while(i!=null&&i.consumedBy!=null);if(e.isLeft){let o=null;if(n){let s=n.getIntersection(t);if(s!==null&&(t.isAnEndpoint(s)||(o=s),!n.isAnEndpoint(s))){let l=this._splitSafely(n,s);for(let f=0,c=l.length;f<c;f++)r.push(l[f])}}let a=null;if(i){let s=i.getIntersection(t);if(s!==null&&(t.isAnEndpoint(s)||(a=s),!i.isAnEndpoint(s))){let l=this._splitSafely(i,s);for(let f=0,c=l.length;f<c;f++)r.push(l[f])}}if(o!==null||a!==null){let s=null;o===null?s=a:a===null?s=o:s=dt.comparePoints(o,a)<=0?o:a,this.queue.delete(t.rightSE),r.push(t.rightSE);let l=t.split(s);for(let f=0,c=l.length;f<c;f++)r.push(l[f])}r.length>0?(this.tree.delete(t),r.push(e)):(this.segments.push(t),t.prev=n)}else{if(n&&i){let o=n.getIntersection(i);if(o!==null){if(!n.isAnEndpoint(o)){let a=this._splitSafely(n,o);for(let s=0,l=a.length;s<l;s++)r.push(a[s])}if(!i.isAnEndpoint(o)){let a=this._splitSafely(i,o);for(let s=0,l=a.length;s<l;s++)r.push(a[s])}}}this.tree.delete(t)}return r}_splitSafely(e,t){this.tree.delete(e);let r=e.rightSE;this.queue.delete(r);let n=e.split(t);return n.push(r),e.consumedBy===void 0&&this.tree.add(e),n}},b2=class{constructor(){D(this,"type"),D(this,"numMultiPolys")}run(e,t,r){Ai.type=e;let n=[new k0(t,!0)];for(let f=0,c=r.length;f<c;f++)n.push(new k0(r[f],!1));if(Ai.numMultiPolys=n.length,Ai.type==="difference"){let f=n[0],c=1;for(;c<n.length;)qf(n[c].bbox,f.bbox)!==null?c++:n.splice(c,1)}if(Ai.type==="intersection")for(let f=0,c=n.length;f<c;f++){let u=n[f];for(let d=f+1,h=n.length;d<h;d++)if(qf(u.bbox,n[d].bbox)===null)return[]}let i=new pa(dt.compare);for(let f=0,c=n.length;f<c;f++){let u=n[f].getSweepEvents();for(let d=0,h=u.length;d<h;d++)i.add(u[d])}let o=new m2(i),a=null;for(i.size!=0&&(a=i.first(),i.delete(a));a;){let f=o.process(a);for(let c=0,u=f.length;c<u;c++){let d=f[c];d.consumedBy===void 0&&i.add(d)}i.size!=0?(a=i.first(),i.delete(a)):a=null}kt.reset();let s=p2.factory(o.segments);return new g2(s).getGeom()}},Ai=new b2,Vf=Ai,y2=0,ma=class la{constructor(t,r,n,i){D(this,"id"),D(this,"leftSE"),D(this,"rightSE"),D(this,"rings"),D(this,"windings"),D(this,"ringOut"),D(this,"consumedBy"),D(this,"prev"),D(this,"_prevInResult"),D(this,"_beforeState"),D(this,"_afterState"),D(this,"_isInResult"),this.id=++y2,this.leftSE=t,t.segment=this,t.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=t,this.rings=n,this.windings=i}static compare(t,r){let n=t.leftSE.point.x,i=r.leftSE.point.x,o=t.rightSE.point.x,a=r.rightSE.point.x;if(a.isLessThan(n))return 1;if(o.isLessThan(i))return-1;let s=t.leftSE.point.y,l=r.leftSE.point.y,f=t.rightSE.point.y,c=r.rightSE.point.y;if(n.isLessThan(i)){if(l.isLessThan(s)&&l.isLessThan(f))return 1;if(l.isGreaterThan(s)&&l.isGreaterThan(f))return-1;let u=t.comparePoint(r.leftSE.point);if(u<0)return 1;if(u>0)return-1;let d=r.comparePoint(t.rightSE.point);return d!==0?d:-1}if(n.isGreaterThan(i)){if(s.isLessThan(l)&&s.isLessThan(c))return-1;if(s.isGreaterThan(l)&&s.isGreaterThan(c))return 1;let u=r.comparePoint(t.leftSE.point);if(u!==0)return u;let d=t.comparePoint(r.rightSE.point);return d<0?1:d>0?-1:1}if(s.isLessThan(l))return-1;if(s.isGreaterThan(l))return 1;if(o.isLessThan(a)){let u=r.comparePoint(t.rightSE.point);if(u!==0)return u}if(o.isGreaterThan(a)){let u=t.comparePoint(r.rightSE.point);if(u<0)return 1;if(u>0)return-1}if(!o.eq(a)){let u=f.minus(s),d=o.minus(n),h=c.minus(l),g=a.minus(i);if(u.isGreaterThan(d)&&h.isLessThan(g))return 1;if(u.isLessThan(d)&&h.isGreaterThan(g))return-1}return o.isGreaterThan(a)?1:o.isLessThan(a)||f.isLessThan(c)?-1:f.isGreaterThan(c)?1:t.id<r.id?-1:t.id>r.id?1:0}static fromRing(t,r,n){let i,o,a,s=dt.comparePoints(t,r);if(s<0)i=t,o=r,a=1;else if(s>0)i=r,o=t,a=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);let l=new dt(i,!0),f=new dt(o,!1);return new la(l,f,[n],[a])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let t=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t.isLessThan(r)?t:r},ur:{x:this.rightSE.point.x,y:t.isGreaterThan(r)?t:r}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(t){return t.x.eq(this.leftSE.point.x)&&t.y.eq(this.leftSE.point.y)||t.x.eq(this.rightSE.point.x)&&t.y.eq(this.rightSE.point.y)}comparePoint(t){return kt.orient(this.leftSE.point,t,this.rightSE.point)}getIntersection(t){let r=this.bbox(),n=t.bbox(),i=qf(r,n);if(i===null)return null;let o=this.leftSE.point,a=this.rightSE.point,s=t.leftSE.point,l=t.rightSE.point,f=Si(r,s)&&this.comparePoint(s)===0,c=Si(n,o)&&t.comparePoint(o)===0,u=Si(r,l)&&this.comparePoint(l)===0,d=Si(n,a)&&t.comparePoint(a)===0;if(c&&f)return d&&!u?a:!d&&u?l:null;if(c)return u&&o.x.eq(l.x)&&o.y.eq(l.y)?null:o;if(f)return d&&a.x.eq(s.x)&&a.y.eq(s.y)?null:s;if(d&&u)return null;if(d)return a;if(u)return l;let h=h2(o,this.vector(),s,t.vector());return h===null||!Si(i,h)?null:kt.snap(h)}split(t){let r=[],n=t.events!==void 0,i=new dt(t,!0),o=new dt(t,!1),a=this.rightSE;this.replaceRightSE(o),r.push(o),r.push(i);let s=new la(i,a,this.rings.slice(),this.windings.slice());return dt.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),dt.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),r}swapEvents(){let t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let r=0,n=this.windings.length;r<n;r++)this.windings[r]*=-1}consume(t){let r=this,n=t;for(;r.consumedBy;)r=r.consumedBy;for(;n.consumedBy;)n=n.consumedBy;let i=la.compare(r,n);if(i!==0){if(i>0){let o=r;r=n,n=o}if(r.prev===n){let o=r;r=n,n=o}for(let o=0,a=n.rings.length;o<a;o++){let s=n.rings[o],l=n.windings[o],f=r.rings.indexOf(s);f===-1?(r.rings.push(s),r.windings.push(l)):r.windings[f]+=l}n.rings=null,n.windings=null,n.consumedBy=r,n.leftSE.consumedBy=r.leftSE,n.rightSE.consumedBy=r.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};let r=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){let f=this.rings[s],c=this.windings[s],u=r.indexOf(f);u===-1?(r.push(f),n.push(c)):n[u]+=c}let o=[],a=[];for(let s=0,l=r.length;s<l;s++){if(n[s]===0)continue;let f=r[s],c=f.poly;if(a.indexOf(c)===-1)if(f.isExterior)o.push(c);else{a.indexOf(c)===-1&&a.push(c);let u=o.indexOf(f.poly);u!==-1&&o.splice(u,1)}}for(let s=0,l=o.length;s<l;s++){let f=o[s].multiPoly;i.indexOf(f)===-1&&i.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let t=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch(Vf.type){case"union":{let n=t.length===0,i=r.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<r.length?(n=t.length,i=r.length):(n=r.length,i=t.length),this._isInResult=i===Vf.numMultiPolys&&n<i;break}case"xor":{let n=Math.abs(t.length-r.length);this._isInResult=n%2===1;break}case"difference":{let n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(r);break}}return this._isInResult}},P0=class{constructor(e,t,r){if(D(this,"poly"),D(this,"isExterior"),D(this,"segments"),D(this,"bbox"),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=r,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let n=kt.snap({x:new ht(e[0][0]),y:new ht(e[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let i=n;for(let o=1,a=e.length;o<a;o++){if(typeof e[o][0]!="number"||typeof e[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let s=kt.snap({x:new ht(e[o][0]),y:new ht(e[o][1])});s.x.eq(i.x)&&s.y.eq(i.y)||(this.segments.push(ma.fromRing(i,s,this)),s.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.x),s.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.y),s.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.x),s.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.y),i=s)}(!n.x.eq(i.x)||!n.y.eq(i.y))&&this.segments.push(ma.fromRing(i,n,this))}getSweepEvents(){let e=[];for(let t=0,r=this.segments.length;t<r;t++){let n=this.segments[t];e.push(n.leftSE),e.push(n.rightSE)}return e}},x2=class{constructor(e,t){if(D(this,"multiPoly"),D(this,"exteriorRing"),D(this,"interiorRings"),D(this,"bbox"),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new P0(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let r=1,n=e.length;r<n;r++){let i=new P0(e[r],this,!1);i.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i)}this.multiPoly=t}getSweepEvents(){let e=this.exteriorRing.getSweepEvents();for(let t=0,r=this.interiorRings.length;t<r;t++){let n=this.interiorRings[t].getSweepEvents();for(let i=0,o=n.length;i<o;i++)e.push(n[i])}return e}},k0=class{constructor(e,t){if(D(this,"isSubject"),D(this,"polys"),D(this,"bbox"),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:new ht(Number.POSITIVE_INFINITY),y:new ht(Number.POSITIVE_INFINITY)},ur:{x:new ht(Number.NEGATIVE_INFINITY),y:new ht(Number.NEGATIVE_INFINITY)}};for(let r=0,n=e.length;r<n;r++){let i=new x2(e[r],this);i.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i)}this.isSubject=t}getSweepEvents(){let e=[];for(let t=0,r=this.polys.length;t<r;t++){let n=this.polys[t].getSweepEvents();for(let i=0,o=n.length;i<o;i++)e.push(n[i])}return e}};var v2=(e,...t)=>Vf.run("intersection",e,t),qC=kt.set;function w2(e,t={}){let r=[];if(gp(e,i=>{r.push(i.coordinates)}),r.length<2)throw new Error("Must specify at least 2 geometries");let n=v2(r[0],...r.slice(1));return n.length===0?null:n.length===1?Qf(n[0],t.properties):cp(n,t.properties)}var Mp=w2,_2={Point:Fp,MultiPoint:S2,LineString:Lp,MultiLineString:T2,Polygon:Ip,MultiPolygon:C2};function E2(e,t){let[r,n,i,o]=t,a=$f([r,o]),s=$f([i,n]),l=[a,s];if(e.type==="GeometryCollection")throw new Error("Unsupported geometry type GeometryCollection");let f=_2[e.type],c=f(e.coordinates,l);return{...e,coordinates:c}}function Fp([e,t],[r,n]){let i=M0(r[0],n[0],e),o=M0(r[1],n[1],t);return[i,o]}function tl(e,t){return e.map(r=>Fp($f(r),t))}function S2(e,t){return tl(e,t)}function Lp(e,t){return tl(e,t)}function T2(e,t){return e.map(r=>Lp(r,t))}function Ip(e,t){return e.map(r=>tl(r,t))}function C2(e,t){return e.map(r=>Ip(r,t))}function $f(e){return Nf(e)}function M0(e,t,r){return(r-e)/(t-e)}function A2(e,t,r){var n=e.length,i=on(e[0],t),o=[],a,s,l;let f,c;for(r||(r=[]),a=1;a<n;a++){for(f=e[a-1],c=e[a],s=l=on(c,t);;)if(i|s){if(i&s)break;i?(f=Hf(f,c,i,t),i=on(f,t)):(c=Hf(f,c,s,t),s=on(c,t))}else{o.push(f),s!==l?(o.push(c),a<n-1&&(r.push(o),o=[])):a===n-1&&o.push(c);break}i=l}return o.length&&r.push(o),r}function P2(e,t){var r,n,i,o,a,s,l;for(n=1;n<=8;n*=2){for(r=[],i=e[e.length-1],o=!(on(i,t)&n),a=0;a<e.length;a++)s=e[a],l=!(on(s,t)&n),l!==o&&r.push(Hf(i,s,n,t)),l&&r.push(s),i=s,o=l;if(e=r,!e.length)break}return r}function Hf(e,t,r,n){return r&8?[e[0]+(t[0]-e[0])*(n[3]-e[1])/(t[1]-e[1]),n[3]]:r&4?[e[0]+(t[0]-e[0])*(n[1]-e[1])/(t[1]-e[1]),n[1]]:r&2?[n[2],e[1]+(t[1]-e[1])*(n[2]-e[0])/(t[0]-e[0])]:r&1?[n[0],e[1]+(t[1]-e[1])*(n[0]-e[0])/(t[0]-e[0])]:null}function on(e,t){var r=0;return e[0]<t[0]?r|=1:e[0]>t[2]&&(r|=2),e[1]<t[1]?r|=4:e[1]>t[3]&&(r|=8),r}function k2(e,t){let r=Pt(e),n=r.type,i=e.type==="Feature"?e.properties:{},o=r.coordinates;switch(n){case"LineString":case"MultiLineString":{let a=[];return n==="LineString"&&(o=[o]),o.forEach(s=>{A2(s,t,a)}),a.length===1?fp(a[0],i):lp(a,i)}case"Polygon":return Qf(F0(o,t),i);case"MultiPolygon":return cp(o.map(a=>F0(a,t)),i);default:throw new Error("geometry "+n+" not supported")}}function F0(e,t){let r=[];for(let n of e){let i=P2(n,t);i.length>0&&((i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1])&&i.push(i[0]),i.length>=4&&r.push(i))}return r}var L0=k2;function M2(e,t,r){let n=Zv(e);if(!r||Sp(n,r))return!0;let i=Mp(Li([n,_e(r)]));return i?t==="mvt"?E2(i.geometry,e):i.geometry:!1}function F2(e,t,r){return Op(e,t,r)}function Op(e,t,r){let n=Ch(e);if(!r||Sp(n,r))return!0;let i=Mp(Li([_e(n),_e(r)]));if(!i)return!1;let o=Th(i.geometry,t);return new Set(o)}var L2=[-180,-90,0,90],I2=[0,-90,180,90];function O2(e,t){if(!t)return!0;let r=_e(t),n=(0,Zf.polygonToCells)(L0(r,L2).geometry.coordinates,e,!0),i=(0,Zf.polygonToCells)(L0(r,I2).geometry.coordinates,e,!0);return new Set(n.concat(i))}var R2="__geomValue";function B2({tiles:e,tileFormat:t,spatialFilter:r,uniqueIdProperty:n,options:i}){let o=new Map;for(let a of e){if(a.isVisible===!1||!a.data)continue;let s=[a.bbox.west,a.bbox.south,a.bbox.east,a.bbox.north],l=M2(s,t,r);if(l===!1)continue;let f=l===!0?void 0:l;Ff({map:o,spatialFilter:f,data:a.data.points,type:"Point",bbox:s,tileFormat:t,uniqueIdProperty:n,options:i}),Ff({map:o,spatialFilter:f,data:a.data.lines,type:"LineString",bbox:s,tileFormat:t,uniqueIdProperty:n,options:i}),Ff({map:o,spatialFilter:f,data:a.data.polygons,type:"Polygon",bbox:s,tileFormat:t,uniqueIdProperty:n,options:i})}return Array.from(o.values())}function Rp({map:e,data:t,startIndex:r,endIndex:n,type:i,bbox:o,tileFormat:a,uniqueIdProperty:s,storeGeometry:l,spatialFilter:f}){let c=z2(t,r),u=q2(c,s,e);if(!u||e.has(u))return;let d=null;if(l||f){let{positions:g}=t,x=V2(r,n,g);d=G2(x,i)}if(d&&f&&!bp(d,f))return;let h=U2(c);l&&d&&(h[R2]=a==="mvt"?Uv(d,o):d),e.set(u,h)}function D2({map:e,data:t,spatialFilter:r,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}){let l=Bp(t,n),f=s?.storeGeometry||!1;for(let c=0;c<l.length-1;c++){let u=l[c],d=l[c+1];Rp({map:e,data:t,startIndex:u,endIndex:d,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,storeGeometry:f,spatialFilter:r})}}function Bp(e,t){let r;switch(t){case"Polygon":r=e.primitivePolygonIndices;break;case"LineString":r=e.pathIndices;break;case"Point":r=Z2(e);break;default:throw new Error(`Unsupported geometry type: ${t}`)}return r.value}function N2(e,t){return e.featureIds.value[t]}function z2(e,t){let r=N2(e,t),{properties:n,numericProps:i,fields:o}=e,a={uniqueId:o?.[r]?.id,properties:n[r],numericProps:{}};for(let s in i)a.numericProps[s]=i[s].value[t];return a}function U2(e){let{properties:t,numericProps:r}=e;return Object.assign({},t,r)}function q2(e,t,r){if(t)return Mf(e,t);if(e.uniqueId)return e.uniqueId;let n=r.size+1;return Mf(e,"cartodb_id")||Mf(e,"geoid")||n}function Mf(e,t){let{properties:r,numericProps:n}=e;return n[t]||r[t]}function G2(e,t){switch(t){case"Polygon":return{type:"Polygon",coordinates:[e]};case"LineString":return{type:"LineString",coordinates:e};case"Point":return{type:"Point",coordinates:e[0]};default:throw new Error("Invalid geometry type")}}function V2(e,t,r){let n=[];for(let i=e;i<t;i++)n.push(Array.from(r.value.subarray(i*r.size,(i+1)*r.size)));return n}function Ff({map:e,spatialFilter:t,data:r,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}){r?.properties.length&&(t?D2({map:e,data:r,spatialFilter:t,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}):$2({map:e,data:r,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}))}function $2({map:e,data:t,type:r,bbox:n,tileFormat:i,uniqueIdProperty:o,options:a}){let s=Bp(t,r),l=a?.storeGeometry||!1;for(let f=0;f<s.length-1;f++){let c=s[f],u=s[f+1];Rp({map:e,data:t,startIndex:c,endIndex:u,type:r,bbox:n,tileFormat:i,uniqueIdProperty:o,storeGeometry:l})}}function Z2(e){let t=e.featureIds.value,r=t[t.length-1],n=t.constructor,i={value:new n(t.length+1),size:1};return i.value.set(t),i.value.set([r+1],t.length),i}function H2({tiles:e,spatialFilter:t,spatialDataColumn:r,spatialDataType:n}){let i=new Map,o=W2(n),a=Y2(e,o),s=r||o;if(!a)return[];let l;o==="h3"&&(l=O2(a,t));for(let f of e)if(!(f.isVisible===!1||!f.data)){if(o==="quadbin"){let c=j2(f,o);l=Op(c,a,t)}l&&f.data.forEach(c=>{(l===!0||l.has(c.id))&&i.set(c.id,{...c.properties,[s]:c.id})})}return Array.from(i.values())}function j2(e,t){return t==="quadbin"?e.index.q:e.id}function Y2(e,t){let r=e.find(n=>n.data?.length)?.data;if(r){if(t==="quadbin")return Number(No(r[0].id));if(t==="h3")return(0,Dp.getResolution)(r[0].id)}}function W2(e){switch(e){case"h3":return"h3";case"quadbin":return"quadbin";default:throw new Error("Unexpected spatial data type")}}var X2="3.4",Er="geom",Np=7e3,fn=.5,K2=1,rl=4,nl=6,zp="__aggregationValue",Q2=`1 AS ${zp}`;function J2({tiles:e,...t}){let r={};for(let s of t.rasterMetadata.bands)r[s.name]={...s,nodata:Number(s.nodata)};if(e=e.filter(tw),e.length===0)return[];let n=No(e[0].index.q),i=e[0].data.blockSize,o=n+BigInt(Math.log2(i)),a=new Map;for(let s of e){let l=s.index.q,f=F2(l,o,t.spatialFilter);if(f===!1)continue;let c=rw(l,o);for(let u=0;u<c.length;u++){if(f!==!0&&!f.has(c[u]))continue;let d={},h=!1;for(let g in s.data.cells.numericProps){let x=s.data.cells.numericProps[g].value[u],T=r[g];nw(x,T.nodata)&&(d[g]=s.data.cells.numericProps[g].value[u],h=!0)}h&&a.set(c[u],d)}}return Array.from(a.values())}function ew(e){return!!e.data?.cells}function tw(e){return!!(e.isVisible&&e.data?.cells?.numericProps)}function rw(e,t){let r=Ws(e),n=Number(t),i=2**(n-r.z),o=r.x*i,a=r.y*i,s=[];for(let l=0,f=i**2;l<f;l++){let c=o+l%i,u=a+Math.floor(l/i);s.push(Ys({x:c,y:u,z:n}))}return s}function nw(e,t){return Number.isNaN(e)?!1:t!==e}var ZC=new Set(Object.values(Xf));function At(e){return Array.isArray(e)?e.map(t=>At(t)):typeof e!="object"?e:Object.entries(e).reduce((t,[r,n])=>(t[r.toLowerCase()]=typeof n=="object"&&n?At(n):n,t),{})}function J(e,t){if(!e)throw new Error(t)}var Up=class Pi extends Error{constructor(t){super(`${Pi.NAME}: ${t}`),this.name=Pi.NAME}static is(t){return t instanceof Pi||t.message?.includes(Pi.NAME)}};D(Up,"NAME","InvalidColumnError");var jf=Up;function iw(e){for(let t in e)return!1;return!0}var ow=e=>e!==null&&typeof e=="object",qp=e=>ow(e)&&e.constructor==={}.constructor;function aw(e,...t){for(let r of t)for(let n in r)r[n]!==void 0&&(e[n]=r[n]);return e}function va(e,t,r){let n=r.find(i=>i.name===t);return n&&n.type==="geometry"?"geo":e}function sw({tiles:e,spatialFilter:t,uniqueIdProperty:r,tileFormat:n,spatialDataColumn:i=Er,spatialDataType:o,rasterMetadata:a,storeGeometry:s=!1}){return o==="geo"?B2({tiles:e,tileFormat:n,spatialFilter:t,uniqueIdProperty:r,options:{storeGeometry:s}}):e.some(ew)?(J(a,"Missing raster metadata"),J2({tiles:e,spatialFilter:t,spatialDataColumn:i,spatialDataType:o,rasterMetadata:a})):H2({tiles:e,spatialFilter:t,spatialDataColumn:i,spatialDataType:o})}var Sr=class extends Error{constructor(e,t,r,n){let i="Failed to connect";r&&(i="Server returned: ",r.status===400?i+="Bad request":r.status===401||r.status===403?i+="Unauthorized access":r.status===404?i+="Not found":i+="Error",i+=` (${r.status}):`),i+=` ${e.message||e}`;let o=`${t.requestType} API request failed`;o+=`
|
|
171
171
|
${i}`;for(let a of Object.keys(t))a!=="requestType"&&(o+=`
|
|
172
172
|
${fw(a)}: ${t[a]}`);o+=`
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "CARTO official integration with Deck.gl. Build geospatial applications using CARTO and Deck.gl.",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "9.2.
|
|
6
|
+
"version": "9.2.2",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -67,13 +67,13 @@
|
|
|
67
67
|
"quadbin": "^0.4.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@deck.gl/aggregation-layers": "
|
|
71
|
-
"@deck.gl/core": "
|
|
72
|
-
"@deck.gl/extensions": "
|
|
73
|
-
"@deck.gl/geo-layers": "
|
|
74
|
-
"@deck.gl/layers": "
|
|
70
|
+
"@deck.gl/aggregation-layers": "~9.2.0",
|
|
71
|
+
"@deck.gl/core": "~9.2.0",
|
|
72
|
+
"@deck.gl/extensions": "~9.2.0",
|
|
73
|
+
"@deck.gl/geo-layers": "~9.2.0",
|
|
74
|
+
"@deck.gl/layers": "~9.2.0",
|
|
75
75
|
"@loaders.gl/core": "^4.2.0",
|
|
76
|
-
"@luma.gl/core": "
|
|
76
|
+
"@luma.gl/core": "~9.2.2"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "9e183d2ce23bb21d655752ed614da0ce5a6a0458"
|
|
79
79
|
}
|