HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/streamlit/static/static/js/3466.05d62820.chunk.js
/*! For license information please see 3466.05d62820.chunk.js.LICENSE.txt */
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[3466],{12879:(t,e,n)=>{"use strict";n.r(e),n.d(e,{AGGREGATION_OPERATION:()=>y,CPUGridLayer:()=>Jt,ContourLayer:()=>nn,GPUGridLayer:()=>dn,GridLayer:()=>An,HeatmapLayer:()=>Bn,HexagonLayer:()=>te,ScreenGridLayer:()=>kt,_AggregationLayer:()=>ot,_BinSorter:()=>wt,_CPUAggregator:()=>jt,_GPUGridAggregator:()=>V});var i=n(64649),r=n(21970),o=n(70353),s=n(12308),a=n(28007),l=n(56474),c=n(94557),u=n(17225);function h(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=Math.fround(t),r=t-i;return e[n]=i,e[n+1]=r,e}function d(t){return t-Math.fround(t)}function f(t){const e=new Float32Array(32);for(let n=0;n<4;++n)for(let i=0;i<4;++i){const r=4*n+i;h(t[4*i+n],e,2*r)}return e}const A={ONE:1};const p={name:"fp64-arithmetic",vs:"uniform float ONE;\nvec2 split(float a) {\n  const float SPLIT = 4097.0;\n  float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float a_hi = t * ONE - (t - a);\n  float a_lo = a * ONE - a_hi;\n#else\n  float a_hi = t - (t - a);\n  float a_lo = a - a_hi;\n#endif\n  return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n  vec2 b = split(a.x);\n  b.y += a.y;\n  return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float sum = (a + b) * ONE;\n  float err = b - (sum - a) * ONE;\n#else\n  float sum = a + b;\n  float err = b - (sum - a);\n#endif\n  return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n  float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float v = (s * ONE - a) * ONE;\n  float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n  float v = s - a;\n  float err = (a - (s - v)) + (b - v);\n#endif\n  return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n  float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float v = (s * ONE - a) * ONE;\n  float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n  float v = s - a;\n  float err = (a - (s - v)) - (b + v);\n#endif\n  return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n  float prod = a * a;\n  vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n    a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n  float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n  return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n  float prod = a * b;\n  vec2 a_fp64 = split(a);\n  vec2 b_fp64 = split(b);\n  float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n    a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n  return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n  vec2 s, t;\n  s = twoSum(a.x, b.x);\n  t = twoSum(a.y, b.y);\n  s.y += t.x;\n  s = quickTwoSum(s.x, s.y);\n  s.y += t.y;\n  s = quickTwoSum(s.x, s.y);\n  return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n  vec2 s, t;\n  s = twoSub(a.x, b.x);\n  t = twoSub(a.y, b.y);\n  s.y += t.x;\n  s = quickTwoSum(s.x, s.y);\n  s.y += t.y;\n  s = quickTwoSum(s.x, s.y);\n  return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n  vec2 prod = twoProd(a.x, b.x);\n  prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  prod = split2(prod);\n#endif\n  prod = quickTwoSum(prod.x, prod.y);\n  prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  prod = split2(prod);\n#endif\n  prod = quickTwoSum(prod.x, prod.y);\n  return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n  float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n  vec2 yn = a * xn;\n#endif\n  float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n  vec2 prod = twoProd(xn, diff);\n  return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n  if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n  if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n  float x = 1.0 / sqrt(a.x);\n  float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n  vec2 yn_sqr = twoSqr(yn);\n#endif\n  float diff = sub_fp64(a, yn_sqr).x;\n  vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  return sum_fp64(split(yn), prod);\n#else\n  return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",fs:null,getUniforms:function(){return A},fp64ify:h,fp64LowPart:d,fp64ifyMatrix4:f};var g=n(46802),m=n(2123);const y={SUM:1,MEAN:2,MIN:3,MAX:4};function v(t,e){return t+e}function _(t,e){return e>t?e:t}function b(t,e){return e<t?e:t}function x(t,e,n){const i=y[t]||y.SUM;switch(e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(t))return t;return n=>(e.index=n.index,t(n.source,e))}(e,n),i){case y.MIN:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(b,1/0):null}(t,e);case y.SUM:return t=>function(t,e){if(Number.isFinite(e))return t.length?t.length*e:null;const n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(v,0):null}(t,e);case y.MEAN:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(v,0)/n.length:null}(t,e);case y.MAX:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(_,-1/0):null}(t,e);default:return null}}function w(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>(e.indices=n.map((t=>t.index)),t(n.map((t=>t.source)),e))}const C={projectPoints:!1,viewport:null,createBufferObjects:!0,moduleSettings:{}},B=3402823466e29,E=[32775,32774],T=[32776,32774],S=[32776,32775],M={[y.SUM]:32774,[y.MEAN]:32774,[y.MIN]:E,[y.MAX]:T},I={size:1,operation:y.SUM,needMin:!1,needMax:!1,combineMaxMin:!1},P="#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec3 positions;\nattribute vec3 positions64Low;\nattribute vec3 weights;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform bool projectPoints;\nuniform vec2 translation;\nuniform vec3 scaling;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n  vec4 result;\n  pos.xy = pos.xy/pos.w;\n  result = pos + vec4(translation, 0., 0.);\n  result.xy = scaling.z > 0. ? result.xy * scaling.xy : result.xy;\n  return result.xy;\n}\n\nvoid main(void) {\n\n  vWeights = weights;\n\n  vec4 windowPos = vec4(positions, 1.);\n  if (projectPoints) {\n    windowPos = project_position_to_clipspace(positions, positions64Low, vec3(0));\n  }\n\n  vec2 pos = project_to_pixel(windowPos);\n\n  vec2 pixelXY64[2];\n  pixelXY64[0] = vec2(pos.x, 0.);\n  pixelXY64[1] = vec2(pos.y, 0.);\n  vec2 gridXY64[2];\n  gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n  gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n  float x = floor(gridXY64[0].x);\n  float y = floor(gridXY64[1].x);\n  pos = vec2(x, y);\n  pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n  vec2 offset = 1.0 / gridSize;\n  pos = pos + offset;\n\n  gl_Position = vec4(pos, 0.0, 1.0);\n  gl_PointSize = 1.0;\n}\n",D="#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n  gl_FragColor = vec4(vWeights, 1.0);\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",F="#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n  vec2 pos = vec2(-1.0, -1.0);\n  vec2 offset = 1.0 / vec2(gridSize);\n  pos = pos + offset;\n\n  gl_Position = vec4(pos, 0.0, 1.0);\n\n  int yIndex = gl_InstanceID / gridSize[0];\n  int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n  vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n  vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n  vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n  vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n  vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n  vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n  vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n  gl_PointSize = 1.0;\n}\n",L="#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n  vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n  if (textureColor.a == 0.) {\n    discard;\n  }\n  fragColor.rgb = textureColor.rgb;\n  fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",O="#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n  bool isCellValid = bool(aggregationValues.w > 0.);\n  meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n  meanValues.w = aggregationValues.w;\n  gl_PointSize = 1.0;\n}\n";var R=n(58300),k=n(79078);const U={10240:9728,10241:9728};function z(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{width:n=1,height:i=1,data:r=null,unpackFlipY:o=!0,parameters:s=U}=e;return new R.Z(t,{data:r,format:(0,a.D0)(t)?34836:6408,type:5126,border:0,mipmaps:!1,parameters:s,dataFormat:6408,width:n,height:i,unpackFlipY:o})}function G(t,e){const{id:n,width:i=1,height:r=1,texture:o}=e;return new k.Z(t,{id:n,width:i,height:r,attachments:{36064:o}})}const N=["aggregationBuffer","maxMinBuffer","minBuffer","maxBuffer"],Z={maxData:"maxBuffer",minData:"minBuffer",maxMinData:"maxMinBuffer"},j=[o.h.WEBGL2,o.h.COLOR_ATTACHMENT_RGBA32F,o.h.BLEND_EQUATION_MINMAX,o.h.FLOAT_BLEND,o.h.TEXTURE_FLOAT];class V{static getAggregationData(t){let{aggregationData:e,maxData:n,minData:i,maxMinData:r,pixelIndex:o}=t;const s=4*o,a={};return e&&(a.cellCount=e[s+3],a.cellWeight=e[s]),r?(a.maxCellWieght=r[0],a.minCellWeight=r[3]):(n&&(a.maxCellWieght=n[0],a.totalCount=n[3]),i&&(a.minCellWeight=i[0],a.totalCount=n[3])),a}static getCellData(t){let{countsData:e,size:n=1}=t;const i=e.length/4,r=new Float32Array(i*n),o=new Uint32Array(i);for(let s=0;s<i;s++){for(let t=0;t<n;t++)r[s*n+t]=e[4*s+t];o[s]=e[4*s+3]}return{cellCounts:o,cellWeights:r}}static isSupported(t){return(0,s.ag)(t,j)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.id=e.id||"gpu-grid-aggregator",this.gl=t,this.state={weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=(0,a.D0)(t)&&(0,s.ag)(this.gl,o.h.BLEND_EQUATION_MINMAX,o.h.COLOR_ATTACHMENT_RGBA32F,o.h.TEXTURE_FLOAT),this._hasGPUSupport&&this._setupModels()}delete(){const{gridAggregationModel:t,allAggregationModel:e,meanTransform:n}=this,{textures:i,framebuffers:r,maxMinFramebuffers:o,minFramebuffers:s,maxFramebuffers:a,meanTextures:l,resources:c}=this.state;null===t||void 0===t||t.delete(),null===e||void 0===e||e.delete(),null===n||void 0===n||n.delete(),function(t){t=Array.isArray(t)?t:[t],t.forEach((t=>{for(const e in t)t[e].delete()}))}([r,i,o,s,a,l,c])}run(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});const e=this._normalizeAggregationParams(t);return this._hasGPUSupport||r.Z.log(1,"GPUGridAggregator: not supported")(),this._runAggregation(e)}getData(t){const e={},n=this.state.results;n[t].aggregationData||(n[t].aggregationData=n[t].aggregationBuffer.getData()),e.aggregationData=n[t].aggregationData;for(const i in Z){const r=Z[i];(n[t][i]||n[t][r])&&(n[t][i]=n[t][i]||n[t][r].getData(),e[i]=n[t][i])}return e}updateShaders(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState({shaderOptions:t,modelDirty:!0})}_normalizeAggregationParams(t){const e={...C,...t},{weights:n}=e;return n&&(e.weights=function(t){const e={};for(const n in t)e[n]={...I,...t[n]};return e}(n)),e}setState(t){Object.assign(this.state,t)}_getAggregateData(t){const e={},{textures:n,framebuffers:i,maxMinFramebuffers:r,minFramebuffers:o,maxFramebuffers:s,resources:a}=this.state,{weights:c}=t;for(const u in c){e[u]={};const{needMin:t,needMax:h,combineMaxMin:d}=c[u];e[u].aggregationTexture=n[u],e[u].aggregationBuffer=(0,l.Jb)(i[u],{target:c[u].aggregationBuffer,sourceType:5126}),t&&h&&d?(e[u].maxMinBuffer=(0,l.Jb)(r[u],{target:c[u].maxMinBuffer,sourceType:5126}),e[u].maxMinTexture=a["".concat(u,"-maxMinTexture")]):(t&&(e[u].minBuffer=(0,l.Jb)(o[u],{target:c[u].minBuffer,sourceType:5126}),e[u].minTexture=a["".concat(u,"-minTexture")]),h&&(e[u].maxBuffer=(0,l.Jb)(s[u],{target:c[u].maxBuffer,sourceType:5126}),e[u].maxTexture=a["".concat(u,"-maxTexture")]))}return this._trackGPUResultBuffers(e,c),e}_renderAggregateData(t){const{cellSize:e,projectPoints:n,attributes:i,moduleSettings:r,numCol:o,numRow:s,weights:a,translation:l,scaling:c}=t,{maxMinFramebuffers:u,minFramebuffers:h,maxFramebuffers:d}=this.state,f=[o,s],A={blend:!0,depthTest:!1,blendFunc:[1,1]},p={cellSize:e,gridSize:f,projectPoints:n,translation:l,scaling:c};for(const g in a){const{needMin:t,needMax:e}=a[g],n=t&&e&&a[g].combineMaxMin;this._renderToWeightsTexture({id:g,parameters:A,moduleSettings:r,uniforms:p,gridSize:f,attributes:i,weights:a}),n?this._renderToMaxMinTexture({id:g,parameters:{...A,blendEquation:S},gridSize:f,minOrMaxFb:u[g],clearParams:{clearColor:[0,0,0,B]},combineMaxMin:n}):(t&&this._renderToMaxMinTexture({id:g,parameters:{...A,blendEquation:E},gridSize:f,minOrMaxFb:h[g],clearParams:{clearColor:[B,B,B,0]},combineMaxMin:n}),e&&this._renderToMaxMinTexture({id:g,parameters:{...A,blendEquation:T},gridSize:f,minOrMaxFb:d[g],clearParams:{clearColor:[0,0,0,0]},combineMaxMin:n}))}}_renderToMaxMinTexture(t){const{id:e,parameters:n,gridSize:i,minOrMaxFb:r,combineMaxMin:o,clearParams:s={}}=t,{framebuffers:l}=this.state,{gl:c,allAggregationModel:u}=this;(0,a.s8)(c,{...s,framebuffer:r,viewport:[0,0,i[0],i[1]]},(()=>{c.clear(16384),u.draw({parameters:n,uniforms:{uSampler:l[e].texture,gridSize:i,combineMaxMin:o}})}))}_renderToWeightsTexture(t){const{id:e,parameters:n,moduleSettings:i,uniforms:r,gridSize:o,weights:s}=t,{framebuffers:l,equations:c,weightAttributes:h}=this.state,{gl:d,gridAggregationModel:f}=this,{operation:A}=s[e],p=A===y.MIN?[B,B,B,0]:[0,0,0,0];if((0,a.s8)(d,{framebuffer:l[e],viewport:[0,0,o[0],o[1]],clearColor:p},(()=>{d.clear(16384);const t={weights:h[e]};f.draw({parameters:{...n,blendEquation:c[e]},moduleSettings:i,uniforms:r,attributes:t})})),A===y.MEAN){const{meanTextures:t,textures:n}=this.state,i={_sourceTextures:{aggregationValues:t[e]},_targetTexture:n[e],elementCount:n[e].width*n[e].height};this.meanTransform?this.meanTransform.update(i):this.meanTransform=function(t,e){return new u.Z(t,{vs:O,_targetTextureVarying:"meanValues",...e})}(d,i),this.meanTransform.run({parameters:{blend:!1,depthTest:!1}}),l[e].attach({36064:n[e]})}}_runAggregation(t){this._updateModels(t),this._setupFramebuffers(t),this._renderAggregateData(t);const e=this._getAggregateData(t);return this.setState({results:e}),e}_setupFramebuffers(t){const{textures:e,framebuffers:n,maxMinFramebuffers:i,minFramebuffers:r,maxFramebuffers:o,meanTextures:s,equations:a}=this.state,{weights:l}=t,{numCol:c,numRow:u}=t,h={width:c,height:u};for(const d in l){const{needMin:t,needMax:f,combineMaxMin:A,operation:p}=l[d];e[d]=l[d].aggregationTexture||e[d]||z(this.gl,{id:"".concat(d,"-texture"),width:c,height:u}),e[d].resize(h);let g=e[d];p===y.MEAN&&(s[d]=s[d]||z(this.gl,{id:"".concat(d,"-mean-texture"),width:c,height:u}),s[d].resize(h),g=s[d]),n[d]?n[d].attach({36064:g}):n[d]=G(this.gl,{id:"".concat(d,"-fb"),width:c,height:u,texture:g}),n[d].resize(h),a[d]=M[p]||M.SUM,(t||f)&&(t&&f&&A?i[d]||(g=l[d].maxMinTexture||this._getMinMaxTexture("".concat(d,"-maxMinTexture")),i[d]=G(this.gl,{id:"".concat(d,"-maxMinFb"),texture:g})):(t&&(r[d]||(g=l[d].minTexture||this._getMinMaxTexture("".concat(d,"-minTexture")),r[d]=G(this.gl,{id:"".concat(d,"-minFb"),texture:g}))),f&&(o[d]||(g=l[d].maxTexture||this._getMinMaxTexture("".concat(d,"-maxTexture")),o[d]=G(this.gl,{id:"".concat(d,"-maxFb"),texture:g})))))}}_getMinMaxTexture(t){const{resources:e}=this.state;return e[t]||(e[t]=z(this.gl,{id:"resourceName"})),e[t]}_setupModels(){let{numCol:t=0,numRow:e=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var n;const{gl:i}=this,{shaderOptions:r}=this.state;if(null===(n=this.gridAggregationModel)||void 0===n||n.delete(),this.gridAggregationModel=function(t,e){const n=(0,g.l)({vs:P,fs:D,modules:[p,m.Z]},e);return new c.Z(t,{id:"Gird-Aggregation-Model",vertexCount:1,drawMode:0,...n})}(i,r),!this.allAggregationModel){const n=t*e;this.allAggregationModel=function(t,e){return new c.Z(t,{id:"All-Aggregation-Model",vs:F,fs:L,modules:[p],vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:e,attributes:{position:[0,0]}})}(i,n)}}_setupWeightAttributes(t){const{weightAttributes:e}=this.state,{weights:n}=t;for(const i in n)e[i]=t.attributes[i]}_trackGPUResultBuffers(t,e){const{resources:n}=this.state;for(const i in t)if(t[i])for(const r of N)if(t[i][r]&&e[i][r]!==t[i][r]){const e="gpu-result-".concat(i,"-").concat(r);n[e]&&n[e].delete(),n[e]=t[i][r]}}_updateModels(t){const{vertexCount:e,attributes:n,numCol:i,numRow:r}=t,{modelDirty:o}=this.state;o&&(this._setupModels(t),this.setState({modelDirty:!1})),this._setupWeightAttributes(t),this.gridAggregationModel.setVertexCount(e),this.gridAggregationModel.setAttributes(n),this.allAggregationModel.setInstanceCount(i*r)}}var H=n(69296),J=n(90031),W=n(2578);const Q=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function K(t){let e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(Number.isFinite(t[0]))e=new i(t);else{e=new i(4*t.length);let n=0;for(let i=0;i<t.length;i++){const r=t[i];e[n++]=r[0],e[n++]=r[1],e[n++]=r[2],e[n++]=Number.isFinite(r[3])?r[3]:255}}if(n)for(let r=0;r<e.length;r++)e[r]/=255;return e}const q=[0,0,0,0],X=[0,255,0,255],Y=["minColor","maxColor","colorRange","colorDomain"],$={cellSizePixels:{value:100,min:1},cellMarginPixels:{value:2,min:0,max:5},colorDomain:null,colorRange:Q};class tt extends J.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}static isSupported(t){return(0,s.ag)(t,[o.h.TEXTURE_FLOAT])}getShaders(){return{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\nuniform sampler2D maxTexture;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n  vec4 outColor = vec4(0., 0., 0., 0.);\n  if (value >= domain.x && value <= domain.y) {\n    float domainRange = domain.y - domain.x;\n    if (domainRange <= 0.) {\n      outColor = colorRange[0];\n    } else {\n      float rangeCount = float(RANGE_COUNT);\n      float rangeStep = domainRange / rangeCount;\n      float idx = floor((value - domain.x) / rangeStep);\n      idx = clamp(idx, 0., rangeCount - 1.);\n      int intIdx = int(idx);\n      outColor = colorRange[intIdx];\n    }\n  }\n  outColor = outColor / 255.;\n  return outColor;\n}\n\nvoid main(void) {\n  vSampleCount = instanceCounts.a;\n\n  float weight = instanceCounts.r;\n  float maxWeight = texture2D(maxTexture, vec2(0.5)).r;\n\n  float step = weight / maxWeight;\n  vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n  vec2 domain = colorDomain;\n  float domainMaxValid = float(colorDomain.y != 0.);\n  domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n  vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n  float rangeMinMax = float(shouldUseMinMax);\n  vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n  vColor = vec4(color.rgb, color.a * opacity);\n  picking_setPickingColor(instancePickingColors);\n\n  gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n  if (vSampleCount <= 0.0) {\n    discard;\n  }\n  gl_FragColor = vColor;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[W.Z]}}initializeState(){const{gl:t}=this.context;this.getAttributeManager().addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,noAlloc:!0}}),this.setState({model:this._getModel(t)})}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){super.updateState(t);const{oldProps:e,props:n,changeFlags:i}=t,r=this.getAttributeManager();n.numInstances!==e.numInstances?r.invalidateAll():e.cellSizePixels!==n.cellSizePixels&&r.invalidate("instancePositions"),this._updateUniforms(e,n,i)}draw(t){let{uniforms:e}=t;const{parameters:n,maxTexture:i}=this.props,r=this.props.minColor||q,o=this.props.maxColor||X,s=this.props.colorDomain||[1,0],{model:a}=this.state;a.setUniforms(e).setUniforms({minColor:r,maxColor:o,maxTexture:i,colorDomain:s}).draw({parameters:{depthTest:!1,depthMask:!1,...n}})}calculateInstancePositions(t,e){let{numInstances:n}=e;const{width:i,height:r}=this.context.viewport,{cellSizePixels:o}=this.props,s=Math.ceil(i/o),{value:a,size:l}=t;for(let c=0;c<n;c++){const t=c%s,e=Math.floor(c/s);a[c*l+0]=t*o/i*2-1,a[c*l+1]=1-e*o/r*2,a[c*l+2]=0}}_getModel(t){return new c.Z(t,{...this.getShaders(),id:this.props.id,geometry:new H.Z({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0})}_shouldUseMinMax(){const{minColor:t,maxColor:e,colorDomain:n,colorRange:i}=this.props;return t||e?(r.Z.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!n&&!i}_updateUniforms(t,e,n){const{model:i}=this.state;if(Y.some((n=>t[n]!==e[n]))&&i.setUniforms({shouldUseMinMax:this._shouldUseMinMax()}),t.colorRange!==e.colorRange&&i.setUniforms({colorRange:K(e.colorRange)}),t.cellMarginPixels!==e.cellMarginPixels||t.cellSizePixels!==e.cellSizePixels||n.viewportChanged){const{width:t,height:e}=this.context.viewport,{cellSizePixels:n,cellMarginPixels:r}=this.props,o=n>r?r:0,s=new Float32Array([(n-o)/t*2,-(n-o)/e*2,1]);i.setUniforms({cellScale:s})}}}(0,i.Z)(tt,"layerName","ScreenGridCellLayer"),(0,i.Z)(tt,"defaultProps",$);var et=n(79366),nt=n(49473),it=n(96684);function rt(t,e){const n={};for(const i in t)e.includes(i)||(n[i]=t[i]);return n}class ot extends et.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeAggregationLayer(t){super.initializeState(this.context),this.setState({ignoreProps:rt(this.constructor._propTypes,t.data.props),dimensions:t})}updateState(t){super.updateState(t);const{changeFlags:e}=t;if(e.extensionsChanged){const t=this.getShaders({});t&&t.defines&&(t.defines.NON_INSTANCED_MODEL=1),this.updateShaders(t)}this._updateAttributes()}updateAttributes(t){this.setState({changedAttributes:t})}getAttributes(){return this.getAttributeManager().getShaderAttributes()}getModuleSettings(){const{viewport:t,mousePosition:e,gl:n}=this.context;return Object.assign(Object.create(this.props),{viewport:t,mousePosition:e,pickingActive:0,devicePixelRatio:(0,a.w)(n)})}updateShaders(t){}isAggregationDirty(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{props:n,oldProps:i,changeFlags:r}=t,{compareAll:o=!1,dimension:s}=e,{ignoreProps:a}=this.state,{props:l,accessors:c=[]}=s,{updateTriggersChanged:u}=r;if(r.dataChanged)return!0;if(u){if(u.all)return!0;for(const t of c)if(u[t])return!0}if(o)return!!r.extensionsChanged||(0,nt.tg)({oldProps:i,newProps:n,ignoreProps:a,propTypes:this.constructor._propTypes});for(const h of l)if(n[h]!==i[h])return!0;return!1}isAttributeChanged(t){const{changedAttributes:e}=this.state;return t?e&&void 0!==e[t]:!function(t){let e=!0;for(const n in t){e=!1;break}return e}(e)}_getAttributeManager(){return new it.Z(this.context.gl,{id:this.props.id,stats:this.context.stats})}}(0,i.Z)(ot,"layerName","AggregationLayer");var st=n(33839);function at(t,e,n){const i=n;return i.domain=()=>t,i.range=()=>e,i}function lt(t,e){return at(t,e,(n=>function(t,e,n){const i=t[1]-t[0];if(i<=0)return r.Z.warn("quantizeScale: invalid domain, returning range[0]")(),e[0];const o=i/e.length,s=Math.floor((n-t[0])/o),a=Math.max(Math.min(s,e.length-1),0);return e[a]}(t,e,n)))}function ct(t,e){return at(t,e,(n=>function(t,e,n){return(n-t[0])/(t[1]-t[0])*(e[1]-e[0])+e[0]}(t,e,n)))}function ut(t,e){const n=t.sort(ht);let i=0;const r=Math.max(1,e.length),o=new Array(r-1);for(;++i<r;)o[i-1]=dt(n,i/r);const s=t=>function(t,e,n){return e[function(t,e){let n=0,i=t.length;for(;n<i;){const r=n+i>>>1;ht(t[r],e)>0?i=r:n=r+1}return n}(t,n)]}(o,e,t);return s.thresholds=()=>o,at(t,e,s)}function ht(t,e){return t-e}function dt(t,e){const n=t.length;if(e<=0||n<2)return t[0];if(e>=1)return t[n-1];const i=(n-1)*e,r=Math.floor(i),o=t[r];return o+(t[r+1]-o)*(i-r)}function ft(t,e){const n=new Map,i=[];for(const r of t){const t="".concat(r);n.has(t)||n.set(t,i.push(r))}return at(t,e,(t=>function(t,e,n,i){const r="".concat(i);let o=e.get(r);return void 0===o&&(o=t.push(i),e.set(r,o)),n[(o-1)%n.length]}(i,n,e,t)))}function At(t){return void 0!==t&&null!==t}function pt(t,e){return("function"===typeof e?t.map(e):t).filter(At)}function gt(t,e){return pt(t,e)}function mt(t,e){return function(t){const e=[];return t.forEach((t=>{!e.includes(t)&&At(t)&&e.push(t)})),e}(pt(t,e))}const yt=t=>t.length,vt=t=>t.points,_t=t=>t.index,bt=(t,e)=>t<e?-1:t>e?1:t>=e?0:NaN,xt={getValue:yt,getPoints:vt,getIndex:_t,filterData:null};class wt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xt;(0,i.Z)(this,"maxCount",void 0),(0,i.Z)(this,"maxValue",void 0),(0,i.Z)(this,"minValue",void 0),(0,i.Z)(this,"totalCount",void 0),(0,i.Z)(this,"aggregatedBins",void 0),(0,i.Z)(this,"sortedBins",void 0),(0,i.Z)(this,"binMap",void 0),this.aggregatedBins=this.getAggregatedBins(t,e),this._updateMinMaxValues(),this.binMap=this.getBinMap()}getAggregatedBins(t,e){const{getValue:n=yt,getPoints:i=vt,getIndex:r=_t,filterData:o}=e,s="function"===typeof o,a=t.length,l=[];let c=0;for(let u=0;u<a;u++){const e=t[u],a=i(e),h=r(e),d=s?a.filter(o):a;e.filteredPoints=s?d:null;const f=d.length?n(d):null;null!==f&&void 0!==f&&(l[c]={i:Number.isFinite(h)?h:u,value:f,counts:d.length},c++)}return l}_percentileToIndex(t){const e=this.sortedBins.length;if(e<2)return[0,0];const[n,i]=t.map((t=>{return e=t,n=0,i=100,Math.max(n,Math.min(i,e));var e,n,i}));return[Math.ceil(n/100*(e-1)),Math.floor(i/100*(e-1))]}getBinMap(){const t={};for(const e of this.aggregatedBins)t[e.i]=e;return t}_updateMinMaxValues(){let t=0,e=0,n=3402823466e29,i=0;for(const r of this.aggregatedBins)t=t>r.counts?t:r.counts,e=e>r.value?e:r.value,n=n<r.value?n:r.value,i+=r.counts;this.maxCount=t,this.maxValue=e,this.minValue=n,this.totalCount=i}getValueRange(t){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort(((t,e)=>bt(t.value,e.value)))),!this.sortedBins.length)return[];let e=0,n=this.sortedBins.length-1;if(Array.isArray(t)){const i=this._percentileToIndex(t);e=i[0],n=i[1]}return[this.sortedBins[e].value,this.sortedBins[n].value]}getValueDomainByScale(t){let[e=0,n=100]=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort(((t,e)=>bt(t.value,e.value)))),!this.sortedBins.length)return[];const i=this._percentileToIndex([e,n]);return this._getScaleDomain(t,i)}_getScaleDomain(t,e){let[n,i]=e;const r=this.sortedBins;switch(t){case"quantize":case"linear":default:return[r[n].value,r[i].value];case"quantile":return gt(r.slice(n,i+1),(t=>t.value));case"ordinal":return mt(r,(t=>t.value))}}}var Ct=n(73115),Bt=n(18252);const Et=6378e3;function Tt(t){return Number.isFinite(t)?t:0}function St(t,e){const n=t.positions.value;let i,r,o=1/0,s=-1/0,a=1/0,l=-1/0;for(let c=0;c<e;c++)r=n[3*c],i=n[3*c+1],o=i<o?i:o,s=i>s?i:s,a=r<a?r:a,l=r>l?r:l;return{xMin:Tt(a),xMax:Tt(l),yMin:Tt(o),yMax:Tt(s)}}function Mt(t,e){const n=t<0?-1:1;let i=n<0?Math.abs(t)+e:Math.abs(t);return i=Math.floor(i/e)*e,i*n}function It(t,e){if(!(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]))return{xOffset:e,yOffset:e};const{yMin:n,yMax:i}=t;return function(t,e){const n=(s=t,s/Et*(180/Math.PI)),i=(r=e,o=t,o/Et*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,o;var s;return{yOffset:n,xOffset:i}}(e,(n+i)/2)}function Pt(t,e,n,i){const o=It(t,e,i!==Bt.Df.CARTESIAN),s=function(t,e,n,i){const{width:o,height:s}=i,a=n===Bt.Df.CARTESIAN?[-o/2,-s/2]:[-180,-90];r.Z.assert(n===Bt.Df.CARTESIAN||n===Bt.Df.LNGLAT||n===Bt.Df.DEFAULT);const{xMin:l,yMin:c}=t;return[-1*(Mt(l-a[0],e.xOffset)+a[0]),-1*(Mt(c-a[1],e.yOffset)+a[1])]}(t,o,i,n),{xMin:a,yMin:l,xMax:c,yMax:u}=t,h=c-a+o.xOffset,d=u-l+o.yOffset;return{gridOffset:o,translation:s,width:h,height:d,numCol:Math.ceil(h/o.xOffset),numRow:Math.ceil(d/o.yOffset)}}function Dt(t,e){const n=function(t,e){const{data:n=[],cellSize:i}=t,{attributes:r,viewport:o,projectPoints:s,numInstances:a}=e,l=r.positions.value,{size:c}=r.positions.getAccessor(),u=e.boundingBox||function(t,e){const n=t.value,{size:i}=t.getAccessor();let r,o,s=1/0,a=-1/0,l=1/0,c=-1/0;for(let u=0;u<e;u++)o=n[u*i],r=n[u*i+1],Number.isFinite(o)&&Number.isFinite(r)&&(s=r<s?r:s,a=r>a?r:a,l=o<l?o:l,c=o>c?o:c);return{xMin:l,xMax:c,yMin:s,yMax:a}}(r.positions,a),h=e.posOffset||[180,90],d=e.gridOffset||It(u,i);if(d.xOffset<=0||d.yOffset<=0)return{gridHash:{},gridOffset:d};const{width:f,height:A}=o,p=Math.ceil(f/d.xOffset),g=Math.ceil(A/d.yOffset),m={},{iterable:y,objectInfo:v}=(0,Ct.jB)(n),_=new Array(3);for(const b of y){v.index++,_[0]=l[v.index*c],_[1]=l[v.index*c+1],_[2]=c>=3?l[v.index*c+2]:0;const[t,e]=s?o.project(_):_;if(Number.isFinite(t)&&Number.isFinite(e)){const n=Math.floor((e+h[1])/d.yOffset),i=Math.floor((t+h[0])/d.xOffset);if(!s||i>=0&&i<p&&n>=0&&n<g){const t="".concat(n,"-").concat(i);m[t]=m[t]||{count:0,points:[],lonIdx:i,latIdx:n},m[t].count+=1,m[t].points.push({source:b,index:v.index})}}}return{gridHash:m,gridOffset:d,offsets:[-1*h[0],-1*h[1]]}}(t,e),i=function(t){let{gridHash:e,gridOffset:n,offsets:i}=t;const r=new Array(Object.keys(e).length);let o=0;for(const s in e){const t=s.split("-"),a=parseInt(t[0],10),l=parseInt(t[1],10),c=o++;r[c]={index:c,position:[i[0]+n.xOffset*l,i[1]+n.yOffset*a],...e[s]}}return r}(n);return{gridHash:n.gridHash,gridOffset:n.gridOffset,data:i}}class Ft extends ot{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeAggregationLayer(t){let{dimensions:e}=t;const{gl:n}=this.context;super.initializeAggregationLayer(e),this.setState({layerData:{},gpuGridAggregator:new V(n,{id:"".concat(this.id,"-gpu-aggregator")}),cpuGridAggregator:Dt})}updateState(t){super.updateState(t),this.updateAggregationState(t);const{aggregationDataDirty:e,aggregationWeightsDirty:n,gpuAggregation:i}=this.state;if(this.getNumInstances()<=0)return;let r=!1;(e||i&&n)&&(this._updateAggregation(t),r=!0),i||!e&&!n||(this._updateWeightBins(),this._uploadAggregationResults(),r=!0),this.setState({aggregationDirty:r})}finalizeState(t){var e;const{count:n}=this.state.weights;n&&n.aggregationBuffer&&n.aggregationBuffer.delete(),null===(e=this.state.gpuGridAggregator)||void 0===e||e.delete(),super.finalizeState(t)}updateShaders(t){this.state.gpuAggregation&&this.state.gpuGridAggregator.updateShaders(t)}updateAggregationState(t){r.Z.assert(!1)}allocateResources(t,e){if(this.state.numRow!==t||this.state.numCol!==e){const n=e*t*4*4,i=this.context.gl,{weights:r}=this.state;for(const t in r){const e=r[t];e.aggregationBuffer&&e.aggregationBuffer.delete(),e.aggregationBuffer=new st.Z(i,{byteLength:n,accessor:{size:4,type:5126,divisor:1}})}}}updateResults(t){let{aggregationData:e,maxMinData:n,maxData:i,minData:r}=t;const{count:o}=this.state.weights;o&&(o.aggregationData=e,o.maxMinData=n,o.maxData=i,o.minData=r)}_updateAggregation(t){const{cpuGridAggregator:e,gpuGridAggregator:n,gridOffset:i,posOffset:r,translation:o=[0,0],scaling:s=[0,0,0],boundingBox:a,projectPoints:l,gpuAggregation:c,numCol:u,numRow:h}=this.state,{props:d}=t,{viewport:f}=this.context,A=this.getAttributes(),p=this.getNumInstances();if(c){const{weights:t}=this.state;n.run({weights:t,cellSize:[i.xOffset,i.yOffset],numCol:u,numRow:h,translation:o,scaling:s,vertexCount:p,projectPoints:l,attributes:A,moduleSettings:this.getModuleSettings()})}else{const t=e(d,{gridOffset:i,projectPoints:l,attributes:A,viewport:f,posOffset:r,boundingBox:a});this.setState({layerData:t})}}_updateWeightBins(){const{getValue:t}=this.state,e=new wt(this.state.layerData.data||[],{getValue:t});this.setState({sortedBins:e})}_uploadAggregationResults(){const{numCol:t,numRow:e}=this.state,{data:n}=this.state.layerData,{aggregatedBins:i,minValue:r,maxValue:o,totalCount:s}=this.state.sortedBins,a=new Float32Array(t*e*4).fill(0);for(const h of i){const{lonIdx:e,latIdx:i}=n[h.i],{value:r,counts:o}=h,s=4*(e+i*t);a[s]=r,a[s+4-1]=o}const l=new Float32Array([o,0,0,r]),c=new Float32Array([o,0,0,s]),u=new Float32Array([r,0,0,s]);this.updateResults({aggregationData:a,maxMinData:l,maxData:c,minData:u})}}(0,i.Z)(Ft,"layerName","GridAggregationLayer");const Lt={...tt.defaultProps,getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM"},Ot="positions",Rt={data:{props:["cellSizePixels"]},weights:{props:["aggregation"],accessors:["getWeight"]}};class kt extends Ft{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeState(){const{gl:t}=this.context;if(!tt.isSupported(t))return this.setState({supported:!1}),void r.Z.error("ScreenGridLayer: ".concat(this.id," is not supported on this browser"))();super.initializeAggregationLayer({dimensions:Rt,getCellSize:t=>t.cellSizePixels});const e={count:{size:1,operation:y.SUM,needMax:!0,maxTexture:z(t,{id:"".concat(this.id,"-max-texture")})}};this.setState({supported:!0,projectPoints:!0,weights:e,subLayerData:{attributes:{}},maxTexture:e.count.maxTexture,positionAttributeName:"positions",posOffset:[0,0],translation:[1,-1]});this.getAttributeManager().add({[Ot]:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},count:{size:3,accessor:"getWeight"}})}shouldUpdateState(t){let{changeFlags:e}=t;return this.state.supported&&e.somethingChanged}updateState(t){super.updateState(t)}renderLayers(){if(!this.state.supported)return[];const{maxTexture:t,numRow:e,numCol:n,weights:i}=this.state,{updateTriggers:r}=this.props,{aggregationBuffer:o}=i.count;return new(this.getSubLayerClass("cells",tt))(this.props,this.getSubLayerProps({id:"cell-layer",updateTriggers:r}),{data:{attributes:{instanceCounts:o}},maxTexture:t,numInstances:e*n})}finalizeState(t){super.finalizeState(t);const{aggregationBuffer:e,maxBuffer:n,maxTexture:i}=this.state;null===e||void 0===e||e.delete(),null===n||void 0===n||n.delete(),null===i||void 0===i||i.delete()}getPickingInfo(t){let{info:e}=t;const{index:n}=e;if(n>=0){const{gpuGridAggregator:t,gpuAggregation:i,weights:r}=this.state,o=i?t.getData("count"):r.count;e.object=V.getAggregationData({pixelIndex:n,...o})}return e}updateResults(t){let{aggregationData:e,maxData:n}=t;const{count:i}=this.state.weights;i.aggregationData=e,i.aggregationBuffer.setData({data:e}),i.maxData=n,i.maxTexture.setImageData({data:n})}updateAggregationState(t){const e=t.props.cellSizePixels,n=t.oldProps.cellSizePixels!==e,{viewportChanged:i}=t.changeFlags;let o=t.props.gpuAggregation;this.state.gpuAggregation!==t.props.gpuAggregation&&o&&!V.isSupported(this.context.gl)&&(r.Z.warn("GPU Grid Aggregation not supported, falling back to CPU")(),o=!1);const s=o!==this.state.gpuAggregation;this.setState({gpuAggregation:o});const a=this.isAttributeChanged(Ot),{dimensions:l}=this.state,{data:c,weights:u}=l,h=a||s||i||this.isAggregationDirty(t,{compareAll:o,dimension:c}),d=this.isAggregationDirty(t,{dimension:u});this.setState({aggregationDataDirty:h,aggregationWeightsDirty:d});const{viewport:f}=this.context;if(i||n){const{width:t,height:n}=f,i=Math.ceil(t/e),r=Math.ceil(n/e);this.allocateResources(r,i),this.setState({scaling:[t/2,-n/2,1],gridOffset:{xOffset:e,yOffset:e},width:t,height:n,numCol:i,numRow:r})}d&&this._updateAccessors(t),(h||d)&&this._resetResults()}_updateAccessors(t){const{getWeight:e,aggregation:n,data:i}=t.props,{count:r}=this.state.weights;r&&(r.getWeight=e,r.operation=y[n]),this.setState({getValue:x(n,e,{data:i})})}_resetResults(){const{count:t}=this.state.weights;t&&(t.aggregationData=null)}}(0,i.Z)(kt,"layerName","ScreenGridLayer"),(0,i.Z)(kt,"defaultProps",Lt);var Ut=n(90555);function zt(){}const Gt=["getBins","getDomain","getScaleFunc"],Nt=[{key:"fillColor",accessor:"getFillColor",pickingInfo:"colorValue",getBins:{triggers:{value:{prop:"getColorValue",updateTrigger:"getColorValue"},weight:{prop:"getColorWeight",updateTrigger:"getColorWeight"},aggregation:{prop:"colorAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"lowerPercentile"},upperPercentile:{prop:"upperPercentile"},scaleType:{prop:"colorScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"colorDomain"},range:{prop:"colorRange"}},onSet:{props:"onSetColorDomain"}},nullValue:[0,0,0,0]},{key:"elevation",accessor:"getElevation",pickingInfo:"elevationValue",getBins:{triggers:{value:{prop:"getElevationValue",updateTrigger:"getElevationValue"},weight:{prop:"getElevationWeight",updateTrigger:"getElevationWeight"},aggregation:{prop:"elevationAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"elevationLowerPercentile"},upperPercentile:{prop:"elevationUpperPercentile"},scaleType:{prop:"elevationScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"elevationDomain"},range:{prop:"elevationRange"}},onSet:{props:"onSetElevationDomain"}},nullValue:-1}],Zt=t=>t.cellSize;class jt{constructor(t){this.state={layerData:{},dimensions:{}},this.changeFlags={},this.dimensionUpdaters={},this._getCellSize=t.getCellSize||Zt,this._getAggregator=t.getAggregator,this._addDimension(t.dimensions||Nt)}static defaultDimensions(){return Nt}updateState(t,e){const{oldProps:n,props:i,changeFlags:r}=t;this.updateGetValueFuncs(n,i,r);const o=this.needsReProjectPoints(n,i,r);let s=!1;if(r.dataChanged||o)this.getAggregatedData(i,e),s=!0;else{(this.getDimensionChanges(n,i,r)||[]).forEach((t=>"function"===typeof t&&t())),s=!0}return this.setState({aggregationDirty:s}),this.state}setState(t){this.state={...this.state,...t}}setDimensionState(t,e){this.setState({dimensions:{...this.state.dimensions,[t]:{...this.state.dimensions[t],...e}}})}normalizeResult(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.hexagons?{data:t.hexagons,...t}:t.layerData?{data:t.layerData,...t}:t}getAggregatedData(t,e){const n=this._getAggregator(t)(t,e);this.setState({layerData:this.normalizeResult(n)}),this.changeFlags={layerData:!0},this.getSortedBins(t)}updateGetValueFuncs(t,e,n){for(const i in this.dimensionUpdaters){const{value:r,weight:o,aggregation:s}=this.dimensionUpdaters[i].getBins.triggers;let a=e[r.prop];this.needUpdateDimensionStep(this.dimensionUpdaters[i].getBins,t,e,n)&&(a=a?w(a,{data:e.data}):x(e[s.prop],e[o.prop],{data:e.data})),a&&this.setDimensionState(i,{getValue:a})}}needsReProjectPoints(t,e,n){return this._getCellSize(t)!==this._getCellSize(e)||this._getAggregator(t)!==this._getAggregator(e)||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPosition)}addDimension(t){this._addDimension(t)}_addDimension(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>{const{key:e}=t;this.dimensionUpdaters[e]=this.getDimensionUpdaters(t),this.state.dimensions[e]={getValue:null,domain:null,sortedBins:null,scaleFunc:zt}}))}getDimensionUpdaters(t){let{key:e,accessor:n,pickingInfo:i,getBins:r,getDomain:o,getScaleFunc:s,nullValue:a}=t;return{key:e,accessor:n,pickingInfo:i,getBins:{updater:this.getDimensionSortedBins,...r},getDomain:{updater:this.getDimensionValueDomain,...o},getScaleFunc:{updater:this.getDimensionScale,...s},attributeAccessor:this.getSubLayerDimensionAttribute(e,a)}}needUpdateDimensionStep(t,e,n,i){return Object.values(t.triggers).some((t=>t.updateTrigger?i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged[t.updateTrigger]):e[t.prop]!==n[t.prop]))}getDimensionChanges(t,e,n){const i=[];for(const r in this.dimensionUpdaters){const o=Gt.find((i=>this.needUpdateDimensionStep(this.dimensionUpdaters[r][i],t,e,n)));o&&i.push(this.dimensionUpdaters[r][o].updater.bind(this,e,this.dimensionUpdaters[r]))}return i.length?i:null}getUpdateTriggers(t){const e=t.updateTriggers||{},n={};for(const i in this.dimensionUpdaters){const{accessor:r}=this.dimensionUpdaters[i];n[r]={},Gt.forEach((o=>{Object.values(this.dimensionUpdaters[i][o].triggers).forEach((i=>{let{prop:o,updateTrigger:s}=i;if(s){const t=e[s];"object"!==typeof t||Array.isArray(t)?void 0!==t&&(n[r][o]=t):Object.assign(n[r],t)}else n[r][o]=t[o]}))}))}return n}getSortedBins(t){for(const e in this.dimensionUpdaters)this.getDimensionSortedBins(t,this.dimensionUpdaters[e])}getDimensionSortedBins(t,e){const{key:n}=e,{getValue:i}=this.state.dimensions[n],r=new wt(this.state.layerData.data||[],{getValue:i,filterData:t._filterData});this.setDimensionState(n,{sortedBins:r}),this.getDimensionValueDomain(t,e)}getDimensionValueDomain(t,e){const{getDomain:n,key:i}=e,{triggers:{lowerPercentile:r,upperPercentile:o,scaleType:s}}=n,a=this.state.dimensions[i].sortedBins.getValueDomainByScale(t[s.prop],[t[r.prop],t[o.prop]]);this.setDimensionState(i,{valueDomain:a}),this.getDimensionScale(t,e)}getDimensionScale(t,e){const{key:n,getScaleFunc:i,getDomain:r}=e,{domain:o,range:s}=i.triggers,{scaleType:a}=r.triggers,{onSet:l}=i,c=t[s.prop],u=t[o.prop]||this.state.dimensions[n].valueDomain,h=function(t){switch(t){case"quantize":default:return lt;case"linear":return ct;case"quantile":return ut;case"ordinal":return ft}}(a&&t[a.prop]),d=h(u,c);"object"===typeof l&&"function"===typeof t[l.props]&&t[l.props](d.domain()),this.setDimensionState(n,{scaleFunc:d})}getSubLayerDimensionAttribute(t,e){return n=>{const{sortedBins:i,scaleFunc:r}=this.state.dimensions[t],o=i.binMap[n.index];if(o&&0===o.counts)return e;const s=o&&o.value,a=r.domain();return s>=a[0]&&s<=a[a.length-1]?r(s):e}}getSubLayerAccessors(t){const e={};for(const n in this.dimensionUpdaters){const{accessor:i}=this.dimensionUpdaters[n];e[i]=this.getSubLayerDimensionAttribute(t,n)}return e}getPickingInfo(t){let{info:e}=t;let n=null;if(e.picked&&e.index>-1){const t=this.state.layerData.data[e.index],i={};for(const e in this.dimensionUpdaters){const{pickingInfo:n}=this.dimensionUpdaters[e],{sortedBins:r}=this.state.dimensions[e],o=r.binMap[t.index]&&r.binMap[t.index].value;i[n]=o}n=Object.assign(i,t,{points:t.filteredPoints||t.points})}return e.picked=Boolean(n),e.object=n,e}getAccessor(t){return this.dimensionUpdaters.hasOwnProperty(t)?this.dimensionUpdaters[t].attributeAccessor:zt}}function Vt(){}const Ht={colorDomain:null,colorRange:Q,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},colorScaleType:"quantize",onSetColorDomain:Vt,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:Vt,gridAggregator:Dt,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:t=>t.position},extruded:!1,material:!0,_filterData:{type:"function",value:null,optional:!0}};class Jt extends ot{initializeState(){const t=new jt({getAggregator:t=>t.gridAggregator,getCellSize:t=>t.cellSize});this.state={cpuAggregator:t,aggregatorState:t.state};this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"}})}updateState(t){super.updateState(t),this.setState({aggregatorState:this.state.cpuAggregator.updateState(t,{viewport:this.context.viewport,attributes:this.getAttributes(),numInstances:this.getNumInstances()})})}getPickingInfo(t){let{info:e}=t;return this.state.cpuAggregator.getPickingInfo({info:e})}_onGetSublayerColor(t){return this.state.cpuAggregator.getAccessor("fillColor")(t)}_onGetSublayerElevation(t){return this.state.cpuAggregator.getAccessor("elevation")(t)}_getSublayerUpdateTriggers(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}renderLayers(){const{elevationScale:t,extruded:e,cellSize:n,coverage:i,material:r,transitions:o}=this.props,{cpuAggregator:s}=this.state,a=this.getSubLayerClass("grid-cell",Ut.Z),l=this._getSublayerUpdateTriggers();return new a({cellSize:n,coverage:i,material:r,elevationScale:t,extruded:e,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:l}),{data:s.state.layerData.data})}}(0,i.Z)(Jt,"layerName","CPUGridLayer"),(0,i.Z)(Jt,"defaultProps",Ht);var Wt=n(35387),Qt=Math.PI/3,Kt=[0,Qt,2*Qt,3*Qt,4*Qt,5*Qt];function qt(t){return t[0]}function Xt(t){return t[1]}function Yt(){}const $t={colorDomain:null,colorRange:Q,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",value:0,min:0,max:100},upperPercentile:{type:"number",value:100,min:0,max:100},colorScaleType:"quantize",onSetColorDomain:Yt,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",value:0,min:0,max:100},elevationUpperPercentile:{type:"number",value:100,min:0,max:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:Yt,radius:{type:"number",value:1e3,min:1},coverage:{type:"number",min:0,max:1,value:1},extruded:!1,hexagonAggregator:function(t,e){const{data:n,radius:i}=t,{viewport:o,attributes:s}=e,a=n.length?function(t,e){const{attributes:n}=e,i=n.positions.value,{size:r}=n.positions.getAccessor();let o,s=1/0,a=1/0,l=-1/0,c=-1/0;for(o=0;o<r*t.length;o+=r){const t=i[o],e=i[o+1];Number.isFinite(t)&&Number.isFinite(e)&&(s=Math.min(t,s),l=Math.max(t,l),a=Math.min(e,a),c=Math.max(e,c))}return[s,a,l,c].every(Number.isFinite)?[(s+l)/2,(a+c)/2]:null}(n,e):null,l=function(t,e,n){const{unitsPerMeter:i}=e.getDistanceScales(n);return t*i[0]}(i,o,a),c=[],{iterable:u,objectInfo:h}=(0,Ct.jB)(n),d=s.positions.value,{size:f}=s.positions.getAccessor();for(const p of u){h.index++;const t=h.index*f,e=[d[t],d[t+1]];Number.isFinite(e[0])&&Number.isFinite(e[1])?c.push({screenCoord:o.projectFlat(e),source:p,index:h.index}):r.Z.warn("HexagonLayer: invalid position")()}const A=function(){var t,e,n,i=0,r=0,o=1,s=1,a=qt,l=Xt;function c(t){var i,r={},o=[],s=t.length;for(i=0;i<s;++i)if(!isNaN(u=+a.call(null,c=t[i],i,t))&&!isNaN(h=+l.call(null,c,i,t))){var c,u,h,d=Math.round(h/=n),f=Math.round(u=u/e-(1&d)/2),A=h-d;if(3*Math.abs(A)>1){var p=u-f,g=f+(u<f?-1:1)/2,m=d+(h<d?-1:1),y=u-g,v=h-m;p*p+A*A>y*y+v*v&&(f=g+(1&d?1:-1)/2,d=m)}var _=f+"-"+d,b=r[_];b?b.push(c):(o.push(b=r[_]=[c]),b.x=(f+(1&d)/2)*e,b.y=d*n)}return o}function u(t){var e=0,n=0;return Kt.map((function(i){var r=Math.sin(i)*t,o=-Math.cos(i)*t,s=r-e,a=o-n;return e=r,n=o,[s,a]}))}return c.hexagon=function(e){return"m"+u(null==e?t:+e).join("l")+"z"},c.centers=function(){for(var a=[],l=Math.round(r/n),c=Math.round(i/e),u=l*n;u<s+t;u+=n,++l)for(var h=c*e+(1&l)*e/2;h<o+e/2;h+=e)a.push([h,u]);return a},c.mesh=function(){var e=u(t).slice(0,4).join("l");return c.centers().map((function(t){return"M"+t+"m"+e})).join("")},c.x=function(t){return arguments.length?(a=t,c):a},c.y=function(t){return arguments.length?(l=t,c):l},c.radius=function(i){return arguments.length?(e=2*(t=+i)*Math.sin(Qt),n=1.5*t,c):t},c.size=function(t){return arguments.length?(i=r=0,o=+t[0],s=+t[1],c):[o-i,s-r]},c.extent=function(t){return arguments.length?(i=+t[0][0],r=+t[0][1],o=+t[1][0],s=+t[1][1],c):[[i,r],[o,s]]},c.radius(1)}().radius(l).x((t=>t.screenCoord[0])).y((t=>t.screenCoord[1]));return{hexagons:A(c).map(((t,e)=>({position:o.unprojectFlat([t.x,t.y]),points:t,index:e}))),radiusCommon:l}},getPosition:{type:"accessor",value:t=>t.position},material:!0,_filterData:{type:"function",value:null,optional:!0}};class te extends ot{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeState(){const t=new jt({getAggregator:t=>t.hexagonAggregator,getCellSize:t=>t.radius});this.state={cpuAggregator:t,aggregatorState:t.state,vertices:null};this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"}})}updateState(t){if(super.updateState(t),t.changeFlags.propsOrDataChanged){const e=this.state.cpuAggregator.updateState(t,{viewport:this.context.viewport,attributes:this.getAttributes()});if(this.state.aggregatorState.layerData!==e.layerData){const{hexagonVertices:t}=e.layerData||{};this.setState({vertices:t&&this.convertLatLngToMeterOffset(t)})}this.setState({aggregatorState:e})}}convertLatLngToMeterOffset(t){const{viewport:e}=this.context;if(Array.isArray(t)&&6===t.length){const n=t[0],i=t[3],r=[(n[0]+i[0])/2,(n[1]+i[1])/2],o=e.projectFlat(r),{metersPerUnit:s}=e.getDistanceScales(r);return t.map((t=>{const n=e.projectFlat(t);return[(n[0]-o[0])*s[0],(n[1]-o[1])*s[1]]}))}return r.Z.error("HexagonLayer: hexagonVertices needs to be an array of 6 points")(),null}getPickingInfo(t){let{info:e}=t;return this.state.cpuAggregator.getPickingInfo({info:e})}_onGetSublayerColor(t){return this.state.cpuAggregator.getAccessor("fillColor")(t)}_onGetSublayerElevation(t){return this.state.cpuAggregator.getAccessor("elevation")(t)}_getSublayerUpdateTriggers(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}renderLayers(){const{elevationScale:t,extruded:e,coverage:n,material:i,transitions:r}=this.props,{aggregatorState:o,vertices:s}=this.state,a=this.getSubLayerClass("hexagon-cell",Wt.Z),l=this._getSublayerUpdateTriggers();return new a({...s?{vertices:s,radius:1}:{radius:o.layerData.radiusCommon||1,radiusUnits:"common",angle:90},diskResolution:6,elevationScale:t,extruded:e,coverage:n,material:i,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:r&&{getFillColor:r.getColorValue||r.getColorWeight,getElevation:r.getElevationValue||r.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:l}),{data:o.layerData.data})}}(0,i.Z)(te,"layerName","HexagonLayer"),(0,i.Z)(te,"defaultProps",$t);var ee=n(24985),ne=n(3453);const ie=.5,re=1/6,oe={N:[0,ie],E:[ie,0],S:[0,-.5],W:[-.5,0],NE:[ie,ie],NW:[-.5,ie],SE:[ie,-.5],SW:[-.5,-.5]},se=[oe.W,oe.SW,oe.S],ae=[oe.S,oe.SE,oe.E],le=[oe.E,oe.NE,oe.N],ce=[oe.NW,oe.W,oe.N],ue=[[-.5,re],[-.5,-re],[-re,-.5],[re,-.5]],he=[[-re,-.5],[re,-.5],[ie,-re],[ie,re]],de=[[ie,-re],[ie,re],[re,ie],[-re,ie]],fe=[[-.5,re],[-.5,-re],[re,ie],[-re,ie]],Ae=[oe.W,oe.SW,oe.SE,oe.E],pe=[oe.S,oe.SE,oe.NE,oe.N],ge=[oe.NW,oe.W,oe.E,oe.NE],me=[oe.NW,oe.SW,oe.S,oe.N],ye=[[-.5,re],[-.5,-re],[ie,-re],[ie,re]],ve=[[-re,-.5],[re,-.5],[re,ie],[-re,ie]],_e=[oe.NW,oe.SW,oe.SE,oe.NE],be=[oe.NW,oe.SW,oe.SE,oe.E,oe.N],xe=[oe.W,oe.SW,oe.SE,oe.NE,oe.N],we=[oe.NW,oe.W,oe.S,oe.SE,oe.NE],Ce=[oe.NW,oe.SW,oe.S,oe.E,oe.NE],Be=[oe.NW,oe.W,[ie,-re],[ie,re],oe.N],Ee=[[-re,-.5],[re,-.5],oe.E,oe.NE,oe.N],Te=[[-.5,re],[-.5,-re],oe.S,oe.SE,oe.E],Se=[oe.W,oe.SW,oe.S,[re,ie],[-re,ie]],Me=[oe.NW,oe.W,[-re,-.5],[re,-.5],oe.N],Ie=[[-.5,re],[-.5,-re],oe.E,oe.NE,oe.N],Pe=[oe.S,oe.SE,oe.E,[re,ie],[-re,ie]],De=[oe.W,oe.SW,oe.S,[ie,-re],[ie,re]],Fe=[oe.W,oe.SW,oe.SE,oe.E,[re,ie],[-re,ie]],Le=[[-.5,re],[-.5,-re],oe.S,oe.SE,oe.NE,oe.N],Oe=[oe.NW,oe.W,[-re,-.5],[re,-.5],oe.E,oe.NE],Re=[oe.NW,oe.SW,oe.S,[ie,-re],[ie,re],oe.N],ke=[oe.W,oe.SW,oe.S,oe.E,oe.NE,oe.N],Ue=[oe.NW,oe.W,oe.S,oe.SE,oe.E,oe.N],ze=[[-.5,re],[-.5,-re],[-re,-.5],[re,-.5],oe.E,oe.NE,oe.N],Ge=[oe.W,oe.SW,oe.S,[ie,-re],[ie,re],[re,ie],[-re,ie]],Ne=[oe.NW,oe.W,[-re,-.5],[re,-.5],[ie,-re],[ie,re],oe.N],Ze=[[-.5,re],[-.5,-re],oe.S,oe.SE,oe.E,[re,ie],[-re,ie]],je=[[-.5,re],[-.5,-re],[-re,-.5],[re,-.5],[ie,-re],[ie,re],[re,ie],[-re,ie]],Ve={0:[],1:[[oe.W,oe.S]],2:[[oe.S,oe.E]],3:[[oe.W,oe.E]],4:[[oe.N,oe.E]],5:{0:[[oe.W,oe.S],[oe.N,oe.E]],1:[[oe.W,oe.N],[oe.S,oe.E]]},6:[[oe.N,oe.S]],7:[[oe.W,oe.N]],8:[[oe.W,oe.N]],9:[[oe.N,oe.S]],10:{0:[[oe.W,oe.N],[oe.S,oe.E]],1:[[oe.W,oe.S],[oe.N,oe.E]]},11:[[oe.N,oe.E]],12:[[oe.W,oe.E]],13:[[oe.S,oe.E]],14:[[oe.W,oe.S]],15:[]};function He(t){return parseInt(t,4)}const Je={[He("0000")]:[],[He("2222")]:[],[He("2221")]:[se],[He("2212")]:[ae],[He("2122")]:[le],[He("1222")]:[ce],[He("0001")]:[se],[He("0010")]:[ae],[He("0100")]:[le],[He("1000")]:[ce],[He("2220")]:[ue],[He("2202")]:[he],[He("2022")]:[de],[He("0222")]:[fe],[He("0002")]:[ue],[He("0020")]:[he],[He("0200")]:[de],[He("2000")]:[fe],[He("0011")]:[Ae],[He("0110")]:[pe],[He("1100")]:[ge],[He("1001")]:[me],[He("2211")]:[Ae],[He("2112")]:[pe],[He("1122")]:[ge],[He("1221")]:[me],[He("2200")]:[ye],[He("2002")]:[ve],[He("0022")]:[ye],[He("0220")]:[ve],[He("1111")]:[_e],[He("1211")]:[be],[He("2111")]:[xe],[He("1112")]:[we],[He("1121")]:[Ce],[He("1011")]:[be],[He("0111")]:[xe],[He("1110")]:[we],[He("1101")]:[Ce],[He("1200")]:[Be],[He("0120")]:[Ee],[He("0012")]:[Te],[He("2001")]:[Se],[He("1022")]:[Be],[He("2102")]:[Ee],[He("2210")]:[Te],[He("0221")]:[Se],[He("1002")]:[Me],[He("2100")]:[Ie],[He("0210")]:[Pe],[He("0021")]:[De],[He("1220")]:[Me],[He("0122")]:[Ie],[He("2012")]:[Pe],[He("2201")]:[De],[He("0211")]:[Fe],[He("2110")]:[Le],[He("1102")]:[Oe],[He("1021")]:[Re],[He("2011")]:[Fe],[He("0112")]:[Le],[He("1120")]:[Oe],[He("1201")]:[Re],[He("2101")]:[ke],[He("0121")]:[ke],[He("1012")]:[Ue],[He("1210")]:[Ue],[He("0101")]:{0:[se,le],1:[ke],2:[ke]},[He("1010")]:{0:[ce,ae],1:[Ue],2:[Ue]},[He("2121")]:{0:[ke],1:[ke],2:[se,le]},[He("1212")]:{0:[Ue],1:[Ue],2:[ce,ae]},[He("2120")]:{0:[ze],1:[ze],2:[ue,le]},[He("2021")]:{0:[Ge],1:[Ge],2:[se,de]},[He("1202")]:{0:[Ne],1:[Ne],2:[ce,he]},[He("0212")]:{0:[Ze],1:[Ze],2:[ae,fe]},[He("0102")]:{0:[ue,le],1:[ze],2:[ze]},[He("0201")]:{0:[se,de],1:[Ge],2:[Ge]},[He("1020")]:{0:[ce,he],1:[Ne],2:[Ne]},[He("2010")]:{0:[ae,fe],1:[Ze],2:[Ze]},[He("2020")]:{0:[fe,he],1:[je],2:[ue,de]},[He("0202")]:{0:[de,ue],1:[je],2:[fe,he]}},We={ISO_LINES:1,ISO_BANDS:2},Qe={zIndex:0,zOffset:.005};function Ke(t,e){return Array.isArray(e)?t<e[0]?0:t<e[1]?1:2:t>=e?1:0}function qe(t){const{cellWeights:e,x:n,y:i,width:o,height:s}=t;let a=t.threshold;t.thresholdValue&&(r.Z.deprecated("thresholdValue","threshold")(),a=t.thresholdValue);const l=n<0,c=n>=o-1,u=i<0,h=i>=s-1,d=l||c||u||h,f={},A={};l||h?A.top=0:(f.top=e[(i+1)*o+n],A.top=Ke(f.top,a)),c||h?A.topRight=0:(f.topRight=e[(i+1)*o+n+1],A.topRight=Ke(f.topRight,a)),c||u?A.right=0:(f.right=e[i*o+n+1],A.right=Ke(f.right,a)),l||u?A.current=0:(f.current=e[i*o+n],A.current=Ke(f.current,a));const{top:p,topRight:g,right:m,current:y}=A;let v=-1;Number.isFinite(a)&&(v=p<<3|g<<2|m<<1|y),Array.isArray(a)&&(v=p<<6|g<<4|m<<2|y);let _=0;return d||(_=Ke((f.top+f.topRight+f.right+f.current)/4,a)),{code:v,meanCode:_}}function Xe(t){const{gridOrigin:e,cellSize:n,x:i,y:r,code:o,meanCode:s,type:a=We.ISO_LINES}=t,l={...Qe,...t.thresholdData};let c=a===We.ISO_BANDS?Je[o]:Ve[o];Array.isArray(c)||(c=c[s]);const u=l.zIndex*l.zOffset,h=(i+1)*n[0],d=(r+1)*n[1],f=e[0]+h,A=e[1]+d;if(a===We.ISO_BANDS){const t=[];return c.forEach((e=>{const i=[];e.forEach((t=>{const e=f+t[0]*n[0],r=A+t[1]*n[1];i.push([e,r,u])})),t.push(i)})),t}const p=[];return c.forEach((t=>{t.forEach((t=>{const e=f+t[0]*n[0],i=A+t[1]*n[1];p.push([e,i,u])}))})),p}const Ye=[255,255,255,255],$e={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM",contours:{type:"object",value:[{threshold:1}],optional:!0,compare:3},zOffset:.005},tn="positions",en={data:{props:["cellSize"]},weights:{props:["aggregation"],accessors:["getWeight"]}};class nn extends Ft{initializeState(){super.initializeAggregationLayer({dimensions:en}),this.setState({contourData:{},projectPoints:!1,weights:{count:{size:1,operation:y.SUM}}});this.getAttributeManager().add({[tn]:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},count:{size:3,accessor:"getWeight"}})}updateState(t){super.updateState(t);let e=!1;const{oldProps:n,props:i}=t,{aggregationDirty:r}=this.state;n.contours===i.contours&&n.zOffset===i.zOffset||(e=!0,this._updateThresholdData(t.props)),this.getNumInstances()>0&&(r||e)&&this._generateContours()}renderLayers(){const{contourSegments:t,contourPolygons:e}=this.state.contourData,n=this.getSubLayerClass("lines",ee.Z),i=this.getSubLayerClass("bands",ne.Z);return[t&&t.length>0&&new n(this.getSubLayerProps({id:"lines"}),{data:this.state.contourData.contourSegments,getSourcePosition:t=>t.start,getTargetPosition:t=>t.end,getColor:t=>t.contour.color||Ye,getWidth:t=>t.contour.strokeWidth||1}),e&&e.length>0&&new i(this.getSubLayerProps({id:"bands"}),{data:this.state.contourData.contourPolygons,getPolygon:t=>t.vertices,getFillColor:t=>t.contour.color||Ye})]}updateAggregationState(t){const{props:e,oldProps:n}=t,{cellSize:i,coordinateSystem:o}=e,{viewport:s}=this.context,a=n.cellSize!==i;let l=e.gpuAggregation;this.state.gpuAggregation!==e.gpuAggregation&&l&&!V.isSupported(this.context.gl)&&(r.Z.warn("GPU Grid Aggregation not supported, falling back to CPU")(),l=!1);const c=l!==this.state.gpuAggregation;this.setState({gpuAggregation:l});const{dimensions:u}=this.state,h=this.isAttributeChanged(tn),{data:d,weights:f}=u;let{boundingBox:A}=this.state;if(h&&(A=St(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:A})),h||a){const{gridOffset:t,translation:e,width:n,height:r,numCol:a,numRow:l}=Pt(A,i,s,o);this.allocateResources(l,a),this.setState({gridOffset:t,boundingBox:A,translation:e,posOffset:e.slice(),gridOrigin:[-1*e[0],-1*e[1]],width:n,height:r,numCol:a,numRow:l})}const p=h||c||this.isAggregationDirty(t,{dimension:d,compareAll:l}),g=this.isAggregationDirty(t,{dimension:f});g&&this._updateAccessors(t),(p||g)&&this._resetResults(),this.setState({aggregationDataDirty:p,aggregationWeightsDirty:g})}_updateAccessors(t){const{getWeight:e,aggregation:n,data:i}=t.props,{count:r}=this.state.weights;r&&(r.getWeight=e,r.operation=y[n]),this.setState({getValue:x(n,e,{data:i})})}_resetResults(){const{count:t}=this.state.weights;t&&(t.aggregationData=null)}_generateContours(){const{numCol:t,numRow:e,gridOrigin:n,gridOffset:i,thresholdData:r}=this.state,{count:o}=this.state.weights;let{aggregationData:s}=o;s||(s=o.aggregationBuffer.getData(),o.aggregationData=s);const{cellWeights:a}=V.getCellData({countsData:s}),l=function(t){let{thresholdData:e,cellWeights:n,gridSize:i,gridOrigin:r,cellSize:o}=t;const s=[],a=[],l=i[0],c=i[1];let u=0,h=0;for(const d of e){const{contour:t}=d,{threshold:e}=t;for(let i=-1;i<l;i++)for(let f=-1;f<c;f++){const{code:A,meanCode:p}=qe({cellWeights:n,threshold:e,x:i,y:f,width:l,height:c}),g={type:We.ISO_BANDS,gridOrigin:r,cellSize:o,x:i,y:f,width:l,height:c,code:A,meanCode:p,thresholdData:d};if(Array.isArray(e)){g.type=We.ISO_BANDS;const e=Xe(g);for(const n of e)a[h++]={vertices:n,contour:t}}else{g.type=We.ISO_LINES;const e=Xe(g);for(let n=0;n<e.length;n+=2)s[u++]={start:e[n],end:e[n+1],contour:t}}}}return{contourSegments:s,contourPolygons:a}}({thresholdData:r,cellWeights:a,gridSize:[t,e],gridOrigin:n,cellSize:[i.xOffset,i.yOffset]});this.setState({contourData:l})}_updateThresholdData(t){const{contours:e,zOffset:n}=t,i=e.length,r=new Array(i);for(let o=0;o<i;o++){const t=e[o];r[o]={contour:t,zIndex:t.zIndex||o,zOffset:n}}this.setState({thresholdData:r})}}(0,i.Z)(nn,"layerName","ContourLayer"),(0,i.Z)(nn,"defaultProps",$e);var rn=n(54976),on=n(64441),sn=n(34819);const an={colorDomain:null,colorRange:Q,elevationDomain:null,elevationRange:[0,1e3],elevationScale:{type:"number",min:0,value:1},gridSize:{type:"array",value:[1,1]},gridOrigin:{type:"array",value:[0,0]},gridOffset:{type:"array",value:[0,0]},cellSize:{type:"number",min:0,max:1e3,value:1e3},offset:{type:"array",value:[1,1]},coverage:{type:"number",min:0,max:1,value:1},extruded:!0,material:!0};class ln extends J.Z{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-vertex-shader\n#define RANGE_COUNT 6\n\nin vec3 positions;\nin vec3 normals;\n\nin vec4 colors;\nin vec4 elevations;\nin vec3 instancePickingColors;\nuniform vec2 offset;\nuniform bool extruded;\nuniform float cellSize;\nuniform float coverage;\nuniform float opacity;\nuniform float elevationScale;\n\nuniform ivec2 gridSize;\nuniform vec2 gridOrigin;\nuniform vec2 gridOriginLow;\nuniform vec2 gridOffset;\nuniform vec2 gridOffsetLow;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 elevationRange;\nuniform vec2 colorDomain;\nuniform bool colorDomainValid;\nuniform vec2 elevationDomain;\nuniform bool elevationDomainValid;\n\nlayout(std140) uniform;\nuniform ColorData\n{\n  vec4 maxMinCount;\n} colorData;\nuniform ElevationData\n{\n  vec4 maxMinCount;\n} elevationData;\n\n#define EPSILON 0.00001\nout vec4 vColor;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n  vec4 outColor = vec4(0., 0., 0., 0.);\n  if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n    float domainRange = domain.y - domain.x;\n    if (domainRange <= 0.) {\n      outColor = colorRange[0];\n    } else {\n      float rangeCount = float(RANGE_COUNT);\n      float rangeStep = domainRange / rangeCount;\n      float idx = floor((value - domain.x) / rangeStep);\n      idx = clamp(idx, 0., rangeCount - 1.);\n      int intIdx = int(idx);\n      outColor = colorRange[intIdx];\n    }\n  }\n  return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n  if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n    return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n  }\n  return -1.;\n}\n\nvoid main(void) {\n  vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n  vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n  float elevation = 0.0;\n\n  if (extruded) {\n    vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n    elevation = linearScale(elvDomain, elevationRange, elevations.r);\n    elevation = elevation  * (positions.z + 1.0) / 2.0 * elevationScale;\n  }\n  float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n  float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n  int yIndex = (gl_InstanceID / gridSize[0]);\n  int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n  vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n  instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n  vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n  instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n  vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n  vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);\n  geometry.worldPosition = centroidPosition;\n  vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n  picking_setPickingColor(instancePickingColors);\n\n  gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n\n  vec3 normals_commonspace = project_normal(normals);\n\n   if (extruded) {\n    vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);\n    vColor = vec4(lightColor, color.a * opacity) / 255.;\n  } else {\n    vColor = vec4(color.rgb, color.a * opacity) / 255.;\n  }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n  fragColor = vColor;\n  fragColor = picking_filterColor(fragColor);\n}\n",modules:[m.Z,rn.N,W.Z,p]})}initializeState(t){let{gl:e}=t;this.getAttributeManager().addInstanced({colors:{size:4,noAlloc:!0},elevations:{size:4,noAlloc:!0}});const n=this._getModel(e);this._setupUniformBuffer(n),this.setState({model:n})}_getModel(t){return new c.Z(t,{...this.getShaders(),id:this.props.id,geometry:new sn.Z,isInstanced:!0})}draw(t){let{uniforms:e}=t;const{cellSize:n,offset:i,extruded:r,elevationScale:o,coverage:s,gridSize:a,gridOrigin:l,gridOffset:c,elevationRange:u,colorMaxMinBuffer:h,elevationMaxMinBuffer:d}=this.props,f=[(0,on.Ks)(l[0]),(0,on.Ks)(l[1])],A=[(0,on.Ks)(c[0]),(0,on.Ks)(c[1])],p=this.getDomainUniforms(),g=K(this.props.colorRange);this.bindUniformBuffers(h,d),this.state.model.setUniforms(e).setUniforms(p).setUniforms({cellSize:n,offset:i,extruded:r,elevationScale:o,coverage:s,gridSize:a,gridOrigin:l,gridOriginLow:f,gridOffset:c,gridOffsetLow:A,colorRange:g,elevationRange:u}).draw(),this.unbindUniformBuffers(h,d)}bindUniformBuffers(t,e){t.bind({target:35345,index:0}),e.bind({target:35345,index:1})}unbindUniformBuffers(t,e){t.unbind({target:35345,index:0}),e.unbind({target:35345,index:1})}getDomainUniforms(){const{colorDomain:t,elevationDomain:e}=this.props,n={};return null!==t?(n.colorDomainValid=!0,n.colorDomain=t):n.colorDomainValid=!1,null!==e?(n.elevationDomainValid=!0,n.elevationDomain=e):n.elevationDomainValid=!1,n}_setupUniformBuffer(t){const e=this.context.gl,n=t.program.handle,i=e.getUniformBlockIndex(n,"ColorData"),r=e.getUniformBlockIndex(n,"ElevationData");e.uniformBlockBinding(n,i,0),e.uniformBlockBinding(n,r,1)}}(0,i.Z)(ln,"layerName","GPUGridCellLayer"),(0,i.Z)(ln,"defaultProps",an);const cn={colorDomain:null,colorRange:Q,getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:1,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:t=>t.position},extruded:!1,material:!0},un={data:{props:["cellSize","colorAggregation","elevationAggregation"]}},hn="positions";class dn extends Ft{initializeState(t){let{gl:e}=t;const n=V.isSupported(e);n||r.Z.error("GPUGridLayer is not supported on this browser, use GridLayer instead")(),super.initializeAggregationLayer({dimensions:un}),this.setState({gpuAggregation:!0,projectPoints:!1,isSupported:n,weights:{color:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new st.Z(e,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})},elevation:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new st.Z(e,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})}},positionAttributeName:"positions"});this.getAttributeManager().add({[hn]:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},color:{size:3,accessor:"getColorWeight"},elevation:{size:3,accessor:"getElevationWeight"}})}updateState(t){if(!1===this.state.isSupported)return;super.updateState(t);const{aggregationDirty:e}=this.state;e&&this.setState({gridHash:null})}getHashKeyForIndex(t){const{numRow:e,numCol:n,boundingBox:i,gridOffset:r}=this.state,o=[n,e],s=[i.xMin,i.yMin],a=[r.xOffset,r.yOffset],l=Math.floor(t/o[0]),c=t-l*o[0],u=Math.floor((l*a[1]+s[1]+90+a[1]/2)/a[1]),h=Math.floor((c*a[0]+s[0]+180+a[0]/2)/a[0]);return"".concat(u,"-").concat(h)}getPositionForIndex(t){const{numRow:e,numCol:n,boundingBox:i,gridOffset:r}=this.state,o=[n,e],s=[i.xMin,i.yMin],a=[r.xOffset,r.yOffset],l=Math.floor(t/o[0]);return[(t-l*o[0])*a[0]+s[0],l*a[1]+s[1]]}getPickingInfo(t){let{info:e,mode:n}=t;const{index:i}=e;let r=null;if(i>=0){const{gpuGridAggregator:t}=this.state,e=this.getPositionForIndex(i),o=V.getAggregationData({pixelIndex:i,...t.getData("color")}),s=V.getAggregationData({pixelIndex:i,...t.getData("elevation")});if(r={colorValue:o.cellWeight,elevationValue:s.cellWeight,count:o.cellCount||s.cellCount,position:e,totalCount:o.totalCount||s.totalCount},"hover"!==n){const{props:t}=this;let{gridHash:e}=this.state;if(!e){const{gridOffset:n,translation:i,boundingBox:r}=this.state,{viewport:o}=this.context;e=Dt(t,{gridOffset:n,attributes:this.getAttributes(),viewport:o,translation:i,boundingBox:r}).gridHash,this.setState({gridHash:e})}const n=e[this.getHashKeyForIndex(i)];Object.assign(r,n)}}return e.picked=Boolean(r),e.object=r,e}renderLayers(){if(!this.state.isSupported)return null;const{elevationScale:t,extruded:e,cellSize:n,coverage:i,material:r,elevationRange:o,colorDomain:s,elevationDomain:a}=this.props,{weights:l,numRow:c,numCol:u,gridOrigin:h,gridOffset:d}=this.state,{color:f,elevation:A}=l,p=K(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",ln))({gridSize:[u,c],gridOrigin:h,gridOffset:[d.xOffset,d.yOffset],colorRange:p,elevationRange:o,colorDomain:s,elevationDomain:a,cellSize:n,coverage:i,material:r,elevationScale:t,extruded:e},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:{attributes:{colors:f.aggregationBuffer,elevations:A.aggregationBuffer}},colorMaxMinBuffer:f.maxMinBuffer,elevationMaxMinBuffer:A.maxMinBuffer,numInstances:u*c})}finalizeState(t){const{color:e,elevation:n}=this.state.weights;[e,n].forEach((t=>{const{aggregationBuffer:e,maxMinBuffer:n}=t;n.delete(),null===e||void 0===e||e.delete()})),super.finalizeState(t)}updateAggregationState(t){const{props:e,oldProps:n}=t,{cellSize:i,coordinateSystem:r}=e,{viewport:o}=this.context,s=n.cellSize!==i,{dimensions:a}=this.state,l=this.isAttributeChanged(hn),c=l||this.isAttributeChanged();let{boundingBox:u}=this.state;if(l&&(u=St(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:u})),l||s){const{gridOffset:t,translation:e,width:n,height:s,numCol:a,numRow:l}=Pt(u,i,o,r);this.allocateResources(l,a),this.setState({gridOffset:t,translation:e,gridOrigin:[-1*e[0],-1*e[1]],width:n,height:s,numCol:a,numRow:l})}const h=c||this.isAggregationDirty(t,{dimension:a.data,compareAll:!0});h&&this._updateAccessors(t),this.setState({aggregationDataDirty:h})}_updateAccessors(t){const{colorAggregation:e,elevationAggregation:n}=t.props,{color:i,elevation:r}=this.state.weights;i.operation=y[e],r.operation=y[n]}}(0,i.Z)(dn,"layerName","GPUGridLayer"),(0,i.Z)(dn,"defaultProps",cn);const fn={...dn.defaultProps,...Jt.defaultProps,gpuAggregation:!1};class An extends et.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeState(){this.state={useGPUAggregation:!0}}updateState(t){let{props:e}=t;this.setState({useGPUAggregation:this.canUseGPUAggregation(e)})}renderLayers(){const{data:t,updateTriggers:e}=this.props,n=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",dn):this.getSubLayerClass("CPU",Jt))(this.props,this.getSubLayerProps({id:n,updateTriggers:e}),{data:t})}canUseGPUAggregation(t){const{gpuAggregation:e,lowerPercentile:n,upperPercentile:i,getColorValue:r,getElevationValue:o,colorScaleType:s}=t;return!!e&&(!!V.isSupported(this.context.gl)&&(0===n&&100===i&&(null===r&&null===o&&("quantile"!==s&&"ordinal"!==s))))}}(0,i.Z)(An,"layerName","GridLayer"),(0,i.Z)(An,"defaultProps",fn);const pn=new Float32Array(12);function gn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=0;for(const i of t)for(let t=0;t<e;t++)pn[n++]=i[t]||0;return pn}class mn extends J.Z{getShaders(){return{vs:"#define SHADER_NAME heatp-map-layer-vertex-shader\n\nuniform sampler2D maxTexture;\nuniform float intensity;\nuniform vec2 colorDomain;\nuniform float threshold;\nuniform float aggregationMode;\n\nattribute vec3 positions;\nattribute vec2 texCoords;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvoid main(void) {\n  gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));\n  vTexCoords = texCoords;\n  vec4 maxTexture = texture2D(maxTexture, vec2(0.5));\n  float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;\n  float minValue = maxValue * threshold;\n  if (colorDomain[1] > 0.) {\n    maxValue = colorDomain[1];\n    minValue = colorDomain[0];\n  }\n  vIntensityMax = intensity / maxValue;\n  vIntensityMin = intensity / minValue;\n}\n",fs:"#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D texture;\nuniform sampler2D colorTexture;\nuniform float aggregationMode;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvec4 getLinearColor(float value) {\n  float factor = clamp(value * vIntensityMax, 0., 1.);\n  vec4 color = texture2D(colorTexture, vec2(factor, 0.5));\n  color.a *= min(value * vIntensityMin, 1.0);\n  return color;\n}\n\nvoid main(void) {\n  vec4 weights = texture2D(texture, vTexCoords);\n  float weight = weights.r;\n\n  if (aggregationMode > 0.5) {\n    weight /= max(1.0, weights.a);\n  }\n  if (weight <= 0.) {\n     discard;\n  }\n\n  vec4 linearColor = getLinearColor(weight);\n  linearColor.a *= opacity;\n  gl_FragColor =linearColor;\n}\n",modules:[m.Z]}}initializeState(t){let{gl:e}=t;this.getAttributeManager().add({positions:{size:3,noAlloc:!0},texCoords:{size:2,noAlloc:!0}}),this.setState({model:this._getModel(e)})}_getModel(t){const{vertexCount:e}=this.props;return new c.Z(t,{...this.getShaders(),id:this.props.id,geometry:new H.Z({drawMode:6,vertexCount:e})})}draw(t){let{uniforms:e}=t;const{model:n}=this.state,{texture:i,maxTexture:r,colorTexture:o,intensity:s,threshold:a,aggregationMode:l,colorDomain:c}=this.props;n.setUniforms({...e,texture:i,maxTexture:r,colorTexture:o,intensity:s,threshold:a,aggregationMode:l,colorDomain:c}).draw()}}(0,i.Z)(mn,"layerName","TriangleLayer");const yn={mipmaps:!1,parameters:{10240:9729,10241:9729,10242:33071,10243:33071},dataFormat:6408},vn=[0,0],_n={SUM:0,MEAN:1},bn={getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:Q,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},xn=[o.h.BLEND_EQUATION_MINMAX,o.h.TEXTURE_FLOAT],wn=[o.h.COLOR_ATTACHMENT_RGBA32F,o.h.FLOAT_BLEND],Cn={data:{props:["radiusPixels"]}};class Bn extends ot{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeState(){const{gl:t}=this.context;if(!(0,s.ag)(t,xn))return this.setState({supported:!1}),void r.Z.error("HeatmapLayer: ".concat(this.id," is not supported on this browser"))();super.initializeAggregationLayer(Cn),this.setState({supported:!0,colorDomain:vn}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){this.state.supported&&(super.updateState(t),this._updateHeatmapState(t))}_updateHeatmapState(t){const{props:e,oldProps:n}=t,i=this._getChangeFlags(t);(i.dataChanged||i.viewportChanged)&&(i.boundsChanged=this._updateBounds(i.dataChanged),this._updateTextureRenderingBounds()),i.dataChanged||i.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):i.viewportZoomChanged&&this._debouncedUpdateWeightmap(),e.colorRange!==n.colorRange&&this._updateColorTexture(t),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:t.context.viewport.zoom})}renderLayers(){if(!this.state.supported)return[];const{weightsTexture:t,triPositionBuffer:e,triTexCoordBuffer:n,maxWeightsTexture:i,colorTexture:r,colorDomain:o}=this.state,{updateTriggers:s,intensity:a,threshold:l,aggregation:c}=this.props;return new(this.getSubLayerClass("triangle",mn))(this.getSubLayerProps({id:"triangle-layer",updateTriggers:s}),{coordinateSystem:Bt.Df.DEFAULT,data:{attributes:{positions:e,texCoords:n}},vertexCount:4,maxTexture:i,colorTexture:r,aggregationMode:_n[c]||0,texture:t,intensity:a,threshold:l,colorDomain:o})}finalizeState(t){super.finalizeState(t);const{weightsTransform:e,weightsTexture:n,maxWeightTransform:i,maxWeightsTexture:r,triPositionBuffer:o,triTexCoordBuffer:s,colorTexture:a,updateTimer:l}=this.state;null===e||void 0===e||e.delete(),null===n||void 0===n||n.delete(),null===i||void 0===i||i.delete(),null===r||void 0===r||r.delete(),null===o||void 0===o||o.delete(),null===s||void 0===s||s.delete(),null===a||void 0===a||a.delete(),l&&clearTimeout(l)}_getAttributeManager(){return new it.Z(this.context.gl,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(t){const e={},{dimensions:n}=this.state;e.dataChanged=this.isAttributeChanged()||this.isAggregationDirty(t,{compareAll:!0,dimension:n.data}),e.viewportChanged=t.changeFlags.viewportChanged;const{zoom:i}=this.state;return t.context.viewport&&t.context.viewport.zoom===i||(e.viewportZoomChanged=!0),e}_createTextures(){const{gl:t}=this.context,{textureSize:e,format:n,type:i}=this.state;this.setState({weightsTexture:new R.Z(t,{width:e,height:e,format:n,type:i,...yn}),maxWeightsTexture:new R.Z(t,{format:n,type:i,...yn})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}_setupTextureParams(){const{gl:t}=this.context,{weightsTextureSize:e}=this.props,n=Math.min(e,(0,a.ZS)(t,3379)),i=(0,s.ag)(t,wn),{format:o,type:l}=function(t){let{gl:e,floatTargetSupport:n}=t;return n?{format:(0,a.D0)(e)?34836:6408,type:5126}:{format:6408,type:5121}}({gl:t,floatTargetSupport:i}),c=i?1:1/255;this.setState({textureSize:n,format:o,type:l,weightsScale:c}),i||r.Z.warn("HeatmapLayer: ".concat(this.id," rendering to float texture not supported, fallingback to low precession format"))()}getShaders(t){return super.getShaders("max-weights-transform"===t?{vs:"attribute vec4 inTexture;\nvarying vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\ngl_PointSize = 1.0;\n}\n",_fs:"varying vec4 outTexture;\nvoid main() {\n  gl_FragColor = outTexture;\n  gl_FragColor.g = outTexture.r / max(1.0, outTexture.a);\n}\n"}:{vs:"attribute vec3 positions;\nattribute vec3 positions64Low;\nattribute float weights;\nvarying vec4 weightsTexture;\nuniform float radiusPixels;\nuniform float textureWidth;\nuniform vec4 commonBounds;\nuniform float weightsScale;\nvoid main()\n{\n  weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);\n\n  float radiusTexels  = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);\n  gl_PointSize = radiusTexels * 2.;\n\n  vec3 commonPosition = project_position(positions, positions64Low);\n  gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;\n  gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n}\n",_fs:"varying vec4 weightsTexture;\nfloat gaussianKDE(float u){\n  return pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);\n}\nvoid main()\n{\n  float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n  if (dist > 0.5) {\n    discard;\n  }\n  gl_FragColor = weightsTexture * gaussianKDE(2. * dist);\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}_createWeightsTransform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;const{gl:n}=this.context;let{weightsTransform:i}=this.state;const{weightsTexture:r}=this.state;null===(e=i)||void 0===e||e.delete(),i=new u.Z(n,{id:"".concat(this.id,"-weights-transform"),elementCount:1,_targetTexture:r,_targetTextureVarying:"weightsTexture",...t}),this.setState({weightsTransform:i})}_setupResources(){const{gl:t}=this.context;this._createTextures();const{textureSize:e,weightsTexture:n,maxWeightsTexture:i}=this.state,r=this.getShaders("weights-transform");this._createWeightsTransform(r);const o=this.getShaders("max-weights-transform"),s=new u.Z(t,{id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:n},_targetTexture:i,_targetTextureVarying:"outTexture",...o,elementCount:e*e});this.setState({weightsTexture:n,maxWeightsTexture:i,maxWeightTransform:s,zoom:null,triPositionBuffer:new st.Z(t,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new st.Z(t,{byteLength:48,accessor:{size:2}})})}updateShaders(t){this._createWeightsTransform(t)}_updateMaxWeightValue(){const{maxWeightTransform:t}=this.state;t.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}_updateBounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{viewport:e}=this.context,n=[e.unproject([0,0]),e.unproject([e.width,0]),e.unproject([e.width,e.height]),e.unproject([0,e.height])].map((t=>t.map(Math.fround))),i=function(t){const e=t.map((t=>t[0])),n=t.map((t=>t[1])),i=Math.min.apply(null,e),r=Math.max.apply(null,e);return[i,Math.min.apply(null,n),r,Math.max.apply(null,n)]}(n),r={visibleWorldBounds:i,viewportCorners:n};let o=!1;if(t||!this.state.worldBounds||(s=this.state.worldBounds,!((a=i)[0]>=s[0]&&a[2]<=s[2]&&a[1]>=s[1]&&a[3]<=s[3]))){const t=this._worldToCommonBounds(i),e=this._commonToWorldBounds(t);this.props.coordinateSystem===Bt.Df.LNGLAT&&(e[1]=Math.max(e[1],-85.051129),e[3]=Math.min(e[3],85.051129),e[0]=Math.max(e[0],-360),e[2]=Math.min(e[2],360));const n=this._worldToCommonBounds(e);r.worldBounds=e,r.normalizedCommonBounds=n,o=!0}var s,a;return this.setState(r),o}_updateTextureRenderingBounds(){const{triPositionBuffer:t,triTexCoordBuffer:e,normalizedCommonBounds:n,viewportCorners:i}=this.state,{viewport:r}=this.context;t.subData(gn(i,3));const o=i.map((t=>function(t,e){const[n,i,r,o]=e;return[(t[0]-n)/(r-n),(t[1]-i)/(o-i)]}(r.projectPosition(t),n)));e.subData(gn(o,2))}_updateColorTexture(t){const{colorRange:e}=t.props;let{colorTexture:n}=this.state;const i=K(e,!1,Uint8Array);n?n.setImageData({data:i,width:e.length}):n=new R.Z(this.context.gl,{data:i,width:e.length,height:1,...yn}),this.setState({colorTexture:n})}_updateWeightmap(){const{radiusPixels:t,colorDomain:e,aggregation:n}=this.props,{weightsTransform:i,worldBounds:r,textureSize:o,weightsTexture:s,weightsScale:l}=this.state;this.state.isWeightMapDirty=!1;const c=this._worldToCommonBounds(r,{useLayerCoordinateSystem:!0});if(e&&"SUM"===n){const{viewport:t}=this.context,n=t.distanceScales.metersPerUnit[2]*(c[2]-c[0])/o;this.state.colorDomain=e.map((t=>t*n*l))}else this.state.colorDomain=e||vn;const u={radiusPixels:t,commonBounds:c,textureWidth:o,weightsScale:l};i.update({elementCount:this.getNumInstances()}),(0,a.s8)(this.context.gl,{clearColor:[0,0,0,0]},(()=>{i.run({uniforms:u,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0,attributes:this.getAttributes(),moduleSettings:this.getModuleSettings()})})),this._updateMaxWeightValue(),s.setParameters({10240:9729,10241:9729})}_debouncedUpdateWeightmap(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],{updateTimer:e}=this.state;const{debounceTimeout:n}=this.props;t?(e=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(e),e=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),n)),this.setState({updateTimer:e})}_worldToCommonBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{useLayerCoordinateSystem:n=!1}=e,[i,r,o,s]=t,{viewport:a}=this.context,{textureSize:l}=this.state,{coordinateSystem:c}=this.props,u=n&&(c===Bt.Df.LNGLAT_OFFSETS||c===Bt.Df.METER_OFFSETS),h=u?a.projectPosition(this.props.coordinateOrigin):[0,0],d=2*l/a.scale;let f,A;return n&&!u?(f=this.projectPosition([i,r,0]),A=this.projectPosition([o,s,0])):(f=a.projectPosition([i,r,0]),A=a.projectPosition([o,s,0])),function(t,e,n){const[i,r,o,s]=t,a=o-i,l=s-r;let c=a,u=l;a/l<e/n?c=e/n*l:u=n/e*a,c<e&&(c=e,u=n);const h=(o+i)/2,d=(s+r)/2;return[h-c/2,d-u/2,h+c/2,d+u/2]}([f[0]-h[0],f[1]-h[1],A[0]-h[0],A[1]-h[1]],d,d)}_commonToWorldBounds(t){const[e,n,i,r]=t,{viewport:o}=this.context,s=o.unprojectPosition([e,n]),a=o.unprojectPosition([i,r]);return s.slice(0,2).concat(a.slice(0,2))}}(0,i.Z)(Bn,"layerName","HeatmapLayer"),(0,i.Z)(Bn,"defaultProps",bn)},88766:(t,e,n)=>{"use strict";n.d(e,{Z:()=>Ge});var i=n(64649),r=n(79366),o=n(21970),s=n(97018);const a="{user}",l="{region}",c={V1:"v1",V2:"v2",V3:"v3"},u={[c.V1]:"https://".concat(a,".carto.com/api/v1/map"),[c.V2]:"https://maps-api-v2.".concat(l,".carto.com/user/").concat(a)},h={QUERY:"query",TABLE:"table",TILESET:"tileset",RASTER:"raster"},d=[h.QUERY,h.TABLE],f=[h.QUERY,h.TABLE],A={GEOJSON:"geojson",NDJSON:"ndjson",TILEJSON:"tilejson",JSON:"json"},p={MVT:"mvt",JSON:"json",GEOJSON:"geojson",BINARY:"binary"};let g;!function(t){t.Number="number",t.Bigint="bigint",t.String="string",t.Geometry="geometry",t.Timestamp="timestamp",t.Object="object",t.Boolean="boolean",t.Variant="variant",t.Unknown="unknown"}(g||(g={}));const m={DATA:"Map data",INSTANTIATION:"Map instantiation",PUBLIC_MAP:"Public map",TILE_STATS:"Tile stats"};function y(t,e){return"".concat(t,"=").concat(encodeURIComponent(e))}let v;!function(t){t.In="in",t.Between="between",t.ClosedOpen="closed_open",t.Time="time",t.StringSearch="stringSearch"}(v||(v={}));const _={apiKey:"default_public",region:"us",username:"public"},b={apiBaseUrl:"https://gcp-us-east1.api.carto.com"};let x={};function w(){return x}function C(t,e){let n="/v3/".concat(e);return t.endsWith("/")&&(n=n.substring(1)),"".concat(t).concat(n)}!function(t){let{apiVersion:e,...n}=t;switch(e=e||c.V3,e){case c.V1:case c.V2:x={apiVersion:e,..._,...n};break;case c.V3:x={apiVersion:e,...b,...n};break;default:throw new Error("Invalid API version ".concat(e,". Use API_VERSIONS enum."))}}({});const B="bigquery",E="carto",T=16,S=4096;async function M(t){let{type:e,source:n,credentials:i}=t;const r=w(),o=(null===i||void 0===i?void 0:i.apiVersion)||r.apiVersion,s={...o===c.V3?b:_,mapsUrl:u[o],...r.apiVersion===o&&r,...i};let a;const l=e===h.TILESET?B:E;switch(o){case c.V1:a=function(t){let{mapConfig:e,credentials:n}=t;const i=P(n),r=JSON.stringify(e);return"".concat(D(n),"?").concat(i.join("&"),"&").concat(y("config",r))}({mapConfig:{version:"1.3.1",buffersize:{mvt:T},layers:[{type:"mapnik",options:{sql:n,vector_extent:S}}]},credentials:s});return(await I({url:a,credentials:s})).metadata.tilejson.vector;case c.V2:return a=function(t){let{connection:e,type:n,source:i,credentials:r}=t;const o=P(r),s=n===h.QUERY?"sql":n;let a="".concat(D(r),"/").concat(e,"/").concat(s,"?");return a+="".concat(y("source",i),"&format=tilejson&").concat(o.join("&")),a}({connection:l,type:e,source:n,credentials:s}),await I({url:a,credentials:s});default:throw new Error("Invalid maps API version. It should be ".concat(c.V1," or ").concat(c.V2))}}async function I(t){let e,{url:n,credentials:i}=t;try{e=await fetch(n,{headers:{Accept:"application/json"}})}catch(o){throw new Error("Failed to connect to Maps API: ".concat(o))}const r=await e.json();return e.ok||function(t){let{response:e,json:n,credentials:i}=t;switch(e.status){case 401:throw new Error("Unauthorized access to Maps API: invalid combination of user ('".concat(i.username,"') and apiKey ('").concat(i.apiKey,"')"));case 403:throw new Error("Unauthorized access to dataset: the provided apiKey('".concat(i.apiKey,"') doesn't provide access to the requested data"));default:const t=i.apiVersion===c.V1?JSON.stringify(n.errors):n.error;throw new Error(t)}}({response:e,json:r,credentials:i}),r}function P(t){return[y("api_key",t.apiKey),y("client","deck-gl-carto")]}function D(t){return t.mapsUrl.replace(a,t.username).replace(l,t.region)}class F extends Error{constructor(t,e,n){let r="Failed to connect";n&&(r="Server returned: ",400===n.status?r+="Bad request":401===n.status||403===n.status?r+="Unauthorized access":404===n.status?r+="Not found":r+="Error",r+=" (".concat(n.status,"):")),r+=" ".concat(t.message||t);let o="".concat(e.requestType," API request failed");o+="\n".concat(r);for(const i of Object.keys(e))"requestType"!==i&&(o+="\n".concat(L(i),": ").concat(e[i]));o+="\n",super(o),(0,i.Z)(this,"error",void 0),(0,i.Z)(this,"errorContext",void 0),(0,i.Z)(this,"response",void 0),this.name="CartoAPIError",this.response=n,this.error=t,this.errorContext=e}}function L(t){return t.replace(/([A-Z])/g," $1").replace(/^./,(t=>t.toUpperCase()))}function O(t,e){o.Z.assert(t,e)}function R(t,e){return"https://unpkg.com/@deck.gl/carto@".concat(e,"/dist/").concat(t,"-worker.js")}const k=8192,U="deck-gl-carto",z="3.2";async function G(t){let{method:e,url:n,headers:i,accessToken:r,body:o,errorContext:s}=t;const a={...i,Accept:"application/json"};r&&(a.Authorization="Bearer ".concat(r)),"POST"===e&&(a["Content-Type"]="application/json");try{return await fetch(n,{method:e,headers:a,body:o})}catch(l){throw new F(l,s)}}async function N(t){let{method:e,url:n,headers:i,accessToken:r,body:o,errorContext:s}=t;const a=await G({method:e,url:n,headers:i,accessToken:r,body:o,errorContext:s});let l;try{l=await a.json()}catch(c){l={error:""}}if(!a.ok)throw new F(l.error,s,a);return l}async function Z(t){let{method:e,url:n,accessToken:i,format:r,body:o,errorContext:s}=t;if(r===A.NDJSON)return G({method:e,url:n,accessToken:i,body:o,errorContext:s});const a=await N({method:e,url:n,accessToken:i,body:o,errorContext:s});return a.rows?a.rows:a}async function j(t){let{type:e,source:n,connection:i,credentials:r,geoColumn:o,columns:s,clientId:a,headers:l,aggregationExp:c,aggregationResLevel:u,queryParameters:d,filters:f}=t;const A="".concat(r.mapsUrl,"/").concat(i,"/").concat(e),p=function(t){let{type:e,source:n,geoColumn:i,columns:r,clientId:o,aggregationExp:s,aggregationResLevel:a,queryParameters:l,filters:c}=t;const u={client:o||U,v:z};return u[e===h.QUERY?"q":"name"]=n,l&&(u.queryParameters=l),i&&(u.geo_column=i),r&&(u.columns=r.join(",")),s?u.aggregationExp=s:function(t){const e=null===t||void 0===t?void 0:t.split(":")[0];return"h3"===e||"quadbin"===e}(i)&&(u.aggregationExp="1 AS value"),a&&(u.aggregationResLevel=a),c&&(u.filters=c),u}({type:e,source:n,geoColumn:o,columns:s,clientId:a,aggregationResLevel:u,aggregationExp:c,queryParameters:d,filters:f}),g=Object.entries(p).map((t=>{let[e,n]=t;return"string"!==typeof n&&(n=JSON.stringify(n)),y(e,n)})),v="".concat(A,"?").concat(g.join("&")),{accessToken:_}=r,b={requestType:m.INSTANTIATION,connection:i,type:e,source:n};return v.length>k&&e===h.QUERY?await N({method:"POST",url:A,headers:l,accessToken:_,body:JSON.stringify(p),errorContext:b}):await N({url:v,headers:l,accessToken:_,errorContext:b})}function V(t,e){const n=t[e];return n&&!n.error&&n.url?n.url[0]:null}async function H(t){let{type:e,source:n,connection:i,credentials:r,geoColumn:s,columns:a,format:l,formatTiles:u,clientId:g,headers:m,aggregationExp:v,aggregationResLevel:_,queryParameters:b,filters:x}=t;const B=w(),E={...B.apiVersion===c.V3&&B,...r};!function(t){let{type:e,source:n,connection:i,credentials:r,geoColumn:o,columns:s,aggregationExp:a,aggregationResLevel:l,filters:u}=t;O(i,"Must define connection"),O(e,"Must define a type"),O(n,"Must define a source"),O(r.apiVersion===c.V3,"Method only available for v3"),O(r.apiBaseUrl,"Must define apiBaseUrl"),O(r.accessToken,"Must define an accessToken"),s&&O(d.includes(e),"The columns parameter is not supported by type ".concat(e)),o?O(f.includes(e),"The geoColumn parameter is not supported by type ".concat(e)):(O(!a,"Have aggregationExp, but geoColumn parameter is missing"),O(!l,"Have aggregationResLevel, but geoColumn parameter is missing")),u&&O(e===h.TABLE||e===h.QUERY,"The filters parameter is only supported by type table and query")}({type:e,source:n,connection:i,credentials:E,geoColumn:s,columns:a,aggregationExp:v,aggregationResLevel:_,filters:x}),E.mapsUrl||(E.mapsUrl=C(E.apiBaseUrl,"maps"));const T=await j({type:e,source:n,connection:i,credentials:E,geoColumn:s,columns:a,clientId:g,headers:m,aggregationExp:v,aggregationResLevel:_,queryParameters:b,filters:x});let S,M=null;if(l)S=l,M=V(T,l),O(M,"Format ".concat(l," not available"));else{const t=[A.GEOJSON,A.JSON,A.NDJSON,A.TILEJSON];for(const e of t)if(M=V(T,e),M){S=e;break}O(M&&S,"Unsupported data formats received from backend.")}l===A.TILEJSON&&u&&(o.Z.assert(Object.values(p).includes(u),"Invalid value for formatTiles: ".concat(u,". Use value from TILE_FORMATS")),M+="&".concat(y("formatTiles",u)));const{accessToken:I}=E;return{url:M,accessToken:I,mapFormat:S,metadata:T}}var J=n(94319),W=n(20905);function Q(t){return t}function K(t,e,n,i){return function t(r,o){if(o>=i.length)return n(r);const s=new W.L,a=i[o++];let l=-1;for(const e of r){const t=a(e,++l,r),n=s.get(t);n?n.push(e):s.set(t,[e])}for(const[e,n]of s)s.set(e,t(n,o));return e(s)}(t,0)}var q=n(47833);function X(t,e,n){return(2!==e.length?(0,q.ZP)(function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return K(t,Q,e,i)}(t,e,n),((t,e)=>{let[n,i]=t,[r,o]=e;return(0,J.Z)(i,o)||(0,J.Z)(n,r)})):(0,q.ZP)(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return K(t,Q,Q,n)}(t,n),((t,n)=>{let[i,r]=t,[o,s]=n;return e(r,s)||(0,J.Z)(i,o)}))).map((t=>{let[e]=t;return e}))}var Y=n(88048),$=n(26379),tt=n(30730),et=(n(52017),n(13629)),nt=n(58458),it=n(95658),rt=n(82601),ot=n(8896);function st(){var t,e,n=(0,nt.Z)().unknown(void 0),i=n.domain,r=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=s<o,d=h?s:o,f=h?o:s;t=(f-d)/Math.max(1,n-l+2*c),a&&(t=Math.floor(t)),d+=(f-d-t*(n-l))*u,e=t*(1-l),a&&(d=Math.round(d),e=Math.round(e));var A=(0,rt.Z)(n).map((function(e){return d+t*e}));return r(h?A.reverse():A)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([o,s]=t,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(t){return[o,s]=t,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,h()):a},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return st(i(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},ot.o.apply(h(),arguments)}function at(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return at(e())},t}var lt=n(79978),ct=n(90983),ut=n(66042),ht=n(87758),dt=n(86425),ft=n(55842),At=n.n(ft),pt=n(19754),gt=n(25880),mt=n.n(gt);function yt(t,e,n){const i=2===e.type?e.readVarint()+e.pos:e.pos+1;return n.value=new t(e.buf.buffer.slice(e.pos,i)),e.pos=i,n.value}class vt{static read(t,e){return t.readFields(vt._readField,{key:"",value:null},e)}static _readField(t,e,n){1===t?e.key=n.readString():2===t&&(e.value=n.readString())}}class _t{static read(t,e){return t.readFields(_t._readField,{},e)}static _readField(t,e,n){if(1===t){const{key:t,value:i}=vt.read(n,n.readVarint()+n.pos);e[t]=i}}}class bt{static read(t,e){const{value:n,size:i}=t.readFields(bt._readField,{value:[],size:0},e);return{value:new Float32Array(n),size:i}}static _readField(t,e,n){1===t?yt(Float64Array,n,e):2===t&&(e.size=n.readVarint(!0))}}class xt{static read(t,e){const{value:n,size:i}=t.readFields(xt._readField,{value:[],size:0},e);return{value:new Uint32Array(n),size:i}}static _readField(t,e,n){1===t?n.readPackedVarint(e.value):2===t&&(e.size=n.readVarint(!0))}}class wt{static read(t,e){return t.readFields(wt._readField,{id:0},e)}static _readField(t,e,n){1===t&&(e.id=n.readVarint())}}class Ct{static read(t,e){return t.readFields(Ct._readField,{value:[]},e)}static _readField(t,e,n){1===t&&yt(Float64Array,n,e)}}class Bt{static read(t,e){return t.readFields(Bt._readField,{key:"",value:null},e)}static _readField(t,e,n){1===t?e.key=n.readString():2===t&&(e.value=Ct.read(n,n.readVarint()+n.pos))}}class Et{static read(t,e){return t.readFields(Et._readField,{positions:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},e)}static _readField(t,e,n){if(1===t)e.positions=bt.read(n,n.readVarint()+n.pos);else if(2===t)e.globalFeatureIds=xt.read(n,n.readVarint()+n.pos);else if(3===t)e.featureIds=xt.read(n,n.readVarint()+n.pos);else if(4===t)e.properties.push(_t.read(n,n.readVarint()+n.pos));else if(5===t){const t=Bt.read(n,n.readVarint()+n.pos);e.numericProps[t.key]=t.value}else 6===t&&e.fields.push(wt.read(n,n.readVarint()+n.pos))}}class Tt{static read(t,e){return t.readFields(Tt._readField,{positions:null,pathIndices:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},e)}static _readField(t,e,n){if(1===t)e.positions=bt.read(n,n.readVarint()+n.pos);else if(2===t)e.pathIndices=xt.read(n,n.readVarint()+n.pos);else if(3===t)e.globalFeatureIds=xt.read(n,n.readVarint()+n.pos);else if(4===t)e.featureIds=xt.read(n,n.readVarint()+n.pos);else if(5===t)e.properties.push(_t.read(n,n.readVarint()+n.pos));else if(6===t){const t=Bt.read(n,n.readVarint()+n.pos);e.numericProps[t.key]=t.value}else 7===t&&e.fields.push(wt.read(n,n.readVarint()+n.pos))}}class St{static read(t,e){return t.readFields(St._readField,{positions:null,polygonIndices:null,globalFeatureIds:null,featureIds:null,primitivePolygonIndices:null,triangles:null,properties:[],numericProps:{},fields:[]},e)}static _readField(t,e,n){if(1===t)e.positions=bt.read(n,n.readVarint()+n.pos);else if(2===t)e.polygonIndices=xt.read(n,n.readVarint()+n.pos);else if(3===t)e.globalFeatureIds=xt.read(n,n.readVarint()+n.pos);else if(4===t)e.featureIds=xt.read(n,n.readVarint()+n.pos);else if(5===t)e.primitivePolygonIndices=xt.read(n,n.readVarint()+n.pos);else if(6===t)e.triangles=xt.read(n,n.readVarint()+n.pos);else if(7===t)e.properties.push(_t.read(n,n.readVarint()+n.pos));else if(8===t){const t=Bt.read(n,n.readVarint()+n.pos);e.numericProps[t.key]=t.value}else 9===t&&e.fields.push(wt.read(n,n.readVarint()+n.pos))}}class Mt{static read(t,e){return t.readFields(Mt._readField,{points:null,lines:null,polygons:null},e)}static _readField(t,e,n){1===t?e.points=Et.read(n,n.readVarint()+n.pos):2===t?e.lines=Tt.read(n,n.readVarint()+n.pos):3===t&&(e.polygons=St.read(n,n.readVarint()+n.pos))}}var It=n(32408),Pt=n.n(It);function Dt(t,e){const n=new(Pt())(t);return e.read(n)}const Ft="8.9.36",Lt="cartoVectorTile";function Ot(t,e,n){let{startPosition:i,endPosition:r,indices:o}=n;const s=t.positions.size,a=i*s,l=r*s,c=t.positions.value.subarray(a,l),u=o.slice(1).map((t=>t-i)),h=mt()(c,u,s);for(let d=0,f=h.length;d<f;++d)e.push(i+h[d])}function Rt(t,e){if(!t)return null;const n=Dt(t,Mt);return n.polygons&&!n.polygons.triangles&&function(t){const{polygonIndices:e,positions:n,primitivePolygonIndices:i}=t,r=[];let o=0;for(let s=0;s<e.value.length-1;s++){const n=e.value[s],a=e.value[s+1],l=i.value.indexOf(a),c=i.value.subarray(o,l);o=l,Ot(t,r,{startPosition:n,endPosition:a,indices:c})}t.triangles={value:new Uint32Array(r),size:1}}(n.polygons),n}const kt={name:"CARTO Vector Tile",version:Ft,id:Lt,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(t,e)=>Rt(t,e),parseSync:Rt,worker:!0,options:{cartoVectorTile:{workerUrl:R(Lt,Ft)}}};var Ut=n(46257),zt=n(7623),Gt=n(43610),Nt=n(10625);(0,pt.fh)([kt]);const Zt=p.BINARY,jt={...s.Z.defaultProps,formatTiles:Zt};class Vt extends s.Z{initializeState(){super.initializeState();const t=this.props.formatTiles===p.BINARY;this.setState({binary:t})}getTileData(t){const e=(0,zt.z0)(this.state.data,t);if(!e)return Promise.reject("Invalid URL");const n=this.getLoadOptions(),{fetch:i}=this.props,{signal:r}=t;return i(e,{propName:"data",layer:this,loadOptions:n,signal:r})}renderSubLayers(t){if(null===t.data)return null;const e=t.tile.bbox,{west:n,south:i,east:r,north:o}=e,s={...t,autoHighlight:!1,extensions:[new Ut.Z,...t.extensions||[]],clipBounds:[n,i,r,o]};return new Gt.Z(s)}getPickingInfo(t){const e=super.getPickingInfo(t);if(this.state.binary&&-1!==e.index){const{data:n}=t.sourceLayer.props;e.object=(0,Nt.F_)(n,{globalFeatureId:e.index})}return e}}(0,i.Z)(Vt,"layerName","CartoTileLayer"),(0,i.Z)(Vt,"defaultProps",jt);var Ht=n(9839),Jt=n(95512),Wt=n(73356);function Qt(t,e){let{west:n,north:i,east:r,south:o}=t;const s=Math.abs(r-n);if(s>180){const t=Math.ceil(s/180);let a=[];for(let s=0;s<t;s++){const t=r+180*s,l=Math.min(t+179.9999999,n);a=a.concat(Qt({west:l,north:i,east:t,south:o},e))}return[...new Set(a)]}const a=(0,Wt.OK)([[[n,i],[n,o],[r,o],[r,i],[n,i]]],e+2,!0);return[...new Set(a.map((t=>(0,Wt.jV)(t,e))))]}function Kt(t){const e=(0,Wt.Lg)(t),n=e.map((t=>t[0])),i=e.map((t=>t[1]));return{west:Math.min(...i),south:Math.min(...n),east:Math.max(...i),north:Math.max(...n)}}function qt(t){const e=2/3*t.zoom,n=Math.log(1/Math.cos(Math.PI*t.latitude/180));return Math.max(0,Math.floor(e+n-2))}class Xt extends Jt.Be{getTileIndices(t){let{viewport:e,minZoom:n,maxZoom:i}=t;if(void 0===e.latitude)return[];const[r,o,s,a]=e.getBounds();let l,c=qt(e);if("number"===typeof n&&Number.isFinite(n)&&c<n)return[];if("number"===typeof i&&Number.isFinite(i)&&c>i){c=i;const t=(0,Wt.Cx)(e.latitude,e.longitude,i);l=(0,Wt.b3)(t,1)}else l=Qt({west:s,north:a,east:r,south:o},c);return l.map((t=>({i:t})))}getTileId(t){let{i:e}=t;return e}getTileMetadata(t){let{i:e}=t;return{bbox:Kt(e)}}getTileZoom(t){let{i:e}=t;return(0,Wt.AI)(e)}getParentIndex(t){const e=(0,Wt.AI)(t.i);return{i:(0,Wt.jV)(t.i,e-1)}}}const Yt={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array};class $t{static read(t,e){return t.readFields($t._readField,{name:"",type:"",data:null},e)}static _readField(t,e,n){if(1===t)e.name=n.readString();else if(2===t)e.type=n.readString();else if(3===t){const t=Yt[e.type];if(!t)throw Error("Invalid data type: ".concat(e.type));e.data={},yt(t,n,e.data)}}}class te{static read(t,e){return t.readFields(te._readField,{blockWidth:0,blockHeight:0,bands:[]},e)}static _readField(t,e,n){1===t?e.blockWidth=n.readVarint():2===t?e.blockHeight=n.readVarint():3===t&&e.bands.push($t.read(n,n.readVarint()+n.pos))}}const ee="8.9.36",ne="cartoRasterTile";function ie(t,e){if(!t)return null;const n=Dt(t,te),{bands:i,blockHeight:r,blockWidth:o}=n,s={};for(let a=0;a<i.length;a++){const{name:t,data:e}=i[a];s[t]=e}return{blockWidth:o,blockHeight:r,cells:{numericProps:s,properties:[]}}}const re={name:"CARTO Raster Tile",version:ee,id:ne,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(t,e)=>ie(t,e),parseSync:ie,worker:!0,options:{cartoRasterTile:{workerUrl:R(ne,ee)}}};class oe{static read(t,e){return t.readFields(oe._readField,{value:[]},e)}static _readField(t,e,n){1===t&&yt(BigUint64Array,n,e)}}class se{static read(t,e){return t.readFields(se._readField,{indices:null,properties:[],numericProps:{}},e)}static _readField(t,e,n){if(1===t)e.indices=oe.read(n,n.readVarint()+n.pos);else if(2===t)e.properties.push(_t.read(n,n.readVarint()+n.pos));else if(3===t){const t=Bt.read(n,n.readVarint()+n.pos);e.numericProps[t.key]=t.value}}}class ae{static read(t,e){return t.readFields(ae._readField,{scheme:0,cells:null},e)}static _readField(t,e,n){1===t?e.scheme=n.readVarint():2===t&&(e.cells=se.read(n,n.readVarint()+n.pos))}}n(80097);const le=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],ce=[0n,1n,2n,4n,8n,16n];function ue(t){return t.toString(16)}function he(t){if(t.z<0||t.z>26)throw new Error("Wrong zoom");const e=BigInt(t.z);let n=BigInt(t.x)<<32n-e,i=BigInt(t.y)<<32n-e;for(let r=0;r<5;r++){const t=ce[5-r],e=le[4-r];n=(n|n<<t)&e,i=(i|i<<t)&e}return 5188146770730811392n|e<<52n|(n|i<<1n)>>12n|0xfffffffffffffn>>2n*e}function de(t){const e=t>>52n&0x1fn,n=(0xfffffffffffffn&t)<<12n;if(1n!==(t>>59n&7n)&&0n!==(t>>57n&3n))throw new Error("Wrong mode");let i=n,r=n>>1n;for(let o=0;o<6;o++){const t=ce[o],e=le[o];i=(i|i>>t)&e,r=(r|r>>t)&e}return i>>=32n-e,r>>=32n-e,{z:Number(e),x:Number(i),y:Number(r)}}function fe(t){return t>>52n&0x1fn}function Ae(t){const e=fe(t)-1n;return t&~(0x1fn<<52n)|e<<52n|0xfffffffffffffn>>2n*e}const pe="8.9.36",ge="cartoSpatialTile";function me(t,e){var n;if(!t)return null;const i=Dt(t,ae),{cells:r}=i;return function(t){const{cells:e,scheme:n}=t,i=e.indices.value.length,r=[];for(let o=0;o<i;o++){const t="h3"===n?ue(e.indices.value[o]):e.indices.value[o],i={...e.properties[o]};for(const n of Object.keys(e.numericProps))i[n]=e.numericProps[n].value[o];r.push({id:t,properties:i})}return r}({cells:r,scheme:null===e||void 0===e||null===(n=e.cartoSpatialTile)||void 0===n?void 0:n.scheme})}const ye={name:"CARTO Spatial Tile",version:pe,id:ge,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-spatial-tile"],category:"geometry",parse:async(t,e)=>me(t,e),parseSync:me,worker:!0,options:{cartoSpatialTile:{scheme:"quadbin",workerUrl:R(ge,pe)}}};var ve=n(58062);(0,pt.fh)([re,ye]);class _e extends ve.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}updateState(t){const{props:e,oldProps:n}=t;e.aggregationResLevel!==n.aggregationResLevel&&this.setState({tileset:null}),super.updateState(t)}_updateAutoHighlight(t){const{hoveredFeatureId:e}=this.state,n=t.object;let i=null;if(n&&(i=n.id),e!==i){let{highlightColor:e}=this.props;"function"===typeof e&&(e=e(t)),this.setState({highlightColor:e,hoveredFeatureId:i})}}getSubLayerPropsByTile(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(t){const{hoveredFeatureId:e}=this.state,n=t.content;var i;return void 0!==(i=e)&&null!==i&&""!==i&&Array.isArray(n)&&this._featureInTile(t,e)?n.findIndex((t=>t.id===e)):-1}_featureInTile(t,e){const n=this.state.tileset,i=n.getTileZoom(t.index),r=t.index.q?"q":"i";let o={[r]:e},s=n.getTileZoom(o);for(;!(s<=i);)o=n.getParentIndex(o),s=n.getTileZoom(o);return o[r]===t.index[r]}}(0,i.Z)(_e,"layerName","SpatialIndexTileLayer"),(0,i.Z)(_e,"defaultProps",{aggregationResLevel:4});const be=t=>{const{data:e}=t,{index:n}=t.tile;return e&&e.length?new Ht.ZP(t,{getHexagon:t=>t.id,centerHexagon:n,highPrecision:!0}):null};class xe extends r.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeState(){Ht.ZP._checkH3Lib(),this.setState({data:null,tileJSON:null})}updateState(t){let{changeFlags:e}=t;if(e.dataChanged){let{data:t}=this.props;const e=t;t=e.tiles,this.setState({data:t,tileJSON:e})}}renderLayers(){const{data:t,tileJSON:e}=this.state;let n=parseInt(e.minresolution),i=parseInt(e.maxresolution);return this.props.minZoom&&(n=Math.max(n,qt({zoom:this.props.minZoom,latitude:0}))),this.props.maxZoom&&(i=Math.min(i,qt({zoom:this.props.maxZoom,latitude:0}))),[new _e(this.props,{id:"h3-tile-layer-".concat(this.props.id),data:t,TilesetClass:Xt,renderSubLayers:be,minZoom:n,maxZoom:i,loadOptions:{...this.getLoadOptions(),cartoSpatialTile:{scheme:"h3"}}})]}}(0,i.Z)(xe,"layerName","H3TileLayer"),(0,i.Z)(xe,"defaultProps",{aggregationResLevel:4});var we=n(17634),Ce=n(75818);const Be=512;function Ee(t){const{x:e,y:n,z:i}=de(t),r=Be/(1<<i);return[e*r,Be-n*r,r]}function Te(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const[n,i]=function(t,e){const[n,i,r]=Ee(t);return[[n,i],[n+e*r,i-e*r]]}(t,e),[r,o]=(0,Ce.es)(n),[s,a]=(0,Ce.es)(i);return[s,o,s,a,r,a,r,o,s,o]}class Se extends we.Z{indexToBounds(){const{data:t,extruded:e,getQuadbin:n}=this.props,i=e?.99:1;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(t,e)=>Te(n(t,e),i),updateTriggers:{getPolygon:i}}}}(0,i.Z)(Se,"layerName","QuadbinLayer"),(0,i.Z)(Se,"defaultProps",{getQuadbin:{type:"accessor",value:t=>t.quadbin}});class Me extends Jt.Be{getTileIndices(t){return super.getTileIndices(t).map(he).map((t=>({q:t,i:ue(t)})))}getTileId(t){let{q:e,i:n}=t;return n||ue(e)}getTileMetadata(t){let{q:e}=t;return super.getTileMetadata(de(e))}getTileZoom(t){let{q:e}=t;return Number(fe(e))}getParentIndex(t){let{q:e}=t;return{q:Ae(e)}}}const Ie=t=>{const{data:e}=t;if(!e||!e.length)return null;const n="bigint"===typeof e[0].id;return new Se(t,{getQuadbin:n?t=>t.id:t=>{return e=t.id,BigInt("0x".concat(e));var e}})};class Pe extends r.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeState(){this.setState({data:null,tileJSON:null})}updateState(t){let{changeFlags:e}=t;if(e.dataChanged){let{data:t}=this.props;const e=t;t=e.tiles,this.setState({data:t,tileJSON:e})}}renderLayers(){const{data:t,tileJSON:e}=this.state,n=parseInt(null===e||void 0===e?void 0:e.maxresolution);return[new _e(this.props,{id:"quadbin-tile-layer-".concat(this.props.id),data:t,TilesetClass:Me,renderSubLayers:Ie,maxZoom:n,loadOptions:{...this.getLoadOptions(),cartoSpatialTile:{scheme:"quadbin"}}})]}}(0,i.Z)(Pe,"layerName","QuadbinTileLayer"),(0,i.Z)(Pe,"defaultProps",{aggregationResLevel:6});var De=n(35387);const Fe={...De.Z.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]};class Le extends De.Z{getShaders(){return{...super.getShaders(),vs:"#version 300 es\n#define SHADER_NAME raster-layer-vertex-shader\n\nin vec3 positions;\nin vec3 normals;\n\nin float instanceElevations;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\n\nin vec3 instancePickingColors;\nuniform float opacity;\nuniform bool extruded;\nuniform bool stroked;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float widthScale;\nuniform vec3 offset;\nout vec4 vColor;\n#ifdef FLAT_SHADING\nout vec4 position_commonspace;\n#endif\n\nvoid main(void) {\n  vec2 common_position = offset.xy;\n  float scale = offset.z;\n\n  int yIndex = - (gl_InstanceID / 256);\n  int xIndex = gl_InstanceID + (yIndex * 256);\n  common_position += scale * vec2(float(xIndex), float(yIndex));\n\n  vec4 color = isStroke ? instanceLineColors : instanceFillColors;\n  float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\n  float cellWidth = coverage * scale;\n  geometry.position = vec4(common_position, 0.0, 1.0);\n  if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n    geometry.position.xyz -= project_uCommonOrigin;\n  }\n  float elevation = 0.0;\n  float strokeOffsetRatio = 1.0;\n\n  if (extruded) {\n    elevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n  } else if (stroked) {\n    float halfOffset = project_pixel_size(widthScale) / cellWidth;\n    if (isStroke) {\n      strokeOffsetRatio -= sign(positions.z) * halfOffset;\n    } else {\n      strokeOffsetRatio -= halfOffset;\n    }\n  }\n\n  geometry.pickingColor = instancePickingColors;\n  vec2 offset = (vec2(0.5) + positions.xy * strokeOffsetRatio) * cellWidth * shouldRender;\n  vec3 pos = vec3(offset, project_size(elevation));\n  DECKGL_FILTER_SIZE(pos, geometry);\n\n  geometry.position.xyz += pos;\n  gl_Position = project_common_position_to_clipspace(geometry.position);\n\n  geometry.normal = project_normal(normals);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  if (extruded && !isStroke) {\n#ifdef FLAT_SHADING\n    position_commonspace = geometry.position;\n    vColor = vec4(color.rgb, color.a * opacity);\n#else\n    vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n    vColor = vec4(lightColor, color.a * opacity);\n#endif\n  } else {\n    vColor = vec4(color.rgb, color.a * opacity);\n  }\n\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n"}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}}(0,i.Z)(Le,"layerName","RasterColumnLayer");class Oe extends r.Z{renderLayers(){const{data:t,getElevation:e,getFillColor:n,getLineColor:i,getLineWidth:r,tileIndex:o,updateTriggers:s}=this.props;if(!t||!o)return null;const{blockWidth:a,blockHeight:l}=t;O(a===l,"blockWidth (".concat(a,") must equal blockHeight (").concat(l,")"));const[c,u,h]=Ee(o),d=[c,u,h/a];return new(this.getSubLayerClass("column",Le))(this.props,this.getSubLayerProps({id:"cell",updateTriggers:s,getElevation:this.getSubLayerAccessor(e),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(r)}),{data:{data:t,length:a*l},offset:d})}getSubLayerAccessor(t){return"function"!==typeof t?super.getSubLayerAccessor(t):(e,n)=>{const{data:i,index:r}=n,o=function(t,e){const{properties:n,numericProps:i}=t;return new Proxy(n[e]||{},{get:(t,n,r)=>n in i?i[n].value[e]:t[n],has:(t,e)=>e in i||e in t})}(i.data.cells,r);return t({properties:o},n)}}}(0,i.Z)(Oe,"layerName","RasterLayer"),(0,i.Z)(Oe,"defaultProps",Fe);const Re=t=>{var e,n;const i=null===(e=t.tile)||void 0===e||null===(n=e.index)||void 0===n?void 0:n.q;return i?new Oe(t,{tileIndex:i}):null};class ke extends r.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeState(){this.setState({data:null,tileJSON:null})}updateState(t){let{changeFlags:e}=t;if(e.dataChanged){let{data:t}=this.props;const e=t;t=e.tiles,this.setState({data:t,tileJSON:e})}}renderLayers(){const{data:t,tileJSON:e}=this.state,n=parseInt(null===e||void 0===e?void 0:e.minzoom),i=parseInt(null===e||void 0===e?void 0:e.maxzoom);return[new _e(this.props,{id:"raster-tile-layer-".concat(this.props.id),data:t,TilesetClass:Me,renderSubLayers:Re,minZoom:n,maxZoom:i})]}}(0,i.Z)(ke,"layerName","RasterTileLayer"),(0,i.Z)(ke,"defaultProps",{});et.Z,nt.Z,it.Z,lt.Z,ct.Z,ut._b,ht.Z;Y.Z,$.Z,tt.Z;function Ue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p.MVT,e=arguments.length>1?arguments[1]:void 0;return"raster"===(arguments.length>2?arguments[2]:void 0)?ke:"h3"===e?xe:"quadbin"===e?Pe:"mvt"===t?s.Z:Vt}(0,dt.WU)("i"),(0,dt.WU)(".5f");const ze={data:null,type:null,onDataLoad:{type:"function",value:t=>{}},onDataError:{type:"function",value:null,optional:!0},uniqueIdProperty:"cartodb_id",credentials:null,connection:null,format:null,formatTiles:null,clientId:null,geoColumn:null,columns:{type:"array",value:null},headers:{type:"object",value:{},optional:!0},aggregationExp:null,aggregationResLevel:null,queryParameters:null};class Ge extends r.Z{initializeState(){this.state={data:null,apiVersion:null}}get isLoaded(){return this.getSubLayers().length>0&&super.isLoaded}_checkProps(t){const{type:e,credentials:n,connection:i,geoColumn:r,columns:s}=t,a={...w(),...n},{apiVersion:l}=a;o.Z.assert(Object.values(c).includes(l),"Invalid apiVersion ".concat(l,". Use API_VERSIONS enum.")),l===c.V1||l===c.V2?(o.Z.assert(e===h.QUERY||e===h.TILESET,"Invalid type ".concat(e,". Use type MAP_TYPES.QUERY or MAP_TYPES.TILESET for apiVersion ").concat(l)),o.Z.assert(!i,"Connection prop is not supported for apiVersion ".concat(l)),o.Z.assert(!r,"geoColumn prop is not supported for apiVersion ".concat(l)),o.Z.assert(!s,"columns prop is not supported for apiVersion ".concat(l))):l===c.V3&&(o.Z.assert(i,"Missing mandatory connection parameter"),o.Z.assert(Object.values(h).includes(e),"Invalid type ".concat(e,". Use MAP_TYPES enum.")),d.includes(e)||o.Z.assert(!s,"columns prop is only supported for types: ".concat(d.join())),f.includes(e)||o.Z.assert(!r,"geoColumn prop is only supported for types: ".concat(f.join())),s&&o.Z.assert(Array.isArray(s),"columns prop must be an Array"))}updateState(t){let{props:e,oldProps:n,changeFlags:i}=t;this._checkProps(e);(i.dataChanged||e.aggregationExp!==n.aggregationExp||e.aggregationResLevel!==n.aggregationResLevel||e.connection!==n.connection||e.geoColumn!==n.geoColumn||e.formatTiles!==n.formatTiles||e.type!==n.type||JSON.stringify(e.columns)!==JSON.stringify(n.columns)||JSON.stringify(e.credentials)!==JSON.stringify(n.credentials)||JSON.stringify(e.queryParameters)!==JSON.stringify(n.queryParameters))&&(this.setState({data:null,apiVersion:null}),this._updateData())}async _updateData(){try{var t,e;const{type:n,data:i,credentials:r,connection:o,...s}=this.props,a={...w(),...r},{apiVersion:l}=a;let u;u=l===c.V1||l===c.V2?{data:await M({type:n,source:i,credentials:r})}:await async function(t){let{type:e,source:n,connection:i,credentials:r,geoColumn:o,columns:s,format:a,formatTiles:l,clientId:c,headers:u,aggregationExp:h,aggregationResLevel:d,queryParameters:f,filters:A}=t;const{url:p,accessToken:g,mapFormat:y,metadata:v}=await H({type:e,source:n,connection:i,credentials:r,geoColumn:o,columns:s,format:a,formatTiles:l,clientId:c,headers:u,aggregationExp:h,aggregationResLevel:d,queryParameters:f,filters:A}),_={requestType:m.DATA,connection:i,type:e,source:n};return{data:await Z({url:p,format:y,accessToken:g,errorContext:_}),format:y,schema:v.schema}}({type:n,source:i,credentials:r,connection:o,...s,format:A.TILEJSON}),this.setState({...u,apiVersion:l}),null===(t=(e=this.props).onDataLoad)||void 0===t||t.call(e,u.data,{propName:"data",layer:this})}catch(n){if(!this.props.onDataError)throw n;this.props.onDataError(n)}}_getSubLayerAndProps(){O(this.state);const{data:t,apiVersion:e}=this.state,{uniqueIdProperty:n}=ze,{data:i,...r}=this.props,o={uniqueIdProperty:n,...r};if(e===c.V1||e===c.V2)return[s.Z,o];const a=new URL(t.tiles[0]);return o.formatTiles=o.formatTiles||a.searchParams.get("formatTiles"),[Ue(o.formatTiles,t.scheme,o.type),o]}renderLayers(){O(this.state);const{apiVersion:t,data:e}=this.state;if(!e)return null;const{credentials:n,updateTriggers:i}=this.props,r=this.getLoadOptions()||{};if(t===c.V3){var o;const t={...w(),...n},{accessToken:e}=t;r.fetch={...r.fetch,headers:{...null===(o=r.fetch)||void 0===o?void 0:o.headers,Authorization:"Bearer ".concat(e)}}}const[s,a]=this._getSubLayerAndProps();return new s(a,this.getSubLayerProps({id:"carto-".concat(s.layerName),data:e,loadOptions:r,updateTriggers:i}))}}(0,i.Z)(Ge,"layerName","CartoLayer"),(0,i.Z)(Ge,"defaultProps",ze)},699:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var i=n(87758),r=n(77481),o=n(83380);function s(t){let{attr:e,domain:n,colors:s=r.LD,nullColor:a=r.PX}=t;(0,o.h)(Array.isArray(n),'Expected "domain" to be an array of numbers');const l="string"===typeof s?(0,r.ZP)(s,n.length+1):s,c=(0,i.Z)().domain(n).range(l);return t=>{const n=(0,o.g)(e,t);return"number"===typeof n&&Number.isFinite(n)?c(n):a}}},96260:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var i=n(77481),r=n(83380);function o(t){let{attr:e,domain:n,colors:o=i.LD,nullColor:s=i.PX,othersColor:a=i.LW}=t;(0,r.h)(Array.isArray(n),'Expected "domain" to be an array of numbers or strings');const l={},c="string"===typeof o?(0,i.ZP)(o,n.length):o;for(const[i,r]of n.entries())l[r]=c[i];return t=>{const n=(0,r.g)(e,t);return"number"===typeof n&&Number.isFinite(n)||"string"===typeof n?l[n]||a:s}}},24002:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var i=n(13629),r=n(77481),o=n(83380);function s(t){let{attr:e,domain:n,colors:s=r.LD,nullColor:a=r.PX}=t;(0,o.h)(Array.isArray(n),'Expected "domain" to be an array of numbers');const l="string"===typeof s?(0,r.ZP)(s,n.length):s,c=(0,i.Z)().domain(n).range(l);return t=>{const n=(0,o.g)(e,t);return"number"===typeof n&&Number.isFinite(n)?c(n):a}}},77481:(t,e,n)=>{"use strict";n.d(e,{LD:()=>o,LW:()=>a,PX:()=>s,ZP:()=>l});var i=n(79354),r=n(83380);const o="PurpOr",s=[204,204,204],a=[119,119,119];function l(t,e){const n=i[t];let o=e;(0,r.h)(n,'Palette "'.concat(t,'" not found. Expected a CARTOColors string'));const s=Object.keys(n).filter((t=>"tags"!==t)).map(Number),a=Math.max(...s),l=Math.min(...s);!Number.isInteger(e)||e>a?o=a:e<l&&(o=l);let c=n[o];return n.tags&&n.tags.includes("qualitative")&&(c=c.slice(0,-1)),c.map((t=>function(t){let e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(t);if(e)return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),255];if(e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(t),e)return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)];if(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t),e)return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),255];return e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t),(0,r.h)(e,'Hexadecimal color "'.concat(t,'" was not parsed correctly')),[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)]}(t)))}},83380:(t,e,n)=>{"use strict";n.d(e,{g:()=>r,h:()=>o});const i=Object.freeze(["function","string"]);function r(t,e){var n;return o("object"===typeof e,'Expected "data" to be an object'),o(i.includes(typeof t),'Expected "attr" to be a function or string'),"function"===typeof t?t(e):null===e||void 0===e||null===(n=e.properties)||void 0===n?void 0:n[t]}function o(t){if(!t)throw new Error("CARTO style error: ".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:""))}},23427:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s,z:()=>o});var i=n(21970);let r={};function o(t){r=t}function s(t,e,n,o){i.Z.level>0&&r[t]&&r[t].call(null,e,n,o)}},96684:(t,e,n)=>{"use strict";n.d(e,{Z:()=>D});var i=n(64649),r=n(12308),o=n(70353),s=n(33839);class a{constructor(t,e){(0,i.Z)(this,"opts",void 0),(0,i.Z)(this,"source",void 0),this.opts=e,this.source=t}get value(){return this.source.value}getValue(){const t=this.source.getBuffer(),e=this.getAccessor();if(t)return[t,e];const{value:n}=this.source,{size:i}=e;let r=n;if(n&&n.length!==i){r=new Float32Array(i);const t=e.elementOffset||0;for(let e=0;e<i;++e)r[e]=n[t+e]}return r}getAccessor(){return{...this.source.getAccessor(),...this.opts}}}var l=n(28321),c=n(64441),u=n(21970);function h(t){return t.stride||t.size*t.bytesPerElement}function d(t,e){e.offset&&u.Z.removed("shaderAttribute.offset","vertexOffset, elementOffset")();const n=h(t),i=(void 0!==e.vertexOffset?e.vertexOffset:t.vertexOffset||0)*n+(e.elementOffset||0)*t.bytesPerElement+(t.offset||0);return{...e,offset:i,stride:n}}class f{constructor(t,e,n){(0,i.Z)(this,"gl",void 0),(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"size",void 0),(0,i.Z)(this,"settings",void 0),(0,i.Z)(this,"value",void 0),(0,i.Z)(this,"doublePrecision",void 0),(0,i.Z)(this,"_buffer",void 0),(0,i.Z)(this,"state",void 0),this.gl=t,this.id=e.id||"",this.size=e.size||1;const s=e.logicalType||e.type,a=5130===s;let l,{defaultValue:c}=e;c=Number.isFinite(c)?[c]:c||new Array(this.size).fill(0),l=a?5126:!s&&e.isIndexed?t&&(0,r.U6)(t,o.h.ELEMENT_INDEX_UINT32)?5125:5123:s||5126;let u=function(t){switch(t){case 5126:return Float32Array;case 5130:return Float64Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return Uint8ClampedArray;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Unknown GL type")}}(s||l||5126);this.doublePrecision=a,a&&!1===e.fp64&&(u=Float32Array),this.value=null,this.settings={...e,defaultType:u,defaultValue:c,logicalType:s,type:l,size:this.size,bytesPerElement:u.BYTES_PER_ELEMENT},this.state={...n,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1},this._buffer=null}get isConstant(){return this.state.constant}get buffer(){if(!this._buffer){const{isIndexed:t,type:e}=this.settings;this._buffer=new s.Z(this.gl,{id:this.id,target:t?34963:34962,accessor:{type:e}})}return this._buffer}get byteOffset(){const t=this.getAccessor();return t.vertexOffset?t.vertexOffset*h(t):0}get numInstances(){return this.state.numInstances}set numInstances(t){this.state.numInstances=t}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),l.Z.release(this.state.allocatedValue)}getShaderAttributes(t,e){if(this.doublePrecision){const n={},i=this.value instanceof Float64Array,r=function(t,e){const n=d(t,e);return{high:n,low:{...n,offset:n.offset+4*t.size}}}(this.getAccessor(),e||{});return n[t]=new a(this,r.high),n["".concat(t,"64Low")]=i?new a(this,r.low):new Float32Array(this.size),n}if(e){const n=d(this.getAccessor(),e);return{[t]:new a(this,n)}}return{[t]:this}}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(){return this.state.constant?this.value:[this.getBuffer(),this.getAccessor()]}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let t=null;if(this.state.constant&&this.value){const e=Array.from(this.value);t=[e,e]}else{const{value:e,numInstances:n,size:i}=this,r=n*i;if(e&&r&&e.length>=r){const n=new Array(i).fill(1/0),o=new Array(i).fill(-1/0);for(let t=0;t<r;)for(let r=0;r<i;r++){const i=e[t++];i<n[r]&&(n[r]=i),i>o[r]&&(o[r]=i)}t=[n,o]}}return this.state.bounds=t,t}setData(t){const{state:e}=this;let n;n=ArrayBuffer.isView(t)?{value:t}:t instanceof s.Z?{buffer:t}:t;const i={...this.settings,...n};if(e.bufferAccessor=i,e.bounds=null,n.constant){let t=n.value;t=this._normalizeValue(t,[],0),this.settings.normalized&&(t=this.normalizeConstant(t));if(!(!e.constant||!this._areValuesEqual(t,this.value)))return!1;e.externalBuffer=null,e.constant=!0,this.value=t}else if(n.buffer){const t=n.buffer;e.externalBuffer=t,e.constant=!1,this.value=n.value||null;const r=n.value instanceof Float64Array;i.type=n.type||t.accessor.type,i.bytesPerElement=t.accessor.BYTES_PER_ELEMENT*(r?2:1),i.stride=h(i)}else if(n.value){this._checkExternalBuffer(n);let t=n.value;e.externalBuffer=null,e.constant=!1,this.value=t,i.bytesPerElement=t.BYTES_PER_ELEMENT,i.stride=h(i);const{buffer:r,byteOffset:o}=this;this.doublePrecision&&t instanceof Float64Array&&(t=(0,c.TK)(t,i));const s=t.byteLength+o+2*i.stride;r.byteLength<s&&r.reallocate(s),r.setAccessor(null),r.subData({data:t,offset:o}),i.type=n.type||r.accessor.type}return!0}updateSubBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.bounds=null;const e=this.value,{startOffset:n=0,endOffset:i}=t;this.buffer.subData({data:this.doublePrecision&&e instanceof Float64Array?(0,c.TK)(e,{size:this.size,startIndex:n,endIndex:i}):e.subarray(n,i),offset:n*e.BYTES_PER_ELEMENT+this.byteOffset})}allocate(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{state:n}=this,i=n.allocatedValue,r=l.Z.allocate(i,t+1,{size:this.size,type:this.settings.defaultType,copy:e});this.value=r;const{buffer:o,byteOffset:s}=this;return o.byteLength<r.byteLength+s&&(o.reallocate(r.byteLength+s),e&&i&&o.subData({data:i instanceof Float64Array?(0,c.TK)(i,this):i,offset:s})),n.allocatedValue=r,n.constant=!1,n.externalBuffer=null,n.bufferAccessor=this.settings,!0}_checkExternalBuffer(t){const{value:e}=t;if(!ArrayBuffer.isView(e))throw new Error("Attribute ".concat(this.id," value is not TypedArray"));const n=this.settings.defaultType;let i=!1;if(this.doublePrecision&&(i=e.BYTES_PER_ELEMENT<4),i)throw new Error("Attribute ".concat(this.id," does not support ").concat(e.constructor.name));e instanceof n||!this.settings.normalized||"normalized"in t||u.Z.warn("Attribute ".concat(this.id," is normalized"))()}normalizeConstant(t){switch(this.settings.type){case 5120:return new Float32Array(t).map((t=>(t+128)/255*2-1));case 5122:return new Float32Array(t).map((t=>(t+32768)/65535*2-1));case 5121:return new Float32Array(t).map((t=>t/255));case 5123:return new Float32Array(t).map((t=>t/65535));default:return t}}_normalizeValue(t,e,n){const{defaultValue:i,size:r}=this.settings;if(Number.isFinite(t))return e[n]=t,e;if(!t){let t=r;for(;--t>=0;)e[n+t]=i[t];return e}switch(r){case 4:e[n+3]=Number.isFinite(t[3])?t[3]:i[3];case 3:e[n+2]=Number.isFinite(t[2])?t[2]:i[2];case 2:e[n+1]=Number.isFinite(t[1])?t[1]:i[1];case 1:e[n+0]=Number.isFinite(t[0])?t[0]:i[0];break;default:let o=r;for(;--o>=0;)e[n+o]=Number.isFinite(t[o])?t[o]:i[o]}return e}_areValuesEqual(t,e){if(!t||!e)return!1;const{size:n}=this;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}}var A=n(12997),p=n(73115),g=n(18757);const m=[],y=[[0,1/0]];var v=n(41894);class _ extends f{constructor(t,e){super(t,e,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:y}),(0,i.Z)(this,"constant",!1),this.settings.update=e.update||(e.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(t){this.state.startIndices=t}needsUpdate(){return this.state.needsUpdate}needsRedraw(){let{clearChangedFlags:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.state.needsRedraw;return this.state.needsRedraw=e&&!t,e}getUpdateTriggers(){const{accessor:t}=this.settings;return[this.id].concat("function"!==typeof t&&t||[])}supportsTransition(){return Boolean(this.settings.transition)}getTransitionSetting(t){if(!t||!this.supportsTransition())return null;const{accessor:e}=this.settings,n=this.settings.transition,i=Array.isArray(e)?t[e.find((e=>t[e]))]:t[e];return(0,v.M0)(i,n)}setNeedsUpdate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,e=arguments.length>1?arguments[1]:void 0;if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),e){const{startRow:t=0,endRow:n=1/0}=e;this.state.updateRanges=function(t,e){if(t===y)return t;if(e[0]<0&&(e[0]=0),e[0]>=e[1])return t;const n=[],i=t.length;let r=0;for(let o=0;o<i;o++){const i=t[o];i[1]<e[0]?(n.push(i),r=o+1):i[0]>e[1]?n.push(i):e=[Math.min(i[0],e[0]),Math.max(i[1],e[1])]}return n.splice(r,0,e),n}(this.state.updateRanges,[t,n])}else this.state.updateRanges=y}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=m}setNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.state.needsRedraw=this.state.needsRedraw||t}allocate(t){const{state:e,settings:n}=this;return!n.noAlloc&&(!!n.update&&(super.allocate(t,e.updateRanges!==y),!0))}updateBuffer(t){let{numInstances:e,data:n,props:i,context:r}=t;if(!this.needsUpdate())return!1;const{state:{updateRanges:o},settings:{update:s,noAlloc:a}}=this;let l=!0;if(s){for(const[t,a]of o)s.call(r,this,{data:n,startRow:t,endRow:a,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength<this.value.byteLength+this.byteOffset)this.setData({value:this.value,constant:this.constant}),this.constant=!1;else for(const[t,n]of o){const i=Number.isFinite(t)?this.getVertexOffset(t):0,r=Number.isFinite(n)?this.getVertexOffset(n):a||!Number.isFinite(e)?this.value.length:e*this.size;super.updateSubBuffer({startOffset:i,endOffset:r})}else;this._checkAttributeArray()}else l=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),l}setConstantValue(t){if(void 0===t||"function"===typeof t)return!1;return this.setData({constant:!0,value:t})&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0}setExternalBuffer(t){const{state:e}=this;return t?(this.clearNeedsUpdate(),e.lastExternalBuffer===t||(e.lastExternalBuffer=t,this.setNeedsRedraw(),this.setData(t)),!0):(e.lastExternalBuffer=null,!1)}setBinaryValue(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{state:n,settings:i}=this;if(!t)return n.binaryValue=null,n.binaryAccessor=null,!1;if(i.noAlloc)return!1;if(n.binaryValue===t)return this.clearNeedsUpdate(),!0;n.binaryValue=t,this.setNeedsRedraw();if(i.transform||e!==this.startIndices){ArrayBuffer.isView(t)&&(t={value:t});const r=t;(0,A.Z)(ArrayBuffer.isView(r.value),"invalid ".concat(i.accessor));const o=Boolean(r.size)&&r.size!==this.size;return n.binaryAccessor=(0,p.jr)(r.value,{size:r.size||this.size,stride:r.stride,offset:r.offset,startIndices:e,nested:o}),!1}return this.clearNeedsUpdate(),this.setData(t),!0}getVertexOffset(t){const{startIndices:e}=this;return(e?t<e.length?e[t]:this.numInstances:t)*this.size}getShaderAttributes(){const t=this.settings.shaderAttributes||{[this.id]:null},e={};for(const n in t)Object.assign(e,super.getShaderAttributes(n,t[n]));return e}_autoUpdater(t,e){let{data:n,startRow:i,endRow:r,props:o,numInstances:s}=e;if(t.constant)return;const{settings:a,state:l,value:c,size:u,startIndices:h}=t,{accessor:d,transform:f}=a,m=l.binaryAccessor||("function"===typeof d?d:o[d]);(0,A.Z)("function"===typeof m,'accessor "'.concat(d,'" is not a function'));let y=t.getVertexOffset(i);const{iterable:v,objectInfo:_}=(0,p.jB)(n,i,r);for(const A of v){_.index++;let e=m(A,_);if(f&&(e=f.call(this,e)),h){const n=(_.index<h.length-1?h[_.index+1]:s)-h[_.index];if(e&&Array.isArray(e[0])){let n=y;for(const i of e)t._normalizeValue(i,c,n),n+=u}else e&&e.length>u?c.set(e,y):(t._normalizeValue(e,_.target,0),(0,g.k)({target:c,source:_.target,start:y,count:n}));y+=n*u}else t._normalizeValue(e,c,y),y+=u}}_validateAttributeUpdaters(){const{settings:t}=this;if(!(t.noAlloc||"function"===typeof t.update))throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:t}=this,e=Math.min(4,this.size);if(t&&t.length>=e){let n=!0;switch(e){case 4:n=n&&Number.isFinite(t[3]);case 3:n=n&&Number.isFinite(t[2]);case 2:n=n&&Number.isFinite(t[1]);case 1:n=n&&Number.isFinite(t[0]);break;default:n=!1}if(!n)throw new Error("Illegal attribute generated for ".concat(this.id))}}}var b=n(18188),x=n(23427),w=n(17225),C=n(99188);const B="\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n  vCurrent = mix(aFrom, aTo, time);\n  gl_Position = vec4(0.0);\n}\n";var E=n(56474),T=n(58300),S=n(79078);const M={interpolation:class{constructor(t){let{gl:e,attribute:n,timeline:r}=t;(0,i.Z)(this,"gl",void 0),(0,i.Z)(this,"type","interpolation"),(0,i.Z)(this,"attributeInTransition",void 0),(0,i.Z)(this,"settings",void 0),(0,i.Z)(this,"attribute",void 0),(0,i.Z)(this,"transition",void 0),(0,i.Z)(this,"currentStartIndices",void 0),(0,i.Z)(this,"currentLength",void 0),(0,i.Z)(this,"transform",void 0),(0,i.Z)(this,"buffers",void 0),this.gl=e,this.transition=new C.Z(r),this.attribute=n,this.attributeInTransition=new _(e,n.settings),this.currentStartIndices=n.startIndices,this.currentLength=0,this.transform=function(t,e){const n=(0,v.w)(e.size);return new w.Z(t,{vs:B,defines:{ATTRIBUTE_TYPE:n},varyings:["vCurrent"]})}(e,n);const o={byteLength:0,usage:35050};this.buffers=[new s.Z(e,o),new s.Z(e,o)]}get inProgress(){return this.transition.inProgress}start(t,e){if(t.duration<=0)return void this.transition.cancel();this.settings=t;const{gl:n,buffers:i,attribute:r}=this;(0,v.DY)(i);const o={numInstances:e,attribute:r,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of i)(0,v.IV)({buffer:s,...o});this.currentStartIndices=r.startIndices,this.currentLength=(0,v.pi)(r,e),this.attributeInTransition.setData({buffer:i[1],value:r.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/r.size),sourceBuffers:{aFrom:i[0],aTo:(0,v.AQ)(n,r)},feedbackBuffers:{vCurrent:i[1]}})}update(){const t=this.transition.update();if(t){const{duration:t,easing:e}=this.settings,{time:n}=this.transition;let i=n/t;e&&(i=e(i)),this.transform.run({uniforms:{time:i}})}return t}cancel(){this.transition.cancel(),this.transform.delete();for(const t of this.buffers)t.delete();this.buffers.length=0}},spring:class{constructor(t){let{gl:e,attribute:n,timeline:r}=t;(0,i.Z)(this,"gl",void 0),(0,i.Z)(this,"type","spring"),(0,i.Z)(this,"attributeInTransition",void 0),(0,i.Z)(this,"settings",void 0),(0,i.Z)(this,"attribute",void 0),(0,i.Z)(this,"transition",void 0),(0,i.Z)(this,"currentStartIndices",void 0),(0,i.Z)(this,"currentLength",void 0),(0,i.Z)(this,"texture",void 0),(0,i.Z)(this,"framebuffer",void 0),(0,i.Z)(this,"transform",void 0),(0,i.Z)(this,"buffers",void 0),this.gl=e,this.type="spring",this.transition=new C.Z(r),this.attribute=n,this.attributeInTransition=new _(e,{...n.settings,normalized:!1}),this.currentStartIndices=n.startIndices,this.currentLength=0,this.texture=function(t){return new T.Z(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(t,e){return new S.Z(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(t,e,n){const i=(0,v.w)(e.size);return new w.Z(t,{framebuffer:n,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n  ATTRIBUTE_TYPE velocity = cur - prev;\n  ATTRIBUTE_TYPE delta = dest - cur;\n  ATTRIBUTE_TYPE spring = delta * stiffness;\n  ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n  return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n  bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n  vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n  vNext = getNextValue(aCur, aPrev, aTo);\n  gl_Position = vec4(0, 0, 0, 1);\n  gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n  if (vIsTransitioningFlag == 0.0) {\n    discard;\n  }\n  gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,n,this.framebuffer);const o={byteLength:0,usage:35050};this.buffers=[new s.Z(e,o),new s.Z(e,o),new s.Z(e,o)]}get inProgress(){return this.transition.inProgress}start(t,e){const{gl:n,buffers:i,attribute:r}=this,o={numInstances:e,attribute:r,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of i)(0,v.IV)({buffer:s,...o});this.settings=t,this.currentStartIndices=r.startIndices,this.currentLength=(0,v.pi)(r,e),this.attributeInTransition.setData({buffer:i[1],value:r.value}),this.transition.start({...t,duration:1/0}),this.transform.update({elementCount:Math.floor(this.currentLength/r.size),sourceBuffers:{aTo:(0,v.AQ)(n,r)}})}update(){const{buffers:t,transform:e,framebuffer:n,transition:i}=this;if(!i.update())return!1;const r=this.settings;e.update({sourceBuffers:{aPrev:t[0],aCur:t[1]},feedbackBuffers:{vNext:t[2]}}),e.run({framebuffer:n,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.stiffness,damping:r.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),(0,v.DY)(t),this.attributeInTransition.setData({buffer:t[1],value:this.attribute.value});return(0,E.z6)(n)[0]>0||i.end(),!0}cancel(){this.transition.cancel(),this.transform.delete();for(const t of this.buffers)t.delete();this.buffers.length=0,this.texture.delete(),this.framebuffer.delete()}}};class I{constructor(t,e){let{id:n,timeline:r}=e;(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"isSupported",void 0),(0,i.Z)(this,"gl",void 0),(0,i.Z)(this,"timeline",void 0),(0,i.Z)(this,"transitions",void 0),(0,i.Z)(this,"needsRedraw",void 0),(0,i.Z)(this,"numInstances",void 0),this.id=n,this.gl=t,this.timeline=r,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=w.Z.isSupported(t)}finalize(){for(const t in this.transitions)this._removeTransition(t)}update(t){let{attributes:e,transitions:n,numInstances:i}=t;this.numInstances=i||1;for(const r in e){const t=e[r],i=t.getTransitionSetting(n);i&&this._updateAttribute(r,t,i)}for(const r in this.transitions){const t=e[r];t&&t.getTransitionSetting(n)||this._removeTransition(r)}}hasAttribute(t){const e=this.transitions[t];return e&&e.inProgress}getAttributes(){const t={};for(const e in this.transitions){const n=this.transitions[e];n.inProgress&&(t[e]=n.attributeInTransition)}return t}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const e in this.transitions){this.transitions[e].update()&&(this.needsRedraw=!0)}const t=this.needsRedraw;return this.needsRedraw=!1,t}_removeTransition(t){this.transitions[t].cancel(),delete this.transitions[t]}_updateAttribute(t,e,n){const i=this.transitions[t];let r=!i||i.type!==n.type;if(r){if(!this.isSupported)return void u.Z.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();i&&this._removeTransition(t);const o=M[n.type];o?this.transitions[t]=new o({attribute:e,timeline:this.timeline,gl:this.gl}):(u.Z.error("unsupported transition type '".concat(n.type,"'"))(),r=!1)}(r||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(n,this.numInstances))}}const P="attributeManager.invalidate";class D{constructor(t){let{id:e="attribute-manager",stats:n,timeline:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"gl",void 0),(0,i.Z)(this,"attributes",void 0),(0,i.Z)(this,"updateTriggers",void 0),(0,i.Z)(this,"needsRedraw",void 0),(0,i.Z)(this,"userData",void 0),(0,i.Z)(this,"stats",void 0),(0,i.Z)(this,"attributeTransitionManager",void 0),(0,i.Z)(this,"mergeBoundsMemoized",(0,b.Z)(c.cc)),this.id=e,this.gl=t,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=n,this.attributeTransitionManager=new I(t,{id:"".concat(e,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(t){this._add(t)}addInstanced(t){this._add(t,{instanced:1})}remove(t){for(const e of t)void 0!==this.attributes[e]&&(this.attributes[e].delete(),delete this.attributes[e])}invalidate(t,e){const n=this._invalidateTrigger(t,e);(0,x.Z)(P,this,t,n)}invalidateAll(t){for(const e in this.attributes)this.attributes[e].setNeedsUpdate(e,t);(0,x.Z)(P,this,"all")}update(t){let{data:e,numInstances:n,startIndices:i=null,transitions:r,props:o={},buffers:s={},context:a={}}=t,l=!1;(0,x.Z)("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart();for(const c in this.attributes){const t=this.attributes[c],r=t.settings.accessor;t.startIndices=i,t.numInstances=n,o[c]&&u.Z.removed("props.".concat(c),"data.attributes.".concat(c))(),t.setExternalBuffer(s[c])||t.setBinaryValue("string"===typeof r?s[r]:void 0,e.startIndices)||"string"===typeof r&&!s[r]&&t.setConstantValue(o[r])||t.needsUpdate()&&(l=!0,this._updateAttribute({attribute:t,numInstances:n,data:e,props:o,context:a})),this.needsRedraw=this.needsRedraw||t.needsRedraw()}l&&(0,x.Z)("attributeManager.updateEnd",this,n),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}updateTransition(){const{attributeTransitionManager:t}=this,e=t.run();return this.needsRedraw=this.needsRedraw||e,e}getAttributes(){return this.attributes}getBounds(t){const e=t.map((t=>{var e;return null===(e=this.attributes[t])||void 0===e?void 0:e.getBounds()}));return this.mergeBoundsMemoized(e)}getChangedAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1};const{attributes:e,attributeTransitionManager:n}=this,i={...n.getAttributes()};for(const r in e){const o=e[r];o.needsRedraw(t)&&!n.hasAttribute(r)&&(i[r]=o)}return i}getShaderAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t||(t=this.getAttributes());const n={};for(const i in t)e[i]||Object.assign(n,t[i].getShaderAttributes());return n}_add(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(const n in t){const i=t[n];this.attributes[n]=this._createAttribute(n,i,e)}this._mapUpdateTriggersToAttributes()}_createAttribute(t,e,n){const i={...e,id:t,size:(e.isIndexed?1:e.size)||1,divisor:n.instanced?1:e.divisor||0};return new _(this.gl,i)}_mapUpdateTriggersToAttributes(){const t={};for(const e in this.attributes){this.attributes[e].getUpdateTriggers().forEach((n=>{t[n]||(t[n]=[]),t[n].push(e)}))}this.updateTriggers=t}_invalidateTrigger(t,e){const{attributes:n,updateTriggers:i}=this,r=i[t];return r&&r.forEach((t=>{const i=n[t];i&&i.setNeedsUpdate(i.id,e)})),r}_updateAttribute(t){const{attribute:e,numInstances:n}=t;if((0,x.Z)("attribute.updateStart",e),e.constant)return void e.setConstantValue(e.value);e.allocate(n)&&(0,x.Z)("attribute.allocate",e,n);e.updateBuffer(t)&&(this.needsRedraw=!0,(0,x.Z)("attribute.updateEnd",e,n))}}},41894:(t,e,n)=>{"use strict";function i(t){const{source:e,target:n,start:i=0,size:r,getData:o}=t,s=t.end||n.length,a=e.length,l=s-i;if(a>l)return void n.set(e.subarray(0,l),i);if(n.set(e,i),!o)return;let c=a;for(;c<l;){const t=o(c,e);for(let e=0;e<r;e++)n[i+c]=t[e]||0,c++}}n.d(e,{DY:()=>l,pi:()=>c,w:()=>a,AQ:()=>s,M0:()=>o,IV:()=>u});const r={interpolation:{duration:0,easing:t=>t},spring:{stiffness:.05,damping:.5}};function o(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});const n=t.type||"interpolation";return{...r[n],...e,...t,type:n}}function s(t,e){const n=e.getBuffer();return n?[n,{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function a(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(t,'"'))}}function l(t){t.push(t.shift())}function c(t,e){const{doublePrecision:n,settings:i,value:r,size:o}=t,s=n&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*o)*s}function u(t){let{buffer:e,numInstances:n,attribute:r,fromLength:o,fromStartIndices:s,getData:a=(t=>t)}=t;const l=r.doublePrecision&&r.value instanceof Float64Array?2:1,u=r.size*l,h=r.byteOffset,d=r.startIndices,f=s&&d,A=c(r,n),p=r.isConstant;if(!f&&o>=A)return;const g=p?r.value:r.getBuffer().getData({srcByteOffset:h});if(r.settings.normalized&&!p){const t=a;a=(e,n)=>r.normalizeConstant(t(e,n))}const m=p?(t,e)=>a(g,e):(t,e)=>a(g.subarray(t,t+u),e),y=e.getData({length:o}),v=new Float32Array(A);!function(t){let{source:e,target:n,size:r,getData:o,sourceStartIndices:s,targetStartIndices:a}=t;if(!Array.isArray(a))return i({source:e,target:n,size:r,getData:o}),n;let l=0,c=0;const u=o&&((t,e)=>o(t+c,e)),h=Math.min(s.length,a.length);for(let d=1;d<h;d++){const t=s[d]*r,o=a[d]*r;i({source:e.subarray(l,t),target:n,start:c,end:o,size:r,getData:u}),l=t,c=o}c<n.length&&i({source:[],target:n,start:c,size:r,getData:u})}({source:y,target:v,sourceStartIndices:s,targetStartIndices:d,size:u,getData:m}),e.byteLength<v.byteLength+h&&e.reallocate(v.byteLength+h),e.subData({data:v,offset:h})}},79366:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var i=n(64649),r=n(90031),o=n(23427),s=n(18757),a=n(48915);class l extends r.Z{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every((t=>t.isLoaded))}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(t){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo(t){let{info:e}=t;const{object:n}=e;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id?(e.object=n.__source.object,e.index=n.__source.index,e):e}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){return e&&e.length}getSubLayerClass(t,e){const{_subLayerProps:n}=this.props;return n&&n[t]&&n[t].type||e}getSubLayerRow(t,e,n){return t.__source={parent:this,object:e,index:n},t}getSubLayerAccessor(t){if("function"===typeof t){const e={index:-1,data:this.props.data,target:[]};return(n,i)=>n&&n.__source?(e.index=n.__source.index,t(n.__source.object,e)):t(n,i)}return t}getSubLayerProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;const{opacity:n,pickable:i,visible:r,parameters:o,getPolygonOffset:s,highlightedObjectIndex:l,autoHighlight:c,highlightColor:u,coordinateSystem:h,coordinateOrigin:d,wrapLongitude:f,positionFormat:A,modelMatrix:p,extensions:g,fetch:m,operation:y,_subLayerProps:v}=this.props,_={id:"",updateTriggers:{},opacity:n,pickable:i,visible:r,parameters:o,getPolygonOffset:s,highlightedObjectIndex:l,autoHighlight:c,highlightColor:u,coordinateSystem:h,coordinateOrigin:d,wrapLongitude:f,positionFormat:A,modelMatrix:p,extensions:g,fetch:m,operation:y},b=v&&t.id&&v[t.id],x=b&&b.updateTriggers,w=t.id||"sublayer";if(b){const e=this.props[a.Wb],n=t.type?t.type._propTypes:{};for(const t in b){const i=n[t]||e[t];i&&"accessor"===i.type&&(b[t]=this.getSubLayerAccessor(b[t]))}}Object.assign(_,t,b),_.id="".concat(this.props.id,"-").concat(w),_.updateTriggers={all:null===(e=this.props.updateTriggers)||void 0===e?void 0:e.all,...t.updateTriggers,...x};for(const a of g){const t=a.getSubLayerProps.call(this,a);t&&Object.assign(_,t,{updateTriggers:Object.assign(_.updateTriggers,t.updateTriggers)})}return _}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_postUpdate(t,e){let n=this.internalState.subLayers;const i=!n||this.needsUpdate();if(i){const t=this.renderLayers();n=(0,s.x)(t,Boolean),this.internalState.subLayers=n}(0,o.Z)("compositeLayer.renderLayers",this,i,n);for(const r of n)r.parent=this}}(0,i.Z)(l,"layerName","CompositeLayer")},18252:(t,e,n)=>{"use strict";n.d(e,{Df:()=>r,FP:()=>a,iI:()=>s,zG:()=>o});var i=n(21970);const r={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(r,"IDENTITY",{get:()=>(i.Z.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const o={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},s={common:0,meters:1,pixels:2},a={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}}},90031:(t,e,n)=>{"use strict";n.d(e,{Z:()=>at});var i=n(64649),r=n(18252),o=n(96684),s=n(41894),a=n(47410),l=n(99188);class c extends l.Z{get value(){return this._value}_onUpdate(){const{time:t,settings:{fromValue:e,toValue:n,duration:i,easing:r}}=this,o=r(t/i);this._value=(0,a.t7)(e,n,o)}}const u=1e-5;function h(t,e,n,i,r){const o=e-t;return(n-e)*r+-o*i+o+e}function d(t,e){if(Array.isArray(t)){let n=0;for(let i=0;i<t.length;i++){const r=t[i]-e[i];n+=r*r}return Math.sqrt(n)}return Math.abs(t-e)}class f extends l.Z{get value(){return this._currValue}_onUpdate(){const{fromValue:t,toValue:e,damping:n,stiffness:i}=this.settings,{_prevValue:r=t,_currValue:o=t}=this;let s=function(t,e,n,i,r){if(Array.isArray(n)){const o=[];for(let s=0;s<n.length;s++)o[s]=h(t[s],e[s],n[s],i,r);return o}return h(t,e,n,i,r)}(r,o,e,n,i);const a=d(s,e),l=d(s,o);a<u&&l<u&&(s=e,this.end()),this._prevValue=o,this._currValue=s}}var A=n(21970);const p={interpolation:c,spring:f};class g{constructor(t){this.transitions=new Map,this.timeline=t}get active(){return this.transitions.size>0}add(t,e,n,i){const{transitions:r}=this;if(r.has(t)){const n=r.get(t),{value:i=n.settings.fromValue}=n;e=i,this.remove(t)}if(!(i=(0,s.M0)(i)))return;const o=p[i.type];if(!o)return void A.Z.error("unsupported transition type '".concat(i.type,"'"))();const a=new o(this.timeline);a.start({...i,fromValue:e,toValue:n}),r.set(t,a)}remove(t){const{transitions:e}=this;e.has(t)&&(e.get(t).cancel(),e.delete(t))}update(){const t={};for(const[e,n]of this.transitions)n.update(),t[e]=n.value,n.inProgress||this.remove(e);return t}clear(){for(const t of this.transitions.keys())this.remove(t)}}var m=n(49473),y=n(48915);function v(t){if(null===(e=t)||"object"!==typeof e)throw new Error("count(): argument not an object");var e;if("function"===typeof t.count)return t.count();if(Number.isFinite(t.size))return t.size;if(Number.isFinite(t.length))return t.length;if(function(t){return null!==t&&"object"===typeof t&&t.constructor===Object}(t))return Object.keys(t).length;throw new Error("count(): argument not a container")}var _=n(23427),b=n(28007),x=n(12997),w=n(18188),C=n(46802),B=n(70487),E=n(52310),T=n(62220),S=n(99007),M=n(75818);const I=[0,0,0];function P(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=e.projectPosition(t);if(n&&e instanceof E.Z){const[n,r,o=0]=t,s=e.getDistanceScales([n,r]);i[2]=o*s.unitsPerMeter[2]}return i}function D(t,e){let{viewport:n,modelMatrix:i,coordinateSystem:o,coordinateOrigin:s,offsetMode:a}=e,[l,c,u=0]=t;switch(i&&([l,c,u]=T.fF([],[l,c,u,1],i)),o){case r.Df.LNGLAT:return P([l,c,u],n,a);case r.Df.LNGLAT_OFFSETS:return P([l+s[0],c+s[1],u+(s[2]||0)],n,a);case r.Df.METER_OFFSETS:return P((0,M.eG)(s,[l,c,u]),n,a);case r.Df.CARTESIAN:default:return n.isGeospatial?[l+s[0],c+s[1],u+s[2]]:n.projectPosition([l,c,u])}}function F(t,e){const{viewport:n,coordinateSystem:i,coordinateOrigin:o,modelMatrix:s,fromCoordinateSystem:a,fromCoordinateOrigin:l}=function(t){const{viewport:e,modelMatrix:n,coordinateOrigin:i}=t;let{coordinateSystem:o,fromCoordinateSystem:s,fromCoordinateOrigin:a}=t;return o===r.Df.DEFAULT&&(o=e.isGeospatial?r.Df.LNGLAT:r.Df.CARTESIAN),void 0===s&&(s=o),void 0===a&&(a=i),{viewport:e,coordinateSystem:o,coordinateOrigin:i,modelMatrix:n,fromCoordinateSystem:s,fromCoordinateOrigin:a}}(e),{autoOffset:c=!0}=e,{geospatialOrigin:u=I,shaderCoordinateOrigin:h=I,offsetMode:d=!1}=c?(0,B.v)(n,i,o):{},f=D(t,{viewport:n,modelMatrix:s,coordinateSystem:a,coordinateOrigin:l,offsetMode:d});if(d){const t=n.projectPosition(u||h);S.lu(f,f,t)}return f}var L=n(28321),O=n(73115),R=n(58300);const k={10241:9987,10240:9729,10242:33071,10243:33071},U={};var z=n(98949);const G={boolean:{validate:(t,e)=>!0,equal:(t,e,n)=>Boolean(t)===Boolean(e)},number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},color:{validate:(t,e)=>e.optional&&!t||j(t)&&(3===t.length||4===t.length),equal:(t,e,n)=>(0,z.v)(t,e,1)},accessor:{validate(t,e){const n=V(t);return"function"===n||n===V(e.value)},equal:(t,e,n)=>"function"===typeof e||(0,z.v)(t,e,1)},array:{validate:(t,e)=>e.optional&&!t||j(t),equal(t,e,n){const{compare:i}=n,r=Number.isInteger(i)?i:i?1:0;return i?(0,z.v)(t,e,r):t===e}},object:{equal(t,e,n){if(n.ignore)return!0;const{compare:i}=n,r=Number.isInteger(i)?i:i?1:0;return i?(0,z.v)(t,e,r):t===e}},function:{validate:(t,e)=>e.optional&&!t||"function"===typeof t,equal:(t,e,n)=>!n.compare&&!1!==n.ignore||t===e},data:{transform:(t,e,n)=>{const{dataTransform:i}=n.props;return i&&t?i(t):t}},image:{transform:(t,e,n)=>{const i=n.context;return i&&i.gl?function(t,e,n,i){if(n instanceof R.Z)return n;n.constructor&&"Object"!==n.constructor.name&&(n={data:n});let r=null;n.compressed&&(r={10241:n.data.length>1?9985:9729});const o=new R.Z(e,{...n,parameters:{...k,...r,...i}});return U[o.id]=t,o}(n.id,i.gl,t,{...e.parameters,...n.props.textureParameters}):null},release:(t,e,n)=>{var i,r;i=n.id,(r=t)&&r instanceof R.Z&&U[r.id]===i&&(r.delete(),delete U[r.id])}}};function N(t,e){switch(V(e)){case"object":return Z(t,e);case"array":return Z(t,{type:"array",value:e,compare:!1});case"boolean":return Z(t,{type:"boolean",value:e});case"number":return Z(t,{type:"number",value:e});case"function":return Z(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function Z(t,e){return"type"in e?{name:t,...G[e.type],...e}:"value"in e?{name:t,type:V(e.value),...e}:{name:t,type:"object",value:e}}function j(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function V(t){return j(t)?"array":null===t?"null":typeof t}const H="_mergedDefaultProps";function J(t,e){let n=H;if(e)for(const r of e){const t=r.constructor;t&&(n+=":".concat(t.extensionName||t.name))}const i=K(t,n);return i||(t[n]=function(t,e){const n=t.prototype;if(!n)return null;const i=Object.getPrototypeOf(t),r=J(i),o=K(t,"defaultProps")||{},s=function(t){const e={},n={},i={};for(const[r,o]of Object.entries(t)){const t=null===o||void 0===o?void 0:o.deprecatedFor;if(t)i[r]=Array.isArray(t)?t:[t];else{const t=N(r,o);e[r]=t,n[r]=t.value}}return{propTypes:e,defaultProps:n,deprecatedProps:i}}(o),a=Object.assign(Object.create(null),r,s.defaultProps),l=Object.assign(Object.create(null),null===r||void 0===r?void 0:r[y.Wb],s.propTypes),c=Object.assign(Object.create(null),null===r||void 0===r?void 0:r[y.E7],s.deprecatedProps);for(const u of e){const t=J(u.constructor);t&&(Object.assign(a,t),Object.assign(l,t[y.Wb]),Object.assign(c,t[y.E7]))}(function(t,e){const n=function(t){const e=t.componentName;e||A.Z.warn("".concat(t.name,".componentName not specified"))();return e||t.name}(e);Object.defineProperties(t,{id:{writable:!0,value:n}})})(a,t),function(t,e){const n={},i={};for(const r in e){const t=e[r],{name:o,value:s}=t;t.async&&(n[o]=s,i[o]=W(o))}t[y.lY]=n,t[y.fO]={},Object.defineProperties(t,i)}(a,l),function(t,e){for(const n in e)Object.defineProperty(t,n,{enumerable:!1,set(t){const i="".concat(this.id,": ").concat(n);for(const r of e[n])Q(this,r)||(this[r]=t);A.Z.deprecated(i,e[n].join("/"))()}})}(a,c),a[y.Wb]=l,a[y.E7]=c,0!==e.length||Q(t,"_propTypes")||(t._propTypes=l);return a}(t,e||[]))}function W(t){return{enumerable:!0,set(e){"string"===typeof e||e instanceof Promise||(0,O.D0)(e)?this[y.fO][t]=e:this[y.bN][t]=e},get(){if(this[y.bN]){if(t in this[y.bN]){return this[y.bN][t]||this[y.lY][t]}if(t in this[y.fO]){const e=this[y.fm]&&this[y.fm].internalState;if(e&&e.hasAsyncProp(t))return e.getAsyncProp(t)||this[y.lY][t]}}return this[y.lY][t]}}}function Q(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function K(t,e){return Q(t,e)&&t[e]}let q=0;class X{constructor(){(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"props",void 0),(0,i.Z)(this,"count",void 0);for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.props=function(t,e){let n;for(let o=e.length-1;o>=0;o--){const t=e[o];"extensions"in t&&(n=t.extensions)}const i=J(t.constructor,n),r=Object.create(i);r[y.fm]=t,r[y.fO]={},r[y.bN]={};for(let o=0;o<e.length;++o){const t=e[o];for(const e in t)r[e]=t[e]}return Object.freeze(r),r}(this,e),this.id=this.props.id,this.count=q++}clone(t){const{props:e}=this,n={};for(const i in e[y.lY])i in e[y.bN]?n[i]=e[y.bN][i]:i in e[y.fO]&&(n[i]=e[y.fO][i]);return new this.constructor({...e,...n,...t})}}(0,i.Z)(X,"componentName","Component"),(0,i.Z)(X,"defaultProps",{});const Y=Object.freeze({});class ${constructor(t){(0,i.Z)(this,"component",void 0),(0,i.Z)(this,"onAsyncPropUpdated",void 0),(0,i.Z)(this,"asyncProps",void 0),(0,i.Z)(this,"oldProps",void 0),(0,i.Z)(this,"oldAsyncProps",void 0),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=()=>{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(const t in this.asyncProps){const e=this.asyncProps[t];e&&e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||Y}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(t){return t in this.asyncProps}getAsyncProp(t){const e=this.asyncProps[t];return e&&e.resolvedValue}isAsyncPropLoading(t){if(t){const e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(const e in this.asyncProps)if(this.isAsyncPropLoading(e))return!0;return!1}reloadAsyncProp(t,e){this._watchPromise(t,Promise.resolve(e))}setAsyncProps(t){this.component=t[y.fm]||this.component;const e=t[y.bN]||{},n=t[y.fO]||t,i=t[y.lY]||{};for(const r in e){const t=e[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t),e[r]=this.getAsyncProp(r)}for(const r in n){const t=n[r];this._createAsyncPropData(r,i[r]),this._updateAsyncProp(r,t)}}_fetch(t,e){return null}_onResolve(t,e){}_onError(t,e){}_updateAsyncProp(t,e){this._didAsyncInputValueChange(t,e)&&("string"===typeof e&&(e=this._fetch(t,e)),e instanceof Promise?this._watchPromise(t,e):(0,O.D0)(e)?this._resolveAsyncIterable(t,e):this._setPropValue(t,e))}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(const t in this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}}_didAsyncInputValueChange(t,e){const n=this.asyncProps[t];return e!==n.resolvedValue&&e!==n.lastValue&&(n.lastValue=e,!0)}_setPropValue(t,e){this._freezeAsyncOldProps();const n=this.asyncProps[t];n&&(e=this._postProcessValue(n,e),n.resolvedValue=e,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount)}_setAsyncPropValue(t,e,n){const i=this.asyncProps[t];i&&n>=i.resolvedLoadCount&&void 0!==e&&(this._freezeAsyncOldProps(),i.resolvedValue=e,i.resolvedLoadCount=n,this.onAsyncPropUpdated(t,e))}_watchPromise(t,e){const n=this.asyncProps[t];if(n){n.pendingLoadCount++;const i=n.pendingLoadCount;e.then((e=>{this.component&&(e=this._postProcessValue(n,e),this._setAsyncPropValue(t,e,i),this._onResolve(t,e))})).catch((e=>{this._onError(t,e)}))}}async _resolveAsyncIterable(t,e){if("data"!==t)return void this._setPropValue(t,e);const n=this.asyncProps[t];if(!n)return;n.pendingLoadCount++;const i=n.pendingLoadCount;let r=[],o=0;for await(const s of e){if(!this.component)return;const{dataTransform:e}=this.component.props;r=e?e(s,r):r.concat(s),Object.defineProperty(r,"__diff",{enumerable:!1,value:[{startRow:o,endRow:r.length}]}),o=r.length,this._setAsyncPropValue(t,r,i)}this._onResolve(t,r)}_postProcessValue(t,e){const n=t.type;return n&&this.component&&(n.release&&n.release(t.resolvedValue,n,this.component),n.transform)?n.transform(e,n,this.component):e}_createAsyncPropData(t,e){if(!this.asyncProps[t]){const n=this.component&&this.component.props[y.Wb];this.asyncProps[t]={type:n&&n[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}class tt extends ${constructor(t){let{attributeManager:e,layer:n}=t;super(n),(0,i.Z)(this,"attributeManager",void 0),(0,i.Z)(this,"needsRedraw",void 0),(0,i.Z)(this,"needsUpdate",void 0),(0,i.Z)(this,"subLayers",void 0),(0,i.Z)(this,"usesPickingColorCache",void 0),(0,i.Z)(this,"hasPickingBuffer",void 0),(0,i.Z)(this,"changeFlags",void 0),(0,i.Z)(this,"viewport",void 0),(0,i.Z)(this,"uniformTransitions",void 0),(0,i.Z)(this,"propsInTransition",void 0),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(t,e){const n=this.layer,i=null===n||void 0===n?void 0:n.props.fetch;return i?i(e,{propName:t,layer:n}):super._fetch(t,e)}_onResolve(t,e){const n=this.layer;if(n){const i=n.props.onDataLoad;"data"===t&&i&&i(e,{propName:t,layer:n})}}_onError(t,e){const n=this.layer;n&&n.raiseError(e,"loading ".concat(t," of ").concat(this.layer))}}var et=n(49125);const nt=2**24-1,it=Object.freeze([]),rt=(0,w.Z)((t=>{let{oldViewport:e,viewport:n}=t;return e.equals(n)}));let ot=new Uint8ClampedArray(0);const st={data:{type:"data",value:it,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:t=>t&&t.__diff,optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:(t,e)=>{let{propName:n,layer:i,loaders:r,loadOptions:o,signal:s}=e;const{resourceManager:a}=i.context;var l;(o=o||i.getLoadOptions(),r=r||i.props.loaders,s)&&(o={...o,fetch:{...null===(l=o)||void 0===l?void 0:l.fetch,signal:s}});let c=a.contains(t);return c||o||(a.add({resourceId:t,data:(0,et.z)(t,r),persistent:!1}),c=!0),c?a.subscribe({resourceId:t,onChange:t=>{var e;return null===(e=i.internalState)||void 0===e?void 0:e.reloadAsyncProp(n,t)},consumerId:i.id,requestId:n}):(0,et.z)(t,r,o)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:r.Df.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:t=>{let{layerIndex:e}=t;return[0,100*-e]}},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class at extends X{constructor(){super(...arguments),(0,i.Z)(this,"internalState",null),(0,i.Z)(this,"lifecycle",y.dt.NO_STATE),(0,i.Z)(this,"context",void 0),(0,i.Z)(this,"state",void 0),(0,i.Z)(this,"parent",null)}static get componentName(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}get root(){let t=this;for(;t.parent;)t=t.parent;return t}toString(){const t=this.constructor.layerName||this.constructor.name;return"".concat(t,"({id: '").concat(this.props.id,"'})")}project(t){(0,x.Z)(this.internalState);const e=this.internalState.viewport||this.context.viewport,n=D(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,r,o]=(0,M.aW)(n,e.pixelProjectionMatrix);return 2===t.length?[i,r]:[i,r,o]}unproject(t){(0,x.Z)(this.internalState);return(this.internalState.viewport||this.context.viewport).unproject(t)}projectPosition(t,e){(0,x.Z)(this.internalState);return F(t,{viewport:this.internalState.viewport||this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...e})}get isComposite(){return!1}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return!!this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||this.state.model&&[this.state.model])||[]}setModuleParameters(t){for(const e of this.getModels())e.updateModuleSettings(t)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===r.Df.DEFAULT||t===r.Df.LNGLAT||t===r.Df.CARTESIAN}onHover(t,e){return this.props.onHover&&this.props.onHover(t,e)||!1}onClick(t,e){return this.props.onClick&&this.props.onClick(t,e)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e[0]=t+1&255,e[1]=t+1>>8&255,e[2]=t+1>>8>>8&255,e}decodePickingColor(t){(0,x.Z)(t instanceof Uint8Array);const[e,n,i]=t;return e+256*n+65536*i-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&void 0!==this.state.numInstances?this.state.numInstances:v(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){var t;return null===(t=this.getAttributeManager())||void 0===t?void 0:t.getBounds(["positions","instancePositions"])}getShaders(t){for(const e of this.props.extensions)t=(0,C.l)(t,e.getShaders.call(this,e));return t}shouldUpdateState(t){return t.changeFlags.propsOrDataChanged}updateState(t){const e=this.getAttributeManager(),{dataChanged:n}=t.changeFlags;if(n&&e)if(Array.isArray(n))for(const i of n)e.invalidateAll(i);else e.invalidateAll();if(e){const{props:n}=t,i=this.internalState.hasPickingBuffer,r=Number.isInteger(n.highlightedObjectIndex)||n.pickable||n.extensions.some((t=>t.getNeedsPickingBuffer.call(this,t)));if(i!==r){this.internalState.hasPickingBuffer=r;const{pickingColors:t,instancePickingColors:n}=e.attributes,i=t||n;i&&(r&&i.constant&&(i.constant=!1,e.invalidate(i.id)),i.value||r||(i.constant=!0,i.value=[0,0,0]))}}}finalizeState(t){for(const n of this.getModels())n.delete();const e=this.getAttributeManager();e&&e.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(t){for(const e of this.getModels())e.draw(t)}getPickingInfo(t){let{info:e,mode:n,sourceLayer:i}=t;const{index:r}=e;return r>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[r]),e}raiseError(t,e){var n,i,r,o;(e&&(t=new Error("".concat(e,": ").concat(t.message),{cause:t})),null!==(n=(i=this.props).onError)&&void 0!==n&&n.call(i,t))||(null===(r=this.context)||void 0===r||null===(o=r.onError)||void 0===o||o.call(r,t,this))}getNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(t)}needsUpdate(){return!!this.internalState&&(this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()))}hasUniformTransition(){var t;return(null===(t=this.internalState)||void 0===t?void 0:t.uniformTransitions.active)||!1}activateViewport(t){if(!this.internalState)return;const e=this.internalState.viewport;this.internalState.viewport=t,e&&rt({oldViewport:e,viewport:t})||(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";const e=this.getAttributeManager();e&&("all"===t?e.invalidateAll():e.invalidate(t))}updateAttributes(t){for(const e of this.getModels())this._setModelAttributes(e,t)}_updateAttributes(){const t=this.getAttributeManager();if(!t)return;const e=this.props,n=this.getNumInstances(),i=this.getStartIndices();t.update({data:e.data,numInstances:n,startIndices:i,props:e,transitions:e.transitions,buffers:e.data.attributes,context:this});const r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const e=t.update(),n=Object.create(this.props);for(const t in e)Object.defineProperty(n,t,{value:e[t]});return n}return this.props}calculateInstancePickingColors(t,e){let{numInstances:n}=e;if(t.constant)return;const i=Math.floor(ot.length/3);if(this.internalState.usesPickingColorCache=!0,i<n){n>nt&&A.Z.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),ot=L.Z.allocate(ot,n,{size:3,copy:!0,maxCount:Math.max(n,nt)});const t=Math.floor(ot.length/3),e=[];for(let n=i;n<t;n++)this.encodePickingColor(n,e),ot[3*n+0]=e[0],ot[3*n+1]=e[1],ot[3*n+2]=e[2]}t.value=ot.subarray(0,3*n)}_setModelAttributes(t,e){const n=this.getAttributeManager(),i=t.userData.excludeAttributes||{},r=n.getShaderAttributes(e,i);t.setAttributes(r)}disablePickingIndex(t){const e=this.props.data;if(!("attributes"in e))return void this._disablePickingIndex(t);const{pickingColors:n,instancePickingColors:i}=this.getAttributeManager().attributes,r=n||i,o=r&&e.attributes&&e.attributes[r.id];if(o&&o.value){const n=o.value,i=this.encodePickingColor(t);for(let t=0;t<e.length;t++){const e=r.getVertexOffset(t);n[e]===i[0]&&n[e+1]===i[1]&&n[e+2]===i[2]&&this._disablePickingIndex(t)}}else this._disablePickingIndex(t)}_disablePickingIndex(t){const{pickingColors:e,instancePickingColors:n}=this.getAttributeManager().attributes,i=e||n;if(!i)return;const r=i.getVertexOffset(t),o=i.getVertexOffset(t+1);i.buffer.subData({data:new Uint8Array(o-r),offset:r})}restorePickingColors(){const{pickingColors:t,instancePickingColors:e}=this.getAttributeManager().attributes,n=t||e;n&&(this.internalState.usesPickingColorCache&&n.value.buffer!==ot.buffer&&(n.value=ot.subarray(0,n.value.length)),n.updateSubBuffer({startOffset:0}))}_initialize(){(0,x.Z)(!this.internalState),(0,x.Z)(Number.isFinite(this.props.coordinateSystem)),(0,_.Z)("layer.initialize",this);const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new tt({attributeManager:t,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(A.Z.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),t)}),this.internalState.uniformTransitions=new g(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(const e of this.props.extensions)e.initializeState.call(this,this.context,e);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(t){(0,_.Z)("layer.matched",this,this===t);const{state:e,internalState:n}=t;this!==t&&(this.internalState=n,this.state=e,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){const t=this.needsUpdate();if((0,_.Z)("layer.update",this,t),!t)return;const e=this.props,n=this.context,i=this.internalState,r=n.viewport,o=this._updateUniformTransition();i.propsInTransition=o,n.viewport=i.viewport||r,this.props=o;try{const t=this._getUpdateParams(),e=this.getModels();if(n.gl)this.updateState(t);else try{this.updateState(t)}catch(s){}for(const n of this.props.extensions)n.updateState.call(this,t,n);const i=this.getModels()[0]!==e[0];this._postUpdate(t,i)}finally{n.viewport=r,this.props=e,this._clearChangeFlags(),i.needsUpdate=!1,i.resetOldProps()}}_finalize(){(0,_.Z)("layer.finalize",this),this.finalizeState(this.context);for(const t of this.props.extensions)t.finalizeState.call(this,this.context,t)}_drawLayer(t){let{moduleParameters:e=null,uniforms:n={},parameters:i={}}=t;this._updateAttributeTransition();const r=this.props,o=this.context;this.props=this.internalState.propsInTransition||r;const s=this.props.opacity;n.opacity=Math.pow(s,1/2.2);try{e&&this.setModuleParameters(e);const{getPolygonOffset:t}=this.props,r=t&&t(n)||[0,0];(0,b.dR)(o.gl,{polygonOffset:r}),(0,b.s8)(o.gl,i,(()=>{const t={moduleParameters:e,uniforms:n,parameters:i,context:o};for(const e of this.props.extensions)e.draw.call(this,t,e);this.draw(t)}))}finally{this.props=r}}getChangeFlags(){var t;return null===(t=this.internalState)||void 0===t?void 0:t.changeFlags}setChangeFlags(t){if(!this.internalState)return;const{changeFlags:e}=this.internalState;for(const i in t)if(t[i]){let n=!1;if("dataChanged"===i){const r=t[i],o=e[i];r&&Array.isArray(o)&&(e.dataChanged=Array.isArray(r)?o.concat(r):r,n=!0)}e[i]||(e[i]=t[i],n=!0),n&&(0,_.Z)("layer.changeFlag",this,i,t)}const n=Boolean(e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged);e.propsOrDataChanged=n,e.somethingChanged=n||e.viewportChanged||e.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(t,e){const n=(0,m.Yt)(t,e);if(n.updateTriggersChanged)for(const r in n.updateTriggersChanged)n.updateTriggersChanged[r]&&this.invalidateAttribute(r);if(n.transitionsChanged)for(const r in n.transitionsChanged){var i;this.internalState.uniformTransitions.add(r,e[r],t[r],null===(i=t.transitions)||void 0===i?void 0:i[r])}return this.setChangeFlags(n)}validateProps(){(0,m.eQ)(this.props)}updateAutoHighlight(t){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const e={pickingSelectedColor:t.picked?t.color:null},{highlightColor:n}=this.props;t.picked&&"function"===typeof n&&(e.pickingHighlightColor=n(t)),this.setModuleParameters(e),this.setNeedsRedraw()}_getAttributeManager(){const t=this.context;return new o.Z(t.gl,{id:this.props.id,stats:t.stats,timeline:t.timeline})}_postUpdate(t,e){const{props:n,oldProps:i}=t;this.setNeedsRedraw(),this._updateAttributes();const{model:r}=this.state;null===r||void 0===r||r.setInstanceCount(this.getNumInstances());const{autoHighlight:o,highlightedObjectIndex:s,highlightColor:a}=n;if(e||i.autoHighlight!==o||i.highlightedObjectIndex!==s||i.highlightColor!==a){const t={};o||(t.pickingSelectedColor=null),Array.isArray(a)&&(t.pickingHighlightColor=a),(e||s!==i.highlightedObjectIndex)&&(t.pickingSelectedColor=Number.isFinite(s)&&s>=0?this.encodePickingColor(s):null),this.setModuleParameters(t)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let e=!1;e=e||this.internalState.needsRedraw&&this.id;const n=this.getAttributeManager(),i=!!n&&n.getNeedsRedraw(t);if(e=e||i,e)for(const r of this.props.extensions)r.onNeedsRedraw.call(this,r);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags,e}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}(0,i.Z)(at,"defaultProps",st),(0,i.Z)(at,"layerName","Layer")},48915:(t,e,n)=>{"use strict";n.d(e,{E7:()=>s,Wb:()=>o,bN:()=>c,dt:()=>i,fO:()=>l,fm:()=>r,lY:()=>a});const i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},r=Symbol.for("component"),o=Symbol.for("propTypes"),s=Symbol.for("deprecatedProps"),a=Symbol.for("asyncPropDefaults"),l=Symbol.for("asyncPropOriginal"),c=Symbol.for("asyncPropResolved")},49473:(t,e,n)=>{"use strict";n.d(e,{Yt:()=>o,eQ:()=>r,tg:()=>a});var i=n(48915);function r(t){const e=t[i.Wb];for(const n in e){const i=e[n],{validate:r}=i;if(r&&!r(t[n],i))throw new Error("Invalid prop ".concat(n,": ").concat(t[n]))}}function o(t,e){const n=a({newProps:t,oldProps:e,propTypes:t[i.Wb],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),r=function(t,e){if(null===e)return"oldProps is null, initial diff";let n=!1;const{dataComparator:i,_dataDiff:r}=t;i?i(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied");n&&r&&(n=r(t.data,e.data)||n);return n}(t,e);let o=!1;return r||(o=function(t,e){if(null===e)return{all:!0};if("all"in t.updateTriggers){if(u(t,e,"all"))return{all:!0}}const n={};let i=!1;for(const r in t.updateTriggers)if("all"!==r){u(t,e,r)&&(n[r]=!0,i=!0)}return!!i&&n}(t,e)),{dataChanged:r,propsChanged:n,updateTriggersChanged:o,extensionsChanged:c(t,e),transitionsChanged:s(t,e)}}function s(t,e){if(!t.transitions)return!1;const n={},r=t[i.Wb];let o=!1;for(const i in t.transitions){const s=r[i],a=s&&s.type;("number"===a||"color"===a||"array"===a)&&l(t[i],e[i],s)&&(n[i]=!0,o=!0)}return!!o&&n}function a(t){let{newProps:e,oldProps:n,ignoreProps:i={},propTypes:r={},triggerName:o="props"}=t;if(n===e)return!1;if("object"!==typeof e||null===e)return"".concat(o," changed shallowly");if("object"!==typeof n||null===n)return"".concat(o," changed shallowly");for(const s of Object.keys(e))if(!(s in i)){if(!(s in n))return"".concat(o,".").concat(s," added");const t=l(e[s],n[s],r[s]);if(t)return"".concat(o,".").concat(s," ").concat(t)}for(const s of Object.keys(n))if(!(s in i)){if(!(s in e))return"".concat(o,".").concat(s," dropped");if(!Object.hasOwnProperty.call(e,s)){const t=l(e[s],n[s],r[s]);if(t)return"".concat(o,".").concat(s," ").concat(t)}}return!1}function l(t,e,n){let i=n&&n.equal;return i&&!i(t,e,n)?"changed deeply":i||(i=t&&e&&t.equals,!i||i.call(t,e))?i||e===t?null:"changed shallowly":"changed deeply"}function c(t,e){if(null===e)return!0;const n=e.extensions,{extensions:i}=t;if(i===n)return!1;if(!n||!i)return!0;if(i.length!==n.length)return!0;for(let r=0;r<i.length;r++)if(!i[r].equals(n[r]))return!0;return!1}function u(t,e,n){let i=t.updateTriggers[n];i=void 0===i||null===i?{}:i;let r=e.updateTriggers[n];r=void 0===r||null===r?{}:r;return a({oldProps:r,newProps:i,triggerName:n})}},2578:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const i={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};const r={inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n    // for picking depth values\n    picking_setPickingAttribute(position.z / position.w);\n  ","vs:DECKGL_FILTER_COLOR":"\n  picking_setPickingColor(geometry.pickingColor);\n  ","fs:#decl":"\nuniform bool picking_uAttribute;\n  ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n  // use highlight color if this fragment belongs to the selected object.\n  color = picking_filterHighlightColor(color);\n\n  // use picking color if rendering to picking FBO.\n  color = picking_filterPickingColor(color);\n    "}},...{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n  return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n  return\n    picking_uSelectedColorValid &&\n    !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n  if (picking_uActive) {\n    picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n    if (!picking_uAttribute) {\n      picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n    }\n  } else {\n    picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n  }\n}\n\nvoid picking_setPickingAttribute(float value) {\n  if (picking_uAttribute) {\n    picking_vRGBcolor_Avalid.r = value;\n  }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n  if (picking_uAttribute) {\n    picking_vRGBcolor_Avalid.rg = value;\n  }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n  if (picking_uAttribute) {\n    picking_vRGBcolor_Avalid.rgb = value;\n  }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n  if (picking_uActive) {\n    return color;\n  }\n  bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n  if (selected) {\n    float highLightAlpha = picking_uHighlightColor.a;\n    float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n    float highLightRatio = highLightAlpha / blendedAlpha;\n\n    vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n    return vec4(blendedRGB, blendedAlpha);\n  } else {\n    return color;\n  }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n  if (picking_uActive) {\n    if (picking_vRGBcolor_Avalid.a == 0.0) {\n      discard;\n    }\n    return picking_vRGBcolor_Avalid;\n  }\n  return color;\n}\nvec4 picking_filterColor(vec4 color) {\n  vec4 highightColor = picking_filterHighlightColor(color);\n  return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const e={};if(void 0!==t.pickingSelectedColor)if(t.pickingSelectedColor){const n=t.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=n}else e.picking_uSelectedColorValid=0;if(t.pickingHighlightColor){const n=Array.from(t.pickingHighlightColor,(t=>t/255));Number.isFinite(n[3])||(n[3]=1),e.picking_uHighlightColor=n}return void 0!==t.pickingActive&&(e.picking_uActive=Boolean(t.pickingActive),e.picking_uAttribute=Boolean(t.pickingAttribute)),e}}}},66199:(t,e,n)=>{"use strict";n.d(e,{Z:()=>f});const i={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n  float r, s, t, x;\n\n  if (a == 0.0) {\n    return 0.0;\n  }\n\n  x = -a * a;\n  s = a;\n  r = a;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_3;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_5;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_7;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_9;\n  s = s + t;\n\n  return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n  if (a == 0.0) {\n    sin_t = 0.0;\n    cos_t = 1.0;\n  }\n  sin_t = sin_taylor_fp32(a);\n  cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n    float sin_a;\n    float cos_a;\n\n    if (a == 0.0) {\n        return 0.0;\n    }\n    float z = floor(a / TWO_PI);\n    float r = a - TWO_PI * z;\n\n    float t;\n    float q = floor(r / PI_2 + 0.5);\n    int j = int(q);\n\n    if (j < -2 || j > 2) {\n        return 1.0 / 0.0;\n    }\n\n    t = r - PI_2 * q;\n\n    q = floor(t / PI_16 + 0.5);\n    int k = int(q);\n    int abs_k = int(abs(float(k)));\n\n    if (abs_k > 4) {\n        return 1.0 / 0.0;\n    } else {\n        t = t - PI_16 * q;\n    }\n\n    float u = 0.0;\n    float v = 0.0;\n\n    float sin_t, cos_t;\n    float s, c;\n    sincos_taylor_fp32(t, sin_t, cos_t);\n\n    if (k == 0) {\n        s = sin_t;\n        c = cos_t;\n    } else {\n        if (abs(float(abs_k) - 1.0) < 0.5) {\n            u = COS_TABLE_0;\n            v = SIN_TABLE_0;\n        } else if (abs(float(abs_k) - 2.0) < 0.5) {\n            u = COS_TABLE_1;\n            v = SIN_TABLE_1;\n        } else if (abs(float(abs_k) - 3.0) < 0.5) {\n            u = COS_TABLE_2;\n            v = SIN_TABLE_2;\n        } else if (abs(float(abs_k) - 4.0) < 0.5) {\n            u = COS_TABLE_3;\n            v = SIN_TABLE_3;\n        }\n        if (k > 0) {\n            s = u * sin_t + v * cos_t;\n            c = u * cos_t - v * sin_t;\n        } else {\n            s = u * sin_t - v * cos_t;\n            c = u * cos_t + v * sin_t;\n        }\n    }\n\n    if (j == 0) {\n        sin_a = s;\n        cos_a = c;\n    } else if (j == 1) {\n        sin_a = c;\n        cos_a = -s;\n    } else if (j == -1) {\n        sin_a = -c;\n        cos_a = s;\n    } else {\n        sin_a = -s;\n        cos_a = -c;\n    }\n    return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n  return tan_taylor_fp32(a);\n#else\n  return tan(a);\n#endif\n}\n",fs:null},r="#define SMOOTH_EDGE_RADIUS 0.5",o={name:"geometry",vs:"\n".concat(r,"\n\nstruct VertexGeometry {\n  vec4 position;\n  vec3 worldPosition;\n  vec3 worldPositionAlt;\n  vec3 normal;\n  vec2 uv;\n  vec3 pickingColor;\n} geometry = VertexGeometry(\n  vec4(0.0, 0.0, 1.0, 0.0),\n  vec3(0.0),\n  vec3(0.0),\n  vec3(0.0),\n  vec2(0.0),\n  vec3(0.0)\n);\n"),fs:"\n".concat(r,"\n\nstruct FragmentGeometry {\n  vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n  return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n")};var s=n(18252);const a=Object.keys(s.Df).map((t=>"const int COORDINATE_SYSTEM_".concat(t," = ").concat(s.Df[t],";"))).join(""),l=Object.keys(s.zG).map((t=>"const int PROJECTION_MODE_".concat(t," = ").concat(s.zG[t],";"))).join(""),c=Object.keys(s.iI).map((t=>"const int UNIT_".concat(t.toUpperCase()," = ").concat(s.iI[t],";"))).join(""),u="".concat(a,"\n").concat(l,"\n").concat(c,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\nuniform bool project_uPseudoMeters;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size_at_latitude(float lat) {\n  float y = clamp(lat, -89.9, 89.9);\n  return 1.0 / cos(radians(y));\n}\n\nfloat project_size() {\n  if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR &&\n    project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\n    project_uPseudoMeters == false) {\n    \n    if (geometry.position.w == 0.0) {\n      return project_size_at_latitude(geometry.worldPosition.y);\n    }\n  \n    float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\n    float y2 = y * y;\n    float y4 = y2 * y2;\n    float y6 = y4 * y2;\n    return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n  }\n  return 1.0;\n}\n\nfloat project_size_at_latitude(float meters, float lat) {\n  return meters * project_uCommonUnitsPerMeter.z * project_size_at_latitude(lat);\n}\nfloat project_size(float meters) {\n  return meters * project_uCommonUnitsPerMeter.z * project_size();\n}\n\nvec2 project_size(vec2 meters) {\n  return meters * project_uCommonUnitsPerMeter.xy * project_size();\n}\n\nvec3 project_size(vec3 meters) {\n  return meters * project_uCommonUnitsPerMeter * project_size();\n}\n\nvec4 project_size(vec4 meters) {\n  return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n  vec3 uz = normalize(up);\n  vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n  vec3 uy = cross(uz, ux);\n  return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n  if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n    transform = project_get_orientation_matrix(commonPosition);\n    return true;\n  }\n  return false;\n}\nvec3 project_normal(vec3 vector) {\n  vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n  vec3 n = normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n  mat3 rotation;\n  if (project_needs_rotation(geometry.position.xyz, rotation)) {\n    n = rotation * n;\n  }\n  return n;\n}\n\nvec4 project_offset_(vec4 offset) {\n  float dy = offset.y;\n  vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n  return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n  float x = lnglat.x;\n  if (project_uWrapLongitude) {\n    x = mod(x + 180., 360.0) - 180.;\n  }\n  float y = clamp(lnglat.y, -89.9, 89.9);\n  return vec2(\n    radians(x) + PI,\n    PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n  ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n  float lambda = radians(lnglatz.x);\n  float phi = radians(lnglatz.y);\n  float cosPhi = cos(phi);\n  float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n  return vec3(\n    sin(lambda) * cosPhi,\n    -cos(lambda) * cosPhi,\n    sin(phi)\n  ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n  vec4 position_world = project_uModelMatrix * position;\n  if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n    if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n      return vec4(\n        project_mercator_(position_world.xy),\n        project_size_at_latitude(position_world.z, position_world.y),\n        position_world.w\n      );\n    }\n    if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n      position_world.xyz += project_uCoordinateOrigin;\n    }\n  }\n  if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n    if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n      return vec4(\n        project_globe_(position_world.xyz),\n        position_world.w\n      );\n    }\n  }\n  if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n    if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n      if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n        return vec4(\n          project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n          project_size(position_world.z),\n          position_world.w\n        );\n      }\n    }\n  }\n  if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n    (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n    (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n     project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n    position_world.xyz -= project_uCoordinateOrigin;\n  }\n  return project_offset_(position_world) + project_offset_(project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n  return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n  vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n  return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n  vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n  return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n  vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n  return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n  return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n  return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n  vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n  return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n  return project_size(meters) * project_uScale;\n}\nfloat project_size_to_pixel(float size, int unit) {\n  if (unit == UNIT_METERS) return project_size_to_pixel(size);\n  if (unit == UNIT_COMMON) return size * project_uScale;\n  return size;\n}\nfloat project_pixel_size(float pixels) {\n  return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n  return pixels / project_uScale;\n}\n");var h=n(70487);const d={};const f={name:"project",dependencies:[i,o],vs:u,getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;return"viewport"in t?(0,h.C)(t):{}}}},70487:(t,e,n)=>{"use strict";n.d(e,{C:()=>A,v:()=>f});var i=n(83367),r=n(62220),o=n(18252),s=n(18188);const a=[0,0,0,0],l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=[0,0,0],h=[0,0,0],d=(0,s.Z)((function(t){let{viewport:e,devicePixelRatio:n,coordinateSystem:s,coordinateOrigin:h}=t;const{projectionCenter:d,viewProjectionMatrix:A,originCommon:p,cameraPosCommon:g,shaderCoordinateOrigin:m,geospatialOrigin:y}=function(t,e,n){const{viewMatrixUncentered:o,projectionMatrix:s}=t;let{viewMatrix:c,viewProjectionMatrix:u}=t,h=a,d=a,A=t.cameraPosition;const{geospatialOrigin:p,shaderCoordinateOrigin:g,offsetMode:m}=f(t,e,n);m&&(d=t.projectPosition(p||g),A=[A[0]-d[0],A[1]-d[1],A[2]-d[2]],d[3]=1,h=r.fF([],d,u),c=o||c,u=i.Jp([],s,c),u=i.Jp([],u,l));return{viewMatrix:c,viewProjectionMatrix:u,projectionCenter:h,originCommon:d,cameraPosCommon:A,shaderCoordinateOrigin:g,geospatialOrigin:p}}(e,s,h),v=e.getDistanceScales(),_=[e.width*n,e.height*n],b=r.fF([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,x={project_uCoordinateSystem:s,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:m,project_uCommonOrigin:p.slice(0,3),project_uCenter:d,project_uPseudoMeters:Boolean(e._pseudoMeters),project_uViewportSize:_,project_uDevicePixelRatio:n,project_uFocalDistance:b,project_uCommonUnitsPerMeter:v.unitsPerMeter,project_uCommonUnitsPerWorldUnit:v.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:u,project_uScale:e.scale,project_uWrapLongitude:!1,project_uViewProjectionMatrix:A,project_uModelMatrix:c,project_uCameraPosition:g};if(y){const t=e.getDistanceScales(y);switch(s){case o.Df.METER_OFFSETS:x.project_uCommonUnitsPerWorldUnit=t.unitsPerMeter,x.project_uCommonUnitsPerWorldUnit2=t.unitsPerMeter2;break;case o.Df.LNGLAT:case o.Df.LNGLAT_OFFSETS:e._pseudoMeters||(x.project_uCommonUnitsPerMeter=t.unitsPerMeter),x.project_uCommonUnitsPerWorldUnit=t.unitsPerDegree,x.project_uCommonUnitsPerWorldUnit2=t.unitsPerDegree2;break;case o.Df.CARTESIAN:x.project_uCommonUnitsPerWorldUnit=[1,1,t.unitsPerMeter[2]],x.project_uCommonUnitsPerWorldUnit2=[0,0,t.unitsPerMeter2[2]]}}return x}));function f(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;n.length<3&&(n=[n[0],n[1],0]);let i,r=n,s=!0;switch(i=e===o.Df.LNGLAT_OFFSETS||e===o.Df.METER_OFFSETS?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case o.zG.WEB_MERCATOR:e!==o.Df.LNGLAT&&e!==o.Df.CARTESIAN||(i=[0,0,0],s=!1);break;case o.zG.WEB_MERCATOR_AUTO_OFFSET:e===o.Df.LNGLAT?r=i:e===o.Df.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case o.zG.IDENTITY:r=t.position.map(Math.fround),r[2]=r[2]||0;break;case o.zG.GLOBE:s=!1,i=null;break;default:s=!1}return{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:s}}function A(t){let{viewport:e,devicePixelRatio:n=1,modelMatrix:i=null,coordinateSystem:r=o.Df.DEFAULT,coordinateOrigin:s=h,autoWrapLongitude:a=!1}=t;r===o.Df.DEFAULT&&(r=e.isGeospatial?o.Df.LNGLAT:o.Df.CARTESIAN);const l=d({viewport:e,devicePixelRatio:n,coordinateSystem:r,coordinateOrigin:s});return l.project_uWrapLongitude=a,l.project_uModelMatrix=i||c,l}},2123:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});const i={name:"project32",dependencies:[n(66199).Z],vs:"\nvec4 project_position_to_clipspace(\n  vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n  vec3 projectedPosition = project_position(position, position64Low);\n  mat3 rotation;\n  if (project_needs_rotation(projectedPosition, rotation)) {\n    // offset is specified as ENU\n    // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n    offset = rotation * offset;\n  }\n  commonPosition = vec4(projectedPosition + offset, 1.0);\n  return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n  vec3 position, vec3 position64Low, vec3 offset\n) {\n  vec4 commonPosition;\n  return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"}},99188:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var i=n(64649);class r{constructor(t){(0,i.Z)(this,"_inProgress",void 0),(0,i.Z)(this,"_handle",void 0),(0,i.Z)(this,"_timeline",void 0),(0,i.Z)(this,"time",void 0),(0,i.Z)(this,"settings",void 0),this._inProgress=!1,this._handle=null,this._timeline=t,this.time=0,this.settings={duration:0}}get inProgress(){return this._inProgress}start(t){var e,n;this.cancel(),this.settings=t,this._inProgress=!0,null===(e=(n=this.settings).onStart)||void 0===e||e.call(n,this)}end(){var t,e;this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,null===(t=(e=this.settings).onEnd)||void 0===t||t.call(e,this))}cancel(){var t,e;this._inProgress&&(null===(t=(e=this.settings).onInterrupt)||void 0===t||t.call(e,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){var t,e;if(!this._inProgress)return!1;if(null===this._handle){const{_timeline:t,settings:e}=this;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),null===(t=(e=this.settings).onUpdate)||void 0===t||t.call(e,this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}},12997:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}n.d(e,{Z:()=>i})},98949:(t,e,n)=>{"use strict";function i(t,e,n){if(t===e)return!0;if(!n||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!i(t[r],e[r],n-1))return!1;return!0}if(Array.isArray(e))return!1;if("object"===typeof t&&"object"===typeof e){const r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(const s of r){if(!e.hasOwnProperty(s))return!1;if(!i(t[s],e[s],n-1))return!1}return!0}return!1}n.d(e,{v:()=>i})},18757:(t,e,n)=>{"use strict";function i(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0;return Array.isArray(t)?r(t,e,[]):e(t)?[t]:[]}function r(t,e,n){let i=-1;for(;++i<t.length;){const o=t[i];Array.isArray(o)?r(o,e,n):e(o)&&n.push(o)}return n}function o(t){let{target:e,source:n,start:i=0,count:r=1}=t;const o=n.length,s=r*o;let a=0;for(let l=i;a<o;a++)e[l++]=n[a];for(;a<s;)a<s-a?(e.copyWithin(i+a,i,i+a),a*=2):(e.copyWithin(i+a,i,i+s-a),a=s);return e}n.d(e,{k:()=>o,x:()=>i})},73115:(t,e,n)=>{"use strict";n.d(e,{D0:()=>s,jB:()=>o,jr:()=>a});const i=[],r=[];function o(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=i;const s={index:-1,data:t,target:[]};return t?"function"===typeof t[Symbol.iterator]?o=t:t.length>0&&(r.length=t.length,o=r):o=i,(e>0||Number.isFinite(n))&&(o=(Array.isArray(o)?o:Array.from(o)).slice(e,n),s.index=e-1),{iterable:o,objectInfo:s}}function s(t){return t&&t[Symbol.asyncIterator]}function a(t,e){const{size:n,stride:i,offset:r,startIndices:o,nested:s}=e,a=t.BYTES_PER_ELEMENT,l=i?i/a:n,c=r?r/a:0,u=Math.floor((t.length-c)/l);return(e,i)=>{let{index:r,target:a}=i;if(!o){const e=r*l+c;for(let i=0;i<n;i++)a[i]=t[e+i];return a}const h=o[r],d=o[r+1]||u;let f;if(s){f=new Array(d-h);for(let e=h;e<d;e++){const i=e*l+c;a=new Array(n);for(let e=0;e<n;e++)a[e]=t[i+e];f[e-h]=a}}else if(l===n)f=t.subarray(h*n+c,d*n+c);else{f=new t.constructor((d-h)*n);let e=0;for(let i=h;i<d;i++){const r=i*l+c;for(let i=0;i<n;i++)f[e++]=t[r+i]}}return f}}},21970:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});const i=new(n(87294).Z)({id:"deck"})},64441:(t,e,n)=>{"use strict";n.d(e,{Du:()=>a,Ks:()=>u,TK:()=>d,Xt:()=>s,bS:()=>o,cc:()=>f});var i=n(28321),r=n(431);function o(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(t){return[t[12],t[13],t[14]]}function a(t){return{left:c(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:c(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:c(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:c(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:c(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:c(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const l=new r.Z;function c(t,e,n,i){l.set(t,e,n);const o=l.len();return{distance:i/o,normal:new r.Z(-t/o,-e/o,-n/o)}}function u(t){return t-Math.fround(t)}let h;function d(t,e){const{size:n=1,startIndex:r=0}=e,o=void 0!==e.endIndex?e.endIndex:t.length,s=(o-r)/n;h=i.Z.allocate(h,s,{type:Float32Array,size:2*n});let a=r,l=0;for(;a<o;){for(let e=0;e<n;e++){const i=t[a++];h[l+e]=i,h[l+e+n]=u(i)}l+=2*n}return h.subarray(0,s*n*2)}function f(t){let e=null,n=!1;for(const i of t)i&&(e?(n||(e=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],n=!0),e[0][0]=Math.min(e[0][0],i[0][0]),e[0][1]=Math.min(e[0][1],i[0][1]),e[1][0]=Math.max(e[1][0],i[1][0]),e[1][1]=Math.max(e[1][1],i[1][1])):e=i);return e}},18188:(t,e,n)=>{"use strict";function i(t,e){if(t===e)return!0;if(Array.isArray(t)){const n=t.length;if(!e||e.length!==n)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}return!1}function r(t){let e,n={};return r=>{for(const o in r)if(!i(r[o],n[o])){e=t(r),n=r;break}return e}}n.d(e,{Z:()=>r})},46802:(t,e,n)=>{"use strict";function i(t,e){if(!e)return t;const n={...t,...e};if("defines"in e&&(n.defines={...t.defines,...e.defines}),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some((t=>"project64"===t.name)))){const t=n.modules.findIndex((t=>"project32"===t.name));t>=0&&n.modules.splice(t,1)}if("inject"in e)if(t.inject){const i={...t.inject};for(const t in e.inject)i[t]=(i[t]||"")+e.inject[t];n.inject=i}else n.inject=e.inject;return n}n.d(e,{l:()=>i})},55678:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var i=n(64649),r=n(73115),o=n(28321),s=n(12997),a=n(33839);class l{constructor(t){(0,i.Z)(this,"opts",void 0),(0,i.Z)(this,"typedArrayManager",void 0),(0,i.Z)(this,"indexStarts",[0]),(0,i.Z)(this,"vertexStarts",[0]),(0,i.Z)(this,"vertexCount",0),(0,i.Z)(this,"instanceCount",0),(0,i.Z)(this,"attributes",void 0),(0,i.Z)(this,"_attributeDefs",void 0),(0,i.Z)(this,"data",void 0),(0,i.Z)(this,"getGeometry",void 0),(0,i.Z)(this,"geometryBuffer",void 0),(0,i.Z)(this,"buffers",void 0),(0,i.Z)(this,"positionSize",void 0),(0,i.Z)(this,"normalize",void 0);const{attributes:e={}}=t;this.typedArrayManager=o.Z,this.attributes={},this._attributeDefs=e,this.opts=t,this.updateGeometry(t)}updateGeometry(t){Object.assign(this.opts,t);const{data:e,buffers:n={},getGeometry:i,geometryBuffer:r,positionFormat:o,dataChanged:a,normalize:l=!0}=this.opts;if(this.data=e,this.getGeometry=i,this.positionSize=r&&r.size||("XY"===o?2:3),this.buffers=n,this.normalize=l,r&&((0,s.Z)(e.startIndices),this.getGeometry=this.getGeometryFromBuffer(r),l||(n.positions=r)),this.geometryBuffer=n.positions,Array.isArray(a))for(const s of a)this._rebuildGeometry(s);else this._rebuildGeometry()}updatePartialGeometry(t){let{startRow:e,endRow:n}=t;this._rebuildGeometry({startRow:e,endRow:n})}getGeometryFromBuffer(t){const e=t.value||t;return ArrayBuffer.isView(e)?(0,r.jr)(e,{size:this.positionSize,offset:t.offset,stride:t.stride,startIndices:this.data.startIndices}):null}_allocate(t,e){const{attributes:n,buffers:i,_attributeDefs:r,typedArrayManager:o}=this;for(const s in r)if(s in i)o.release(n[s]),n[s]=null;else{const i=r[s];i.copy=e,n[s]=o.allocate(n[s],t,i)}}_forEachGeometry(t,e,n){const{data:i,getGeometry:o}=this,{iterable:s,objectInfo:a}=(0,r.jB)(i,e,n);for(const r of s){a.index++;t(o?o(r,a):null,a.index)}}_rebuildGeometry(t){if(!this.data)return;let{indexStarts:e,vertexStarts:n,instanceCount:i}=this;const{data:r,geometryBuffer:o}=this,{startRow:s=0,endRow:l=1/0}=t||{},c={};if(t||(e=[0],n=[0]),this.normalize||!o)this._forEachGeometry(((t,e)=>{const i=t&&this.normalizeGeometry(t);c[e]=i,n[e+1]=n[e]+(i?this.getGeometrySize(i):0)}),s,l),i=n[n.length-1];else if(n=r.startIndices,i=n[r.length]||0,ArrayBuffer.isView(o))i=i||o.length/this.positionSize;else if(o instanceof a.Z){const t=o.accessor.stride||4*this.positionSize;i=i||o.byteLength/t}else if(o.buffer){const t=o.stride||4*this.positionSize;i=i||o.buffer.byteLength/t}else if(o.value){const t=o.value,e=o.stride/t.BYTES_PER_ELEMENT||this.positionSize;i=i||t.length/e}this._allocate(i,Boolean(t)),this.indexStarts=e,this.vertexStarts=n,this.instanceCount=i;const u={};this._forEachGeometry(((t,r)=>{const o=c[r]||t;u.vertexStart=n[r],u.indexStart=e[r];const s=r<n.length-1?n[r+1]:i;u.geometrySize=s-n[r],u.geometryIndex=r,this.updateGeometryAttributes(o,u)}),s,l),this.vertexCount=e[e.length-1]}}},28321:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var i=n(64649);const r=new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.Z)(this,"_pool",[]),(0,i.Z)(this,"opts",{overAlloc:2,poolSize:100}),this.setOptions(t)}setOptions(t){Object.assign(this.opts,t)}allocate(t,e,n){let{size:i=1,type:r,padding:o=0,copy:s=!1,initialize:a=!1,maxCount:l}=n;const c=r||t&&t.constructor||Float32Array,u=e*i+o;if(ArrayBuffer.isView(t)){if(u<=t.length)return t;if(u*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new c(t.buffer,0,u)}let h=1/0;l&&(h=l*i+o);const d=this._allocate(c,u,a,h);return t&&s?d.set(t):a||d.fill(0,0,4),this._release(t),d}release(t){this._release(t)}_allocate(t,e,n,i){let r=Math.max(Math.ceil(e*this.opts.overAlloc),1);r>i&&(r=i);const o=this._pool,s=t.BYTES_PER_ELEMENT*r,a=o.findIndex((t=>t.byteLength>=s));if(a>=0){const e=new t(o.splice(a,1)[0],0,r);return n&&e.fill(0),e}return new t(r)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:n}=t,{byteLength:i}=n,r=e.findIndex((t=>t.byteLength>=i));r<0?e.push(n):(r>0||e.length<this.opts.poolSize)&&e.splice(r,0,n),e.length>this.opts.poolSize&&e.shift()}}},83427:(t,e,n)=>{"use strict";n.d(e,{Z:()=>g});var i=n(64649),r=n(21970),o=n(64441),s=n(12987),a=n(47410),l=n(431),c=n(83367),u=n(75818),h=n(18252);const d=Math.PI/180,f=(0,o.bS)(),A=[0,0,0],p={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};class g{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"x",void 0),(0,i.Z)(this,"y",void 0),(0,i.Z)(this,"width",void 0),(0,i.Z)(this,"height",void 0),(0,i.Z)(this,"padding",void 0),(0,i.Z)(this,"isGeospatial",void 0),(0,i.Z)(this,"zoom",void 0),(0,i.Z)(this,"focalDistance",void 0),(0,i.Z)(this,"position",void 0),(0,i.Z)(this,"modelMatrix",void 0),(0,i.Z)(this,"distanceScales",void 0),(0,i.Z)(this,"scale",void 0),(0,i.Z)(this,"center",void 0),(0,i.Z)(this,"cameraPosition",void 0),(0,i.Z)(this,"projectionMatrix",void 0),(0,i.Z)(this,"viewMatrix",void 0),(0,i.Z)(this,"viewMatrixUncentered",void 0),(0,i.Z)(this,"viewMatrixInverse",void 0),(0,i.Z)(this,"viewProjectionMatrix",void 0),(0,i.Z)(this,"pixelProjectionMatrix",void 0),(0,i.Z)(this,"pixelUnprojectionMatrix",void 0),(0,i.Z)(this,"resolution",void 0),(0,i.Z)(this,"_frustumPlanes",{}),this.id=t.id||this.constructor.displayName||"viewport",this.x=t.x||0,this.y=t.y||0,this.width=t.width||1,this.height=t.height||1,this.zoom=t.zoom||0,this.padding=t.padding,this.distanceScales=t.distanceScales||p,this.focalDistance=t.focalDistance||1,this.position=t.position||A,this.modelMatrix=t.modelMatrix||null;const{longitude:e,latitude:n}=t;this.isGeospatial=Number.isFinite(n)&&Number.isFinite(e),this._initProps(t),this._initMatrices(t),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get subViewports(){return null}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?h.zG.WEB_MERCATOR:h.zG.WEB_MERCATOR_AUTO_OFFSET:h.zG.IDENTITY}equals(t){return t instanceof g&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&(0,a.fS)(t.projectionMatrix,this.projectionMatrix)&&(0,a.fS)(t.viewMatrix,this.viewMatrix))}project(t){let{topLeft:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.projectPosition(t),i=(0,u.aW)(n,this.pixelProjectionMatrix),[r,o]=i,s=e?o:this.height-o;return 2===t.length?[r,s]:[r,s,i[2]]}unproject(t){let{topLeft:e=!0,targetZ:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[i,r,o]=t,s=e?r:this.height-r,a=n&&n*this.distanceScales.unitsPerMeter[2],l=(0,u.CT)([i,s,o],this.pixelUnprojectionMatrix,a),[c,h,d]=this.unprojectPosition(l);return Number.isFinite(o)?[c,h,d]:Number.isFinite(n)?[c,h,n]:[c,h]}projectPosition(t){const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){if(this.isGeospatial){const e=(0,u.w5)(t);return e[1]=(0,a.uZ)(e[1],-318,830),e}return t}unprojectFlat(t){return this.isGeospatial?(0,u.es)(t):t}getBounds(){const t={targetZ:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).z||0},e=this.unproject([0,0],t),n=this.unproject([this.width,0],t),i=this.unproject([0,this.height],t),r=this.unproject([this.width,this.height],t);return[Math.min(e[0],n[0],i[0],r[0]),Math.min(e[1],n[1],i[1],r[1]),Math.max(e[0],n[0],i[0],r[0]),Math.max(e[1],n[1],i[1],r[1])]}getDistanceScales(t){return t?(0,u.ro)({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel(t){let{x:e,y:n,width:i=1,height:r=1}=t;return e<this.x+this.width&&this.x<e+i&&n<this.y+this.height&&this.y<n+r}getFrustumPlanes(){return this._frustumPlanes.near||Object.assign(this._frustumPlanes,(0,o.Du)(this.viewProjectionMatrix)),this._frustumPlanes}panByPosition(t,e){return null}_initProps(t){const e=t.longitude,n=t.latitude;this.isGeospatial&&(Number.isFinite(t.zoom)||(this.zoom=(0,u.Bf)({latitude:n})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||(0,u.ro)({latitude:n,longitude:e}));const i=Math.pow(2,this.zoom);this.scale=i;const{position:r,modelMatrix:o}=t;let a=A;if(r&&(a=o?new s.Z(o).transformAsVector(r,[]):r),this.isGeospatial){const t=this.projectPosition([e,n,0]);this.center=new l.Z(a).scale(this.distanceScales.unitsPerMeter).add(t)}else this.center=this.projectPosition(a)}_initMatrices(t){const{viewMatrix:e=f,projectionMatrix:n=null,orthographic:i=!1,fovyRadians:u,fovy:h=75,near:A=.1,far:p=1e3,padding:g=null,focalDistance:m=1}=t;this.viewMatrixUncentered=e,this.viewMatrix=(new s.Z).multiplyRight(e).translate(new l.Z(this.center).negate()),this.projectionMatrix=n||function(t){let{width:e,height:n,orthographic:i,fovyRadians:r,focalDistance:o,padding:l,near:c,far:u}=t;const h=e/n,d=i?(new s.Z).orthographic({fovy:r,aspect:h,focalDistance:o,near:c,far:u}):(new s.Z).perspective({fovy:r,aspect:h,near:c,far:u});if(l){const{left:t=0,right:i=0,top:r=0,bottom:o=0}=l,s=(0,a.uZ)((t+e-i)/2,0,e)-e/2,c=(0,a.uZ)((r+n-o)/2,0,n)-n/2;d[8]-=2*s/e,d[9]+=2*c/n}return d}({width:this.width,height:this.height,orthographic:i,fovyRadians:u||h*d,focalDistance:m,padding:g,near:A,far:p});const y=(0,o.bS)();c.Jp(y,y,this.projectionMatrix),c.Jp(y,y,this.viewMatrix),this.viewProjectionMatrix=y,this.viewMatrixInverse=c.U_([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=(0,o.Xt)(this.viewMatrixInverse);const v=(0,o.bS)(),_=(0,o.bS)();c.bA(v,v,[this.width/2,-this.height/2,1]),c.Iu(v,v,[1,-1,0]),c.Jp(_,v,this.viewProjectionMatrix),this.pixelProjectionMatrix=_,this.pixelUnprojectionMatrix=c.U_((0,o.bS)(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||r.Z.warn("Pixel project matrix not invertible")()}}(0,i.Z)(g,"displayName","Viewport")},52310:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var i=n(64649),r=n(83427),o=n(75818),s=n(77548),a=n(47410),l=n(12987);class c extends r.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{latitude:e=0,longitude:n=0,zoom:r=0,pitch:s=0,bearing:c=0,nearZMultiplier:u=.1,farZMultiplier:h=1.01,nearZ:d,farZ:f,orthographic:A=!1,projectionMatrix:p,repeat:g=!1,worldOffset:m=0,position:y,padding:v,legacyMeterSizes:_=!1}=t;let{width:b,height:x,altitude:w=1.5}=t;const C=Math.pow(2,r);let B;b=b||1,x=x||1;let E=null;if(p)w=p[5]/2,B=(0,o.Lu)(w);else{let n;if(t.fovy?(B=t.fovy,w=(0,o.sj)(B)):B=(0,o.Lu)(w),v){const{top:t=0,bottom:e=0}=v;n=[0,(0,a.uZ)((t+x-e)/2,0,x)-x/2]}E=(0,o.wl)({width:b,height:x,scale:C,center:y&&[0,0,y[2]*(0,o.NC)(e)],offset:n,pitch:s,fovy:B,nearZMultiplier:u,farZMultiplier:h}),Number.isFinite(d)&&(E.near=d),Number.isFinite(f)&&(E.far=f)}let T=(0,o.lf)({height:x,pitch:s,bearing:c,scale:C,altitude:w});if(m){T=(new l.Z).translate([512*m,0,0]).multiplyLeft(T)}super({...t,width:b,height:x,viewMatrix:T,longitude:n,latitude:e,zoom:r,...E,fovy:B,focalDistance:w}),(0,i.Z)(this,"longitude",void 0),(0,i.Z)(this,"latitude",void 0),(0,i.Z)(this,"pitch",void 0),(0,i.Z)(this,"bearing",void 0),(0,i.Z)(this,"altitude",void 0),(0,i.Z)(this,"fovy",void 0),(0,i.Z)(this,"orthographic",void 0),(0,i.Z)(this,"_subViewports",void 0),(0,i.Z)(this,"_pseudoMeters",void 0),this.latitude=e,this.longitude=n,this.zoom=r,this.pitch=s,this.bearing=c,this.altitude=w,this.fovy=B,this.orthographic=A,this._subViewports=g?[]:null,this._pseudoMeters=_,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),e=Math.floor((t[0]+180)/360),n=Math.ceil((t[2]-180)/360);for(let i=e;i<=n;i++){const t=i?new c({...this,worldOffset:i}):this;this._subViewports.push(t)}}return this._subViewports}projectPosition(t){if(this._pseudoMeters)return super.projectPosition(t);const[e,n]=this.projectFlat(t);return[e,n,(t[2]||0)*(0,o.NC)(t[1])]}unprojectPosition(t){if(this._pseudoMeters)return super.unprojectPosition(t);const[e,n]=this.unprojectFlat(t);return[e,n,(t[2]||0)/(0,o.NC)(n)]}addMetersToLngLat(t,e){return(0,o.eG)(t,e)}panByPosition(t,e){const n=(0,o.CT)(e,this.pixelUnprojectionMatrix),i=this.projectFlat(t),r=s.IH([],i,s.tk([],n)),a=s.IH([],this.center,r),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=(0,o.zX)(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{width:n,height:i}=this,{longitude:r,latitude:s,zoom:a}=(0,o.Xg)({width:n,height:i,bounds:t,...e});return new c({width:n,height:i,longitude:r,latitude:s,zoom:a})}}(0,i.Z)(c,"displayName","WebMercatorViewport")},75751:(t,e,n)=>{"use strict";n.d(e,{D0:()=>l,Ew:()=>c,Kn:()=>o,Lj:()=>u,Os:()=>d,Ss:()=>s,TW:()=>a,zH:()=>h});const i=t=>"boolean"===typeof t,r=t=>"function"===typeof t,o=t=>null!==t&&"object"===typeof t,s=t=>o(t)&&t.constructor==={}.constructor,a=t=>t&&"function"===typeof t[Symbol.iterator],l=t=>t&&"function"===typeof t[Symbol.asyncIterator],c=t=>"undefined"!==typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,u=t=>"undefined"!==typeof Blob&&t instanceof Blob,h=t=>t&&"object"===typeof t&&t.isBuffer,d=t=>(t=>"undefined"!==typeof ReadableStream&&t instanceof ReadableStream||o(t)&&r(t.tee)&&r(t.cancel)&&r(t.getReader))(t)||(t=>o(t)&&r(t.read)&&r(t.pipe)&&i(t.readable))(t)},49125:(t,e,n)=>{"use strict";n.d(e,{z:()=>ut});var i=n(75751),r=n(56742);let o="";const s={};const a=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,l=/^([-\w.]+\/[-\w.+]+)/;function c(t){const e=a.exec(t);return e?e[1]:""}const u=/\?.*/;function h(t){return t.replace(u,"")}function d(t){if((0,i.Ew)(t)){return t.url}if((0,i.Lj)(t)){return t.name||""}return"string"===typeof t?t:""}function f(t){if((0,i.Ew)(t)){const e=t,n=e.headers.get("content-type")||"",i=h(e.url);return function(t){const e=l.exec(t);return e?e[1]:t}(n)||c(i)}if((0,i.Lj)(t)){return t.type||""}return"string"===typeof t?c(t):""}async function A(t){if((0,i.Ew)(t))return t;const e={},n=function(t){if((0,i.Ew)(t))return t.headers["content-length"]||-1;if((0,i.Lj)(t))return t.size;return"string"===typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}(t);n>=0&&(e["content-length"]=String(n));const r=d(t),o=f(t);o&&(e["content-type"]=o);const s=await async function(t){const e=5;if("string"===typeof t)return"data:,".concat(t.slice(0,e));if(t instanceof Blob){const e=t.slice(0,5);return await new Promise((t=>{const n=new FileReader;n.onload=e=>{var n;return t(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.result)},n.readAsDataURL(e)}))}if(t instanceof ArrayBuffer){const n=function(t){let e="";const n=new Uint8Array(t);for(let i=0;i<n.byteLength;i++)e+=String.fromCharCode(n[i]);return btoa(e)}(t.slice(0,e));return"data:base64,".concat(n)}return null}(t);s&&(e["x-first-bytes"]=s),"string"===typeof t&&(t=(new TextEncoder).encode(t));const a=new Response(t,{headers:e});return Object.defineProperty(a,"url",{value:r}),a}async function p(t,e){if("string"===typeof t){t=function(t){for(const e in s)if(t.startsWith(e)){const n=s[e];t=t.replace(e,n)}return t.startsWith("http://")||t.startsWith("https://")||(t="".concat(o).concat(t)),t}(t);let n=e;return null!==e&&void 0!==e&&e.fetch&&"function"!==typeof(null===e||void 0===e?void 0:e.fetch)&&(n=e.fetch),await fetch(t,n)}return await A(t)}var g=n(30136);function m(t,e){const n=(0,g.pm)(),r=t||n;return"function"===typeof r.fetch?r.fetch:(0,i.Kn)(r.fetch)?t=>p(t,r):null!==e&&void 0!==e&&e.fetch?null===e||void 0===e?void 0:e.fetch:p}function y(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const v="3.4.15";"undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof n.g&&n.g,"undefined"!==typeof document&&document;const _="object"!==typeof process||"[object process]"!==String(process)||process.browser,b="undefined"!==typeof window&&"undefined"!==typeof window.orientation,x="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);x&&parseFloat(x[1]);var w=n(64649);class C{terminate(){}}function B(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const E=new Map;function T(t){B(t.source&&!t.url||!t.source&&t.url);let e=E.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return S((e=t,"try {\n  importScripts('".concat(e,"');\n} catch (error) {\n  console.error(error);\n  throw error;\n}")));var e}(t.url),E.set(t.url,e)),t.source&&(e=S(t.source),E.set(t.source,e))),B(e),e}function S(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function M(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;const i=n||new Set;if(t){if(I(t))i.add(t);else if(I(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===typeof t)for(const r in t)M(t[r],e,i)}else;return void 0===n?Array.from(i):[]}function I(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!==typeof MessagePort&&t instanceof MessagePort||("undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}const P=()=>{};class D{static isSupported(){return"undefined"!==typeof Worker&&_||"undefined"!==typeof C&&!_}constructor(t){(0,w.Z)(this,"name",void 0),(0,w.Z)(this,"source",void 0),(0,w.Z)(this,"url",void 0),(0,w.Z)(this,"terminated",!1),(0,w.Z)(this,"worker",void 0),(0,w.Z)(this,"onMessage",void 0),(0,w.Z)(this,"onError",void 0),(0,w.Z)(this,"_loadableURL","");const{name:e,source:n,url:i}=t;B(n||i),this.name=e,this.source=n,this.url=i,this.onMessage=P,this.onError=t=>console.log(t),this.worker=_?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=P,this.onError=P,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||M(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+="worker ".concat(this.name," from ").concat(this.url,". "),t.message&&(e+="".concat(t.message," in ")),t.lineno&&(e+=":".concat(t.lineno,":").concat(t.colno)),new Error(e)}_createBrowserWorker(){this._loadableURL=T({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}_createNodeWorker(){let t;if(this.url){const e=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);t=new C(e,{eval:!1})}else{if(!this.source)throw new Error("no worker");t=new C(this.source,{eval:!0})}return t.on("message",(t=>{this.onMessage(t)})),t.on("error",(t=>{this.onError(t)})),t.on("exit",(t=>{})),t}}class F{constructor(t,e){(0,w.Z)(this,"name",void 0),(0,w.Z)(this,"workerThread",void 0),(0,w.Z)(this,"isRunning",!0),(0,w.Z)(this,"result",void 0),(0,w.Z)(this,"_resolve",(()=>{})),(0,w.Z)(this,"_reject",(()=>{})),this.name=t,this.workerThread=e,this.result=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){B(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){B(this.isRunning),this.isRunning=!1,this._reject(t)}}class L{static isSupported(){return D.isSupported()}constructor(t){(0,w.Z)(this,"name","unnamed"),(0,w.Z)(this,"source",void 0),(0,w.Z)(this,"url",void 0),(0,w.Z)(this,"maxConcurrency",1),(0,w.Z)(this,"maxMobileConcurrency",1),(0,w.Z)(this,"onDebug",(()=>{})),(0,w.Z)(this,"reuseWorkers",!0),(0,w.Z)(this,"props",{}),(0,w.Z)(this,"jobQueue",[]),(0,w.Z)(this,"idleQueue",[]),(0,w.Z)(this,"count",0),(0,w.Z)(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach((t=>t.destroy())),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}async startJob(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e,n)=>t.done(n),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(t,e)=>t.error(e);const i=new Promise((i=>(this.jobQueue.push({name:t,onMessage:e,onError:n,onStart:i}),this)));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const t=this._getAvailableWorker();if(!t)return;const e=this.jobQueue.shift();if(e){this.onDebug({message:"Starting job",name:e.name,workerThread:t,backlog:this.jobQueue.length});const n=new F(e.name,t);t.onMessage=t=>e.onMessage(n,t.type,t.payload),t.onError=t=>e.onError(n,t),e.onStart(n);try{await n.result}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const t="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new D({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return b?this.maxMobileConcurrency:this.maxConcurrency}}const O={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class R{static isSupported(){return D.isSupported()}static getWorkerFarm(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return R._workerFarm=R._workerFarm||new R({}),R._workerFarm.setProps(t),R._workerFarm}constructor(t){(0,w.Z)(this,"props",void 0),(0,w.Z)(this,"workerPools",new Map),this.props={...O},this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:n,url:i}=t;let r=this.workerPools.get(e);return r||(r=new L({name:e,source:n,url:i}),r.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}(0,w.Z)(R,"_workerFarm",void 0);const k="latest";async function U(t,e,n,i,r){const o=t.id,s=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e[t.id]||{},i="".concat(t.id,"-worker.js");let r=n.workerUrl;if(r||"compression"!==t.id||(r=e.workerUrl),"test"===e._workerType&&(r="modules/".concat(t.module,"/dist/").concat(i)),!r){let e=t.version;"latest"===e&&(e=k);const n=e?"@".concat(e):"";r="https://unpkg.com/@loaders.gl/".concat(t.module).concat(n,"/dist/").concat(i)}return B(r),r}(t,n),a=R.getWorkerFarm(n).getWorkerPool({name:o,url:s});n=JSON.parse(JSON.stringify(n)),i=JSON.parse(JSON.stringify(i||{}));const l=await a.startJob("process-on-worker",z.bind(null,r));l.postMessage("process",{input:e,options:n,context:i});const c=await l.result;return await c.result}async function z(t,e,n,i){switch(n){case"done":e.done(i);break;case"error":e.error(new Error(i.error));break;case"process":const{id:o,input:s,options:a}=i;try{const n=await t(s,a);e.postMessage("done",{id:o,result:n})}catch(r){const t=r instanceof Error?r.message:"unknown error";e.postMessage("error",{id:o,error:t})}break;default:console.warn("parse-with-worker unknown message ".concat(n))}}var G=n(52194);const N=262144;const Z=262144;const j=1048576;var V=n(7494);function H(t){if((e=t)&&"object"===typeof e&&e.isBuffer)return t;var e;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return 0===t.byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if("string"===typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"===typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function J(t,e){return V.jU?async function*(t,e){const n=t.getReader();let i;try{for(;;){const t=i||n.read();null!==e&&void 0!==e&&e._streamReadAhead&&(i=n.read());const{done:r,value:o}=await t;if(r)return;yield H(o)}}catch(r){n.releaseLock()}}(t,e):async function*(t,e){for await(const n of t)yield H(n)}(t)}function W(t,e){if("string"===typeof t)return function*(t,e){const n=(null===e||void 0===e?void 0:e.chunkSize)||N;let i=0;const r=new TextEncoder;for(;i<t.length;){const e=Math.min(t.length-i,n),o=t.slice(i,i+e);i+=e,yield r.encode(o)}}(t,e);if(t instanceof ArrayBuffer)return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const{chunkSize:n=Z}=e;let i=0;for(;i<t.byteLength;){const e=Math.min(t.byteLength-i,n),r=new ArrayBuffer(e),o=new Uint8Array(t,i,e);new Uint8Array(r).set(o),i+=e,yield r}}()}(t,e);if((0,i.Lj)(t))return async function*(t,e){const n=(null===e||void 0===e?void 0:e.chunkSize)||j;let i=0;for(;i<t.size;){const e=i+n,r=await t.slice(i,e).arrayBuffer();i=e,yield r}}(t,e);if((0,i.Os)(t))return J(t,e);if((0,i.Ew)(t)){return J(t.body,e)}throw new Error("makeIterator")}const Q="Cannot convert supplied data type";async function K(t,e,n){const r=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"===typeof t||r)return function(t,e,n){if(e.text&&"string"===typeof t)return t;if((0,i.zH)(t)&&(t=t.buffer),t instanceof ArrayBuffer){const n=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let n=t.buffer;const i=t.byteLength||t.length;return 0===t.byteOffset&&i===n.byteLength||(n=n.slice(t.byteOffset,t.byteOffset+i)),n}throw new Error(Q)}(t,e);if((0,i.Lj)(t)&&(t=await A(t)),(0,i.Ew)(t)){const n=t;return await async function(t){if(!t.ok){const e=await async function(t){let e="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): ");try{const n=t.headers.get("Content-Type");let i=t.statusText;n.includes("application/json")&&(i+=" ".concat(await t.text())),e+=i,e=e.length>60?"".concat(e.slice(0,60),"..."):e}catch(n){}return e}(t);throw new Error(e)}}(n),e.binary?await n.arrayBuffer():await n.text()}if((0,i.Os)(t)&&(t=W(t,n)),(0,i.TW)(t)||(0,i.D0)(t))return async function(t){const e=[];for await(const n of t)e.push(n);return(0,G.JY)(...e)}(t);throw new Error(Q)}var q=n(17834);function X(t,e,n){if(n)return n;const i={fetch:m(e,t),...t};if(i.url){const t=h(i.url);i.baseUrl=t,i.queryString=function(t){const e=t.match(u);return e&&e[0]}(i.url),i.filename=q.vB(t),i.baseUrl=q.XX(t)}return Array.isArray(i.loaders)||(i.loaders=null),i}const Y=new(n(87294).Z)({id:"loaders.gl"});var $=n(11821);const tt=/\.([^.]+)$/;function et(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;if(!nt(t))return null;if(e&&!Array.isArray(e))return(0,r.T)(e);let o=[];e&&(o=o.concat(e)),null!==n&&void 0!==n&&n.ignoreRegisteredLoaders||o.push(...(0,$.kO)()),function(t){for(const e of t)(0,r.T)(e)}(o);const s=function(t,e,n,i){const r=d(t),o=f(t),s=h(r)||(null===i||void 0===i?void 0:i.url);let a=null,l="";null!==n&&void 0!==n&&n.mimeType&&(a=rt(e,null===n||void 0===n?void 0:n.mimeType),l="match forced by supplied MIME type ".concat(null===n||void 0===n?void 0:n.mimeType));var c;a=a||function(t,e){const n=e&&tt.exec(e),i=n&&n[1];return i?function(t,e){e=e.toLowerCase();for(const n of t)for(const t of n.extensions)if(t.toLowerCase()===e)return n;return null}(t,i):null}(e,s),l=l||(a?"matched url ".concat(s):""),a=a||rt(e,o),l=l||(a?"matched MIME type ".concat(o):""),a=a||function(t,e){if(!e)return null;for(const n of t)if("string"===typeof e){if(ot(e,n))return n}else if(ArrayBuffer.isView(e)){if(st(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer){if(st(e,0,n))return n}return null}(e,t),l=l||(a?"matched initial data ".concat(at(t)):""),a=a||rt(e,null===n||void 0===n?void 0:n.fallbackMimeType),l=l||(a?"matched fallback MIME type ".concat(o):""),l&&Y.log(1,"selectLoader selected ".concat(null===(c=a)||void 0===c?void 0:c.name,": ").concat(l,"."));return a}(t,o,n,i);if(!s&&(null===n||void 0===n||!n.nothrow))throw new Error(it(t));return s}function nt(t){return!(t instanceof Response&&204===t.status)}function it(t){const e=d(t),n=f(t);let i="No valid loader found (";i+=e?"".concat(q.vB(e),", "):"no url provided, ",i+="MIME type: ".concat(n?'"'.concat(n,'"'):"not provided",", ");const r=t?at(t):"";return i+=r?' first bytes: "'.concat(r,'"'):"first bytes: not available",i+=")",i}function rt(t,e){for(const n of t){if(n.mimeTypes&&n.mimeTypes.includes(e))return n;if(e==="application/x.".concat(n.id))return n}return null}function ot(t,e){if(e.testText)return e.testText(t);return(Array.isArray(e.tests)?e.tests:[e.tests]).some((e=>t.startsWith(e)))}function st(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some((i=>function(t,e,n,i){if(i instanceof ArrayBuffer)return(0,G.Xq)(i,t,i.byteLength);switch(typeof i){case"function":return i(t,n);case"string":return i===lt(t,e,i.length);default:return!1}}(t,e,n,i)))}function at(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"===typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return lt(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return lt(t,0,e)}return""}function lt(t,e,n){if(t.byteLength<e+n)return"";const i=new DataView(t);let r="";for(let o=0;o<n;o++)r+=String.fromCharCode(i.getUint8(e+o));return r}async function ct(t,e,n,o){y(!o||"object"===typeof o),!e||Array.isArray(e)||(0,r.C)(e)||(o=void 0,n=e,e=void 0),n=n||{};const s=d(t=await t),a=function(t,e){if(!e&&t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...t]:t}return n&&n.length?n:null}(e,o),l=await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(!nt(t))return null;let o=et(t,e,{...n,nothrow:!0},r);if(o)return o;if((0,i.Lj)(t)&&(o=et(t=await t.slice(0,10).arrayBuffer(),e,n,r)),!o&&(null===n||void 0===n||!n.nothrow))throw new Error(it(t));return o}(t,a,n);return l?(o=X({url:s,parse:ct,loaders:a},n=(0,g.GR)(n,l,a,s),o||null),await async function(t,e,n,r){if(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;y(t,"no worker provided");const n=t.version}(t),(0,i.Ew)(e)){const t=e,{ok:n,redirected:i,status:o,statusText:s,type:a,url:l}=t,c=Object.fromEntries(t.headers.entries());r.response={headers:c,ok:n,redirected:i,status:o,statusText:s,type:a,url:l}}if(e=await K(e,t,n),t.parseTextSync&&"string"===typeof e)return n.dataType="text",t.parseTextSync(e,n,r,t);if(function(t,e){return!!R.isSupported()&&!!(_||null!==e&&void 0!==e&&e._nodeWorkers)&&t.worker&&(null===e||void 0===e?void 0:e.worker)}(t,n))return await U(t,e,n,r,ct);if(t.parseText&&"string"===typeof e)return await t.parseText(e,n,r,t);if(t.parse)return await t.parse(e,n,r,t);throw y(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"))}(l,t,n,o)):null}async function ut(t,e,n,o){Array.isArray(e)||(0,r.C)(e)||(void 0,n=e,e=void 0);const s=m(n);let a=t;return"string"===typeof t&&(a=await s(t)),(0,i.Lj)(t)&&(a=await s(t)),await ct(a,e,n)}},11821:(t,e,n)=>{"use strict";n.d(e,{fh:()=>s,kO:()=>a});var i=n(56742),r=n(30136);const o=()=>{const t=(0,r.rx)();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function s(t){const e=o();t=Array.isArray(t)?t:[t];for(const n of t){const t=(0,i.T)(n);e.find((e=>t===e))||e.unshift(t)}}function a(){return o()}},56742:(t,e,n)=>{"use strict";n.d(e,{C:()=>r,T:()=>o});var i=n(57370);function r(t){var e;if(!t)return!1;Array.isArray(t)&&(t=t[0]);return Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions)}function o(t){var e,n;let o;return(0,i.h)(t,"null loader"),(0,i.h)(r(t),"invalid loader"),Array.isArray(t)&&(o=t[1],t=t[0],t={...t,options:{...t.options,...o}}),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(n=t)&&void 0!==n&&n.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}},30136:(t,e,n)=>{"use strict";n.d(e,{pm:()=>h,rx:()=>u,GR:()=>d});var i=n(75751),r=n(64649);const o=new(n(87294).Z)({id:"loaders.gl"});class s{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}var a=n(7494);const l={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){(0,r.Z)(this,"console",void 0),this.console=console}log(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.log.bind(this.console,...e)}info(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.info.bind(this.console,...e)}warn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.warn.bind(this.console,...e)}error(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:a.jU,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},c={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function u(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state=t._state||{},t._state}const h=()=>{const t=u();return t.globalOptions=t.globalOptions||{...l},t.globalOptions};function d(t,e,n,i){return n=n||[],function(t,e){f(t,null,l,c,e);for(const n of e){const i=t&&t[n.id]||{},r=n.options&&n.options[n.id]||{},o=n.deprecatedOptions&&n.deprecatedOptions[n.id]||{};f(i,n.id,r,o,e)}}(t,n=Array.isArray(n)?n:[n]),p(e,t,i)}function f(t,e,n,r,s){const a=e||"Top level",l=e?"".concat(e,"."):"";for(const c in t){const u=!e&&(0,i.Kn)(t[c]);if(!(c in n)&&!("baseUri"===c&&!e)&&!("workerUrl"===c&&e))if(c in r)o.warn("".concat(a," loader option '").concat(l).concat(c,"' no longer supported, use '").concat(r[c],"'"))();else if(!u){const t=A(c,s);o.warn("".concat(a," loader option '").concat(l).concat(c,"' not recognized. ").concat(t))()}}}function A(t,e){const n=t.toLowerCase();let i="";for(const r of e)for(const e in r.options){if(t===e)return"Did you mean '".concat(r.id,".").concat(e,"'?");const o=e.toLowerCase();(n.startsWith(o)||o.startsWith(n))&&(i=i||"Did you mean '".concat(r.id,".").concat(e,"'?"))}return i}function p(t,e,n){const i={...t.options||{}};return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(i,n),null===i.log&&(i.log=new s),g(i,h()),g(i,e),i}function g(t,e){for(const n in e)if(n in e){const r=e[n];(0,i.Ss)(r)&&(0,i.Ss)(t[n])?t[n]={...t[n],...e[n]}:t[n]=e[n]}}},46257:(t,e,n)=>{"use strict";n.d(e,{Z:()=>d});var i=n(64649),r=n(98949);class o{static get componentName(){return Object.prototype.hasOwnProperty.call(this,"extensionName")?this.extensionName:""}constructor(t){(0,i.Z)(this,"opts",void 0),t&&(this.opts=t)}equals(t){return this===t||this.constructor===t.constructor&&(0,r.v)(this.opts,t.opts,1)}getShaders(t){return null}getSubLayerProps(t){const{defaultProps:e}=t.constructor,n={updateTriggers:{}};for(const i in e)if(i in this.props){const t=e[i],r=this.props[i];n[i]=r,t&&"accessor"===t.type&&(n.updateTriggers[i]=this.props.updateTriggers[i],"function"===typeof r&&(n[i]=this.getSubLayerAccessor(r)))}return n}initializeState(t,e){}updateState(t,e){}onNeedsRedraw(t){}getNeedsPickingBuffer(t){return!1}draw(t,e){}finalizeState(t,e){}}(0,i.Z)(o,"defaultProps",{}),(0,i.Z)(o,"extensionName","LayerExtension");const s={clipBounds:[0,0,1,1],clipByInstance:void 0},a="\nuniform vec4 clip_bounds;\n\nbool clip_isInBounds(vec2 position) {\n  return position.x >= clip_bounds[0] && position.y >= clip_bounds[1] && position.x < clip_bounds[2] && position.y < clip_bounds[3];\n}\n",l={name:"clip-vs",vs:a},c={"vs:#decl":"\nvarying float clip_isVisible;\n","vs:DECKGL_FILTER_GL_POSITION":"\n  clip_isVisible = float(clip_isInBounds(geometry.worldPosition.xy));\n","fs:#decl":"\nvarying float clip_isVisible;\n","fs:DECKGL_FILTER_COLOR":"\n  if (clip_isVisible < 0.5) discard;\n"},u={name:"clip-fs",fs:a},h={"vs:#decl":"\nvarying vec2 clip_commonPosition;\n","vs:DECKGL_FILTER_GL_POSITION":"\n  clip_commonPosition = geometry.position.xy;\n","fs:#decl":"\nvarying vec2 clip_commonPosition;\n","fs:DECKGL_FILTER_COLOR":"\n  if (!clip_isInBounds(clip_commonPosition)) discard;\n"};class d extends o{getShaders(){let t="instancePositions"in this.getAttributeManager().attributes;return void 0!==this.props.clipByInstance&&(t=Boolean(this.props.clipByInstance)),this.state.clipByInstance=t,t?{modules:[l],inject:c}:{modules:[u],inject:h}}draw(t){let{uniforms:e}=t;const{clipBounds:n}=this.props;if(this.state.clipByInstance)e.clip_bounds=n;else{const t=this.projectPosition([n[0],n[1],0]),i=this.projectPosition([n[2],n[3],0]);e.clip_bounds=[Math.min(t[0],i[0]),Math.min(t[1],i[1]),Math.max(t[0],i[0]),Math.max(t[1],i[1])]}}}(0,i.Z)(d,"defaultProps",s),(0,i.Z)(d,"extensionName","ClipExtension")},17634:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(64649),r=n(79366),o=n(94300);const s={...o.Z.defaultProps};class a extends r.Z{indexToBounds(){return null}renderLayers(){const{elevationScale:t,extruded:e,wireframe:n,filled:i,stroked:r,lineWidthUnits:s,lineWidthScale:a,lineWidthMinPixels:l,lineWidthMaxPixels:c,lineJointRounded:u,lineMiterLimit:h,lineDashJustified:d,getElevation:f,getFillColor:A,getLineColor:p,getLineWidth:g}=this.props,{updateTriggers:m,material:y,transitions:v}=this.props,_=this.getSubLayerClass("cell",o.Z),{updateTriggers:b,...x}=this.indexToBounds()||{};return new _({filled:i,wireframe:n,extruded:e,elevationScale:t,stroked:r,lineWidthUnits:s,lineWidthScale:a,lineWidthMinPixels:l,lineWidthMaxPixels:c,lineJointRounded:u,lineMiterLimit:h,lineDashJustified:d,material:y,transitions:v,getElevation:f,getFillColor:A,getLineColor:p,getLineWidth:g},this.getSubLayerProps({id:"cell",updateTriggers:m&&{...b,getElevation:m.getElevation,getFillColor:m.getFillColor,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}),x)}}(0,i.Z)(a,"layerName","GeoCellLayer"),(0,i.Z)(a,"defaultProps",s)},9839:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>A});var i=n(64649),r=n(73356),o=n(47410),s=n(79366),a=n(73115),l=n(94300),c=n(35387);function u(t,e){e=void 0===e?t[0][0]:e;for(const n of t){const t=n[0]-e;t>180?n[0]-=360:t<-180&&(n[0]+=360)}}function h(t,e,n){const i=t(e,n),[o,s]=(0,r.VP)(i);return[s,o]}function d(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=(0,r.Lg)(t,!0);return 1!==e?function(t,e,n){const[i,s]=(0,r.VP)(t),a=e.length;u(e,s);const l=e[0]===e[a-1]?a-1:a;for(let r=0;r<l;r++)e[r][0]=(0,o.t7)(s,e[r][0],n),e[r][1]=(0,o.t7)(i,e[r][1],n)}(t,n,e):u(n),n}const f={...l.Z.defaultProps,highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:t=>t.hexagon},extruded:!0};class A extends s.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeState(){A._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}shouldUpdateState(t){let{changeFlags:e}=t;return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}updateState(t){let{props:e,changeFlags:n}=t;if(!0!==e.highPrecision&&(n.dataChanged||n.updateTriggersChanged&&n.updateTriggersChanged.getHexagon)){const t=this._calculateH3DataProps();this.setState(t)}this._updateVertices(this.context.viewport)}_calculateH3DataProps(){let t=-1,e=!1,n=!1;const{iterable:i,objectInfo:o}=(0,a.jB)(this.props.data);for(const s of i){o.index++;const i=this.props.getHexagon(s,o),a=(0,r.AI)(i);if(t<0){if(t=a,!this.props.highPrecision)break}else if(t!==a){n=!0;break}if((0,r.v8)(i)){e=!0;break}}return{resolution:t,edgeLengthKM:t>=0?(0,r.U7)(t,"km"):0,hasMultipleRes:n,hasPentagon:e}}_shouldUseHighPrecision(){if("auto"===this.props.highPrecision){const{resolution:t,hasPentagon:e,hasMultipleRes:n}=this.state,{viewport:i}=this.context;return Boolean(null===i||void 0===i?void 0:i.resolution)||n||e||t>=0&&t<=5}return this.props.highPrecision}_updateVertices(t){if(this._shouldUseHighPrecision())return;const{resolution:e,edgeLengthKM:n,centerHex:i}=this.state;if(e<0)return;const o=this.props.centerHexagon||(0,r.Cx)(t.latitude,t.longitude,e);if(i===o)return;if(i){const t=(0,r.Ji)(i,o);if(t>=0&&t*n<10)return}const{unitsPerMeter:s}=t.distanceScales;let a=d(o);const[l,c]=(0,r.VP)(o),[u,h]=t.projectFlat([c,l]);a=a.map((e=>{const n=t.projectFlat(e);return[(n[0]-u)/s[0],(n[1]-h)/s[1]]})),this.setState({centerHex:o,vertices:a})}renderLayers(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}_getForwardProps(){const{elevationScale:t,material:e,coverage:n,extruded:i,wireframe:r,stroked:o,filled:s,lineWidthUnits:a,lineWidthScale:l,lineWidthMinPixels:c,lineWidthMaxPixels:u,getFillColor:h,getElevation:d,getLineColor:f,getLineWidth:A,transitions:p,updateTriggers:g}=this.props;return{elevationScale:t,extruded:i,coverage:n,wireframe:r,stroked:o,filled:s,lineWidthUnits:a,lineWidthScale:l,lineWidthMinPixels:c,lineWidthMaxPixels:u,material:e,getElevation:d,getFillColor:h,getLineColor:f,getLineWidth:A,transitions:p,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}_renderPolygonLayer(){const{data:t,getHexagon:e,updateTriggers:n,coverage:i}=this.props,r=this.getSubLayerClass("hexagon-cell-hifi",l.Z),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(t,e){let n;return n=void 0===t||null===t?e:"object"===typeof t?{...t,coverage:e}:{getHexagon:t,coverage:e},n}(n.getHexagon,i),new r(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:(t,n)=>function(t){const e=new Float64Array(2*t.length);let n=0;for(const i of t)e[n++]=i[0],e[n++]=i[1];return e}(d(e(t,n),i))})}_renderColumnLayer(){const{data:t,getHexagon:e,updateTriggers:n}=this.props,i=this.getSubLayerClass("hexagon-cell",c.Z),r=this._getForwardProps();return r.updateTriggers.getPosition=n.getHexagon,new i(r,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:r.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:h.bind(null,e)})}}(0,i.Z)(A,"defaultProps",f),(0,i.Z)(A,"layerName","H3HexagonLayer"),(0,i.Z)(A,"_checkH3Lib",(()=>{}))},87072:(t,e,n)=>{"use strict";n.r(e),n.d(e,{GeohashLayer:()=>Ua,GreatCircleLayer:()=>$,H3ClusterLayer:()=>Bt,H3HexagonLayer:()=>Ct.ZP,MVTLayer:()=>Ia.Z,QuadkeyLayer:()=>yt,S2Layer:()=>pt,TerrainLayer:()=>Ma,Tile3DLayer:()=>xa,TileLayer:()=>vt.Z,TripsLayer:()=>bt,_GeoCellLayer:()=>tt.Z,_Tile2DHeader:()=>Ga.o,_Tileset2D:()=>za.Be,_WMSLayer:()=>X,_getURLFromTemplate:()=>Ba.z0});var i={};n.r(i),n.d(i,{readFileAsArrayBuffer:()=>Bi,readFileAsText:()=>Ei,requireFromFile:()=>Ti,requireFromString:()=>Si});var r={};n.r(r),n.d(r,{decode:()=>Or,name:()=>Lr});var o={};n.r(o),n.d(o,{name:()=>zr,preprocess:()=>Gr});var s={};n.r(s),n.d(s,{name:()=>Zr,preprocess:()=>jr});var a={};n.r(a),n.d(a,{decode:()=>Qr,encode:()=>Kr,name:()=>Jr,preprocess:()=>Wr});var l={};n.r(l),n.d(l,{decode:()=>so,name:()=>no});var c={};n.r(c),n.d(c,{decode:()=>fo,encode:()=>Ao,name:()=>ho});var u={};n.r(u),n.d(u,{decode:()=>mo,encode:()=>yo,name:()=>go});var h={};n.r(h),n.d(h,{decode:()=>bo,encode:()=>xo,name:()=>_o});var d={};n.r(d),n.d(d,{decode:()=>Eo,name:()=>Bo});var f=n(64649),A=n(79366),p=n(98949),g=n(18252),m=n(17377);class y{constructor(t){(0,f.Z)(this,"fetch",void 0),(0,f.Z)(this,"loadOptions",void 0),(0,f.Z)(this,"_needsRefresh",!0),(0,f.Z)(this,"props",void 0),this.props={...t},this.loadOptions={...t.loadOptions},this.fetch=function(t){const e=null===t||void 0===t?void 0:t.fetch;if(e&&"function"===typeof e)return(t,n)=>e(t,n);const n=null===t||void 0===t?void 0:t.fetch;if(n&&"function"!==typeof n)return t=>fetch(t,n);return t=>fetch(t)}(this.loadOptions)}setProps(t){this.props=Object.assign(this.props,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this._needsRefresh;return t&&(this._needsRefresh=!1),e}}class v extends y{}var _=n(29518);class b extends v{constructor(t){super(t)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(t){const e=this.getGranularParameters(t),n=this.getURLFromTemplate(e),i=await this.fetch(n),r=await i.arrayBuffer();return await _.S.parse(r)}getGranularParameters(t){const[e,n,i,r]=t.bbox;return{...t,east:e,north:n,south:r,west:i}}getURLFromTemplate(t){let e=this.props.url;for(const[n,i]of Object.entries(t))e=e.replace("${".concat(n,"}"),String(i)),e=e.replace("{".concat(n,"}"),String(i));return e}}(0,f.Z)(b,"type","template"),(0,f.Z)(b,"testURL",(t=>t.toLowerCase().includes("{")));var x=n(83652);function w(t){if(Array.isArray(t))return t.map((t=>w(t)));if(t&&"object"===typeof t){const n={};for(const[i,r]of Object.entries(t))n[(e=i,"string"===typeof e?e.charAt(0).toLowerCase()+e.slice(1):e)]=w(r);return n}var e;return t}const C={name:"XML",id:"xml",module:"xml",version:"3.4.15",worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:function(t){return t.startsWith("<?xml")},options:{xml:{parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(t,e)=>B((new TextDecoder).decode(t),e),parseTextSync:(t,e)=>B(t,e)};function B(t,e){var n;const i={...C.options.xml,...null===e||void 0===e?void 0:e.xml};if("fast-xml-parser"===i.parser){const n={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:i.removeNSPrefix,textNodeName:i.textNodeName,isArray:(t,e,n,r)=>{var o;const s=Boolean(null===i||void 0===i||null===(o=i.arrayPaths)||void 0===o?void 0:o.some((t=>e===t)));return s},...null===e||void 0===e?void 0:e._fastXML},r=function(t,e){return new x.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...e}).parse(t)}(t,n);return i.uncapitalizeKeys?w(r):r}throw new Error(null===e||void 0===e||null===(n=e.xml)||void 0===n?void 0:n.parser)}function E(t){return Array.isArray(t)?t:t?[t]:[]}function T(t){const e=E(t);return e.length>0&&e.every((t=>"string"===typeof t))?e:[]}function S(t){switch(typeof t){case"number":return t;case"string":return parseFloat(t);default:return}}function M(t){switch(typeof t){case"number":return t;case"string":return parseInt(t,10);default:return}}function I(t){switch(t){case"true":case"1":return!0;default:return!1}}function P(t,e){const n=C.parseTextSync(t,e),i=n.WMT_MS_Capabilities||n.WMS_Capabilities||n,r=function(t){var e,n,i,r,o,s,a,l,c,u,h,d,f,A,p,g;const m={version:String(t.version||""),name:String((null===(e=t.Service)||void 0===e?void 0:e.Name)||"unnamed"),title:null!==(n=t.Service)&&void 0!==n&&n.Title?String(null===(i=t.Service)||void 0===i?void 0:i.Title):void 0,abstract:null!==(r=t.Service)&&void 0!==r&&r.Abstract?String(null===(o=t.Service)||void 0===o?void 0:o.Abstract):void 0,keywords:T(null===(s=t.Service)||void 0===s||null===(a=s.KeywordList)||void 0===a?void 0:a.Keyword),fees:null!==(l=t.Service)&&void 0!==l&&l.Fees?JSON.stringify(null===(c=t.Service)||void 0===c?void 0:c.Fees):void 0,accessConstraints:null!==(u=t.Service)&&void 0!==u&&u.AccessConstraints?JSON.stringify(null===(h=t.Service)||void 0===h?void 0:h.AccessConstraints):void 0,layerLimit:M(null===(d=t.Service)||void 0===d?void 0:d.LayerLimit),maxWidth:M(null===(f=t.Service)||void 0===f?void 0:f.maxWidth),maxHeight:M(null===(A=t.Service)||void 0===A?void 0:A.maxHeight),layers:[],requests:D(null===(p=t.Capability)||void 0===p?void 0:p.Request),exceptions:F(t.Exception)},y=E(null===(g=t.Capability)||void 0===g?void 0:g.Layer);for(const v of y)m.layers.push(L(v));for(const[v,_]of Object.entries(m))void 0===_&&delete m[v];return m}(i);if(null!==e&&void 0!==e&&e.inheritedLayerProps)for(const o of r.layers)O(o,null);return(null!==e&&void 0!==e&&e.includeRawData||null!==e&&void 0!==e&&e.raw)&&(r.raw=i),null!==e&&void 0!==e&&e.includeXMLText&&(r.xml=t),r}function D(t){const e={};for(const[n,i]of Object.entries(t||{})){const t=T(null===i||void 0===i?void 0:i.Format);e[n]={mimeTypes:t}}return e}function F(t){if(E(null===t||void 0===t?void 0:t.Format).length>0)return{mimeTypes:T(t)}}function L(t){var e;const n={title:String((null===t||void 0===t?void 0:t.Title)||""),name:(null===t||void 0===t?void 0:t.Name)&&String(null===t||void 0===t?void 0:t.Name),abstract:(null===t||void 0===t?void 0:t.Name)&&String(null===t||void 0===t?void 0:t.Abstract),keywords:T(null===(e=t.KeywordList)||void 0===e?void 0:e.Keyword)},i=(null===t||void 0===t?void 0:t.CRS)||(null===t||void 0===t?void 0:t.SRS);i&&Array.isArray(i)&&i.every((t=>"string"===typeof t))&&(n.crs=i);let r=(null===t||void 0===t?void 0:t.EX_GeographicBoundingBox)&&function(t){const{westBoundLongitude:e,northBoundLatitude:n,eastBoundLongitude:i,southBoundLatitude:r}=t;return[[e,r],[i,n]]}(null===t||void 0===t?void 0:t.EX_GeographicBoundingBox);r&&(n.geographicBoundingBox=r),r=(null===t||void 0===t?void 0:t.LatLonBoundingBox)&&function(t){const{minx:e,miny:n,maxx:i,maxy:r}=t;return[[e,n],[i,r]]}(null===t||void 0===t?void 0:t.LatLonBoundingBox),r&&(n.geographicBoundingBox=r);const o=(null===t||void 0===t?void 0:t.BoundingBox)&&E(null===t||void 0===t?void 0:t.BoundingBox).map((t=>function(t){const{CRS:e,SRS:n,minx:i,miny:r,maxx:o,maxy:s,resx:a,resy:l}=t,c={crs:e||n,boundingBox:[[S(i),S(r)],[S(o),S(s)]]};return a&&(c.xResolution=a),l&&(c.yResolution=l),c}(t)));o&&o.length>0&&(n.boundingBoxes=o);const s=E(null===t||void 0===t?void 0:t.Dimension).map((t=>function(t){const{name:e,units:n,value:i}=t,r={name:e,units:n,extent:i};t.unitSymbol&&(r.unitSymbol=t.unitSymbol);t.default&&(r.defaultValue=t.default);t.multipleValues&&(r.multipleValues=I(t.multipleValues));t.nearestValue&&(r.nearestValue=I(t.nearestValue));t.current&&(r.current=I(t.current));return r}(t)));s.length&&(n.dimensions=s),null!==t&&void 0!==t&&t.opaque&&(n.opaque=I(null===t||void 0===t?void 0:t.opaque)),null!==t&&void 0!==t&&t.cascaded&&(n.cascaded=I(null===t||void 0===t?void 0:t.cascaded)),null!==t&&void 0!==t&&t.queryable&&(n.queryable=I(null===t||void 0===t?void 0:t.queryable));const a=E(null===t||void 0===t?void 0:t.Layer),l=[];for(const c of a)l.push(L(c));l.length>0&&(n.layers=l);for(const[c,u]of Object.entries(n))void 0===u&&delete n[c];return n}function O(t,e){null!==e&&void 0!==e&&e.geographicBoundingBox&&!t.geographicBoundingBox&&(t.geographicBoundingBox=[...e.geographicBoundingBox]),null!==e&&void 0!==e&&e.crs&&!t.crs&&(t.crs=[...e.crs]),null!==e&&void 0!==e&&e.boundingBoxes&&!t.boundingBoxes&&(t.boundingBoxes=[...e.boundingBoxes]),null!==e&&void 0!==e&&e.dimensions&&!t.dimensions&&(t.dimensions=[...e.dimensions]);for(const n of t.layers||[])O(n,t)}const R={id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:"3.4.15",worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:function(t){return t.startsWith("<?xml")},options:{wms:{}},parse:async(t,e)=>P((new TextDecoder).decode(t),null===e||void 0===e?void 0:e.wms),parseTextSync:(t,e)=>P(t,null===e||void 0===e?void 0:e.wms)};function k(t,e){var n;const i=(null===(n=C.parseTextSync(t,e).FeatureInfoResponse)||void 0===n?void 0:n.FIELDS)||[];return{features:(Array.isArray(i)?i:[i]).map((t=>function(t){const e=t||{};return{attributes:e,type:"",bounds:{bottom:0,top:0,left:0,right:0}}}(t)))}}const U={...R,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(t,e)=>k((new TextDecoder).decode(t),e),parseTextSync:(t,e)=>k(t,e)};function z(t,e){var n;return null===(n=C.parseTextSync)||void 0===n?void 0:n.call(C,t,e)}const G={...R,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(t,e)=>z((new TextDecoder).decode(t),e),parseTextSync:(t,e)=>z(t,e)};const N={id:"wms-error",name:"WMS Error",module:"wms",version:"3.4.15",worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:function(t){return t.startsWith("<?xml")},options:{wms:{throwOnError:!1}},parse:async(t,e)=>Z((new TextDecoder).decode(t),e),parseSync:(t,e)=>Z((new TextDecoder).decode(t),e),parseTextSync:(t,e)=>Z(t,e)};function Z(t,e){const n={...N.options.wms,...null===e||void 0===e?void 0:e.wms},i=function(t,e){var n,i,r;const o=null===(n=C.parseTextSync)||void 0===n?void 0:n.call(C,t,e),s=(null===o||void 0===o||null===(i=o.ServiceExceptionReport)||void 0===i?void 0:i.ServiceException)||(null===o||void 0===o||null===(r=o["ogc:ServiceExceptionReport"])||void 0===r?void 0:r["ogc:ServiceException"]);return"string"===typeof s?s:s.value||s.code||"Unknown error"}(t,n),r=n.minimalErrors?i:"WMS Service error: ".concat(i);if(n.throwOnError)throw new Error(r);return r}class j extends v{constructor(t){var e;super(t),(0,f.Z)(this,"url",void 0),(0,f.Z)(this,"substituteCRS84",void 0),(0,f.Z)(this,"flipCRS",void 0),(0,f.Z)(this,"wmsParameters",void 0),(0,f.Z)(this,"vendorParameters",void 0),(0,f.Z)(this,"capabilities",null),this.url=t.url,this.substituteCRS84=null!==(e=t.substituteCRS84)&&void 0!==e&&e,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...t.wmsParameters},this.vendorParameters=t.vendorParameters||{}}async getMetadata(){const t=await this.getCapabilities();return this.normalizeMetadata(t)}async getImage(t){return await this.getMap(t)}normalizeMetadata(t){return t}async getCapabilities(t,e){const n=this.getCapabilitiesURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();this._checkResponse(i,r);const o=await R.parse(r,this.loadOptions);return this.capabilities=o,o}async getMap(t,e){const n=this.getMapURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();this._checkResponse(i,r);try{return await _.S.parse(r,this.loadOptions)}catch{throw this._parseError(r)}}async getFeatureInfo(t,e){const n=this.getFeatureInfoURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();return this._checkResponse(i,r),await U.parse(r,this.loadOptions)}async getFeatureInfoText(t,e){const n=this.getFeatureInfoURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();return this._checkResponse(i,r),(new TextDecoder).decode(r)}async describeLayer(t,e){const n=this.describeLayerURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();return this._checkResponse(i,r),await G.parse(r,this.loadOptions)}async getLegendGraphic(t,e){const n=this.getLegendGraphicURL(t,e),i=await this.fetch(n),r=await i.arrayBuffer();this._checkResponse(i,r);try{return await _.S.parse(r,this.loadOptions)}catch{throw this._parseError(r)}}getCapabilitiesURL(t,e){const n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetCapabilities",n,e)}getMapURL(t,e){t=this._getWMS130Parameters(t);const n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetMap",n,e)}getFeatureInfoURL(t,e){const n={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetFeatureInfo",n,e)}describeLayerURL(t,e){const n={version:this.wmsParameters.version,...t};return this._getWMSUrl("DescribeLayer",n,e)}getLegendGraphicURL(t,e){const n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetLegendGraphic",n,e)}_parseWMSUrl(t){const[e,n]=t.split("?"),i=n.split("&"),r={};for(const o of i){const[t,e]=o.split("=");r[t]=e}return{url:e,parameters:r}}_getWMSUrl(t,e,n){let i=this.url,r=!0;const o={service:"WMS",version:e.version,request:t,...e,...this.vendorParameters,...n},s=["transparent","time","elevation"];for(const[a,l]of Object.entries(o))s.includes(a)&&!l||(i+=r?"?":"&",r=!1,i+=this._getURLParameter(a,l,e));return encodeURI(i)}_getWMS130Parameters(t){const e={...t};return e.srs&&(e.crs=e.crs||e.srs,delete e.srs),e}_getURLParameter(t,e,n){switch(t){case"crs":"1.3.0"!==n.version?t="srs":this.substituteCRS84&&"EPSG:4326"===e&&(e="CRS:84");break;case"srs":"1.3.0"===n.version&&(t="crs");break;case"bbox":const i=this._flipBoundingBox(e,n);i&&(e=i)}return t=t.toUpperCase(),Array.isArray(e)?"".concat(t,"=").concat(e.join(",")):"".concat(t,"=").concat(e?String(e):"")}_flipBoundingBox(t,e){if(!Array.isArray(t)||4!==t.length)return null;const n=t;return"1.3.0"===e.version&&this.flipCRS.includes(e.crs||"")&&!(this.substituteCRS84&&"EPSG:4326"===e.crs)?[n[1],n[0],n[3],n[2]]:n}async _fetchArrayBuffer(t){const e=await this.fetch(t),n=await e.arrayBuffer();return this._checkResponse(e,n),n}_checkResponse(t,e){const n=t.headers["content-type"];if(!t.ok||N.mimeTypes.includes(n)){const t=function(t,e){const n={...t};for(const[i,r]of Object.entries(e))r&&"object"===typeof r?(n[i]=n[i]||{},Object.assign(n[i],e[i])):n[i]=e[i];return n}(this.loadOptions,{wms:{throwOnError:!0}}),n=N.parseSync(e,t);throw new Error(n)}}_parseError(t){const e=N.parseSync(t,this.loadOptions);return new Error(e)}}(0,f.Z)(j,"type","wms"),(0,f.Z)(j,"testURL",(t=>t.toLowerCase().includes("wms")));class V extends v{constructor(t){super(t)}async getMetadata(){return await this.metadata()}async getImage(t){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(t){throw new Error("not implemented")}metadataURL(t){return"".concat(this.props.url,"?f=pjson")}exportImageURL(t){const e="bbox=".concat(t.bbox[0],",").concat(t.bbox[1],",").concat(t.bbox[2],",").concat(t.bbox[3]),n="size=".concat(t.width,",").concat(t.height),i={...t,bbox:e,size:n};return delete i.width,delete i.height,this.getUrl("exportImage",i)}getUrl(t,e,n){let i="".concat(this.props.url,"/").concat(t),r=!0;for(const[o,s]of Object.entries(e))i+=r?"?":"&",r=!1,Array.isArray(s)?i+="".concat(o.toUpperCase(),"=").concat(s.join(",")):i+="".concat(o.toUpperCase(),"=").concat(s?String(s):"");return i}async checkResponse(t){if(!t.ok)throw new Error("error")}}(0,f.Z)(V,"type","arcgis-image-server"),(0,f.Z)(V,"testURL",(t=>t.toLowerCase().includes("ImageServer")));const H=[j,V,b];function J(t){const{type:e="auto"}=t;switch("auto"===e?function(t){for(const e of H)if(e.testURL&&e.testURL(t))return e.type;return"wms"}(t.url):e){case"template":return new b(t);case"wms":return new j(t);default:throw new Error("Not a valid image source type")}}var W=n(75818);const Q=6378137*Math.PI;function K(t){const e=(0,W.w5)(t);return e[0]=(e[0]/256-1)*Q,e[1]=(e[1]/256-1)*Q,e}const q={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:()=>{}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:()=>{}},onImageLoad:{type:"function",value:()=>{}},onImageLoadError:{type:"function",compare:!1,value:(t,e)=>console.error(e,t)}};class X extends A.Z{constructor(){super(...arguments),(0,f.Z)(this,"state",void 0)}get isLoaded(){var t;return 0===(null===(t=this.state)||void 0===t?void 0:t.loadCounter)&&super.isLoaded}shouldUpdateState(){return!0}initializeState(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}updateState(t){let{changeFlags:e,props:n,oldProps:i}=t;const{viewport:r}=this.context;e.dataChanged||n.serviceType!==i.serviceType?(this.state.imageSource=this._createImageSource(n),this._loadMetadata(),this.debounce((()=>this.loadImage(r,"image source changed")),0)):(0,p.v)(n.layers,i.layers,1)?e.viewportChanged&&this.debounce((()=>this.loadImage(r,"viewport changed"))):this.debounce((()=>this.loadImage(r,"layers changed")),0)}finalizeState(){}renderLayers(){const{bounds:t,image:e,lastRequestParameters:n}=this.state;return e&&new m.Z({...this.getSubLayerProps({id:"bitmap"}),_imageCoordinateSystem:"EPSG:4326"===n.srs?g.Df.LNGLAT:g.Df.CARTESIAN,bounds:t,image:e})}async getFeatureInfoText(t,e){const{lastRequestParameters:n}=this.state;if(n){var i,r;return await(null===(i=(r=this.state.imageSource).getFeatureInfoText)||void 0===i?void 0:i.call(r,{...n,query_layers:n.layers,x:t,y:e,info_format:"application/vnd.ogc.gml"}))}return""}_createImageSource(t){if(t.data instanceof v)return t.data;if("string"===typeof t.data)return J({url:t.data,loadOptions:t.loadOptions,type:t.serviceType});throw new Error("invalid image source in props.data")}async _loadMetadata(){const{imageSource:t}=this.state;try{this.state.loadCounter++;const n=await t.getMetadata();var e;if(this.state.imageSource===t)null===(e=this.getCurrentLayer())||void 0===e||e.props.onMetadataLoad(n)}catch(i){var n;null===(n=this.getCurrentLayer())||void 0===n||n.props.onMetadataLoadError(i)}finally{this.state.loadCounter--}}async loadImage(t,e){const{layers:n,serviceType:i}=this.props;if("wms"===i&&0===n.length)return;const r=t.getBounds(),{width:o,height:s}=t,a=this.getRequestId();let{srs:l}=this.props;"auto"===l&&(l=t.resolution?"EPSG:4326":"EPSG:3857");const c={width:o,height:s,bbox:r,layers:n,srs:l};if("EPSG:3857"===l){const[t,e]=K([r[0],r[1]]),[n,i]=K([r[2],r[3]]);c.bbox=[t,e,n,i]}try{this.state.loadCounter++,this.props.onImageLoadStart(a);const t=await this.state.imageSource.getImage(c);var u;if(this.state.lastRequestId<a)null===(u=this.getCurrentLayer())||void 0===u||u.props.onImageLoad(a),this.setState({image:t,bounds:r,lastRequestParameters:c,lastRequestId:a})}catch(d){var h;this.raiseError(d,"Load image"),null===(h=this.getCurrentLayer())||void 0===h||h.props.onImageLoadError(a,d)}finally{this.state.loadCounter--}}getRequestId(){return this.state._nextRequestId++}debounce(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout((()=>t()),e)}}(0,f.Z)(X,"layerName","WMSLayer"),(0,f.Z)(X,"defaultProps",q);var Y=n(73351);class $ extends Y.Z{}(0,f.Z)($,"layerName","GreatCircleLayer"),(0,f.Z)($,"defaultProps",{getHeight:{type:"accessor",value:0},greatCircle:!0});var tt=n(17634),et=n(84977),nt=n.n(et);const it=3,rt=61,ot=180/Math.PI;function st(t,e,n){const i=1<<e;return[(t[0]+n[0])/i,(t[1]+n[1])/i]}function at(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function lt(t){return[at(t[0]),at(t[1])]}function ct(t,e){let[n,i]=e;switch(t){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function ut(t){let[e,n,i]=t;const r=Math.atan2(i,Math.sqrt(e*e+n*n));return[Math.atan2(n,e)*ot,r*ot]}function ht(t,e,n,i){if(0===i){1===n&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);const i=e[0];e[0]=e[1],e[1]=i}}const dt=100;function ft(t){if("string"===typeof t){if(t.indexOf("/")>0)return t;t=function(t){const e=t.padEnd(16,"0");return nt().fromString(e,16)}(t)}return function(t){let e=nt().fromString(t,!0,10).toString(2);for(;e.length<it+rt;)e="0"+e;const n=e.lastIndexOf("1"),i=e.substring(0,3),r=e.substring(3,n),o=r.length/2,s=nt().fromString(i,!0,2).toString(10);let a=nt().fromString(r,!0,2).toString(4);for(;a.length<o;)a="0"+a;return"".concat(s,"/").concat(a)}(t.toString())}function At(t){return function(t){let{face:e,ij:n,level:i}=t;const r=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(dt*Math.pow(2,-i))),s=new Float64Array(4*o*2+2);let a=0,l=0;for(let c=0;c<4;c++){const t=r[c].slice(0),u=r[c+1],h=(u[0]-t[0])/o,d=(u[1]-t[1])/o;for(let r=0;r<o;r++){t[0]+=h,t[1]+=d;const r=ut(ct(e,lt(st(n,i,t))));Math.abs(r[1])>89.999&&(r[0]=l);const o=r[0]-l;r[0]+=o>180?-360:o<-180?360:0,s[a++]=r[0],s[a++]=r[1],l=r[0]}}return s[a++]=s[0],s[a++]=s[1],s}(function(t){const e=t.split("/"),n=parseInt(e[0],10),i=e[1],r=i.length,o=[0,0];let s;for(let a=r-1;a>=0;a--){s=r-a;const t=i[a];let e=0,n=0;"1"===t?n=1:"2"===t?(e=1,n=1):"3"===t&&(e=1);const l=Math.pow(2,s-1);ht(l,o,e,n),o[0]+=l*e,o[1]+=l*n}if(n%2===1){const t=o[0];o[0]=o[1],o[1]=t}return{face:n,ij:o,level:s}}(ft(t)))}class pt extends tt.Z{indexToBounds(){const{data:t,getS2Token:e}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(t,n)=>At(e(t,n))}}}(0,f.Z)(pt,"layerName","S2Layer"),(0,f.Z)(pt,"defaultProps",{getS2Token:{type:"accessor",value:t=>t.token}});const gt=512;function mt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const[n,i]=function(t,e){let n=0,i=0,r=1<<t.length;const o=r/gt;for(let s=0;s<t.length;s++){r>>=1;const e=parseInt(t[s]);e%2&&(n|=r),e>1&&(i|=r)}return[[n/o,gt-i/o],[(n+e)/o,gt-(i+e)/o]]}(t,e),[r,o]=(0,W.es)(n),[s,a]=(0,W.es)(i);return[s,o,s,a,r,a,r,o,s,o]}class yt extends tt.Z{indexToBounds(){const{data:t,extruded:e,getQuadkey:n}=this.props,i=e?.99:1;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(t,e)=>mt(n(t,e),i),updateTriggers:{getPolygon:i}}}}(0,f.Z)(yt,"layerName","QuadkeyLayer"),(0,f.Z)(yt,"defaultProps",{getQuadkey:{type:"accessor",value:t=>t.quadkey}});var vt=n(58062),_t=n(69554);class bt extends _t.Z{getShaders(){const t=super.getShaders();return t.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying float vTime;\n","vs:#main-end":"vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n","fs:#decl":"uniform bool fadeTrail;\nuniform float trailLength;\nuniform float currentTime;\nvarying float vTime;\n","fs:#main-start":"if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {\n  discard;\n}\n","fs:DECKGL_FILTER_COLOR":"if(fadeTrail) {\n  color.a *= 1.0 - (currentTime - vTime) / trailLength;\n}\n"},t}initializeState(){super.initializeState();this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}draw(t){const{fadeTrail:e,trailLength:n,currentTime:i}=this.props;t.uniforms={...t.uniforms,fadeTrail:e,trailLength:n,currentTime:i},super.draw(t)}}(0,f.Z)(bt,"layerName","TripsLayer"),(0,f.Z)(bt,"defaultProps",{fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:t=>t.timestamps}});var xt=n(73356),wt=n(73115),Ct=n(9839);class Bt extends tt.Z{initializeState(){Ct.ZP._checkH3Lib()}updateState(t){let{props:e,changeFlags:n}=t;if(n.dataChanged||n.updateTriggersChanged&&n.updateTriggersChanged.getHexagons){const{data:t,getHexagons:n}=e,i=[],{iterable:r,objectInfo:o}=(0,wt.jB)(t);for(const e of r){o.index++;const t=n(e,o),r=(0,xt.kU)(t,!0);for(const n of r)i.push(this.getSubLayerRow({polygon:n},e,o.index))}this.setState({polygons:i})}}indexToBounds(){const{getElevation:t,getFillColor:e,getLineColor:n,getLineWidth:i}=this.props;return{data:this.state.polygons,getPolygon:t=>t.polygon,getElevation:this.getSubLayerAccessor(t),getFillColor:this.getSubLayerAccessor(e),getLineColor:this.getSubLayerAccessor(n),getLineWidth:this.getSubLayerAccessor(i)}}}(0,f.Z)(Bt,"layerName","H3ClusterLayer"),(0,f.Z)(Bt,"defaultProps",{getHexagons:{type:"accessor",value:t=>t.hexagons}});var Et=n(69296),Tt=n(21970),St=n(11162),Mt=n(1231),It=n(92086),Pt=n(78032),Dt=n(94557),Ft=n(36800);class Lt extends Ft.Z{getShaders(){const t=super.getShaders();return t.modules.push(Pt.b),{...t,vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvec2 applyUVRegion(vec2 uv) {\n  #ifdef HAS_UV_REGIONS\n    return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n  #else\n    return uv;\n  #endif\n}\n\nvoid main(void) {\n  vec2 uv = applyUVRegion(texCoords);\n  geometry.uv = uv;\n\n  if (pickFeatureIds) {\n    geometry.pickingColor = featureIdsPickingColors;\n  } else {\n    geometry.pickingColor = instancePickingColors;\n  }\n\n  vTexCoord = uv;\n  cameraPosition = project_uCameraPosition;\n  vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n  vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n  vec3 projectedPosition = project_position(positions);\n  position_commonspace = vec4(projectedPosition, 1.0);\n  gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n  geometry.position = position_commonspace;\n  normals_commonspace = project_normal(instanceModelMatrix * normals);\n  geometry.normal = normals_commonspace;\n\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  #ifdef MODULE_PBR\n    pbr_vPosition = geometry.position.xyz;\n    #ifdef HAS_NORMALS\n      pbr_vNormal = geometry.normal;\n    #endif\n\n    #ifdef HAS_UV\n      pbr_vUV = uv;\n    #else\n      pbr_vUV = vec2(0., 0.);\n    #endif\n    geometry.uv = pbr_vUV;\n  #endif\n\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n  \n#ifdef MODULE_PBR\n\n  fragColor = vColor * pbr_filterColor(vec4(0));\n  geometry.uv = pbr_vUV;\n  fragColor.a *= opacity;\n\n#else\n\n  geometry.uv = vTexCoord;\n\n  vec3 normal;\n  if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n    normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n    normal = vec3(0.0, 0.0, 1.0);\n#endif\n  } else {\n    normal = normals_commonspace;\n  }\n\n  vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n  vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n  fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n  DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"}}initializeState(){const{featureIds:t}=this.props;super.initializeState();const e=this.getAttributeManager();t&&e.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;e.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}draw(t){const{featureIds:e}=this.props;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(e)}),super.draw(t))}getModel(t){const{id:e,pbrMaterial:n}=this.props,i=this.parseMaterial(n,t);this.setState({materialParser:i});const r=this.getShaders();var o;(o=t.attributes).COLOR_0||o.colors||(o.colors={constant:!0,value:new Float32Array([1,1,1])});return new Dt.Z(this.context.gl,{...this.getShaders(),id:e,geometry:t,defines:{...r.defines,...null===i||void 0===i?void 0:i.defines,HAS_UV_REGIONS:t.attributes.uvRegions},parameters:null===i||void 0===i?void 0:i.parameters,isInstanced:!0})}updatePbrMaterialUniforms(t){const{model:e}=this.state;if(e){const{mesh:n}=this.props,i=this.parseMaterial(t,n);this.setState({materialParser:i}),e.setUniforms(i.uniforms)}}parseMaterial(t,e){var n;const i=Boolean(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture);return null===(n=this.state.materialParser)||void 0===n||n.delete(),new It.Z(this.context.gl,{attributes:{NORMAL:e.attributes.normals,TEXCOORD_0:e.attributes.texCoords},material:{unlit:i,...t},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}calculateFeatureIdsPickingColors(t){const e=this.props.featureIds,n=new Uint8ClampedArray(e.length*t.size),i=[];for(let r=0;r<e.length;r++)this.encodePickingColor(e[r],i),n[3*r]=i[0],n[3*r+1]=i[1],n[3*r+2]=i[2];t.value=n}finalizeState(t){var e;super.finalizeState(t),null===(e=this.state.materialParser)||void 0===e||e.delete(),this.setState({materialParser:null})}}(0,f.Z)(Lt,"layerName","MeshLayer"),(0,f.Z)(Lt,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});var Ot=n(65959),Rt=n(12987),kt=n(431),Ut=n(84802),zt=n(45903),Gt=n(47410),Nt=n(99007);const Zt=6378137,jt=6378137,Vt=6356752.314245179;Math.max(Zt,jt,Vt);function Ht(t){return t}new kt.Z;function Jt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ht;return"longitude"in t?(e[0]=n(t.longitude),e[1]=n(t.latitude),e[2]=t.height):"x"in t?(e[0]=n(t.x),e[1]=n(t.y),e[2]=t.z):(e[0]=n(t[0]),e[1]=n(t[1]),e[2]=t[2]),e}function Wt(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ht;return"longitude"in e?(e.longitude=n(t[0]),e.latitude=n(t[1]),e.height=t[2]):"x"in e?(e.x=n(t[0]),e.y=n(t[1]),e.z=t[2]):(e[0]=n(t[0]),e[1]=n(t[1]),e[2]=t[2]),e}const Qt=new kt.Z,Kt=new kt.Z,qt=new kt.Z;const Xt=new kt.Z,Yt={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},$t={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},te={east:new kt.Z,north:new kt.Z,up:new kt.Z,west:new kt.Z,south:new kt.Z,down:new kt.Z},ee=new kt.Z,ne=new kt.Z,ie=new kt.Z;function re(t,e,n,i,r,o){const s=Yt[e]&&Yt[e][n];let a,l,c;(0,zt.Z)(s&&(!i||i===s));const u=Xt.copy(r);if((0,Gt.fS)(u.x,0,1e-14)&&(0,Gt.fS)(u.y,0,1e-14)){const t=Math.sign(u.z);a=ee.fromArray($t[e]),"east"!==e&&"west"!==e&&a.scale(t),l=ne.fromArray($t[n]),"east"!==n&&"west"!==n&&l.scale(t),c=ie.fromArray($t[i]),"east"!==i&&"west"!==i&&c.scale(t)}else{const{up:r,east:o,north:s}=te;o.set(-u.y,u.x,0).normalize(),t.geodeticSurfaceNormal(u,r),s.copy(r).cross(o);const{down:h,west:d,south:f}=te;h.copy(r).scale(-1),d.copy(o).scale(-1),f.copy(s).scale(-1),a=te[e],l=te[n],c=te[i]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=l.x,o[5]=l.y,o[6]=l.z,o[7]=0,o[8]=c.x,o[9]=c.y,o[10]=c.z,o[11]=0,o[12]=u.x,o[13]=u.y,o[14]=u.z,o[15]=1,o}const oe=new kt.Z,se=new kt.Z,ae=new kt.Z,le=new kt.Z,ce=new kt.Z,ue=new kt.Z;class he{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(0,f.Z)(this,"radii",void 0),(0,f.Z)(this,"radiiSquared",void 0),(0,f.Z)(this,"radiiToTheFourth",void 0),(0,f.Z)(this,"oneOverRadii",void 0),(0,f.Z)(this,"oneOverRadiiSquared",void 0),(0,f.Z)(this,"minimumRadius",void 0),(0,f.Z)(this,"maximumRadius",void 0),(0,f.Z)(this,"centerToleranceSquared",Ut.Z.EPSILON1),(0,f.Z)(this,"squaredXOverSquaredZ",void 0),(0,zt.Z)(t>=0),(0,zt.Z)(e>=0),(0,zt.Z)(n>=0),this.radii=new kt.Z(t,e,n),this.radiiSquared=new kt.Z(t*t,e*e,n*n),this.radiiToTheFourth=new kt.Z(t*t*t*t,e*e*e*e,n*n*n*n),this.oneOverRadii=new kt.Z(0===t?0:1/t,0===e?0:1/e,0===n?0:1/n),this.oneOverRadiiSquared=new kt.Z(0===t?0:1/(t*t),0===e?0:1/(e*e),0===n?0:1/(n*n)),this.minimumRadius=Math.min(t,e,n),this.maximumRadius=Math.max(t,e,n),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const n=se,i=ae,[,,r]=t;this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);const o=Math.sqrt(n.dot(i));return i.scale(1/o),n.scale(r),i.add(n),i.to(e)}cartesianToCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];ue.from(t);const n=this.scaleToGeodeticSurface(ue,le);if(!n)return;const i=this.geodeticSurfaceNormal(n,se),r=ce;r.copy(ue).subtract(n);return function(t,e){return Wt(t,e,Gt.vc._cartographicRadians?Ht:Gt.Ux)}([Math.atan2(i.y,i.x),Math.asin(i.z),Math.sign(Nt.AK(r,ue))*Nt.kE(r)],e)}eastNorthUpToFixedFrame(t){return re(this,"east","north","up",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Rt.Z)}localFrameToFixedFrame(t,e,n,i){return re(this,t,e,n,i,arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Rt.Z)}geocentricSurfaceNormal(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return oe.from(t).normalize().to(e)}geodeticSurfaceNormalCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const n=function(t){return Jt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],Gt.vc._cartographicRadians?Ht:Gt.Yr)}(t),i=n[0],r=n[1],o=Math.cos(r);return oe.set(o*Math.cos(i),o*Math.sin(i),Math.sin(r)).normalize(),oe.to(e)}geodeticSurfaceNormal(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return oe.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}scaleToGeodeticSurface(t,e){return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const{oneOverRadii:i,oneOverRadiiSquared:r,centerToleranceSquared:o}=e;Qt.from(t);const s=Qt.x,a=Qt.y,l=Qt.z,c=i.x,u=i.y,h=i.z,d=s*s*c*c,f=a*a*u*u,A=l*l*h*h,p=d+f+A,g=Math.sqrt(1/p);if(!Number.isFinite(g))return;const m=Kt;if(m.copy(t).scale(g),p<o)return m.to(n);const y=r.x,v=r.y,_=r.z,b=qt;b.set(m.x*y*2,m.y*v*2,m.z*_*2);let x,w,C,B,E=(1-g)*Qt.len()/(.5*b.len()),T=0;do{E-=T,x=1/(1+E*y),w=1/(1+E*v),C=1/(1+E*_);const t=x*x,e=w*w,n=C*C;B=d*t+f*e+A*n-1,T=B/(-2*(d*(t*x)*y+f*(e*w)*v+A*(n*C)*_))}while(Math.abs(B)>Ut.Z.EPSILON12);return Qt.scale([x,w,C]).to(n)}(t,this,e)}scaleToGeocentricSurface(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];le.from(t);const n=le.x,i=le.y,r=le.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+r*r*o.z);return le.multiplyScalar(s).to(e)}transformPositionToScaledSpace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return le.from(t).scale(this.oneOverRadii).to(e)}transformPositionFromScaledSpace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return le.from(t).scale(this.radii).to(e)}getSurfaceNormalIntersectionWithZAxis(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];(0,zt.Z)((0,Gt.fS)(this.radii.x,this.radii.y,Ut.Z.EPSILON15)),(0,zt.Z)(this.radii.z>0),le.from(t);const i=le.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-e))return le.set(0,0,i).to(n)}}(0,f.Z)(he,"WGS84",new he(Zt,jt,Vt));var de=n(92138),fe=n(17834),Ae=n(65192);class pe{constructor(t,e,n){(0,f.Z)(this,"item",void 0),(0,f.Z)(this,"previous",void 0),(0,f.Z)(this,"next",void 0),this.item=t,this.previous=e,this.next=n}}class ge{constructor(){(0,f.Z)(this,"head",null),(0,f.Z)(this,"tail",null),(0,f.Z)(this,"_length",0)}get length(){return this._length}add(t){const e=new pe(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),++this._length,e}remove(t){t&&(t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,--this._length)}splice(t,e){t!==e&&(this.remove(e),this._insert(t,e))}_insert(t,e){const n=t.next;t.next=e,this.tail===t?this.tail=e:n.previous=e,e.next=n,e.previous=t,++this._length}}class me{constructor(){(0,f.Z)(this,"_list",void 0),(0,f.Z)(this,"_sentinel",void 0),(0,f.Z)(this,"_trimTiles",void 0),this._list=new ge,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(t){const e=t._cacheNode;e&&this._list.splice(this._sentinel,e)}add(t,e,n){e._cacheNode||(e._cacheNode=this._list.add(e),n&&n(t,e))}unloadTile(t,e,n){const i=e._cacheNode;i&&(this._list.remove(i),e._cacheNode=null,n&&n(t,e))}unloadTiles(t,e){const n=this._trimTiles;this._trimTiles=!1;const i=this._list,r=1024*t.maximumMemoryUsage*1024,o=this._sentinel;let s=i.head;for(;s!==o&&(t.gpuMemoryUsageInBytes>r||n);){const n=s.item;s=s.next,this.unloadTile(t,n,e)}}trim(){this._trimTiles=!0}}var ye=n(57370);var ve=n(89019);const _e=new kt.Z,be=new kt.Z,xe=new ve.Mh([new ve.JO,new ve.JO,new ve.JO,new ve.JO,new ve.JO,new ve.JO]);function we(t,e){const{cameraDirection:n,cameraUp:i,height:r}=t,{metersPerUnit:o}=t.distanceScales,s=Be(t,t.center),a=he.WGS84.eastNorthUpToFixedFrame(s),l=t.unprojectPosition(t.cameraPosition),c=he.WGS84.cartographicToCartesian(l,new kt.Z),u=new kt.Z(a.transformAsVector(new kt.Z(n).scale(o))).normalize(),h=new kt.Z(a.transformAsVector(new kt.Z(i).scale(o))).normalize();!function(t){const e=t.getFrustumPlanes(),n=Ce(e.near,t.cameraPosition),i=Be(t,n),r=Be(t,t.cameraPosition,be);let o=0;xe.planes[o++].fromPointNormal(i,_e.copy(i).subtract(r));for(const s in e){if("near"===s)continue;const r=Be(t,Ce(e[s],n,be),be);xe.planes[o++].fromPointNormal(r,_e.copy(i).subtract(r))}}(t);const d=t.constructor,{longitude:f,latitude:A,width:p,bearing:g,zoom:m}=t;return{camera:{position:c,direction:u,up:h},viewport:t,topDownViewport:new d({longitude:f,latitude:A,height:r,width:p,bearing:g,zoom:m,pitch:0}),height:r,cullingVolume:xe,frameNumber:e,sseDenominator:1.15}}function Ce(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new kt.Z;const i=t.normal.dot(e);return n.copy(t.normal).scale(t.distance-i).add(e),n}function Be(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new kt.Z;const i=t.unprojectPosition(e);return he.WGS84.cartographicToCartesian(i,n)}const Ee=6356752.314245179,Te=new kt.Z;function Se(t,e){if(t instanceof ve.F7){const{halfAxes:n}=t,i=function(t){t.getColumn(0,Te);const e=t.getColumn(1),n=t.getColumn(2),i=Te.add(e).add(n);return i.len()}(n);return Math.log2(Ee/(i+e[2]))}if(t instanceof ve.KM){const{radius:n}=t;return Math.log2(Ee/(n+e[2]))}if(t.width&&t.height){const{width:e,height:n}=t;return(Math.log2(6378137/e)+Math.log2(6378137/n))/2}return 1}function Me(t,e,n){const i=he.WGS84.cartographicToCartesian([t.xmax,t.ymax,t.zmax],new kt.Z),r=Math.sqrt(Math.pow(i[0]-n[0],2)+Math.pow(i[1]-n[1],2)+Math.pow(i[2]-n[2],2));return Math.log2(Ee/(r+e[2]))}const Ie=0,Pe=1,De=3,Fe=4,Le=5,Oe={ADD:1,REPLACE:2},Re={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},ke={I3S:"I3S",TILES3D:"TILES3D"},Ue={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},ze=1;var Ge=n(34980),Ne=n(73518);function Ze(t){return void 0!==t&&null!==t}const je=new kt.Z,Ve=new kt.Z,He=new kt.Z,Je=new kt.Z;function We(t,e,n){if((0,ye.h)(t,"3D Tile: boundingVolume must be defined"),t.box)return function(t,e,n){const i=new kt.Z(t[0],t[1],t[2]);e.transform(i,i);let r=[];if(10===t.length){const e=t.slice(3,6),n=new Ge.Z;n.fromArray(t,6);const i=new kt.Z([1,0,0]),o=new kt.Z([0,1,0]),s=new kt.Z([0,0,1]);i.transformByQuaternion(n),i.scale(e[0]),o.transformByQuaternion(n),o.scale(e[1]),s.transformByQuaternion(n),s.scale(e[2]),r=[...i.toArray(),...o.toArray(),...s.toArray()]}else r=[...t.slice(3,6),...t.slice(6,9),...t.slice(9,12)];const o=e.transformAsVector(r.slice(0,3)),s=e.transformAsVector(r.slice(3,6)),a=e.transformAsVector(r.slice(6,9)),l=new Ne.Z([o[0],o[1],o[2],s[0],s[1],s[2],a[0],a[1],a[2]]);if(Ze(n))return n.center=i,n.halfAxes=l,n;return new ve.F7(i,l)}(t.box,e,n);if(t.region){const[e,n,i,r,o,s]=t.region,a=he.WGS84.cartographicToCartesian([(0,Gt.RW)(e),(0,Gt.RW)(r),o],He),l=he.WGS84.cartographicToCartesian([(0,Gt.RW)(i),(0,Gt.RW)(n),s],Je),c=(new kt.Z).addVectors(a,l).multiplyScalar(.5),u=(new kt.Z).subVectors(a,l).len()/2;return Ke([c[0],c[1],c[2],u],new Rt.Z)}if(t.sphere)return Ke(t.sphere,e,n);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function Qe(t,e){if(t.box)return function(t){const e=qe(),{halfAxes:n}=t,i=new kt.Z(n.getColumn(0)),r=new kt.Z(n.getColumn(1)),o=new kt.Z(n.getColumn(2));for(let s=0;s<2;s++){for(let n=0;n<2;n++){for(let n=0;n<2;n++)je.copy(t.center),je.add(i),je.add(r),je.add(o),Xe(e,je),o.negate();r.negate()}i.negate()}return e}(e);if(t.region){const[e,n,i,r,o,s]=t.region;return[[(0,Gt.RW)(e),(0,Gt.RW)(n),o],[(0,Gt.RW)(i),(0,Gt.RW)(r),s]]}if(t.sphere)return function(t){const e=qe(),{center:n,radius:i}=t,r=he.WGS84.scaleToGeodeticSurface(n,je);let o;o=r?he.WGS84.geodeticSurfaceNormal(r):new kt.Z(0,0,1);let s=new kt.Z(o[2],-o[1],0);s.len()>0?s.normalize():s=new kt.Z(0,1,0);const a=s.clone().cross(o);for(const l of[s,a,o]){Ve.copy(l).scale(i);for(let t=0;t<2;t++)je.copy(n),je.add(Ve),Xe(e,je),Ve.negate()}return e}(e);throw new Error("Unkown boundingVolume type")}function Ke(t,e,n){const i=new kt.Z(t[0],t[1],t[2]);e.transform(i,i);const r=e.getScale(Ve),o=Math.max(Math.max(r[0],r[1]),r[2]),s=t[3]*o;return Ze(n)?(n.center=i,n.radius=s,n):new ve.KM(i,s)}function qe(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function Xe(t,e){he.WGS84.cartesianToCartographic(e,je),t[0][0]=Math.min(t[0][0],je[0]),t[0][1]=Math.min(t[0][1],je[1]),t[0][2]=Math.min(t[0][2],je[2]),t[1][0]=Math.max(t[1][0],je[0]),t[1][1]=Math.max(t[1][1],je[1]),t[1][2]=Math.max(t[1][2],je[2])}new kt.Z,new kt.Z,new Rt.Z,new kt.Z,new kt.Z,new kt.Z;function Ye(t,e){if(t.dynamicScreenSpaceError&&t.dynamicScreenSpaceErrorComputedDensity){const n=t.dynamicScreenSpaceErrorComputedDensity,i=t.dynamicScreenSpaceErrorFactor,r=function(t,e){const n=t*e;return 1-Math.exp(-n*n)}(e,n)*i;return r}return 0}const $e=new kt.Z,tn=new kt.Z,en=new kt.Z,nn=new kt.Z,rn=new kt.Z,on=new Rt.Z,sn=new Rt.Z;function an(t,e){const{topDownViewport:n}=e,i=t.header.mbs[1],r=t.header.mbs[0],o=t.header.mbs[2],s=t.header.mbs[3],a=[...t.boundingVolume.center],l=n.unprojectPosition(n.cameraPosition);he.WGS84.cartographicToCartesian(l,$e),tn.copy($e).subtract(a).normalize(),he.WGS84.eastNorthUpToFixedFrame(a,on),sn.copy(on).invert(),en.copy($e).transform(sn);const c=Math.sqrt(en[0]*en[0]+en[1]*en[1]),u=c*c/en[2];nn.copy([en[0],en[1],u]);const h=nn.transform(on).subtract(a).normalize(),d=tn.cross(h).normalize().scale(s).add(a),f=he.WGS84.cartesianToCartographic(d),A=n.project([r,i,o]),p=n.project(f);return rn.copy(A).subtract(p).magnitude()}class ln{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,f.Z)(this,"_map",new Map),(0,f.Z)(this,"_array",void 0),(0,f.Z)(this,"_length",void 0),this._array=new Array(t),this._length=t}get length(){return this._length}set length(t){this._length=t,t>this._array.length&&(this._array.length=t)}get values(){return this._array}get(t){return(0,ye.h)(t<this._array.length),this._array[t]}set(t,e){(0,ye.h)(t>=0),t>=this.length&&(this.length=t+1),this._map.has(this._array[t])&&this._map.delete(this._array[t]),this._array[t]=e,this._map.set(e,t)}delete(t){const e=this._map.get(t);e>=0&&(this._array.splice(e,1),this._map.delete(t),this.length--)}peek(){return this._array[this._length-1]}push(t){if(!this._map.has(t)){const e=this.length++;this._array[e]=t,this._map.set(t,e)}}pop(){const t=this._array[--this.length];return this._map.delete(t),t}reserve(t){(0,ye.h)(t>=0),t>this._array.length&&(this._array.length=t)}resize(t){(0,ye.h)(t>=0),this.length=t}trim(t){null!==t&&void 0!==t||(t=this.length),this._array.length=t}reset(){this._array=[],this._map=new Map,this._length=0}find(t){return this._map.has(t)}}const cn={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class un{traversalFinished(t){return!0}constructor(t){(0,f.Z)(this,"options",void 0),(0,f.Z)(this,"root",null),(0,f.Z)(this,"selectedTiles",{}),(0,f.Z)(this,"requestedTiles",{}),(0,f.Z)(this,"emptyTiles",{}),(0,f.Z)(this,"lastUpdate",(new Date).getTime()),(0,f.Z)(this,"updateDebounceTime",1e3),(0,f.Z)(this,"_traversalStack",new ln),(0,f.Z)(this,"_emptyTraversalStack",new ln),(0,f.Z)(this,"_frameNumber",null),this.options={...cn,...t}}traverse(t,e,n){this.root=t,this.options={...this.options,...n},this.reset(),this.updateTile(t,e),this._frameNumber=e.frameNumber,this.executeTraversal(t,e)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(t,e){const n=this._traversalStack;for(t._selectionDepth=1,n.push(t);n.length>0;){const t=n.pop();let i=!1;this.canTraverse(t,e)&&(this.updateChildTiles(t,e),i=this.updateAndPushChildren(t,e,n,t.hasRenderContent?t._selectionDepth+1:t._selectionDepth));const r=t.parent,o=Boolean(!r||r._shouldRefine),s=!i;t.hasRenderContent?t.refine===Oe.ADD?(this.loadTile(t,e),this.selectTile(t,e)):t.refine===Oe.REPLACE&&(this.loadTile(t,e),s&&this.selectTile(t,e)):(this.emptyTiles[t.id]=t,this.loadTile(t,e),s&&this.selectTile(t,e)),this.touchTile(t,e),t._shouldRefine=i&&o}const i=(new Date).getTime();(this.traversalFinished(e)||i-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=i,this.options.onTraversalEnd(e))}updateChildTiles(t,e){const n=t.children;for(const i of n)this.updateTile(i,e)}updateAndPushChildren(t,e,n,i){const{loadSiblings:r,skipLevelOfDetail:o}=this.options,s=t.children;s.sort(this.compareDistanceToCamera.bind(this));const a=t.refine===Oe.REPLACE&&t.hasRenderContent&&!o;let l=!1,c=!0;for(const u of s)if(u._selectionDepth=i,u.isVisibleAndInRequestVolume?(n.find(u)&&n.delete(u),n.push(u),l=!0):(a||r)&&(this.loadTile(u,e),this.touchTile(u,e)),a){let t;if(t=!!u._inRequestVolume&&(u.hasRenderContent?u.contentAvailable:this.executeEmptyTraversal(u,e)),c=c&&t,!c)return!1}return l||(c=!1),c}updateTile(t,e){this.updateTileVisibility(t,e)}selectTile(t,e){this.shouldSelectTile(t)&&(t._selectedFrame=e.frameNumber,this.selectedTiles[t.id]=t)}loadTile(t,e){this.shouldLoadTile(t)&&(t._requestedFrame=e.frameNumber,t._priority=t._getPriority(),this.requestedTiles[t.id]=t)}touchTile(t,e){t.tileset._cache.touch(t),t._touchedFrame=e.frameNumber}canTraverse(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!t.hasChildren&&(t.hasTilesetContent?!t.contentExpired:!(!i&&!t.isVisibleAndInRequestVolume)&&this.shouldRefine(t,e,n))}shouldLoadTile(t){return t.hasUnloadedContent||t.contentExpired}shouldSelectTile(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t._screenSpaceError;return n&&(i=t.getScreenSpaceError(e,!0)),i>this.options.maximumScreenSpaceError}updateTileVisibility(t,e){const n=[];if(this.options.viewportTraversersMap)for(const i in this.options.viewportTraversersMap){this.options.viewportTraversersMap[i]===e.viewport.id&&n.push(i)}else n.push(e.viewport.id);t.updateVisibility(e,n)}compareDistanceToCamera(t,e){return t._distanceToCamera-e._distanceToCamera}anyChildrenVisible(t,e){let n=!1;for(const i of t.children)i.updateVisibility(e),n=n||i.isVisibleAndInRequestVolume;return n}executeEmptyTraversal(t,e){let n=!0;const i=this._emptyTraversalStack;for(i.push(t);i.length>0&&n;){const t=i.pop();this.updateTile(t,e),t.isVisibleAndInRequestVolume||this.loadTile(t,e),this.touchTile(t,e);if(!t.hasRenderContent&&this.canTraverse(t,e,!1,!0)){const e=t.children;for(const t of e)i.find(t)&&i.delete(t),i.push(t)}else t.contentAvailable||t.hasEmptyContent||(n=!1)}return n}}const hn=new kt.Z;class dn{constructor(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";(0,f.Z)(this,"tileset",void 0),(0,f.Z)(this,"header",void 0),(0,f.Z)(this,"id",void 0),(0,f.Z)(this,"url",void 0),(0,f.Z)(this,"parent",void 0),(0,f.Z)(this,"refine",void 0),(0,f.Z)(this,"type",void 0),(0,f.Z)(this,"contentUrl",void 0),(0,f.Z)(this,"lodMetricType","geometricError"),(0,f.Z)(this,"lodMetricValue",0),(0,f.Z)(this,"boundingVolume",null),(0,f.Z)(this,"content",null),(0,f.Z)(this,"contentState",Ie),(0,f.Z)(this,"gpuMemoryUsageInBytes",0),(0,f.Z)(this,"children",[]),(0,f.Z)(this,"depth",0),(0,f.Z)(this,"viewportIds",[]),(0,f.Z)(this,"transform",new Rt.Z),(0,f.Z)(this,"extensions",null),(0,f.Z)(this,"implicitTiling",null),(0,f.Z)(this,"userData",{}),(0,f.Z)(this,"computedTransform",void 0),(0,f.Z)(this,"hasEmptyContent",!1),(0,f.Z)(this,"hasTilesetContent",!1),(0,f.Z)(this,"traverser",new un({})),(0,f.Z)(this,"_cacheNode",null),(0,f.Z)(this,"_frameNumber",null),(0,f.Z)(this,"_expireDate",null),(0,f.Z)(this,"_expiredContent",null),(0,f.Z)(this,"_boundingBox",void 0),(0,f.Z)(this,"_distanceToCamera",0),(0,f.Z)(this,"_screenSpaceError",0),(0,f.Z)(this,"_visibilityPlaneMask",void 0),(0,f.Z)(this,"_visible",void 0),(0,f.Z)(this,"_contentBoundingVolume",void 0),(0,f.Z)(this,"_viewerRequestVolume",void 0),(0,f.Z)(this,"_initialTransform",new Rt.Z),(0,f.Z)(this,"_priority",0),(0,f.Z)(this,"_selectedFrame",0),(0,f.Z)(this,"_requestedFrame",0),(0,f.Z)(this,"_selectionDepth",0),(0,f.Z)(this,"_touchedFrame",0),(0,f.Z)(this,"_centerZDepth",0),(0,f.Z)(this,"_shouldRefine",!1),(0,f.Z)(this,"_stackLength",0),(0,f.Z)(this,"_visitedFrame",0),(0,f.Z)(this,"_inRequestVolume",!1),(0,f.Z)(this,"_lodJudge",null),this.header=e,this.tileset=t,this.id=i||e.id,this.url=e.url,this.parent=n,this.refine=this._getRefine(e.refine),this.type=e.type,this.contentUrl=e.contentUrl,this._initializeLodMetric(e),this._initializeTransforms(e),this._initializeBoundingVolumes(e),this._initializeContent(e),this._initializeRenderingState(e),Object.seal(this)}destroy(){this.header=null}isDestroyed(){return null===this.header}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===De||this.hasEmptyContent}get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===Ie}get contentExpired(){return this.contentState===Fe}get contentFailed(){return this.contentState===Le}get distanceToCamera(){return this._distanceToCamera}get screenSpaceError(){return this._screenSpaceError}get boundingBox(){return this._boundingBox||(this._boundingBox=Qe(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}getScreenSpaceError(t,e){switch(this.tileset.type){case ke.I3S:return an(this,t);case ke.TILES3D:return function(t,e,n){const i=t.tileset,r=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,o=n?r:t.lodMetricValue;if(0===o)return 0;const s=Math.max(t._distanceToCamera,1e-7),{height:a,sseDenominator:l}=e,{viewDistanceScale:c}=i.options;let u=o*a*(c||1)/(s*l);return u-=Ye(i,s),u}(this,t,e);default:throw new Error("Unsupported tileset type")}}unselect(){this._selectedFrame=0}_getGpuMemoryUsageInBytes(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}_getPriority(){const t=this.tileset._traverser,{skipLevelOfDetail:e}=t.options,n=this.refine===Oe.ADD||e;if(n&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Ie)return-1;const i=this.parent,r=i&&(!n||0===this._screenSpaceError||i.hasTilesetContent)?i._screenSpaceError:this._screenSpaceError,o=t.root?t.root._screenSpaceError:0;return Math.max(o-r,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=Pe;const t=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!t)return this.contentState=Ie,!1;try{const t=this.tileset.getTileUrl(this.contentUrl),e=this.tileset.loader,n={...this.tileset.loadOptions,[e.id]:{...this.tileset.loadOptions[e.id],isTileset:"json"===this.type,...this._getLoaderSpecificOptions(e.id)}};return this.content=await(0,Ot.z)(t,e,n),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=De,this._onContentLoaded(),!0}catch(e){throw this.contentState=Le,e}finally{t.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=Ie,!0}updateVisibility(t,e){if(this._frameNumber===t.frameNumber)return;const n=this.parent,i=n?n._visibilityPlaneMask:ve.Mh.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const t=n?n.computedTransform:this.tileset.modelMatrix;this._updateTransform(t)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,i),this._visible=this._visibilityPlaneMask!==ve.Mh.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=e}visibility(t,e){const{cullingVolume:n}=t,{boundingVolume:i}=this;return n.computeVisibilityWithPlaneMask(i,e)}contentVisibility(){return!0}distanceToTile(t){const e=this.boundingVolume;return Math.sqrt(Math.max(e.distanceSquaredTo(t.camera.position),0))}cameraSpaceZDepth(t){let{camera:e}=t;const n=this.boundingVolume;return hn.subVectors(n.center,e.position),e.direction.dot(hn)}insideViewerRequestVolume(t){const e=this._viewerRequestVolume;return!e||e.distanceSquaredTo(t.camera.position)<=0}updateExpiration(){if(void 0!==(t=this._expireDate)&&null!==t&&this.contentReady&&!this.hasEmptyContent){const t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=Fe,this._expiredContent=this.content)}var t}get extras(){return this.header.extras}_initializeLodMetric(t){"lodMetricType"in t?this.lodMetricType=t.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in t?this.lodMetricValue=t.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(t){this.transform=t.transform?new Rt.Z(t.transform):new Rt.Z;const e=this.parent,n=this.tileset,i=e&&e.computedTransform?e.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new Rt.Z(i).multiplyRight(this.transform);const r=e&&e._initialTransform?e._initialTransform.clone():new Rt.Z;this._initialTransform=new Rt.Z(r).multiplyRight(this.transform)}_initializeBoundingVolumes(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}_initializeContent(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Ie,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(t){this.depth=t.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=ve.Mh.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(t){return t||this.parent&&this.parent.refine||Oe.REPLACE}_isTileset(){return-1!==this.contentUrl.indexOf(".json")}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}_updateBoundingVolume(t){this.boundingVolume=We(t.boundingVolume,this.computedTransform,this.boundingVolume);const e=t.content;e&&(e.boundingVolume&&(this._contentBoundingVolume=We(e.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=We(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Rt.Z).clone().multiplyRight(this.transform);!t.equals(this.computedTransform)&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(t){return"i3s"===t?{...this.tileset.options.i3s,_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1}:{assetGltfUpAxis:(e=this.tileset.tileset).asset&&e.asset.gltfUpAxis||"Y"};var e}}class fn extends un{compareDistanceToCamera(t,e){return 0===e._distanceToCamera&&0===t._distanceToCamera?e._centerZDepth-t._centerZDepth:e._distanceToCamera-t._distanceToCamera}updateTileVisibility(t,e){if(super.updateTileVisibility(t,e),!t.isVisibleAndInRequestVolume)return;const n=t.children.length>0;if(t.hasTilesetContent&&n){const n=t.children[0];return this.updateTileVisibility(n,e),void(t._visible=n._visible)}if(this.meetsScreenSpaceErrorEarly(t,e))return void(t._visible=!1);const i=t.refine===Oe.REPLACE,r=t._optimChildrenWithinParent===ze;i&&r&&n&&!this.anyChildrenVisible(t,e)&&(t._visible=!1)}meetsScreenSpaceErrorEarly(t,e){const{parent:n}=t;return!(!n||n.hasTilesetContent||n.refine!==Oe.ADD)&&!this.shouldRefine(t,e,!0)}}class An{constructor(){(0,f.Z)(this,"frameNumberMap",new Map)}register(t,e){const n=this.frameNumberMap.get(t)||new Map,i=n.get(e)||0;n.set(e,i+1),this.frameNumberMap.set(t,n)}deregister(t,e){const n=this.frameNumberMap.get(t);if(!n)return;const i=n.get(e)||1;n.set(e,i-1)}isZero(t,e){var n;return 0===((null===(n=this.frameNumberMap.get(t))||void 0===n?void 0:n.get(e))||0)}}const pn="REQUESTED",gn="COMPLETED",mn="ERROR";class yn{constructor(){(0,f.Z)(this,"_statusMap",void 0),(0,f.Z)(this,"pendingTilesRegister",new An),this._statusMap={}}add(t,e,n,i){if(!this._statusMap[e]){const{frameNumber:r,viewport:{id:o}}=i;this._statusMap[e]={request:t,callback:n,key:e,frameState:i,status:pn},this.pendingTilesRegister.register(o,r),t().then((t=>{this._statusMap[e].status=gn;const{frameNumber:n,viewport:{id:r}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(r,n),this._statusMap[e].callback(t,i)})).catch((t=>{this._statusMap[e].status=mn;const{frameNumber:i,viewport:{id:r}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(r,i),n(t)}))}}update(t,e){if(this._statusMap[t]){const{frameNumber:n,viewport:{id:i}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(i,n);const{frameNumber:r,viewport:{id:o}}=e;this.pendingTilesRegister.register(o,r),this._statusMap[t].frameState=e}}find(t){return this._statusMap[t]}hasPendingTiles(t,e){return!this.pendingTilesRegister.isZero(t,e)}}class vn extends un{constructor(t){super(t),(0,f.Z)(this,"_tileManager",void 0),this._tileManager=new yn}traversalFinished(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}shouldRefine(t,e){return t._lodJudge=function(t,e){if(0===t.lodMetricValue||isNaN(t.lodMetricValue))return"DIG";const n=2*an(t,e);return n<2?"OUT":!t.header.children||n<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}(t,e),"DIG"===t._lodJudge}updateChildTiles(t,e){const n=t.header.children||[],i=t.children,r=t.tileset;for(const o of n){const n="".concat(o.id,"-").concat(e.viewport.id),s=i&&i.find((t=>t.id===n));if(s)s&&this.updateTile(s,e);else{let i=()=>this._loadTile(o.id,r);this._tileManager.find(n)?this._tileManager.update(n,e):(r.tileset.nodePages&&(i=()=>r.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(i,n,(e=>this._onTileLoad(e,t,n)),e))}}return!1}async _loadTile(t,e){const{loader:n}=e,i=e.getTileUrl("".concat(e.url,"/nodes/").concat(t)),r={...e.loadOptions,i3s:{...e.loadOptions.i3s,isTileHeader:!0}};return await(0,Ot.z)(i,n,r)}_onTileLoad(t,e,n){const i=new dn(e.tileset,t,e,n);e.children.push(i);const r=this._tileManager.find(i.id).frameState;this.updateTile(i,r),this._frameNumber===r.frameNumber&&(this.traversalFinished(r)||(new Date).getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(i,r)}}const _n={description:"",ellipsoid:he.WGS84,modelMatrix:new Rt.Z,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:t=>t,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},bn="Tiles In Tileset(s)",xn="Tiles In Memory",wn="Tiles In View",Cn="Tiles To Render",Bn="Tiles Loaded",En="Tiles Loading",Tn="Tiles Unloaded",Sn="Failed Tile Loads",Mn="Points/Vertices",In="Tile Memory Use";class Pn{constructor(t,e){(0,f.Z)(this,"options",void 0),(0,f.Z)(this,"loadOptions",void 0),(0,f.Z)(this,"type",void 0),(0,f.Z)(this,"tileset",void 0),(0,f.Z)(this,"loader",void 0),(0,f.Z)(this,"url",void 0),(0,f.Z)(this,"basePath",void 0),(0,f.Z)(this,"modelMatrix",void 0),(0,f.Z)(this,"ellipsoid",void 0),(0,f.Z)(this,"lodMetricType",void 0),(0,f.Z)(this,"lodMetricValue",void 0),(0,f.Z)(this,"refine",void 0),(0,f.Z)(this,"root",null),(0,f.Z)(this,"roots",{}),(0,f.Z)(this,"asset",{}),(0,f.Z)(this,"description",""),(0,f.Z)(this,"properties",void 0),(0,f.Z)(this,"extras",null),(0,f.Z)(this,"attributions",{}),(0,f.Z)(this,"credits",{}),(0,f.Z)(this,"stats",void 0),(0,f.Z)(this,"contentFormats",{draco:!1,meshopt:!1,dds:!1,ktx2:!1}),(0,f.Z)(this,"cartographicCenter",null),(0,f.Z)(this,"cartesianCenter",null),(0,f.Z)(this,"zoom",1),(0,f.Z)(this,"boundingVolume",null),(0,f.Z)(this,"dynamicScreenSpaceErrorComputedDensity",0),(0,f.Z)(this,"maximumMemoryUsage",32),(0,f.Z)(this,"gpuMemoryUsageInBytes",0),(0,f.Z)(this,"_frameNumber",0),(0,f.Z)(this,"_queryParams",{}),(0,f.Z)(this,"_extensionsUsed",[]),(0,f.Z)(this,"_tiles",{}),(0,f.Z)(this,"_pendingCount",0),(0,f.Z)(this,"selectedTiles",[]),(0,f.Z)(this,"traverseCounter",0),(0,f.Z)(this,"geometricError",0),(0,f.Z)(this,"lastUpdatedVieports",null),(0,f.Z)(this,"_requestedTiles",[]),(0,f.Z)(this,"_emptyTiles",[]),(0,f.Z)(this,"frameStateData",{}),(0,f.Z)(this,"_traverser",void 0),(0,f.Z)(this,"_cache",new me),(0,f.Z)(this,"_requestScheduler",void 0),(0,f.Z)(this,"updatePromise",null),(0,f.Z)(this,"tilesetInitializationPromise",void 0),this.options={..._n,...e},this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||fe.XX(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new Ae.Z({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.stats=new de.Z({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(t)}destroy(){this._destroy()}isLoaded(){return 0===this._pendingCount&&0!==this._frameNumber&&0===this._requestedTiles.length}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return new URLSearchParams(this._queryParams).toString()}setProps(t){this.options={...this.options,...t}}setOptions(t){this.options={...this.options,...t}}getTileUrl(t){return t.startsWith("data:")?t:"".concat(t).concat(t.includes("?")?"&":"?").concat(this.queryParams)}hasExtension(t){return Boolean(this._extensionsUsed.indexOf(t)>-1)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((()=>{!t&&this.lastUpdatedVieports?t=this.lastUpdatedVieports:this.lastUpdatedVieports=t,t&&this.doUpdate(t)}))}async selectTiles(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return await this.tilesetInitializationPromise,t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise((t=>{setTimeout((()=>{this.lastUpdatedVieports&&this.doUpdate(this.lastUpdatedVieports),t(this._frameNumber),this.updatePromise=null}),this.options.debounceTime)}))),this.updatePromise}doUpdate(t){if("loadTiles"in this.options&&!this.options.loadTiles)return;if(this.traverseCounter>0)return;const e=t instanceof Array?t:[t];this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;const n=[];for(const i of e){const t=i.id;this._needTraverse(t)?n.push(t):this.traverseCounter--}for(const i of e){const t=i.id;if(this.roots[t]||(this.roots[t]=this._initializeTileHeaders(this.tileset,null)),!n.includes(t))continue;const e=we(i,this._frameNumber);this._traverser.traverse(this.roots[t],e,this.options)}}_needTraverse(t){let e=t;return this.options.viewportTraversersMap&&(e=this.options.viewportTraversersMap[t]),e===t}_onTraversalEnd(t){const e=t.viewport.id;this.frameStateData[e]||(this.frameStateData[e]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const n=this.frameStateData[e],i=Object.values(this._traverser.selectedTiles),[r,o]=function(t,e,n){if(0===n||t.length<=n)return[t,[]];const i=[],{longitude:r,latitude:o}=e.viewport;for(const[c,u]of t.entries()){const[t,e]=u.header.mbs,n=Math.abs(r-t),s=Math.abs(o-e),a=Math.sqrt(s*s+n*n);i.push([c,a])}const s=i.sort(((t,e)=>t[1]-e[1])),a=[];for(let c=0;c<n;c++)a.push(t[s[c][0]]);const l=[];for(let c=n;c<s.length;c++)l.push(t[s[c][0]]);return[a,l]}(i,t,this.options.maximumTilesSelected);n.selectedTiles=r;for(const s of o)s.unselect();n._requestedTiles=Object.values(this._traverser.requestedTiles),n._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const t in this.frameStateData){const e=this.frameStateData[t];this.selectedTiles=this.selectedTiles.concat(e.selectedTiles),this._requestedTiles=this._requestedTiles.concat(e._requestedTiles),this._emptyTiles=this._emptyTiles.concat(e._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const t of this.selectedTiles)this._tiles[t.id]=t;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(t,e){if(t.length!==e.length)return!0;const n=new Set(t.map((t=>t.id))),i=new Set(e.map((t=>t.id)));let r=t.filter((t=>!i.has(t.id))).length>0;return r=r||e.filter((t=>!n.has(t.id))).length>0,r}_loadTiles(){for(const t of this._requestedTiles)t.contentUnloaded&&this._loadTile(t)}_unloadTiles(){this._cache.unloadTiles(this,((t,e)=>t._unloadTile(e)))}_updateStats(){let t=0,e=0;for(const n of this.selectedTiles)n.contentAvailable&&n.content&&(t++,n.content.pointCount?e+=n.content.pointCount:e+=n.content.vertexCount);this.stats.get(wn).count=this.selectedTiles.length,this.stats.get(Cn).count=t,this.stats.get(Mn).count=e}async _initializeTileSet(t){this.type===ke.I3S&&(this.calculateViewPropsI3S(),t.root=await t.root),this.root=this._initializeTileHeaders(t,null),this.type===ke.TILES3D&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===ke.I3S&&this._initializeI3STileset()}calculateViewPropsI3S(){var t;const e=this.tileset.fullExtent;if(e){const{xmin:t,xmax:n,ymin:i,ymax:r,zmin:o,zmax:s}=e;return this.cartographicCenter=new kt.Z(t+(n-t)/2,i+(r-i)/2,o+(s-o)/2),this.cartesianCenter=he.WGS84.cartographicToCartesian(this.cartographicCenter,new kt.Z),void(this.zoom=Me(e,this.cartographicCenter,this.cartesianCenter))}const n=null===(t=this.tileset.store)||void 0===t?void 0:t.extent;if(n){const[t,e,i,r]=n;return this.cartographicCenter=new kt.Z(t+(i-t)/2,e+(r-e)/2,0),this.cartesianCenter=he.WGS84.cartographicToCartesian(this.cartographicCenter,new kt.Z),void(this.zoom=function(t,e,n){const[i,r,o,s]=t;return Me({xmin:i,xmax:o,ymin:r,ymax:s,zmin:0,zmax:0},e,n)}(n,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new kt.Z,this.zoom=1}calculateViewPropsTiles3D(){const t=this.root,{center:e}=t.boundingVolume;if(!e)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new kt.Z,void(this.zoom=1);0!==e[0]||0!==e[1]||0!==e[2]?this.cartographicCenter=he.WGS84.cartesianToCartographic(e,new kt.Z):this.cartographicCenter=new kt.Z(0,0,-he.WGS84.radii[0]),this.cartesianCenter=e,this.zoom=Se(t.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get(bn),this.stats.get(En),this.stats.get(xn),this.stats.get(wn),this.stats.get(Cn),this.stats.get(Bn),this.stats.get(Tn),this.stats.get(Sn),this.stats.get(Mn),this.stats.get(In,"memory")}_initializeTileHeaders(t,e){const n=new dn(this,t.root,e);if(e&&(e.children.push(n),n.depth=e.depth+1),this.type===ke.TILES3D){const t=[];for(t.push(n);t.length>0;){const e=t.pop();this.stats.get(bn).incrementCount();const n=e.header.children||[];for(const r of n){var i;const n=new dn(this,r,e);if(null!==(i=n.contentUrl)&&void 0!==i&&i.includes("?session=")){const t=new URL(n.contentUrl).searchParams.get("session");t&&(this._queryParams.session=t)}e.children.push(n),n.depth=e.depth+1,t.push(n)}}}return n}_initializeTraverser(){let t;switch(this.type){case ke.TILES3D:t=fn;break;case ke.I3S:t=vn;break;default:t=un}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(t){this._destroySubtree(t)}async _loadTile(t){let e;try{this._onStartTileLoading(),e=await t.loadContent()}catch(n){this._onTileLoadError(t,n instanceof Error?n:new Error("load failed"))}finally{this._onEndTileLoading(),this._onTileLoad(t,e)}}_onTileLoadError(t,e){this.stats.get(Sn).incrementCount();const n=e.message||e.toString(),i=t.url;console.error("A 3D tile failed to load: ".concat(t.url," ").concat(n)),this.options.onTileError(t,n,i)}_onTileLoad(t,e){if(e){if(this.type===ke.I3S){var n,i;const t=(null===(n=this.tileset)||void 0===n||null===(i=n.nodePagesTile)||void 0===i?void 0:i.nodesInNodePages)||0;this.stats.get(bn).reset(),this.stats.get(bn).addCount(t)}t&&t.content&&function(t,e){(0,ye.h)(t),(0,ye.h)(e);const{rtcCenter:n,gltfUpAxis:i}=e,{computedTransform:r,boundingVolume:{center:o}}=t;let s=new Rt.Z(r);switch(n&&s.translate(n),i){case"Z":default:break;case"Y":const t=(new Rt.Z).rotateX(Math.PI/2);s=s.multiplyRight(t);break;case"X":const e=(new Rt.Z).rotateY(-Math.PI/2);s=s.multiplyRight(e)}e.isQuantized&&s.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);const a=new kt.Z(o);e.cartesianModelMatrix=s,e.cartesianOrigin=a;const l=he.WGS84.cartesianToCartographic(a,new kt.Z),c=he.WGS84.eastNorthUpToFixedFrame(a).invert();e.cartographicModelMatrix=c.multiplyRight(s),e.cartographicOrigin=l,e.coordinateSystem||(e.modelMatrix=e.cartographicModelMatrix)}(t,t.content),this.updateContentTypes(t),this._addTileToCache(t),this.options.onTileLoad(t)}}updateContentTypes(t){if(this.type===ke.I3S)switch(t.header.isDracoGeometry&&(this.contentFormats.draco=!0),t.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0}else if(this.type===ke.TILES3D){var e;const{extensionsRemoved:n=[]}=(null===(e=t.content)||void 0===e?void 0:e.gltf)||{};n.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),n.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),n.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}}_onStartTileLoading(){this._pendingCount++,this.stats.get(En).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(En).decrementCount()}_addTileToCache(t){this._cache.add(this,t,(e=>e._updateCacheStats(t)))}_updateCacheStats(t){this.stats.get(Bn).incrementCount(),this.stats.get(xn).incrementCount(),this.gpuMemoryUsageInBytes+=t.gpuMemoryUsageInBytes||0,this.stats.get(In).count=this.gpuMemoryUsageInBytes}_unloadTile(t){this.gpuMemoryUsageInBytes-=t.gpuMemoryUsageInBytes||0,this.stats.get(xn).decrementCount(),this.stats.get(Tn).incrementCount(),this.stats.get(In).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(t),t.unloadContent()}_destroy(){const t=[];for(this.root&&t.push(this.root);t.length>0;){const e=t.pop();for(const n of e.children)t.push(n);this._destroyTile(e)}this.root=null}_destroySubtree(t){const e=t,n=[];for(n.push(e);n.length>0;){t=n.pop();for(const e of t.children)n.push(e);t!==e&&this._destroyTile(t)}e.children=[]}_destroyTile(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}_initializeTiles3DTileset(t){if(t.queryString){const e=new URLSearchParams(t.queryString),n=Object.fromEntries(e.entries());this._queryParams={...this._queryParams,...n}}if(this.asset=t.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=t.properties,this.geometricError=t.geometricError,this._extensionsUsed=t.extensionsUsed||[],this.extras=t.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const Dn="3.4.15",Fn={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(Fn);function Ln(t,e,n){(0,ye.h)(t instanceof ArrayBuffer);const i=new TextDecoder("utf8"),r=new Uint8Array(t,e,n);return i.decode(r)}var On=n(34957);const Rn={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},kn={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...Rn},Un={[Rn.DOUBLE]:Float64Array,[Rn.FLOAT]:Float32Array,[Rn.UNSIGNED_SHORT]:Uint16Array,[Rn.UNSIGNED_INT]:Uint32Array,[Rn.UNSIGNED_BYTE]:Uint8Array,[Rn.BYTE]:Int8Array,[Rn.SHORT]:Int16Array,[Rn.INT]:Int32Array},zn={DOUBLE:Rn.DOUBLE,FLOAT:Rn.FLOAT,UNSIGNED_SHORT:Rn.UNSIGNED_SHORT,UNSIGNED_INT:Rn.UNSIGNED_INT,UNSIGNED_BYTE:Rn.UNSIGNED_BYTE,BYTE:Rn.BYTE,SHORT:Rn.SHORT,INT:Rn.INT},Gn="Failed to convert GL type";class Nn{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(const e in Un){if(Un[e]===t)return e}throw new Error(Gn)}static fromName(t){const e=zn[t];if(!e)throw new Error(Gn);return e}static getArrayType(t){switch(t){case Rn.UNSIGNED_SHORT_5_6_5:case Rn.UNSIGNED_SHORT_4_4_4_4:case Rn.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const e=Un[t];if(!e)throw new Error(Gn);return e}}static getByteSize(t){return Nn.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(Nn.getArrayType(t))}static createTypedArray(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;void 0===i&&(i=(e.byteLength-n)/Nn.getByteSize(t));return new(Nn.getArrayType(t))(e,n,i)}}class Zn{constructor(t,e){(0,f.Z)(this,"json",void 0),(0,f.Z)(this,"buffer",void 0),(0,f.Z)(this,"featuresLength",0),(0,f.Z)(this,"_cachedTypedArrays",{}),this.json=t,this.buffer=e}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kn.UNSIGNED_INT,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const i=this.json[t];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(t,e,n,1,i.byteOffset):i}getPropertyArray(t,e,n){const i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(e=Nn.fromName(i.componentType)),this._getTypedArrayFromBinary(t,e,n,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(t,e,i)}getProperty(t,e,n,i,r){const o=this.json[t];if(!o)return o;const s=this.getPropertyArray(t,e,n);if(1===n)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r}_getTypedArrayFromBinary(t,e,n,i,r){const o=this._cachedTypedArrays;let s=o[t];return s||(s=Nn.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+r,i*n),o[t]=s),s}_getTypedArrayFromArray(t,e,n){const i=this._cachedTypedArrays;let r=i[t];return r||(r=Nn.createTypedArray(e,n),i[t]=r),r}}const jn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Vn={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},Hn={SCALAR:(t,e,n)=>{e[n]=t},VEC2:(t,e,n)=>{e[2*n+0]=t[0],e[2*n+1]=t[1]},VEC3:(t,e,n)=>{e[3*n+0]=t[0],e[3*n+1]=t[1],e[3*n+2]=t[2]},VEC4:(t,e,n)=>{e[4*n+0]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+3]=t[3]},MAT2:(t,e,n)=>{e[4*n+0]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+3]=t[3]},MAT3:(t,e,n)=>{e[9*n+0]=t[0],e[9*n+1]=t[1],e[9*n+2]=t[2],e[9*n+3]=t[3],e[9*n+4]=t[4],e[9*n+5]=t[5],e[9*n+6]=t[6],e[9*n+7]=t[7],e[9*n+8]=t[8],e[9*n+9]=t[9]},MAT4:(t,e,n)=>{e[16*n+0]=t[0],e[16*n+1]=t[1],e[16*n+2]=t[2],e[16*n+3]=t[3],e[16*n+4]=t[4],e[16*n+5]=t[5],e[16*n+6]=t[6],e[16*n+7]=t[7],e[16*n+8]=t[8],e[16*n+9]=t[9],e[16*n+10]=t[10],e[16*n+11]=t[11],e[16*n+12]=t[12],e[16*n+13]=t[13],e[16*n+14]=t[14],e[16*n+15]=t[15]}};const Jn=t=>void 0!==t;function Wn(t,e,n){if(!e)return null;let i=t.getExtension("3DTILES_batch_table_hierarchy");const r=e.HIERARCHY;return r&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=r,i=r),i?function(t,e){let n,i,r;const o=t.instancesLength,s=t.classes;let a,l=t.classIds,c=t.parentCounts,u=t.parentIds,h=o;Jn(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,r=getBinaryAccessor(l),l=r.createArrayBufferView(e.buffer,e.byteOffset+l.byteOffset,o));if(Jn(c))for(Jn(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,r=getBinaryAccessor(c),c=r.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,o)),a=new Uint16Array(o),h=0,n=0;n<o;++n)a[n]=h,h+=c[n];Jn(u)&&Jn(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,r=getBinaryAccessor(u),u=r.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,h));const d=s.length;for(n=0;n<d;++n){const t=s[n].length,i=s[n].instances,r=getBinaryProperties(t,i,e);s[n].instances=combine(r,i)}const f=new Array(d).fill(0),A=new Uint16Array(o);for(n=0;n<o;++n)i=l[n],A[n]=f[i],++f[i];const p={classes:s,classIds:l,classIndexes:A,parentCounts:c,parentIndexes:a,parentIds:u};return function(t){const e=t.classIds,n=e.length;for(let i=0;i<n;++i)Kn(t,i,stack)}(p),p}(i,n):null}function Qn(t,e,n){if(!t)return;const i=t.parentCounts;return t.parentIds?n(t,e):i>0?function(t,e,n){const i=t.classIds,r=t.parentCounts,o=t.parentIds,s=t.parentIndexes,a=i.length,l=scratchVisited;l.length=Math.max(l.length,a);const c=++marker,u=scratchStack;u.length=0,u.push(e);for(;u.length>0;){if(l[e=u.pop()]===c)continue;l[e]=c;const i=n(t,e);if(Jn(i))return i;const a=r[e],h=s[e];for(let t=0;t<a;++t){const n=o[h+t];n!==e&&u.push(n)}}return null}(t,e,n):function(t,e,n){let i=!0;for(;i;){const r=n(t,e);if(Jn(r))return r;const o=t.parentIds[e];i=o!==e,e=o}throw new Error("traverseHierarchySingleParent")}(t,e,n)}function Kn(t,e,n){const i=t.parentCounts,r=t.parentIds,o=t.parentIndexes,s=t.classIds.length;if(!Jn(r))return;assert(e<s,"Parent index ".concat(e," exceeds the total number of instances: ").concat(s)),assert(-1===n.indexOf(e),"Circular dependency detected in the batch table hierarchy."),n.push(e);const a=Jn(i)?i[e]:1,l=Jn(i)?o[e]:e;for(let c=0;c<a;++c){const i=r[l+c];i!==e&&Kn(t,i,n)}n.pop(e)}function qn(t){return void 0!==t&&null!==t}const Xn=(t,e)=>t,Yn={HIERARCHY:!0,extensions:!0,extras:!0};class $n{constructor(t,e,n){var i;let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(0,f.Z)(this,"json",void 0),(0,f.Z)(this,"binary",void 0),(0,f.Z)(this,"featureCount",void 0),(0,f.Z)(this,"_extensions",void 0),(0,f.Z)(this,"_properties",void 0),(0,f.Z)(this,"_binaryProperties",void 0),(0,f.Z)(this,"_hierarchy",void 0),(0,ye.h)(n>=0),this.json=t||{},this.binary=e,this.featureCount=n,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={};for(const o in this.json)Yn[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),r["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Wn(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,e){if(this._checkBatchId(t),(0,ye.h)("string"===typeof e,e),this._hierarchy){return qn(Qn(this._hierarchy,t,((t,n)=>{const i=t.classIds[n];return t.classes[i].name===e})))}return!1}isExactClass(t,e){return(0,ye.h)("string"===typeof e,e),this.getExactClassName(t)===e}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){const e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}hasProperty(t,e){return this._checkBatchId(t),(0,ye.h)("string"===typeof e,e),qn(this._properties[e])||this._hasPropertyInHierarchy(t,e)}getPropertyNames(t,e){this._checkBatchId(t),(e=qn(e)?e:[]).length=0;const n=Object.keys(this._properties);return e.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}getProperty(t,e){if(this._checkBatchId(t),(0,ye.h)("string"===typeof e,e),this._binaryProperties){const n=this._binaryProperties[e];if(qn(n))return this._getBinaryProperty(n,t)}const n=this._properties[e];if(qn(n))return Xn(n[t]);if(this._hierarchy){const n=this._getHierarchyProperty(t,e);if(qn(n))return n}}setProperty(t,e,n){const i=this.featureCount;if(this._checkBatchId(t),(0,ye.h)("string"===typeof e,e),this._binaryProperties){const i=this._binaryProperties[e];if(i)return void this._setBinaryProperty(i,t,n)}if(this._hierarchy&&this._setHierarchyProperty(this,t,e,n))return;let r=this._properties[e];qn(r)||(this._properties[e]=new Array(i),r=this._properties[e]),r[t]=Xn(n)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,e){return t.unpack(t.typedArray,e)}_setBinaryProperty(t,e,n){t.pack(n,t.typedArray,e)}_initializeBinaryProperties(){let t=null;for(const e in this._properties){const n=this._properties[e],i=this._initializeBinaryProperty(e,n);i&&(t=t||{},t[e]=i)}return t}_initializeBinaryProperty(t,e){if("byteOffset"in e){const n=e;(0,ye.h)(this.binary,"Property ".concat(t," requires a batch table binary.")),(0,ye.h)(n.type,"Property ".concat(t," requires a type."));const i=function(t,e,n,i){const{componentType:r}=t;(0,ye.h)(t.componentType);const o="string"===typeof r?Nn.fromName(r):r,s=jn[t.type],a=Vn[t.type],l=Hn[t.type];return n+=t.byteOffset,{values:Nn.createTypedArray(o,e,n,s*i),type:o,size:s,unpacker:a,packer:l}}(n,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}_hasPropertyInHierarchy(t,e){if(!this._hierarchy)return!1;const n=Qn(this._hierarchy,t,((t,n)=>{const i=t.classIds[n];return qn(t.classes[i].instances[e])}));return qn(n)}_getPropertyNamesInHierarchy(t,e){Qn(this._hierarchy,t,((t,n)=>{const i=t.classIds[n],r=t.classes[i].instances;for(const o in r)r.hasOwnProperty(o)&&-1===e.indexOf(o)&&e.push(o)}))}_getHierarchyProperty(t,e){return Qn(this._hierarchy,t,((t,n)=>{const i=t.classIds[n],r=t.classes[i],o=t.classIndexes[n],s=r.instances[e];return qn(s)?qn(s.typedArray)?this._getBinaryProperty(s,o):Xn(s[o]):null}))}_setHierarchyProperty(t,e,n,i){const r=Qn(this._hierarchy,e,((t,r)=>{const o=t.classIds[r],s=t.classes[o],a=t.classIndexes[r],l=s.instances[n];return!!qn(l)&&((0,ye.h)(r===e,'Inherited property "'.concat(n,'" is read-only.')),qn(l.typedArray)?this._setBinaryProperty(l,a,i):l[a]=Xn(i),!0)}));return qn(r)}}const ti=4;function ei(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=new DataView(e);if(t.magic=i.getUint32(n,!0),n+=ti,t.version=i.getUint32(n,!0),n+=ti,t.byteLength=i.getUint32(n,!0),n+=ti,1!==t.version)throw new Error("3D Tile Version ".concat(t.version," not supported"));return n}const ni=4,ii="b3dm tile in legacy format.";function ri(t,e,n){const i=new DataView(e);let r;t.header=t.header||{};let o=i.getUint32(n,!0);n+=ni;let s=i.getUint32(n,!0);n+=ni;let a=i.getUint32(n,!0);n+=ni;let l=i.getUint32(n,!0);return n+=ni,a>=570425344?(n-=2*ni,r=o,a=s,l=0,o=0,s=0,console.warn(ii)):l>=570425344&&(n-=ni,r=a,a=o,l=s,o=0,s=0,console.warn(ii)),t.header.featureTableJsonByteLength=o,t.header.featureTableBinaryByteLength=s,t.header.batchTableJsonByteLength=a,t.header.batchTableBinaryByteLength=l,t.header.batchLength=r,n}function oi(t,e,n,i){return n=function(t,e,n,i){const{featureTableJsonByteLength:r,featureTableBinaryByteLength:o,batchLength:s}=t.header;if(t.featureTableJson={BATCH_LENGTH:s||0},r>0){const i=Ln(e,n,r);t.featureTableJson=JSON.parse(i)}return n+=r,t.featureTableBinary=new Uint8Array(e,n,o),n+=o,n}(t,e,n),n=function(t,e,n,i){const{batchTableJsonByteLength:r,batchTableBinaryByteLength:o}=t.header;if(r>0){const i=Ln(e,n,r);t.batchTableJson=JSON.parse(i),n+=r,o>0&&(t.batchTableBinary=new Uint8Array(e,n,o),t.batchTableBinary=new Uint8Array(t.batchTableBinary),n+=o)}return n}(t,e,n),n}function si(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const n=t>>11&31,i=t>>5&63,r=31&t;return e[0]=n<<3,e[1]=i<<2,e[2]=r<<3,e}function ai(t,e,n){if(!e&&(!t||!t.batchIds||!n))return null;const{batchIds:i,isRGB565:r,pointCount:o}=t;if(i&&n){const t=new Uint8ClampedArray(3*o);for(let e=0;e<o;e++){const r=i[e],o=n.getProperty(r,"dimensions").map((t=>255*t));t[3*e]=o[0],t[3*e+1]=o[1],t[3*e+2]=o[2]}return{type:kn.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}if(r){const t=new Uint8ClampedArray(3*o);for(let n=0;n<o;n++){const i=si(e[n]);t[3*n]=i[0],t[3*n+1]=i[1],t[3*n+2]=i[2]}return{type:kn.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}return e&&e.length===3*o?{type:kn.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:kn.UNSIGNED_BYTE,value:e,size:4,normalized:!0}}var li=n(95282),ci=n(69801),ui=n(77548),hi=n(63986);class di extends li.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(2),(0,Gt.kJ)(t)&&1===arguments.length?this.copy(t):(Gt.vc.debug&&((0,ci.u5)(t),(0,ci.u5)(e)),this[0]=t,this[1]=e)}set(t,e){return this[0]=t,this[1]=e,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Gt.vc.debug&&((0,ci.u5)(t.x),(0,ci.u5)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return ui.fF(this,this,t),this.check()}transformAsVector(t){return(0,hi.pb)(this,this,t),this.check()}transformByMatrix3(t){return ui.kK(this,this,t),this.check()}transformByMatrix2x3(t){return ui.iu(this,this,t),this.check()}transformByMatrix2(t){return ui.c(this,this,t),this.check()}}new di,new kt.Z,new di,new di,new Uint8Array(1);function fi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return(0,Gt.uZ)(t,0,e)/e*2-1}function Ai(t){return t<0?-1:1}function pi(t,e,n,i){if(function(t,e){if(!t)throw new Error("math.gl assertion failed. ".concat(e))}(i),t<0||t>n||e<0||e>n)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(n));if(i.x=fi(t,n),i.y=fi(e,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){const t=i.x;i.x=(1-Math.abs(i.y))*Ai(t),i.y=(1-Math.abs(t))*Ai(i.y)}return i.normalize()}function gi(t,e,n){return pi(t,e,255,n)}const mi=new kt.Z;function yi(t,e,n){return t.isQuantized?n["3d-tiles"]&&n["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){const n=new kt.Z,i=new Float32Array(3*t.pointCount);for(let r=0;r<t.pointCount;r++)n.set(e[3*r],e[3*r+1],e[3*r+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(i,3*r);return i}(t,e)):{type:kn.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}async function vi(t,e,n,i,r){n=oi(t,e,n=ri(t,e,n=ei(t,e,n))),function(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}(t);const{featureTable:o,batchTable:s}=function(t){const e=new Zn(t.featureTableJson,t.featureTableBinary),n=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(n))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=n,t.featuresLength=n,t.pointsLength=n,t.pointCount=n,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",kn.FLOAT,3);const i=function(t,e){let n=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",kn.UNSIGNED_SHORT,1),t.batchIds)){const i=e.getGlobalProperty("BATCH_LENGTH");if(!i)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:r,batchTableBinary:o}=t;n=new $n(r,o,i)}return n}(t,e);return{featureTable:e,batchTable:i}}(t);return await async function(t,e,n,i,r){let o,s,a;const l=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];l&&(a=l.properties);const c=e.getExtension("3DTILES_draco_point_compression");if(c){s=c.properties;const e=c.byteOffset,n=c.byteLength;if(!s||!Number.isFinite(e)||!n)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=t.featureTableBinary.slice(e,e+n),t.hasPositions=Number.isFinite(s.POSITION),t.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),t.hasNormals=Number.isFinite(s.NORMAL),t.hasBatchIds=Number.isFinite(s.BATCH_ID),t.isTranslucent=Number.isFinite(s.RGBA)}if(!o)return!0;const u={buffer:o,properties:{...s,...a},featureTableProperties:s,batchTableProperties:a,dequantizeInShader:!1};return await async function(t,e,n,i){const{parse:r}=i,o={...n,draco:{...n.draco,extraAttributes:e.batchTableProperties||{}}};delete o["3d-tiles"];const s=await r(e.buffer,On.VJ,o),a=s.attributes.POSITION&&s.attributes.POSITION.value,l=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,c=s.attributes.NORMAL&&s.attributes.NORMAL.value,u=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=a&&s.attributes.POSITION.value.quantization,d=c&&s.attributes.NORMAL.value.quantization;if(h){const e=s.POSITION.data.quantization,n=e.range;t.quantizedVolumeScale=new kt.Z(n,n,n),t.quantizedVolumeOffset=new kt.Z(e.minValues),t.quantizedRange=(1<<e.quantizationBits)-1,t.isQuantizedDraco=!0}d&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);const f={};if(e.batchTableProperties)for(const A of Object.keys(e.batchTableProperties))s.attributes[A]&&s.attributes[A].value&&(f[A.toLowerCase()]=s.attributes[A].value);t.attributes={positions:a,colors:ai(t,l,void 0),normals:c,batchIds:u,...f}}(t,u,i,r)}(t,o,0,i,r),function(t,e,n){if(!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",kn.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){const i=e.getPropertyArray("POSITION_QUANTIZED",kn.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",kn.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",kn.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=yi(t,i,n)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(t,o,i),function(t,e,n){if(!t.attributes.colors){let i=null;e.hasProperty("RGBA")?(i=e.getPropertyArray("RGBA",kn.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?i=e.getPropertyArray("RGB",kn.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(i=e.getPropertyArray("RGB565",kn.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=ai(t,i,n)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",kn.UNSIGNED_BYTE,4))}(t,o,s),function(t,e){if(!t.attributes.normals){let n=null;e.hasProperty("NORMAL")?n=e.getPropertyArray("NORMAL",kn.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(n=e.getPropertyArray("NORMAL_OCT16P",kn.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){const n=new Float32Array(3*t.pointsLength);for(let i=0;i<t.pointsLength;i++)gi(e[2*i],e[2*i+1],mi),mi.toArray(n,3*i);return{type:kn.FLOAT,size:2,value:n}}return{type:kn.FLOAT,size:2,value:e}}(t,n)}}(t,o),n}const _i={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof n.g&&n.g,document:"undefined"!==typeof document&&document},bi=_i.global||_i.self||_i.window||{},xi="object"!==typeof process||"[object process]"!==String(process)||process.browser,wi="function"===typeof importScripts,Ci=("undefined"!==typeof window&&window.orientation,"undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version)),Bi=(Ci&&parseFloat(Ci[1]),null),Ei=null,Ti=null,Si=null;const Mi="3.4.15",Ii={};async function Pi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e&&(t=function(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};if(i[t])return i[t];if(!xi)return"modules/".concat(e,"/dist/libs/").concat(t);if(n.CDN)return function(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(e,"@").concat(Mi,"/dist/libs/").concat(t);if(wi)return"../src/libs/".concat(t);return"modules/".concat(e,"/src/libs/").concat(t)}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})),Ii[t]=Ii[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!xi)try{return i&&Ti&&await Ti(t)}catch{return null}if(wi)return importScripts(t);const e=await fetch(t);return function(t,e){if(!xi)return Si&&Si(t,e);if(wi)return eval.call(bi,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(i){n.text=t}return document.body.appendChild(n),null}(await e.text(),t)}(t),await Ii[t]}const Di="3.4.15",Fi="https://unpkg.com/@loaders.gl/textures@".concat(Di,"/dist/libs/basis_encoder.wasm"),Li="https://unpkg.com/@loaders.gl/textures@".concat(Di,"/dist/libs/basis_encoder.js");let Oi,Ri;async function ki(t){const e=t.modules||{};return e.basis?e.basis:(Oi=Oi||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await Pi("basis_transcoder.js","textures",t),await Pi("basis_transcoder.wasm","textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise((e=>{t(n).then((t=>{const{BasisFile:n,initializeBasis:i}=t;i(),e({BasisFile:n})}))}))}(e,n)}(t),await Oi)}async function Ui(t){const e=t.modules||{};return e.basisEncoder?e.basisEncoder:(Ri=Ri||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await Pi(Li,"textures",t),await Pi(Fi,"textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise((e=>{t(n).then((t=>{const{BasisFile:n,KTX2File:i,initializeBasis:r,BasisEncoder:o}=t;r(),e({BasisFile:n,KTX2File:i,BasisEncoder:o})}))}))}(e,n)}(t),await Ri)}const zi=33776,Gi=33779,Ni=35840,Zi=35842,ji=36196,Vi=37808,Hi=["","WEBKIT_","MOZ_"],Ji={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let Wi=null;function Qi(t){if(!Wi){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,Wi=new Set;for(const e of Hi)for(const n in Ji)if(t&&t.getExtension("".concat(e).concat(n))){const t=Ji[n];Wi.add(t)}}return Wi}n(88687);const Ki=[171,75,84,88,32,50,48,187,13,10,26,10];const qi={etc1:{basisFormat:0,compressed:!0,format:ji},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:zi},bc3:{basisFormat:3,compressed:!0,format:Gi},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Ni},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Zi},"astc-4x4":{basisFormat:10,compressed:!0,format:Vi},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function Xi(t,e,n){const i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");const t=i.getNumImages(),e=[];for(let r=0;r<t;r++){const t=i.getNumLevels(r),o=[];for(let e=0;e<t;e++)o.push(Yi(i,r,e,n));e.push(o)}return e}finally{i.close(),i.delete()}}function Yi(t,e,n,i){const r=t.getImageWidth(e,n),o=t.getImageHeight(e,n),s=t.getHasAlpha(),{compressed:a,format:l,basisFormat:c}=er(i,s),u=t.getImageTranscodedSizeInBytes(e,n,c),h=new Uint8Array(u);if(!t.transcodeImage(h,e,n,c,0,0))throw new Error("failed to start Basis transcoding");return{width:r,height:o,data:h,compressed:a,format:l,hasAlpha:s}}function $i(t,e,n){const i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");const t=i.getLevels(),e=[];for(let r=0;r<t;r++){e.push(tr(i,r,n));break}return[e]}finally{i.close(),i.delete()}}function tr(t,e,n){const{alphaFlag:i,height:r,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:l}=er(n,i),c=t.getImageTranscodedSizeInBytes(e,0,0,l),u=new Uint8Array(c);if(!t.transcodeImage(u,e,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:r,data:u,compressed:s,levelSize:c,hasAlpha:i,format:a}}function er(t,e){let n=t&&t.basis&&t.basis.format;return"auto"===n&&(n=nr()),"object"===typeof n&&(n=e?n.alpha:n.noAlpha),n=n.toLowerCase(),qi[n]}function nr(){const t=Qi();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}const ir={name:"Basis",id:xi?"basis":"basis-nodejs",module:"textures",version:"3.4.15",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},rr={...ir,parse:async function(t,e){if("auto"===e.basis.containerFormat){if(function(t){const e=new Uint8Array(t);return!(e.byteLength<Ki.length||e[0]!==Ki[0]||e[1]!==Ki[1]||e[2]!==Ki[2]||e[3]!==Ki[3]||e[4]!==Ki[4]||e[5]!==Ki[5]||e[6]!==Ki[6]||e[7]!==Ki[7]||e[8]!==Ki[8]||e[9]!==Ki[9]||e[10]!==Ki[10]||e[11]!==Ki[11])}(t)){return $i((await Ui(e)).KTX2File,t,e)}const{BasisFile:n}=await ki(e);return Xi(n,t,e)}if("encoder"===e.basis.module){const n=await Ui(e);return"ktx2"===e.basis.containerFormat?$i(n.KTX2File,t,e):Xi(n.BasisFile,t,e)}{const{BasisFile:n}=await ki(e);return Xi(n,t,e)}}};var or=n(27036),sr=n(52194);function ar(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function lr(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const n=e.baseUri||e.uri;if(!n)throw new Error("'baseUri' must be provided to resolve relative url ".concat(t));return n.substr(0,n.lastIndexOf("/")+1)+t}function cr(t,e,n){const i=t.bufferViews[n];ar(i);const r=e[i.buffer];ar(r);const o=(i.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,o,i.byteLength)}var ur=n(90042),hr=n(83497);const dr=["SCALAR","VEC2","VEC3","VEC4"],fr=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ar=new Map(fr),pr={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},gr={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},mr={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function yr(t){return dr[t-1]||dr[0]}function vr(t){const e=Ar.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function _r(t,e){const n=mr[t.componentType],i=pr[t.type],r=gr[t.componentType],o=t.count*i,s=t.count*i*r;return ar(s>=0&&s<=e.byteLength),{ArrayType:n,length:o,byteLength:s}}function br(t){let{images:e,bufferViews:n}=t;e=e||[],n=n||[];const i=e.map((t=>t.bufferView));n=n.filter((t=>!i.includes(t)));const r=n.reduce(((t,e)=>t+e.byteLength),0),o=e.reduce(((t,e)=>{const{width:n,height:i}=e.image;return t+n*i}),0);return r+Math.ceil(4*o*1.33)}const xr={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class wr{constructor(t){(0,f.Z)(this,"gltf",void 0),(0,f.Z)(this,"sourceBuffers",void 0),(0,f.Z)(this,"byteLength",void 0),this.gltf=t||{json:{...xr},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){const e=this.getUsedExtensions().find((e=>e===t)),n=this.json.extensions||{};return e?n[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find((e=>e===t))?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"===typeof e)return e;const n=this.json[t]&&this.json[t][e];if(!n)throw new Error("glTF file error: Could not find ".concat(t,"[").concat(e,"]"));return n}getTypedArrayForBufferView(t){const e=(t=this.getBufferView(t)).buffer,n=this.gltf.buffers[e];ar(n);const i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,{ArrayType:i,length:r}=_r(t,e);return new i(n,e.byteOffset+t.byteOffset,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,i=e.byteOffset||0;return new Uint8Array(n,i,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,n){return t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}setObjectExtension(t,e,n){(t.extensions||{})[e]=n}removeObjectExtension(t,e){const n=t.extensions||{},i=n[e];return delete n[e],i}addExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ar(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ar(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((e=>e===t))||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((e=>e===t))||this.json.extensionsRequired.push(t)}removeExtension(t){if(!this.getExtension(t))return;this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);const e=this.json.extensionsRemoved;e.includes(t)||e.push(t)}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:n}=t;this.json.nodes=this.json.nodes||[];const i={mesh:e};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:n,material:i,mode:r=4}=t,o={primitives:[{attributes:this._addAttributes(e),mode:r}]};if(n){const t=this._addIndices(n);o.primitives[0].indices=t}return Number.isFinite(i)&&(o.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const n=(0,ur.I)(t),i=e||(null===n||void 0===n?void 0:n.mimeType),r={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}addBufferView(t){const e=t.byteLength;ar(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=(0,hr.Pk)(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(t,e){const n={bufferView:t,type:yr(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3};const n=this.addBufferView(t);let i={min:e.min,max:e.max};i.min&&i.max||(i=this._getAccessorMinMax(t,e.size));const r={size:e.size,componentType:vr(t),count:Math.round(t.length/e.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(r,e))}addTexture(t){const{imageIndex:e}=t,n={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const n=this.byteLength,i=new ArrayBuffer(n),r=new Uint8Array(i);let o=0;for(const s of this.sourceBuffers||[])o=(0,hr.T_)(s,r,o);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}_removeStringFromArray(t,e){let n=!0;for(;n;){const i=t.indexOf(e);i>-1?t.splice(i,1):n=!1}}_addAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={};for(const n in t){const i=t[n],r=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);e[r]=o}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const n={min:null,max:null};if(t.length<e)return n;n.min=[],n.max=[];const i=t.subarray(0,e);for(const r of i)n.min.push(r),n.max.push(r);for(let r=e;r<t.length;r+=e)for(let i=0;i<e;i++)n.min[0+i]=Math.min(n.min[0+i],t[r+i]),n.max[0+i]=Math.max(n.max[0+i],t[r+i]);return n}}const Cr="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",Br="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",Er=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Tr=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Sr={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Mr={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};let Ir;async function Pr(){return Ir||(Ir=async function(){let t=Cr;WebAssembly.validate(Er)&&(t=Br,console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(function(t){const e=new Uint8Array(t.length);for(let i=0;i<t.length;++i){const n=t.charCodeAt(i);e[i]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let n=0;for(let i=0;i<t.length;++i)e[n++]=e[i]<60?Tr[e[i]]:64*(e[i]-60)+e[++i];return e.buffer.slice(0,n)}(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}()),Ir}function Dr(t,e,n,i,r,o,s){const a=t.exports.sbrk,l=i+3&-4,c=a(l*r),u=a(o.length),h=new Uint8Array(t.exports.memory.buffer);h.set(o,u);const d=e(c,i,r,u,o.length);if(0===d&&s&&s(c,l,r),n.set(h.subarray(c,c+i*r)),a(c-a(0)),0!==d)throw new Error("Malformed buffer data: ".concat(d))}const Fr="EXT_meshopt_compression",Lr=Fr;async function Or(t,e){var n;const i=new wr(t);if(null===e||void 0===e||null===(n=e.gltf)||void 0===n||!n.decompressMeshes)return;const r=[];for(const o of t.json.bufferViews||[])r.push(Rr(i,o));await Promise.all(r),i.removeExtension(Fr)}async function Rr(t,e){const n=t.getObjectExtension(e,Fr);if(n){const{byteOffset:i=0,byteLength:r=0,byteStride:o,count:s,mode:a,filter:l="NONE",buffer:c}=n,u=t.gltf.buffers[c],h=new Uint8Array(u.arrayBuffer,u.byteOffset+i,r),d=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);return await async function(t,e,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NONE";const s=await Pr();Dr(s,s.exports[Mr[r]],t,e,n,i,s.exports[Sr[o||"NONE"]])}(d,s,o,h,a,l),d}return null}var kr=n(12746);const Ur="EXT_texture_webp",zr=Ur;function Gr(t,e){const n=new wr(t);if(!(0,kr.V)("image/webp")){if(n.getRequiredExtensions().includes(Ur))throw new Error("gltf: Required extension ".concat(Ur," not supported by browser"));return}const{json:i}=n;for(const r of i.textures||[]){const t=n.getObjectExtension(r,Ur);t&&(r.source=t.source),n.removeObjectExtension(r,Ur)}n.removeExtension(Ur)}const Nr="KHR_texture_basisu",Zr=Nr;function jr(t,e){const n=new wr(t),{json:i}=n;for(const r of i.textures||[]){const t=n.getObjectExtension(r,Nr);t&&(r.source=t.source),n.removeObjectExtension(r,Nr)}n.removeExtension(Nr)}function Vr(t){const{buffer:e,size:n,count:i}=function(t){let e=t,n=1,i=0;t&&t.value&&(e=t.value,n=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return null;if(Array.isArray(t))return new e(t);if(n&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),i=e.length/n);return{buffer:e,size:n,count:i}}(t);return{value:e,size:n,byteOffset:0,count:i,type:yr(n),componentType:vr(e)}}const Hr="KHR_draco_mesh_compression",Jr=Hr;function Wr(t,e,n){const i=new wr(t);for(const r of Yr(i))i.getObjectExtension(r,Hr)}async function Qr(t,e,n){var i;if(null===e||void 0===e||null===(i=e.gltf)||void 0===i||!i.decompressMeshes)return;const r=new wr(t),o=[];for(const s of Yr(r))r.getObjectExtension(s,Hr)&&o.push(qr(r,s,e,n));await Promise.all(o),r.removeExtension(Hr)}function Kr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new wr(t);for(const i of n.json.meshes||[])Xr(i,e),n.addRequiredExtension(Hr)}async function qr(t,e,n,i){const r=t.getObjectExtension(e,Hr);if(!r)return;const o=t.getTypedArrayForBufferView(r.bufferView),s=(0,sr.qv)(o.buffer,o.byteOffset),{parse:a}=i,l={...n};delete l["3d-tiles"];const c=await a(s,On.VJ,l,i),u=function(t){const e={};for(const n in t){const i=t[n];if("indices"!==n){const t=Vr(i);e[n]=t}}return e}(c.attributes);for(const[h,d]of Object.entries(u))if(h in e.attributes){const n=e.attributes[h],i=t.getAccessor(n);null!==i&&void 0!==i&&i.min&&null!==i&&void 0!==i&&i.max&&(d.min=i.min,d.max=i.max)}e.attributes=u,c.indices&&(e.indices=Vr(c.indices)),function(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(e)}function Xr(t,e){var n;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!r.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const s=r.DracoWriter.encodeSync({attributes:t}),a=null===o||void 0===o||null===(n=o.parseSync)||void 0===n?void 0:n.call(o,{attributes:t}),l=r._addFauxAttributes(a.attributes),c=r.addBufferView(s);return{primitives:[{attributes:l,mode:i,extensions:{[Hr]:{bufferView:c,attributes:l}}}]}}function*Yr(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}const $r={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},to={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};const eo="KHR_texture_transform",no=eo,io=new kt.Z,ro=new Ne.Z,oo=new Ne.Z;async function so(t,e){if(!new wr(t).getExtension(eo))return;const n=t.json.materials||[];for(let i=0;i<n.length;i++)ao(i,t)}function ao(t,e){var n,i,r;const o=[],s=null===(n=e.json.materials)||void 0===n?void 0:n[t],a=null===s||void 0===s||null===(i=s.pbrMetallicRoughness)||void 0===i?void 0:i.baseColorTexture;a&&lo(e,t,a,o);const l=null===s||void 0===s?void 0:s.emissiveTexture;l&&lo(e,t,l,o);const c=null===s||void 0===s?void 0:s.normalTexture;c&&lo(e,t,c,o);const u=null===s||void 0===s?void 0:s.occlusionTexture;u&&lo(e,t,u,o);const h=null===s||void 0===s||null===(r=s.pbrMetallicRoughness)||void 0===r?void 0:r.metallicRoughnessTexture;h&&lo(e,t,h,o)}function lo(t,e,n,i){const r=function(t,e){var n;const i=null===(n=t.extensions)||void 0===n?void 0:n[eo],{texCoord:r=0}=t,{texCoord:o=r}=i,s=-1!==e.findIndex((t=>{let[e,n]=t;return e===r&&n===o}));if(!s){const n=function(t){const{offset:e=[0,0],rotation:n=0,scale:i=[1,1]}=t,r=(new Ne.Z).set(1,0,0,0,1,0,e[0],e[1],1),o=ro.set(Math.cos(n),Math.sin(n),0,-Math.sin(n),Math.cos(n),0,0,0,1),s=oo.set(i[0],0,0,0,i[1],0,0,0,1);return r.multiplyRight(o).multiplyRight(s)}(i);return r!==o&&(t.texCoord=o),e.push([r,o]),{originalTexCoord:r,texCoord:o,matrix:n}}return null}(n,i);if(!r)return;const o=t.json.meshes||[];for(const s of o)for(const n of s.primitives){const i=n.material;Number.isFinite(i)&&e===i&&co(t,n,r)}}function co(t,e,n){const{originalTexCoord:i,texCoord:r,matrix:o}=n,s=e.attributes["TEXCOORD_".concat(i)];if(Number.isFinite(s)){var a;const n=null===(a=t.json.accessors)||void 0===a?void 0:a[s];if(n&&n.bufferView){var l;const s=null===(l=t.json.bufferViews)||void 0===l?void 0:l[n.bufferView];if(s){const{arrayBuffer:a,byteOffset:l}=t.buffers[s.buffer],c=(l||0)+(n.byteOffset||0)+(s.byteOffset||0),{ArrayType:u,length:h}=_r(n,s),d=to[n.componentType],f=$r[n.type],A=s.byteStride||d*f,p=new Float32Array(h);for(let t=0;t<n.count;t++){const e=new u(a,c+t*A,2);io.set(e[0],e[1],1),io.transformByMatrix3(o),p.set([io[0],io[1]],t*f)}i===r?function(t,e,n,i){t.componentType=5126,n.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength}),e.buffer=n.length-1,e.byteLength=i.buffer.byteLength,e.byteOffset=0,delete e.byteStride}(n,s,t.buffers,p):function(t,e,n,i,r){i.buffers.push({arrayBuffer:r.buffer,byteOffset:0,byteLength:r.buffer.byteLength});const o=i.json.bufferViews;if(!o)return;o.push({buffer:i.buffers.length-1,byteLength:r.buffer.byteLength,byteOffset:0});const s=i.json.accessors;if(!s)return;s.push({bufferView:(null===o||void 0===o?void 0:o.length)-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),n.attributes["TEXCOORD_".concat(t)]=s.length-1}(r,n,e,t,p)}}}}const uo="KHR_lights_punctual",ho=uo;async function fo(t){const e=new wr(t),{json:n}=e,i=e.getExtension(uo);i&&(e.json.lights=i.lights,e.removeExtension(uo));for(const r of n.nodes||[]){const t=e.getObjectExtension(r,uo);t&&(r.light=t.light),e.removeObjectExtension(r,uo)}}async function Ao(t){const e=new wr(t),{json:n}=e;if(n.lights){const t=e.addExtension(uo);ar(!t.lights),t.lights=n.lights,delete n.lights}if(e.json.lights){for(const t of e.json.lights){const n=t.node;e.addObjectExtension(n,uo,t)}delete e.json.lights}}const po="KHR_materials_unlit",go=po;async function mo(t){const e=new wr(t),{json:n}=e;for(const i of n.materials||[]){i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,po)}e.removeExtension(po)}function yo(t){const e=new wr(t),{json:n}=e;if(e.materials)for(const i of n.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,po,{}),e.addExtension(po))}const vo="KHR_techniques_webgl",_o=vo;async function bo(t){const e=new wr(t),{json:n}=e,i=e.getExtension(vo);if(i){const t=function(t,e){const{programs:n=[],shaders:i=[],techniques:r=[]}=t,o=new TextDecoder;return i.forEach((t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=o.decode(e.getTypedArrayForBufferView(t.bufferView))})),n.forEach((t=>{t.fragmentShader=i[t.fragmentShader],t.vertexShader=i[t.vertexShader]})),r.forEach((t=>{t.program=n[t.program]})),r}(i,e);for(const i of n.materials||[]){const n=e.getObjectExtension(i,vo);n&&(i.technique=Object.assign({},n,t[n.technique]),i.technique.values=wo(i.technique,e)),e.removeObjectExtension(i,vo)}e.removeExtension(vo)}}async function xo(t,e){}function wo(t,e){const n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((e=>{t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)})),Object.keys(n).forEach((t=>{"object"===typeof n[t]&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))})),n}const Co="EXT_feature_metadata",Bo=Co;async function Eo(t){!function(t){var e;const n=t.getExtension(Co),i=null===n||void 0===n||null===(e=n.schema)||void 0===e?void 0:e.classes,r=null===n||void 0===n?void 0:n.featureTables;(null===n||void 0===n?void 0:n.featureTextures)&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.');if(i&&r)for(const o in i){const e=i[o],n=Mo(r,o);n&&To(t,n,e)}}(new wr(t))}function To(t,e,n){for(const r in n.properties){var i;const o=n.properties[r],s=null===e||void 0===e||null===(i=e.properties)||void 0===i?void 0:i[r],a=e.count;if(s){const e=So(t,o,a,s);s.data=e}}}function So(t,e,n,i){const r=i.bufferView;let o=t.getTypedArrayForBufferView(r);switch(e.type){case"STRING":{const e=i.stringOffsetBufferView;o=function(t,e,n){const i=[],r=new TextDecoder("utf8");let o=0;const s=4;for(let a=0;a<n;a++){const n=e[(a+1)*s]-e[a*s],l=t.subarray(o,n+o),c=r.decode(l);i.push(c),o+=n}return i}(o,t.getTypedArrayForBufferView(e),n);break}}return o}function Mo(t,e){for(const n in t){const i=t[n];if(i.class===e)return i}return null}const Io=[r,o,s,a,c,u,h,l,d];function Po(t,e){var n;const i=(null===e||void 0===e||null===(n=e.gltf)||void 0===n?void 0:n.excludeExtensions)||{};return!(t in i&&!i[t])}const Do="KHR_binary_glTF";const Fo={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Lo={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class Oo{constructor(){(0,f.Z)(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),(0,f.Z)(this,"json",void 0)}normalize(t,e){this.json=t.json;const n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(n.asset.version))}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(t){const e=new wr(t),{json:n}=e;for(const i of n.images||[]){const t=e.getObjectExtension(i,Do);t&&Object.assign(i,t),e.removeObjectExtension(i,Do)}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,e.removeExtension(Do)}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in Fo)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const n=t[e];if(n&&!Array.isArray(n)){t[e]=[];for(const i in n){const r=n[i];r.id=r.id||i;const o=t[e].length;t[e].push(r),this.idToIndexMap[e][i]=o}}}_convertObjectIdsToArrayIndices(t){for(const e in Fo)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:n,material:i}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");n&&(e.indices=this._convertIdToIndex(n,"accessor")),i&&(e.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map((t=>this._convertIdToIndex(t,"node")))),t.meshes&&(t.meshes=t.meshes.map((t=>this._convertIdToIndex(t,"mesh"))))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map((t=>this._convertIdToIndex(t,"node"))))}_convertIdsToIndices(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute ".concat(e)),t[e]=[]);for(const n of t[e])for(const t in n){const e=n[t],i=this._convertIdToIndex(e,t);n[t]=i}}_convertIdToIndex(t,e){const n=Lo[e];if(n in this.idToIndexMap){const i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error("gltf v1: failed to resolve ".concat(e," with id ").concat(t));return i}return t}_updateObjects(t){for(const e of this.json.buffers)delete e.type}_updateMaterial(t){for(const r of t.materials){var e,n,i;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const o=(null===(e=r.values)||void 0===e?void 0:e.tex)||(null===(n=r.values)||void 0===n?void 0:n.texture2d_0)||(null===(i=r.values)||void 0===i?void 0:i.diffuseTex),s=t.textures.findIndex((t=>t.id===o));-1!==s&&(r.pbrMetallicRoughness.baseColorTexture={index:s})}}}const Ro={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ko={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Uo=10240,zo=10241,Go=10242,No=10243,Zo=10497,jo={magFilter:Uo,minFilter:zo,wrapS:Go,wrapT:No},Vo={[Uo]:9729,[zo]:9986,[Go]:Zo,[No]:Zo};class Ho{constructor(){(0,f.Z)(this,"baseUri",""),(0,f.Z)(this,"json",{}),(0,f.Z)(this,"buffers",[]),(0,f.Z)(this,"images",[])}postProcess(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{json:n,buffers:i=[],images:r=[],baseUri:o=""}=t;return ar(n),this.baseUri=o,this.json=n,this.buffers=i,this.images=r,this._resolveTree(this.json,e),this.json}_resolveTree(t){t.bufferViews&&(t.bufferViews=t.bufferViews.map(((t,e)=>this._resolveBufferView(t,e)))),t.images&&(t.images=t.images.map(((t,e)=>this._resolveImage(t,e)))),t.samplers&&(t.samplers=t.samplers.map(((t,e)=>this._resolveSampler(t,e)))),t.textures&&(t.textures=t.textures.map(((t,e)=>this._resolveTexture(t,e)))),t.accessors&&(t.accessors=t.accessors.map(((t,e)=>this._resolveAccessor(t,e)))),t.materials&&(t.materials=t.materials.map(((t,e)=>this._resolveMaterial(t,e)))),t.meshes&&(t.meshes=t.meshes.map(((t,e)=>this._resolveMesh(t,e)))),t.nodes&&(t.nodes=t.nodes.map(((t,e)=>this._resolveNode(t,e)))),t.skins&&(t.skins=t.skins.map(((t,e)=>this._resolveSkin(t,e)))),t.scenes&&(t.scenes=t.scenes.map(((t,e)=>this._resolveScene(t,e)))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"===typeof e)return e;const n=this.json[t]&&this.json[t][e];return n||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),n}_resolveScene(t,e){return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map((t=>this.getNode(t))),t}_resolveNode(t,e){return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map((t=>this.getNode(t)))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce(((t,e)=>{const n=this.getMesh(e);return t.id=n.id,t.primitives=t.primitives.concat(n.primitives),t}),{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map((t=>{const e=(t={...t}).attributes;t.attributes={};for(const n in e)t.attributes[n]=this.getAccessor(e[n]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t}))),t}_resolveMaterial(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture={...t.normalTexture},t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture={...t.occlustionTexture},t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture={...t.emmisiveTexture},t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness={...t.pbrMetallicRoughness};const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture={...e.baseColorTexture},e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture={...e.metallicRoughnessTexture},e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){var n,i;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(n=t.componentType,ko[n]),t.components=(i=t.type,Ro[i]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:n,byteLength:i}=_r(t,t.bufferView),r=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset;let o=e.arrayBuffer.slice(r,r+i);t.bufferView.byteStride&&(o=this._getValueFromInterleavedBuffer(e,r,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new n(o)}return t}_getValueFromInterleavedBuffer(t,e,n,i,r){const o=new Uint8Array(r*i);for(let s=0;s<r;s++){const r=e+s*n;o.set(new Uint8Array(t.arrayBuffer.slice(r,r+i)),s*i)}return o.buffer}_resolveTexture(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.getSampler(t.sampler):Vo,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||"sampler-".concat(e),t.parameters={};for(const n in t){const e=this._enumSamplerParameter(n);void 0!==e&&(t.parameters[e]=t[n])}return t}_enumSamplerParameter(t){return jo[t]}_resolveImage(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const n=this.images[e];return n&&(t.image=n),t}_resolveBufferView(t,e){const n=t.buffer,i={id:"bufferView-".concat(e),...t,buffer:this.buffers[n]},r=this.buffers[n].arrayBuffer;let o=this.buffers[n].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),i.data=new Uint8Array(r,o,t.byteLength),i}_resolveCamera(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}const Jo=1735152710,Wo=12,Qo=8,Ko=1313821514,qo=5130562,Xo=0,Yo=1,$o=0,ts=!0;function es(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=new DataView(e),o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(t.getUint8(e+0))).concat(String.fromCharCode(t.getUint8(e+1))).concat(String.fromCharCode(t.getUint8(e+2))).concat(String.fromCharCode(t.getUint8(e+3)))}(r,n+0),s=r.getUint32(n+4,ts),a=r.getUint32(n+8,ts);switch(Object.assign(t,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:o,version:s,json:{},binChunks:[]}),n+=Wo,t.version){case 1:return function(t,e,n){(0,ye.h)(t.header.byteLength>Wo+Qo);const i=e.getUint32(n+0,ts),r=e.getUint32(n+4,ts);return n+=Qo,(0,ye.h)(r===$o),ns(t,e,n,i),n+=i,n+=is(t,e,n,t.header.byteLength),n}(t,r,n);case 2:return function(t,e,n,i){return(0,ye.h)(t.header.byteLength>Wo+Qo),function(t,e,n,i){for(;n+8<=t.header.byteLength;){const r=e.getUint32(n+0,ts),o=e.getUint32(n+4,ts);switch(n+=Qo,o){case Ko:ns(t,e,n,r);break;case qo:is(t,e,n,r);break;case Xo:i.strict||ns(t,e,n,r);break;case Yo:i.strict||is(t,e,n,r)}n+=(0,hr.Pk)(r,4)}}(t,e,n,i),n+t.header.byteLength}(t,r,n,i={});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}function ns(t,e,n,i){const r=new Uint8Array(e.buffer,n,i),o=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(o),(0,hr.Pk)(i,4)}function is(t,e,n,i){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:e.buffer}),(0,hr.Pk)(i,4)}async function rs(t,e){var n,i,r,o;let s=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;!function(t,e,n,i){i.uri&&(t.baseUri=i.uri);if(e instanceof ArrayBuffer&&!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=new DataView(t),{magic:r=Jo}=n,o=i.getUint32(e,!1);return o===r||o===Jo}(e,n,i)){e=(new TextDecoder).decode(e)}if("string"===typeof e)t.json=(0,or.R)(e);else if(e instanceof ArrayBuffer){const r={};n=es(r,e,n,i.glb),ar("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),t._glb=r,t.json=r.json}else ar(!1,"GLTF: must be ArrayBuffer or string");const r=t.json.buffers||[];if(t.buffers=new Array(r.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}const o=t.json.images||[];t.images=new Array(o.length).fill({})}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(new Oo).normalize(t,e)}(t,{normalize:null===s||void 0===s||null===(n=s.gltf)||void 0===n?void 0:n.normalize}),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=Io.filter((t=>Po(t.name,e)));for(const o of i){var r;null===(r=o.preprocess)||void 0===r||r.call(o,t,e,n)}}(t,s,a);const l=[];if(null!==s&&void 0!==s&&null!==(i=s.gltf)&&void 0!==i&&i.loadBuffers&&t.json.buffers&&await async function(t,e,n){const i=t.json.buffers||[];for(let s=0;s<i.length;++s){const a=i[s];if(a.uri){var r,o;const{fetch:i}=n;ar(i);const l=lr(a.uri,e),c=await(null===n||void 0===n||null===(r=n.fetch)||void 0===r?void 0:r.call(n,l)),u=await(null===c||void 0===c||null===(o=c.arrayBuffer)||void 0===o?void 0:o.call(c));t.buffers[s]={arrayBuffer:u,byteOffset:0,byteLength:u.byteLength},delete a.uri}else null===t.buffers[s]&&(t.buffers[s]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}(t,s,a),null!==s&&void 0!==s&&null!==(r=s.gltf)&&void 0!==r&&r.loadImages){const e=async function(t,e,n){const i=function(t){const e=new Set,n=t.json.textures||[];for(const i of n)void 0!==i.source&&e.add(i.source);return Array.from(e).sort()}(t),r=t.json.images||[],o=[];for(const s of i)o.push(os(t,r[s],s,e,n));return await Promise.all(o)}(t,s,a);l.push(e)}const c=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=Io.filter((t=>Po(t.name,e)));for(const o of i){var r;await(null===(r=o.decode)||void 0===r?void 0:r.call(o,t,e,n))}}(t,s,a);return l.push(c),await Promise.all(l),null!==s&&void 0!==s&&null!==(o=s.gltf)&&void 0!==o&&o.postProcess?function(t,e){return(new Ho).postProcess(t,e)}(t,s):t}async function os(t,e,n,i,r){const{fetch:o,parse:s}=r;let a;if(e.uri&&!e.hasOwnProperty("bufferView")){const t=lr(e.uri,i),n=await o(t);a=await n.arrayBuffer(),e.bufferView={data:a}}if(Number.isFinite(e.bufferView)){const n=cr(t.json,t.buffers,e.bufferView);a=(0,sr.qv)(n.buffer,n.byteOffset,n.byteLength)}ar(a,"glTF image has no data");let l=await s(a,[_.S,rr],{mimeType:e.mimeType,basis:i.basis||{format:nr()}},r);l&&l[0]&&(l={compressed:!0,mipmaps:!1,width:l[0].width,height:l[0].height,data:l[0]}),t.images=t.images||[],t.images[n]=l}const ss={name:"glTF",id:"gltf",module:"gltf",version:"3.4.15",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;e={...ss.options,...e},e.gltf={...ss.options.gltf,...e.gltf};const{byteOffset:i=0}=e;return await rs({},t,i,e,n)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};const as={URI:0,EMBEDDED:1};function ls(t,e,n,i){t.rotateYtoZ=!0;const r=t.byteOffset+t.byteLength-n;if(0===r)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=i["3d-tiles"]&&i["3d-tiles"].assetGltfUpAxis?i["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=(0,sr.qv)(e,n,r),t.gltfByteOffset=0,t.gltfByteLength=r,n%4===0||console.warn("".concat(t.type,": embedded glb is not aligned to a 4-byte boundary.")),t.byteOffset+t.byteLength}async function cs(t,e,n,i){const r=n["3d-tiles"]||{};if(function(t,e,n){switch(e){case as.URI:const e=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),n=(new TextDecoder).decode(e);t.gltfUrl=n.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case as.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}(t,e),r.loadGLTF){const{parse:e,fetch:r}=i;t.gltfUrl&&(t.gltfArrayBuffer=await r(t.gltfUrl,n),t.gltfByteOffset=0),t.gltfArrayBuffer&&(t.gltf=await e(t.gltfArrayBuffer,ss,n,i),t.gpuMemoryUsageInBytes=br(t.gltf),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength)}}async function us(t,e,n,i,r){var o;n=function(t,e,n,i,r){n=ei(t,e,n),n=ri(t,e,n),n=oi(t,e,n),n=ls(t,e,n,i);const o=new Zn(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=o.getGlobalProperty("RTC_CENTER",kn.FLOAT,3),n}(t,e,n,i),await cs(t,as.EMBEDDED,i,r);const s=null===t||void 0===t||null===(o=t.gltf)||void 0===o?void 0:o.extensions;return s&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),n}async function hs(t,e,n,i,r){return n=function(t,e,n,i,r){if(n=ei(t,e,n),1!==t.version)throw new Error("Instanced 3D Model version ".concat(t.version," is not supported"));n=ri(t,e,n);const o=new DataView(e);if(t.gltfFormat=o.getUint32(n,!0),n+=4,n=oi(t,e,n),n=ls(t,e,n,i),0===t.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const s=new Zn(t.featureTableJson,t.featureTableBinary),a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=s.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=s.getGlobalProperty("RTC_CENTER",kn.FLOAT,3);new $n(t.batchTableJson,t.batchTableBinary,a);return function(t,e,n,i){const r={instances:new Array(i),batchTable:t._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]},o=r.instances,s=new kt.Z,a=new kt.Z,l=new kt.Z,c=new kt.Z,u=new Ne.Z,h=new Ge.Z,d=new kt.Z,f={},A=new Rt.Z,p=[],g=[],m=new kt.Z,y=new kt.Z;for(let v=0;v<i;v++){let n;if(e.hasProperty("POSITION"))n=e.getProperty("POSITION",kn.FLOAT,3,v,s);else if(e.hasProperty("POSITION_QUANTIZED")){n=e.getProperty("POSITION_QUANTIZED",kn.UNSIGNED_SHORT,3,v,s);const t=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",kn.FLOAT,3,m);if(!t)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",kn.FLOAT,3,y);if(!i)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const r=65535;for(let e=0;e<3;e++)n[e]=n[e]/r*i[e]+t[e]}if(!n)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");s.copy(n),f.translation=s,t.normalUp=e.getProperty("NORMAL_UP",kn.FLOAT,3,v,p),t.normalRight=e.getProperty("NORMAL_RIGHT",kn.FLOAT,3,v,g);const i=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",kn.UNSIGNED_SHORT,2,p),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",kn.UNSIGNED_SHORT,2,g),t.octNormalUp){if(!t.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}t.eastNorthUp?(he.WGS84.eastNorthUpToFixedFrame(s,A),A.getRotationMatrix3(u)):u.identity()}i&&(c.copy(a).cross(l).normalize(),u.setColumn(0,a),u.setColumn(1,l),u.setColumn(2,c)),h.fromMatrix3(u),f.rotation=h,d.set(1,1,1);const r=e.getProperty("SCALE",kn.FLOAT,1,v);Number.isFinite(r)&&d.multiplyByScalar(r);const _=e.getProperty("SCALE_NON_UNIFORM",kn.FLOAT,3,v,p);_&&d.scale(_),f.scale=d;let b=e.getProperty("BATCH_ID",kn.UNSIGNED_SHORT,1,v);void 0===b&&(b=v);const x=(new Rt.Z).fromQuaternion(f.rotation);A.identity(),A.translate(f.translation),A.multiplyRight(x),A.scale(f.scale);const w=A.clone();o[v]={modelMatrix:w,batchId:b}}t.instances=o}(t,s,0,a),n}(t,e,n,i),await cs(t,t.gltfFormat,i,r),n}async function ds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};switch(r.byteOffset=e,r.type=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=new DataView(t);return"".concat(String.fromCharCode(n.getUint8(e+0))).concat(String.fromCharCode(n.getUint8(e+1))).concat(String.fromCharCode(n.getUint8(e+2))).concat(String.fromCharCode(n.getUint8(e+3)))}(t,e),r.type){case Fn.COMPOSITE:return await async function(t,e,n,i,r,o){n=ei(t,e,n);const s=new DataView(e);for(t.tilesLength=s.getUint32(n,!0),n+=4,t.tiles=[];t.tiles.length<t.tilesLength&&t.byteLength-n>12;){const s={};t.tiles.push(s),n=await o(e,n,i,r,s)}return n}(r,t,e,n,i,ds);case Fn.BATCHED_3D_MODEL:return await us(r,t,e,n,i);case Fn.GLTF:return await async function(t,e,n,i){t.rotateYtoZ=!0,t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y";const{parse:r}=i;t.gltf=await r(e,ss,n,i),t.gpuMemoryUsageInBytes=br(t.gltf)}(r,t,n,i);case Fn.INSTANCED_3D_MODEL:return await hs(r,t,e,n,i);case Fn.POINT_CLOUD:return await vi(r,t,e,n,i);default:throw new Error("3DTileLoader: unknown type ".concat(r.type))}}async function fs(t,e,n,i){const r=t[e].bufferView,o=t.bufferViews[r],s=t.buffers[o.buffer];if(null===i||void 0===i||!i.url||!i.fetch)throw new Error("Url is not provided");if(!i.fetch)throw new Error("fetch is not provided");if(s.uri){const t=function(t,e){if(e.startsWith("http")){const n=new URL(t,e);return decodeURI(n.toString())}const n="http://".concat(e),i=new URL(t,n);return"/".concat(i.host).concat(i.pathname)}(s.uri,null===i||void 0===i?void 0:i.url),e=await i.fetch(t),n=await e.arrayBuffer();return new Uint8Array(n,o.byteOffset,o.byteLength)}return new Uint8Array(n,o.byteOffset,o.byteLength)}function As(t){const e=new DataView(t);return e.getUint32(0,!0)+2**32*e.getUint32(4,!0)}const ps={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Dn,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:async function(t,e,n){if(1952609651!==new Uint32Array(t.slice(0,4))[0])throw new Error("Wrong subtree file magic number");if(1!==new Uint32Array(t.slice(4,8))[0])throw new Error("Wrong subtree file verson, must be 1");const i=As(t.slice(8,16)),r=new Uint8Array(t,24,i),o=new TextDecoder("utf8").decode(r),s=JSON.parse(o),a=As(t.slice(16,24));let l=new ArrayBuffer(0);return a&&(l=t.slice(24+i)),"bufferView"in s.tileAvailability&&(s.tileAvailability.explicitBitstream=await fs(s,"tileAvailability",l,n)),"bufferView"in s.contentAvailability&&(s.contentAvailability.explicitBitstream=await fs(s,"contentAvailability",l,n)),"bufferView"in s.childSubtreeAvailability&&(s.childSubtreeAvailability.explicitBitstream=await fs(s,"childSubtreeAvailability",l,n)),s},options:{}};var gs=null;try{gs=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(Na){}function ms(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function ys(t){return!0===(t&&t.__isLong__)}function vs(t){var e=Math.clz32(t&-t);return t?31-e:e}ms.prototype.__isLong__,Object.defineProperty(ms.prototype,"__isLong__",{value:!0}),ms.isLong=ys;var _s={},bs={};function xs(t,e){var n,i,r;return e?(r=0<=(t>>>=0)&&t<256)&&(i=bs[t])?i:(n=Cs(t,0,!0),r&&(bs[t]=n),n):(r=-128<=(t|=0)&&t<128)&&(i=_s[t])?i:(n=Cs(t,t<0?-1:0,!1),r&&(_s[t]=n),n)}function ws(t,e){if(isNaN(t))return e?Fs:Ds;if(e){if(t<0)return Fs;if(t>=Ms)return Us}else{if(t<=-Is)return zs;if(t+1>=Is)return ks}return t<0?ws(-t,e).neg():Cs(t%Ss|0,t/Ss|0,e)}function Cs(t,e,n){return new ms(t,e,n)}ms.fromInt=xs,ms.fromNumber=ws,ms.fromBits=Cs;var Bs=Math.pow;function Es(t,e,n){if(0===t.length)throw Error("empty string");if("number"===typeof e?(n=e,e=!1):e=!!e,"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e?Fs:Ds;if((n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return Es(t.substring(1),e,n).neg();for(var r=ws(Bs(n,8)),o=Ds,s=0;s<t.length;s+=8){var a=Math.min(8,t.length-s),l=parseInt(t.substring(s,s+a),n);if(a<8){var c=ws(Bs(n,a));o=o.mul(c).add(ws(l))}else o=(o=o.mul(r)).add(ws(l))}return o.unsigned=e,o}function Ts(t,e){return"number"===typeof t?ws(t,e):"string"===typeof t?Es(t,e):Cs(t.low,t.high,"boolean"===typeof e?e:t.unsigned)}ms.fromString=Es,ms.fromValue=Ts;var Ss=4294967296,Ms=Ss*Ss,Is=Ms/2,Ps=xs(1<<24),Ds=xs(0);ms.ZERO=Ds;var Fs=xs(0,!0);ms.UZERO=Fs;var Ls=xs(1);ms.ONE=Ls;var Os=xs(1,!0);ms.UONE=Os;var Rs=xs(-1);ms.NEG_ONE=Rs;var ks=Cs(-1,2147483647,!1);ms.MAX_VALUE=ks;var Us=Cs(-1,-1,!0);ms.MAX_UNSIGNED_VALUE=Us;var zs=Cs(0,-2147483648,!1);ms.MIN_VALUE=zs;var Gs=ms.prototype;Gs.toInt=function(){return this.unsigned?this.low>>>0:this.low},Gs.toNumber=function(){return this.unsigned?(this.high>>>0)*Ss+(this.low>>>0):this.high*Ss+(this.low>>>0)},Gs.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(zs)){var e=ws(t),n=this.div(e),i=n.mul(e).sub(this);return n.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var r=ws(Bs(t,6),this.unsigned),o=this,s="";;){var a=o.div(r),l=(o.sub(a.mul(r)).toInt()>>>0).toString(t);if((o=a).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},Gs.getHighBits=function(){return this.high},Gs.getHighBitsUnsigned=function(){return this.high>>>0},Gs.getLowBits=function(){return this.low},Gs.getLowBitsUnsigned=function(){return this.low>>>0},Gs.getNumBitsAbs=function(){if(this.isNegative())return this.eq(zs)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},Gs.isZero=function(){return 0===this.high&&0===this.low},Gs.eqz=Gs.isZero,Gs.isNegative=function(){return!this.unsigned&&this.high<0},Gs.isPositive=function(){return this.unsigned||this.high>=0},Gs.isOdd=function(){return 1===(1&this.low)},Gs.isEven=function(){return 0===(1&this.low)},Gs.equals=function(t){return ys(t)||(t=Ts(t)),(this.unsigned===t.unsigned||this.high>>>31!==1||t.high>>>31!==1)&&(this.high===t.high&&this.low===t.low)},Gs.eq=Gs.equals,Gs.notEquals=function(t){return!this.eq(t)},Gs.neq=Gs.notEquals,Gs.ne=Gs.notEquals,Gs.lessThan=function(t){return this.comp(t)<0},Gs.lt=Gs.lessThan,Gs.lessThanOrEqual=function(t){return this.comp(t)<=0},Gs.lte=Gs.lessThanOrEqual,Gs.le=Gs.lessThanOrEqual,Gs.greaterThan=function(t){return this.comp(t)>0},Gs.gt=Gs.greaterThan,Gs.greaterThanOrEqual=function(t){return this.comp(t)>=0},Gs.gte=Gs.greaterThanOrEqual,Gs.ge=Gs.greaterThanOrEqual,Gs.compare=function(t){if(ys(t)||(t=Ts(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},Gs.comp=Gs.compare,Gs.negate=function(){return!this.unsigned&&this.eq(zs)?zs:this.not().add(Ls)},Gs.neg=Gs.negate,Gs.add=function(t){ys(t)||(t=Ts(t));var e=this.high>>>16,n=65535&this.high,i=this.low>>>16,r=65535&this.low,o=t.high>>>16,s=65535&t.high,a=t.low>>>16,l=0,c=0,u=0,h=0;return u+=(h+=r+(65535&t.low))>>>16,c+=(u+=i+a)>>>16,l+=(c+=n+s)>>>16,l+=e+o,Cs((u&=65535)<<16|(h&=65535),(l&=65535)<<16|(c&=65535),this.unsigned)},Gs.subtract=function(t){return ys(t)||(t=Ts(t)),this.add(t.neg())},Gs.sub=Gs.subtract,Gs.multiply=function(t){if(this.isZero())return this;if(ys(t)||(t=Ts(t)),gs)return Cs(gs.mul(this.low,this.high,t.low,t.high),gs.get_high(),this.unsigned);if(t.isZero())return this.unsigned?Fs:Ds;if(this.eq(zs))return t.isOdd()?zs:Ds;if(t.eq(zs))return this.isOdd()?zs:Ds;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(Ps)&&t.lt(Ps))return ws(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,n=65535&this.high,i=this.low>>>16,r=65535&this.low,o=t.high>>>16,s=65535&t.high,a=t.low>>>16,l=65535&t.low,c=0,u=0,h=0,d=0;return h+=(d+=r*l)>>>16,u+=(h+=i*l)>>>16,h&=65535,u+=(h+=r*a)>>>16,c+=(u+=n*l)>>>16,u&=65535,c+=(u+=i*a)>>>16,u&=65535,c+=(u+=r*s)>>>16,c+=e*l+n*a+i*s+r*o,Cs((h&=65535)<<16|(d&=65535),(c&=65535)<<16|(u&=65535),this.unsigned)},Gs.mul=Gs.multiply,Gs.divide=function(t){if(ys(t)||(t=Ts(t)),t.isZero())throw Error("division by zero");var e,n,i;if(gs)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?Cs((this.unsigned?gs.div_u:gs.div_s)(this.low,this.high,t.low,t.high),gs.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?Fs:Ds;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Fs;if(t.gt(this.shru(1)))return Os;i=Fs}else{if(this.eq(zs))return t.eq(Ls)||t.eq(Rs)?zs:t.eq(zs)?Ls:(e=this.shr(1).div(t).shl(1)).eq(Ds)?t.isNegative()?Ls:Rs:(n=this.sub(t.mul(e)),i=e.add(n.div(t)));if(t.eq(zs))return this.unsigned?Fs:Ds;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();i=Ds}for(n=this;n.gte(t);){e=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var r=Math.ceil(Math.log(e)/Math.LN2),o=r<=48?1:Bs(2,r-48),s=ws(e),a=s.mul(t);a.isNegative()||a.gt(n);)a=(s=ws(e-=o,this.unsigned)).mul(t);s.isZero()&&(s=Ls),i=i.add(s),n=n.sub(a)}return i},Gs.div=Gs.divide,Gs.modulo=function(t){return ys(t)||(t=Ts(t)),gs?Cs((this.unsigned?gs.rem_u:gs.rem_s)(this.low,this.high,t.low,t.high),gs.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},Gs.mod=Gs.modulo,Gs.rem=Gs.modulo,Gs.not=function(){return Cs(~this.low,~this.high,this.unsigned)},Gs.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},Gs.clz=Gs.countLeadingZeros,Gs.countTrailingZeros=function(){return this.low?vs(this.low):vs(this.high)+32},Gs.ctz=Gs.countTrailingZeros,Gs.and=function(t){return ys(t)||(t=Ts(t)),Cs(this.low&t.low,this.high&t.high,this.unsigned)},Gs.or=function(t){return ys(t)||(t=Ts(t)),Cs(this.low|t.low,this.high|t.high,this.unsigned)},Gs.xor=function(t){return ys(t)||(t=Ts(t)),Cs(this.low^t.low,this.high^t.high,this.unsigned)},Gs.shiftLeft=function(t){return ys(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?Cs(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Cs(0,this.low<<t-32,this.unsigned)},Gs.shl=Gs.shiftLeft,Gs.shiftRight=function(t){return ys(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?Cs(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Cs(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},Gs.shr=Gs.shiftRight,Gs.shiftRightUnsigned=function(t){return ys(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?Cs(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):Cs(32===t?this.high:this.high>>>t-32,0,this.unsigned)},Gs.shru=Gs.shiftRightUnsigned,Gs.shr_u=Gs.shiftRightUnsigned,Gs.rotateLeft=function(t){var e;return ys(t)&&(t=t.toInt()),0===(t&=63)?this:32===t?Cs(this.high,this.low,this.unsigned):t<32?(e=32-t,Cs(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned)):(e=32-(t-=32),Cs(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned))},Gs.rotl=Gs.rotateLeft,Gs.rotateRight=function(t){var e;return ys(t)&&(t=t.toInt()),0===(t&=63)?this:32===t?Cs(this.high,this.low,this.unsigned):t<32?(e=32-t,Cs(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned)):(e=32-(t-=32),Cs(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned))},Gs.rotr=Gs.rotateRight,Gs.toSigned=function(){return this.unsigned?Cs(this.low,this.high,!1):this},Gs.toUnsigned=function(){return this.unsigned?this:Cs(this.low,this.high,!0)},Gs.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},Gs.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},Gs.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},ms.fromBytes=function(t,e,n){return n?ms.fromBytesLE(t,e):ms.fromBytesBE(t,e)},ms.fromBytesLE=function(t,e){return new ms(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},ms.fromBytesBE=function(t,e){return new ms(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)};const Ns=ms,Zs=16;function js(t){"X"===t&&(t="");const e=t.padEnd(Zs,"0");return Ns.fromString(e,!0,16)}const Vs=3,Hs=61,Js=180/Math.PI;function Ws(t,e,n){const i=1<<e;return[(t[0]+n[0])/i,(t[1]+n[1])/i]}function Qs(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function Ks(t){return[Qs(t[0]),Qs(t[1])]}function qs(t,e){let[n,i]=e;switch(t){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function Xs(t){let[e,n,i]=t;const r=Math.atan2(i,Math.sqrt(e*e+n*n));return[Math.atan2(n,e)*Js,r*Js]}function Ys(t,e,n,i){if(0===i){1===n&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);const i=e[0];e[0]=e[1],e[1]=i}}function $s(t){const e=function(t){if(t.indexOf("/")>0)return t;const e=js(t);return function(t){if(t.isZero())return"";let e=t.toString(2);for(;e.length<Vs+Hs;)e="0"+e;const n=e.lastIndexOf("1"),i=e.substring(0,3),r=e.substring(3,n),o=r.length/2,s=Ns.fromString(i,!0,2).toString(10);let a="";if(0!==o)for(a=Ns.fromString(r,!0,2).toString(4);a.length<o;)a="0"+a;return"".concat(s,"/").concat(a)}(e)}(t);return function(t){if(0===t.length)throw new Error("Invalid Hilbert quad key ".concat(t));const e=t.split("/"),n=parseInt(e[0],10),i=e[1],r=i.length;let o=0;const s=[0,0];for(let a=r-1;a>=0;a--){o=r-a;const t=i[a];let e=0,n=0;"1"===t?n=1:"2"===t?(e=1,n=1):"3"===t&&(e=1);const l=Math.pow(2,o-1);Ys(l,s,e,n),s[0]+=l*e,s[1]+=l*n}if(n%2===1){const t=s[0];s[0]=s[1],s[1]=t}return{face:n,ij:s,level:o}}(e)}const ta=100;function ea(t){const{face:e,ij:n,level:i}=t,r=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(ta*Math.pow(2,-i))),s=new Float64Array(4*o*2+2);let a=0,l=0;for(let c=0;c<4;c++){const t=r[c].slice(0),u=r[c+1],h=(u[0]-t[0])/o,d=(u[1]-t[1])/o;for(let r=0;r<o;r++){t[0]+=h,t[1]+=d;const r=Xs(qs(e,Ks(Ws(n,i,t))));Math.abs(r[1])>89.999&&(r[0]=l);const o=r[0]-l;r[0]+=o>180?-360:o<-180?360:0,s[a++]=r[0],s[a++]=r[1],l=r[0]}}return s[a++]=s[0],s[a++]=s[1],s}function na(t){if(t.length%2!==0)throw new Error("Invalid corners");const e=[],n=[];for(let i=0;i<t.length;i+=2)e.push(t[i]),n.push(t[i+1]);return e.sort(((t,e)=>t-e)),n.sort(((t,e)=>t-e)),{west:e[0],east:e[e.length-1],north:n[n.length-1],south:n[0]}}function ia(t,e){const n=(null===e||void 0===e?void 0:e.minimumHeight)||0,i=(null===e||void 0===e?void 0:e.maximumHeight)||0,r=function(t){let e;if(2===t.face||5===t.face){let n=null,i=0;for(let e=0;e<4;e++){const r=ea($s("".concat(t.face,"/").concat(e)));"undefined"!==typeof n&&null!==n||(n=new Float64Array(4*r.length)),n.set(r,i),i+=r.length}e=na(n)}else e=na(ea(t));return e}($s(t)),o=r.west,s=r.south,a=r.east,l=r.north,c=[];return c.push(new kt.Z(o,l,n)),c.push(new kt.Z(a,l,n)),c.push(new kt.Z(a,s,n)),c.push(new kt.Z(o,s,n)),c.push(new kt.Z(o,l,i)),c.push(new kt.Z(a,l,i)),c.push(new kt.Z(a,s,i)),c.push(new kt.Z(o,s,i)),c}function ra(t){return function(t){const e=Ks(Ws(t.ij,t.level,[.5,.5]));return Xs(qs(t.face,e))}($s(t))}function oa(t){const e=t.token,n={minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight},i=ia(e,n),r=ra(e),o=r[0],s=r[1],a=he.WGS84.cartographicToCartesian([o,s,n.maximumHeight]),l=new kt.Z(a[0],a[1],a[2]);i.push(l);const c=(0,ve.du)(i);return[...c.center,...c.halfAxes]}const sa={QUADTREE:4,OCTREE:8};function aa(t,e,n){if(null!==t&&void 0!==t&&t.box){const i=function(t,e){const n=function(t){return t.and(t.not().add(1))}(t).shiftRightUnsigned(2);return t.add(Ns.fromNumber(2*e+1-4).multiply(n))}(js(t.s2VolumeInfo.token),e),r=function(t){if(t.isZero())return"X";let e=t.countTrailingZeros();e=(e-e%4)/4;const n=e;e*=4;const i=t.shiftRightUnsigned(e).toString(16).replace(/0+$/,"");return Array(17-n-i.length).join("0")+i}(i),o={...t.s2VolumeInfo};if(o.token=r,"OCTREE"===n){const e=t.s2VolumeInfo,n=e.maximumHeight-e.minimumHeight,i=n/2,r=e.minimumHeight+n/2;e.minimumHeight=r-i,e.maximumHeight=r+i}return{box:oa(o),s2VolumeInfo:o}}}async function la(t){const{options:e,parentData:n={mortonIndex:0,x:0,y:0,z:0},childIndex:i=0,globalData:r={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:o}=t;let{subtree:s,level:a=0}=t;const{subdivisionScheme:l,subtreeLevels:c,maximumLevel:u,contentUrlTemplate:h,subtreesUriTemplate:d,basePath:f}=e,A={children:[],lodMetricValue:0,contentUrl:""},p=sa[l],g=1&i,m=i>>1&1,y=i>>2&1,v=(p**a-1)/(p-1);let _=ha(n.mortonIndex,i),b=v+_,x=ha(n.x,g),w=ha(n.y,m),C=ha(n.z,y),B=!1;a+1>c&&(B=ca(s.childSubtreeAvailability,_));const E=ha(r.x,x),T=ha(r.y,w),S=ha(r.z,C),M=a+r.level;if(B){const t=da("".concat(f,"/").concat(d),M,E,T,S);s=await(0,Ot.z)(t,ps),r.mortonIndex=_,r.x=x,r.y=w,r.z=C,r.level=a,_=0,b=0,x=0,w=0,C=0,a=0}if(!ca(s.tileAvailability,b)||a>u)return A;ca(s.contentAvailability,b)&&(A.contentUrl=da(h,M,E,T,S));const I=a+1,P={mortonIndex:_,x:x,y:w,z:C};for(let D=0;D<p;D++){const t=aa(o,D,l),n=await la({subtree:s,options:e,parentData:P,childIndex:D,level:I,globalData:r,s2VolumeBox:t});if(n.contentUrl||n.children.length){const t=ua(n,M+1,{childTileX:x,childTileY:w,childTileZ:C},e,o);A.children.push(t)}}return A}function ca(t,e){return"constant"in t?Boolean(t.constant):!!t.explicitBitstream&&function(t,e){const n=Math.floor(t/8),i=t%8;return 1===(e[n]>>i&1)}(e,t.explicitBitstream)}function ua(t,e,n,i,r){const{basePath:o,refine:s,getRefine:a,lodMetricType:l,getTileType:c,rootLodMetricValue:u,rootBoundingVolume:h}=i,d=t.contentUrl&&t.contentUrl.replace("".concat(o,"/"),""),f=u/2**e,A=function(t,e,n){if(e.region){const{childTileX:i,childTileY:r,childTileZ:o}=n,[s,a,l,c,u,h]=e.region,d=2**t,f=(l-s)/d,A=(c-a)/d,p=(h-u)/d,[g,m]=[s+f*i,s+f*(i+1)],[y,v]=[a+A*r,a+A*(r+1)],[_,b]=[u+p*o,u+p*(o+1)];return{region:[g,y,m,v,_,b]}}if(e.box)return e;throw new Error("Unsupported bounding volume type ".concat(e))}(e,null!==r&&void 0!==r&&r.box?{box:r.box}:h,n);return{children:t.children,contentUrl:t.contentUrl,content:{uri:d},id:t.contentUrl,refine:a(s),type:c(t),lodMetricType:l,lodMetricValue:f,geometricError:f,transform:t.transform,boundingVolume:A}}function ha(t,e){return parseInt(t.toString(2)+e.toString(2),2)}function da(t,e,n,i,r){const o=function(t){const e={};for(const n in t)e["{".concat(n,"}")]=t[n];return e}({level:e,x:n,y:i,z:r});return t.replace(/{level}|{x}|{y}|{z}/gi,(t=>o[t]))}function fa(t){if(!t.contentUrl)return Re.EMPTY;const e=t.contentUrl.split("?")[0].split(".").pop();switch(e){case"pnts":return Re.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Re.SCENEGRAPH;default:return e}}function Aa(t){switch(t){case"REPLACE":case"replace":return Oe.REPLACE;case"ADD":case"add":return Oe.ADD;default:return t}}function pa(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){const n=new URL(t,"".concat(e,"/"));return decodeURI(n.toString())}return t.startsWith("/")?t:"".concat(e,"/").concat(t)}function ga(t,e){if(!t)return null;if(t.content){const n=t.content.uri||t.content.url;t.contentUrl=pa(n,e.basePath)}return t.id=t.contentUrl,t.lodMetricType=Ue.GEOMETRIC_ERROR,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=fa(t),t.refine=Aa(t.refine),t}async function ma(t,e,n,i){var r,o;const s=e.basePath,{subdivisionScheme:a,maximumLevel:l,subtreeLevels:c,subtrees:{uri:u}}=n,h=pa(da(u,0,0,0,0),s),d=await(0,Ot.z)(h,ps,i),f=pa(t.content.uri,s),A=null===e||void 0===e||null===(r=e.root)||void 0===r?void 0:r.refine,p=t.geometricError,g=null===(o=t.boundingVolume.extensions)||void 0===o?void 0:o["3DTILES_bounding_volume_S2"];if(g){const e={box:oa(g),s2VolumeInfo:g};t.boundingVolume=e}const m=t.boundingVolume,y={contentUrlTemplate:f,subtreesUriTemplate:u,subdivisionScheme:a,subtreeLevels:c,maximumLevel:l,refine:A,basePath:s,lodMetricType:Ue.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:m,getTileType:fa,getRefine:Aa};return await async function(t,e,n){if(!t)return null;t.lodMetricType=Ue.GEOMETRIC_ERROR,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform;const{children:i,contentUrl:r}=await la({subtree:e,options:n,s2VolumeBox:t});r&&(t.contentUrl=r,t.content={uri:r.replace("".concat(n.basePath,"/"),"")});return t.refine=Aa(t.refine),t.type=fa(t),t.children=i,t.id=t.contentUrl,t}(t,d,y)}function ya(t){var e;return(null===t||void 0===t||null===(e=t.extensions)||void 0===e?void 0:e["3DTILES_implicit_tiling"])||(null===t||void 0===t?void 0:t.implicitTiling)}const va={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Dn,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(t,e,n){const i=e["3d-tiles"]||{};let r;r="auto"===i.isTileset?n.url&&-1!==n.url.indexOf(".json"):i.isTileset;t=r?await async function(t,e,n){var i;const r=JSON.parse((new TextDecoder).decode(t));return r.loader=e.loader||va,r.url=n.url,r.queryString=n.queryString,r.basePath=function(t){return fe.XX(t.url)}(r),r.root=await async function(t,e){const n=t.basePath;let i;const r=ya(null===t||void 0===t?void 0:t.root);i=r&&t.root?await ma(t.root,t,r,e):ga(t.root,t);const o=[];for(o.push(i);o.length>0;){const i=(o.pop()||{}).children||[];for(let r of i){const i=ya(r);i?r=await ma(r,t,i,e):ga(r,{basePath:n}),o.push(r)}}return i}(r,e),r.type=ke.TILES3D,r.lodMetricType=Ue.GEOMETRIC_ERROR,r.lodMetricValue=(null===(i=r.root)||void 0===i?void 0:i.lodMetricValue)||0,r}(t,e,n):await async function(t,e,n){const i={content:{featureIds:null}},r=0;return await ds(t,r,e,n,i.content),i.content}(t,e,n);return t},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};const _a=[0],ba={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:"",loader:va,onTilesetLoad:{type:"function",value:t=>{}},onTileLoad:{type:"function",value:t=>{}},onTileUnload:{type:"function",value:t=>{}},onTileError:{type:"function",value:(t,e,n)=>{}},_getMeshColor:{type:"function",value:t=>[255,255,255]}};class xa extends A.Z{constructor(){super(...arguments),(0,f.Z)(this,"state",void 0)}initializeState(){"onTileLoadFail"in this.props&&Tt.Z.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}get isLoaded(){var t,e;return Boolean((null===(t=this.state)||void 0===t||null===(e=t.tileset3d)||void 0===e?void 0:e.isLoaded())&&super.isLoaded)}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){let{props:e,oldProps:n,changeFlags:i}=t;if(e.data&&e.data!==n.data&&this._loadTileset(e.data),i.viewportChanged){const{activeViewports:t}=this.state;Object.keys(t).length&&(this._updateTileset(t),this.state.lastUpdatedViewports=t,this.state.activeViewports={})}if(i.propsChanged){const{layerMap:t}=this.state;for(const e in t)t[e].needsUpdate=!0}}activateViewport(t){const{activeViewports:e,lastUpdatedViewports:n}=this.state;this.internalState.viewport=t,e[t.id]=t;const i=null===n||void 0===n?void 0:n[t.id];i&&t.equals(i)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}getPickingInfo(t){let{info:e,sourceLayer:n}=t;const i=n&&n.props.tile;return e.picked&&(e.object=i),e.sourceTile=i,e}filterSubLayer(t){let{layer:e,viewport:n}=t;const{tile:i}=e.props,{id:r}=n;return i.selected&&i.viewportIds.includes(r)}_updateAutoHighlight(t){const e=t.sourceTile,n=this.state.layerMap[null===e||void 0===e?void 0:e.id];n&&n.layer&&n.layer.updateAutoHighlight(t)}async _loadTileset(t){const{loadOptions:e={}}=this.props;let n=this.props.loader||this.props.loaders;Array.isArray(n)&&(n=n[0]);const i={loadOptions:{...e}};let r=t;if(n.preload){const o=await n.preload(t,e);o.url&&(r=o.url),o.headers&&(i.loadOptions.fetch={...i.loadOptions.fetch,headers:o.headers}),Object.assign(i,o)}const o=await(0,Ot.z)(r,n,i.loadOptions),s=new Pn(o,{onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError,...i});this.setState({tileset3d:s,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(s)}_onTileLoad(t){const{lastUpdatedViewports:e}=this.state;this.props.onTileLoad(t),this._updateTileset(e),this.setNeedsUpdate()}_onTileUnload(t){delete this.state.layerMap[t.id],this.props.onTileUnload(t)}_updateTileset(t){if(!t)return;const{tileset3d:e}=this.state,{timeline:n}=this.context,i=Object.keys(t).length;n&&i&&e&&e.selectTiles(Object.values(t)).then((t=>{this.state.frameNumber!==t&&this.setState({frameNumber:t})}))}_getSubLayer(t,e){if(!t.content)return null;switch(t.type){case Re.POINTCLOUD:return this._makePointCloudLayer(t,e);case Re.SCENEGRAPH:return this._make3DModelLayer(t);case Re.MESH:return this._makeSimpleMeshLayer(t,e);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(t.content.type))}}_makePointCloudLayer(t,e){const{attributes:n,pointCount:i,constantRGBA:r,cartographicOrigin:o,modelMatrix:s}=t.content,{positions:a,normals:l,colors:c}=n;if(!a)return null;const u=e&&e.props.data||{header:{vertexCount:i},attributes:{POSITION:a,NORMAL:l,COLOR_0:c}},{pointSize:h,getPointColor:d}=this.props;return new(this.getSubLayerClass("pointcloud",St.Z))({pointSize:h},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(t.id),tile:t,data:u,coordinateSystem:g.Df.METER_OFFSETS,coordinateOrigin:o,modelMatrix:s,getColor:r||d,_offset:0})}_make3DModelLayer(t){const{gltf:e,instances:n,cartographicOrigin:i,modelMatrix:r}=t.content;return new(this.getSubLayerClass("scenegraph",Mt.Z))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(t.id),tile:t,data:n||_a,scenegraph:e,coordinateSystem:g.Df.METER_OFFSETS,coordinateOrigin:i,modelMatrix:r,getTransformMatrix:t=>t.modelMatrix,getPosition:[0,0,0],_offset:0})}_makeSimpleMeshLayer(t,e){const n=t.content,{attributes:i,indices:r,modelMatrix:o,cartographicOrigin:s,coordinateSystem:a=g.Df.METER_OFFSETS,material:l,featureIds:c}=n,{_getMeshColor:u}=this.props,h=e&&e.props.mesh||new Et.Z({drawMode:4,attributes:wa(i),indices:r});return new(this.getSubLayerClass("mesh",Lt))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(t.id),tile:t,mesh:h,data:_a,getColor:u(t),pbrMaterial:l,modelMatrix:o,coordinateOrigin:s,coordinateSystem:a,featureIds:c,_offset:0})}renderLayers(){const{tileset3d:t,layerMap:e}=this.state;return t?t.tiles.map((t=>{const n=e[t.id]=e[t.id]||{tile:t};let{layer:i}=n;return t.selected&&(i?n.needsUpdate&&(i=this._getSubLayer(t,i),n.needsUpdate=!1):i=this._getSubLayer(t)),n.layer=i,i})).filter(Boolean):null}}function wa(t){const e={};return e.positions={...t.positions,value:new Float32Array(t.positions.value)},t.normals&&(e.normals=t.normals),t.texCoords&&(e.texCoords=t.texCoords),t.colors&&(e.colors=t.colors),t.uvRegions&&(e.uvRegions=t.uvRegions),e}(0,f.Z)(xa,"defaultProps",ba),(0,f.Z)(xa,"layerName","Tile3DLayer");const Ca={name:"Terrain",id:"terrain",module:"terrain",version:"3.4.15",worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};var Ba=n(7623);const Ea=[1],Ta={...vt.Z.defaultProps,elevationData:Ba.zc,texture:{...Ba.zc,optional:!0},meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0,loaders:[Ca]};function Sa(t){return Array.isArray(t)?t.join(";"):t||""}class Ma extends A.Z{constructor(){super(...arguments),(0,f.Z)(this,"state",void 0)}updateState(t){let{props:e,oldProps:n}=t;const i=e.elevationData!==n.elevationData;if(i){const{elevationData:t}=e,n=t&&(Array.isArray(t)||t.includes("{x}")&&t.includes("{y}"));this.setState({isTiled:n})}const r=i||e.meshMaxError!==n.meshMaxError||e.elevationDecoder!==n.elevationDecoder||e.bounds!==n.bounds;if(!this.state.isTiled&&r){const t=this.loadTerrain(e);this.setState({terrain:t})}e.workerUrl&&Tt.Z.removed("workerUrl","loadOptions.terrain.workerUrl")()}loadTerrain(t){let{elevationData:e,bounds:n,elevationDecoder:i,meshMaxError:r,signal:o}=t;var s;if(!e)return null;let a=this.getLoadOptions();a={...a,terrain:{skirtHeight:this.state.isTiled?2*r:0,...null===(s=a)||void 0===s?void 0:s.terrain,bounds:n,meshMaxError:r,elevationDecoder:i}};const{fetch:l}=this.props;return l(e,{propName:"elevationData",layer:this,loadOptions:a,signal:o})}getTiledTerrainData(t){const{elevationData:e,fetch:n,texture:i,elevationDecoder:r,meshMaxError:o}=this.props,{viewport:s}=this.context,a=(0,Ba.z0)(e,t),l=i&&(0,Ba.z0)(i,t),{signal:c}=t;let u=[0,0],h=[0,0];if(s.isGeospatial){const e=t.bbox;u=s.projectFlat([e.west,e.south]),h=s.projectFlat([e.east,e.north])}else{const e=t.bbox;u=[e.left,e.bottom],h=[e.right,e.top]}const d=[u[0],u[1],h[0],h[1]],f=this.loadTerrain({elevationData:a,bounds:d,elevationDecoder:r,meshMaxError:o,signal:c}),A=l?n(l,{propName:"texture",layer:this,loaders:[],signal:c}).catch((t=>null)):Promise.resolve(null);return Promise.all([f,A])}renderSubLayers(t){const e=this.getSubLayerClass("mesh",Ft.Z),{color:n,wireframe:i,material:r}=this.props,{data:o}=t;if(!o)return null;const[s,a]=o;return new e(t,{data:Ea,mesh:s,texture:a,_instanced:!1,coordinateSystem:g.Df.CARTESIAN,getPosition:t=>[0,0,0],getColor:n,wireframe:i,material:r})}onViewportLoad(t){if(!t)return;const{zRange:e}=this.state,n=t.map((t=>t.content)).filter(Boolean).map((t=>t[0].header.boundingBox.map((t=>t[2]))));if(0===n.length)return;const i=Math.min(...n.map((t=>t[0]))),r=Math.max(...n.map((t=>t[1])));(!e||i<e[0]||r>e[1])&&this.setState({zRange:[i,r]})}renderLayers(){const{color:t,material:e,elevationData:n,texture:i,wireframe:r,meshMaxError:o,elevationDecoder:s,tileSize:a,maxZoom:l,minZoom:c,extent:u,maxRequests:h,onTileLoad:d,onTileUnload:f,onTileError:A,maxCacheSize:p,maxCacheByteSize:g,refinementStrategy:m}=this.props;if(this.state.isTiled)return new vt.Z(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:Sa(n),texture:Sa(i),meshMaxError:o,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:a,maxZoom:l,minZoom:c,extent:u,maxRequests:h,onTileLoad:d,onTileUnload:f,onTileError:A,maxCacheSize:p,maxCacheByteSize:g,refinementStrategy:m});if(!n)return null;return new(this.getSubLayerClass("mesh",Ft.Z))(this.getSubLayerProps({id:"mesh"}),{data:Ea,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:t=>[0,0,0],getColor:t,material:e,wireframe:r})}}(0,f.Z)(Ma,"defaultProps",Ta),(0,f.Z)(Ma,"layerName","TerrainLayer");var Ia=n(97018);const Pa="0123456789bcdefghjkmnpqrstuvwxyz",Da={};for(let Za=0;Za<32;Za++)Da[Pa.charAt(Za)]=Za;const Fa=-90,La=90,Oa=-180,Ra=180;function ka(t){const[e,n,i,r]=function(t){let e,n=!0,i=La,r=Fa,o=Ra,s=Oa,a=0;for(let l=0,c=t.length;l<c;l++){const c=t[l].toLowerCase();a=Da[c];for(let t=4;t>=0;t--){const l=a>>t&1;n?(e=(o+s)/2,1===l?s=e:o=e):(e=(i+r)/2,1===l?r=e:i=e),n=!n}}return[r,s,i,o]}(t);return[r,i,r,e,n,e,n,i,r,i]}class Ua extends tt.Z{indexToBounds(){const{data:t,getGeohash:e}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(t,n)=>ka(e(t,n))}}}(0,f.Z)(Ua,"layerName","GeohashLayer"),(0,f.Z)(Ua,"defaultProps",{getGeohash:{type:"accessor",value:t=>t.geohash}});var za=n(95512),Ga=n(24669)},97018:(t,e,n)=>{"use strict";n.d(e,{Z:()=>ut});var i=n(64649),r=n(18252),o=n(21970),s=n(43610),a=n(46257),l=n(12987),c=n(23595);function u(t,e,n){const i=h(t),r=Object.keys(i).filter((t=>i[t]!==Array));return function(t,e,n){const{pointPositionsCount:i,pointFeaturesCount:r,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:l,polygonObjectsCount:c,polygonRingsCount:u,polygonFeaturesCount:h,propArrayTypes:p,coordLength:m}=e,{numericPropKeys:v=[],PositionDataType:_=Float32Array,triangulate:b=!0}=n,x=t[0]&&"id"in t[0],w=t.length>65535?Uint32Array:Uint16Array,C={type:"Point",positions:new _(i*m),globalFeatureIds:new w(i),featureIds:r>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},B={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new _(o*m),globalFeatureIds:new w(o),featureIds:a>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},E={type:"Polygon",polygonIndices:l>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:l>65535?new Uint32Array(u+1):new Uint16Array(u+1),positions:new _(l*m),globalFeatureIds:new w(l),featureIds:h>65535?new Uint32Array(l):new Uint16Array(l),numericProps:{},properties:[],fields:[]};b&&(E.triangles=[]);for(const d of[C,B,E])for(const t of v){const e=p[t];d.numericProps[t]=new e(d.positions.length/m)}B.pathIndices[s]=o,E.polygonIndices[c]=l,E.primitivePolygonIndices[u]=l;const T={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(const g of t){const t=g.geometry,e=g.properties||{};switch(t.type){case"Point":d(t,C,T,m,e),C.properties.push(y(e,v)),x&&C.fields.push({id:g.id}),T.pointFeature++;break;case"LineString":f(t,B,T,m,e),B.properties.push(y(e,v)),x&&B.fields.push({id:g.id}),T.lineFeature++;break;case"Polygon":A(t,E,T,m,e),E.properties.push(y(e,v)),x&&E.fields.push({id:g.id}),T.polygonFeature++;break;default:throw new Error("Invalid geometry type")}T.feature++}return function(t,e,n,i){const r={points:{...t,positions:{value:t.positions,size:i},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:g(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:i},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:g(e.numericProps,1)},polygons:{...n,positions:{value:n.positions,size:i},polygonIndices:{value:n.polygonIndices,size:1},primitivePolygonIndices:{value:n.primitivePolygonIndices,size:1},globalFeatureIds:{value:n.globalFeatureIds,size:1},featureIds:{value:n.featureIds,size:1},numericProps:g(n.numericProps,1)}};n.triangles&&(r.polygons.triangles={value:new Uint32Array(n.triangles),size:1});return r}(C,B,E,m)}(t,{propArrayTypes:i,...e},{numericPropKeys:n&&n.numericPropKeys||r,PositionDataType:n?n.PositionDataType:Float32Array,triangulate:!n||n.triangulate})}function h(t){const e={};for(const n of t)if(n.properties)for(const t in n.properties){const i=n.properties[t];e[t]=v(i,e[t])}return e}function d(t,e,n,i,r){e.positions.set(t.data,n.pointPosition*i);const o=t.data.length/i;m(e,r,n.pointPosition,o),e.globalFeatureIds.fill(n.feature,n.pointPosition,n.pointPosition+o),e.featureIds.fill(n.pointFeature,n.pointPosition,n.pointPosition+o),n.pointPosition+=o}function f(t,e,n,i,r){e.positions.set(t.data,n.linePosition*i);const o=t.data.length/i;m(e,r,n.linePosition,o),e.globalFeatureIds.fill(n.feature,n.linePosition,n.linePosition+o),e.featureIds.fill(n.lineFeature,n.linePosition,n.linePosition+o);for(let s=0,a=t.indices.length;s<a;++s){const r=t.indices[s],o=s===a-1?t.data.length:t.indices[s+1];e.pathIndices[n.linePath++]=n.linePosition,n.linePosition+=(o-r)/i}}function A(t,e,n,i,r){e.positions.set(t.data,n.polygonPosition*i);const o=t.data.length/i;m(e,r,n.polygonPosition,o),e.globalFeatureIds.fill(n.feature,n.polygonPosition,n.polygonPosition+o),e.featureIds.fill(n.polygonFeature,n.polygonPosition,n.polygonPosition+o);for(let s=0,a=t.indices.length;s<a;++s){const r=n.polygonPosition;e.polygonIndices[n.polygonObject++]=r;const o=t.areas[s],a=t.indices[s],l=t.indices[s+1];for(let s=0,c=a.length;s<c;++s){const r=a[s],o=s===c-1?void 0===l?t.data.length:l[0]:a[s+1];e.primitivePolygonIndices[n.polygonRing++]=n.polygonPosition,n.polygonPosition+=(o-r)/i}p(e,o,a,{startPosition:r,endPosition:n.polygonPosition,coordLength:i})}}function p(t,e,n,i){let{startPosition:r,endPosition:o,coordLength:s}=i;if(!t.triangles)return;const a=r*s,l=o*s,u=t.positions.subarray(a,l),h=n[0],d=n.slice(1).map((t=>(t-h)/s)),f=(0,c.OT)(u,d,s,e);for(let c=0,A=f.length;c<A;++c)t.triangles.push(r+f[c])}function g(t,e){const n={};for(const i in t)n[i]={value:t[i],size:e};return n}function m(t,e,n,i){for(const r in t.numericProps)if(r in e){const o=e[r];t.numericProps[r].fill(o,n,n+i)}}function y(t,e){const n={};for(const i in t)e.includes(i)||(n[i]=t[i]);return n}function v(t,e){return e!==Array&&Number.isFinite(t)?e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array:Array}var _=n(32408),b=n.n(_);function x(t){let e=0;for(let n,i,r=0,o=t.length-1;r<t.length;o=r++)n=t[r],i=t[o],e+=(i[0]-n[0])*(n[1]+i[1]);return e}function w(t,e,n){e&&n&&(1===t?e.id=n.readVarint():2===t?function(t,e){const n=t.readVarint()+t.pos;for(;t.pos<n;){const n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(n,e):3===t?e.type=n.readVarint():4===t&&(e._geometry=n.pos))}class C{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(t,e,n,r,o){(0,i.Z)(this,"properties",void 0),(0,i.Z)(this,"extent",void 0),(0,i.Z)(this,"type",void 0),(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"_pbf",void 0),(0,i.Z)(this,"_geometry",void 0),(0,i.Z)(this,"_keys",void 0),(0,i.Z)(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=r,this._values=o,t.readFields(w,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let n=1,i=0,r=0,o=0;const s=[];let a;for(;t.pos<e;){if(i<=0){const e=t.readVarint();n=7&e,i=e>>3}if(i--,1===n||2===n)r+=t.readSVarint(),o+=t.readSVarint(),1===n&&(a&&s.push(a),a=[]),a&&a.push([r,o]);else{if(7!==n)throw new Error("unknown command ".concat(n));a&&a.push(a[0].slice())}}return a&&s.push(a),s}bbox(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let n=1,i=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;for(;t.pos<e;){if(i<=0){const e=t.readVarint();n=7&e,i=e>>3}if(i--,1===n||2===n)r+=t.readSVarint(),o+=t.readSVarint(),r<s&&(s=r),r>a&&(a=r),o<l&&(l=o),o>c&&(c=o);else if(7!==n)throw new Error("unknown command ".concat(n))}return[s,l,a,c]}_toGeoJSON(t){let e,n,i=this.loadGeometry(),r=C.types[this.type];switch(this.type){case 1:const r=[];for(e=0;e<i.length;e++)r[e]=i[e][0];i=r,t(i,this);break;case 2:for(e=0;e<i.length;e++)t(i[e],this);break;case 3:for(i=function(t){const e=t.length;if(e<=1)return[t];const n=[];let i,r;for(let o=0;o<e;o++){const e=x(t[o]);0!==e&&(void 0===r&&(r=e<0),r===e<0?(i&&n.push(i),i=[t[o]]):i&&i.push(t[o]))}return i&&n.push(i),n}(i),e=0;e<i.length;e++)for(n=0;n<i[e].length;n++)t(i[e][n],this)}1===i.length?i=i[0]:r="Multi".concat(r);const o={type:"Feature",geometry:{type:r,coordinates:i},properties:this.properties};return null!==this.id&&(o.id=this.id),o}toGeoJSON(t){if("function"===typeof t)return this._toGeoJSON(t);const{x:e,y:n,z:i}=t,r=this.extent*Math.pow(2,i),o=this.extent*e,s=this.extent*n;return this._toGeoJSON((function(t){for(let e=0;e<t.length;e++){const n=t[e];n[0]=360*(n[0]+o)/r-180;const i=180-360*(n[1]+s)/r;n[1]=360/Math.PI*Math.atan(Math.exp(i*Math.PI/180))-90}}))}}class B{constructor(t,e){(0,i.Z)(this,"version",void 0),(0,i.Z)(this,"name",void 0),(0,i.Z)(this,"extent",void 0),(0,i.Z)(this,"length",void 0),(0,i.Z)(this,"_pbf",void 0),(0,i.Z)(this,"_keys",void 0),(0,i.Z)(this,"_values",void 0),(0,i.Z)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(E,this,e),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const e=this._pbf.readVarint()+this._pbf.pos;return new C(this._pbf,e,this.extent,this._keys,this._values)}}function E(t,e,n){e&&n&&(15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){let e=null;const n=t.readVarint()+t.pos;for(;t.pos<n;){const n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(n)))}class T{constructor(t,e){(0,i.Z)(this,"layers",void 0),this.layers=t.readFields(S,{},e)}}function S(t,e,n){if(3===t&&n){const t=new B(n,n.readVarint()+n.pos);t.length&&e&&(e[t.name]=t)}}function M(t){const e=t.indices.length,n="Polygon";if(e<=1)return{type:n,data:t.data,areas:[[(0,c.ap)(t.data)]],indices:[t.indices]};const i=[],r=[];let o,s=[],a=[],l=0;for(let u,h,d=0;d<e;d++){h=t.indices[d]-l,u=t.indices[d+1]-l||t.data.length;const e=t.data.slice(h,u),n=(0,c.ap)(e);if(0!==n)void 0===o&&(o=n<0),o===n<0?(a.length&&(i.push(s),r.push(a)),a=[h],s=[n]):(s.push(n),a.push(h));else{const e=t.data.slice(0,h),n=t.data.slice(u);t.data=e.concat(n),l+=u-h}}return s&&i.push(s),a.length&&r.push(a),{type:n,areas:i,indices:r,data:t.data}}function I(t,e,n){e&&n&&(1===t?e.id=n.readVarint():2===t?function(t,e){const n=t.readVarint()+t.pos;for(;t.pos<n;){const n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(n,e):3===t?e.type=n.readVarint():4===t&&(e._geometry=n.pos))}let P,D,F,L,O,R,k;class U{constructor(t,e,n,r,o,s){(0,i.Z)(this,"properties",void 0),(0,i.Z)(this,"extent",void 0),(0,i.Z)(this,"type",void 0),(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"_pbf",void 0),(0,i.Z)(this,"_geometry",void 0),(0,i.Z)(this,"_keys",void 0),(0,i.Z)(this,"_values",void 0),(0,i.Z)(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=r,this._values=o,this._geometryInfo=s,t.readFields(I,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry,P=t.readVarint()+t.pos,D=1,L=0,O=0,R=0,k=0;const e=[],n=[];for(;t.pos<P;)if(L<=0&&(F=t.readVarint(),D=7&F,L=F>>3),L--,1===D||2===D)O+=t.readSVarint(),R+=t.readSVarint(),1===D&&e.push(k),n.push(O,R),k+=2;else{if(7!==D)throw new Error("unknown command ".concat(D));if(k>0){const t=e[e.length-1];n.push(n[t],n[t+1]),k+=2}}return{data:n,indices:e}}_toBinaryCoordinates(t){const e=this.loadGeometry();let n;t(e.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=e.indices.length,n={type:"Point",...e};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=e.indices.length,this._geometryInfo.linePositionsCount+=e.data.length/2,n={type:"LineString",...e};break;case 3:n=M(e),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(const t of n.indices)this._geometryInfo.polygonRingsCount+=t.length;this._geometryInfo.polygonPositionsCount+=n.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}const i={type:"Feature",geometry:n,properties:this.properties};return null!==this.id&&(i.id=this.id),i}toBinaryCoordinates(t){if("function"===typeof t)return this._toBinaryCoordinates(t);const{x:e,y:n,z:i}=t,r=this.extent*Math.pow(2,i),o=this.extent*e,s=this.extent*n;return this._toBinaryCoordinates((t=>function(t,e,n,i){for(let r=0,o=t.length;r<o;r+=2){t[r]=360*(t[r]+e)/i-180;const o=180-360*(t[r+1]+n)/i;t[r+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}(t,o,s,r)))}}class z{constructor(t,e){(0,i.Z)(this,"version",void 0),(0,i.Z)(this,"name",void 0),(0,i.Z)(this,"extent",void 0),(0,i.Z)(this,"length",void 0),(0,i.Z)(this,"_pbf",void 0),(0,i.Z)(this,"_keys",void 0),(0,i.Z)(this,"_values",void 0),(0,i.Z)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(G,this,e),this.length=this._features.length}feature(t,e){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const n=this._pbf.readVarint()+this._pbf.pos;return new U(this._pbf,n,this.extent,this._keys,this._values,e)}}function G(t,e,n){e&&n&&(15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){let e=null;const n=t.readVarint()+t.pos;for(;t.pos<n;){const n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(n)))}class N{constructor(t,e){(0,i.Z)(this,"layers",void 0),this.layers=t.readFields(Z,{},e)}}function Z(t,e,n){if(3===t&&n){const t=new z(n,n.readVarint()+n.pos);t.length&&e&&(e[t.name]=t)}}function j(t,e){var n,i;const r=function(t){var e;if(null===t||void 0===t||!t.mvt)throw new Error("mvt options required");const n="wgs84"===(null===(e=t.mvt)||void 0===e?void 0:e.coordinates),{tileIndex:i}=t.mvt,r=i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z);if(n&&!r)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}(e),o=(null===e||void 0===e||null===(n=e.gis)||void 0===n?void 0:n.format)||(null===e||void 0===e||null===(i=e.mvt)||void 0===i?void 0:i.shape);switch(o){case"columnar-table":return{shape:"columnar-table",data:V(t,r)};case"geojson-row-table":return{shape:"geojson-row-table",data:H(t,r)};case"geojson":return H(t,r);case"binary-geometry":case"binary":return V(t,r);default:throw new Error(o)}}function V(t,e){const[n,i]=function(t,e){const n=[],i={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[n,i];const r=new N(new(b())(t)),o=e&&Array.isArray(e.layers)?e.layers:Object.keys(r.layers);return o.forEach((t=>{const o=r.layers[t];if(o)for(let r=0;r<o.length;r++){const s=W(o.feature(r,i),e,t);n.push(s)}})),[n,i]}(t,e),r=u(n,i);return r.byteLength=t.byteLength,r}function H(t,e){if(t.byteLength<=0)return[];const n=[],i=new T(new(b())(t));return(Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach((t=>{const r=i.layers[t];if(r)for(let i=0;i<r.length;i++){const o=J(r.feature(i),e,t);n.push(o)}})),n}function J(t,e,n){const i=t.toGeoJSON("wgs84"===e.coordinates?e.tileIndex:Q);return e.layerProperty&&(i.properties[e.layerProperty]=n),i}function W(t,e,n){const i=t.toBinaryCoordinates("wgs84"===e.coordinates?e.tileIndex:K);return e.layerProperty&&i.properties&&(i.properties[e.layerProperty]=n),i}function Q(t,e){const{extent:n}=e;for(let i=0;i<t.length;i++){const e=t[i];e[0]/=n,e[1]/=n}}function K(t,e){const{extent:n}=e;for(let i=0,r=t.length;i<r;++i)t[i]/=n}const q={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.4.15",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}};var X=n(10625),Y=n(47410);const $={Point:tt,MultiPoint:function(t,e,n){return et(t,e,n)},LineString:nt,MultiLineString:function(t,e,n){return t.map((t=>nt(t,e,n)))},Polygon:it,MultiPolygon:function(t,e,n){return t.map((t=>it(t,e,n)))}};function tt(t,e,n){let[i,r]=t,[o,s]=e;const a=(0,Y.t7)(o[0],s[0],i),l=(0,Y.t7)(o[1],s[1],r);return n.unprojectFlat([a,l])}function et(t,e,n){return t.map((t=>tt(t,e,n)))}function nt(t,e,n){return et(t,e,n)}function it(t,e,n){return t.map((t=>et(t,e,n)))}const rt=["points","lines","polygons"];function ot(t,e,n,i){const r=t.featureIds.value;if(!r.length)return-1;let o=0,s=r[r.length-1]+1;if(i){const e=function(t,e){if(!t.__layers){const e={},{properties:n}=t;for(let t=0;t<n.length;t++){const{layerName:i}=n[t];i&&(e[i]?e[i][1]=t:e[i]=[t,t])}t.__layers=e}return t.__layers[e]}(t,i);if(!e)return-1;o=e[0],s=e[1]+1}let a=-1;if(e in t.numericProps){const i=t.numericProps[e].value.findIndex(((t,e)=>t===n&&r[e]>=o&&r[e]<s));return i>=0?t.globalFeatureIds.value[i]:-1}return e?a=st(t.properties,(t=>t[e]===n),o,s):t.fields&&(a=st(t.fields,(t=>t.id===n),o,s)),a>=0?function(t,e){if(!t.__ids){const e=[],n=t.featureIds.value,i=t.globalFeatureIds.value;for(let t=0;t<n.length;t++)e[n[t]]=i[t];t.__ids=e}return t.__ids[e]}(t,a):-1}function st(t,e,n,i){for(let r=n;r<i;r++)if(e(t[r],r))return r;return-1}var at=n(58062),lt=n(7623);const ct={...s.Z.defaultProps,data:lt.zc,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[q],binary:!0};class ut extends at.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeState(){super.initializeState();const t=void 0===this.context.viewport.resolution&&this.props.binary;this.setState({binary:t,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){var t;return Boolean((null===(t=this.state)||void 0===t?void 0:t.data)&&super.isLoaded)}updateState(t){let{props:e,oldProps:n,context:i,changeFlags:r}=t;var o;r.dataChanged&&this._updateTileData(),null!==(o=this.state)&&void 0!==o&&o.data&&(super.updateState({props:e,oldProps:n,context:i,changeFlags:r}),this._setWGS84PropertyForTiles());const{highlightColor:s}=e;s!==n.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}async _updateTileData(){let t=this.props.data,e=null;if("string"!==typeof t||(0,lt.Xj)(t))t&&"object"===typeof t&&"tilejson"in t&&(e=t);else{const{onDataLoad:i,fetch:r}=this.props;this.setState({data:null,tileJSON:null});try{e=await r(t,{propName:"data",layer:this,loaders:[]})}catch(n){this.raiseError(n,"loading TileJSON"),t=null}i&&i(e,{propName:"data",layer:this})}e&&(t=e.tiles),this.setState({data:t,tileJSON:e})}_getTilesetOptions(){const t=super._getTilesetOptions(),e=this.state.tileJSON,{minZoom:n,maxZoom:i}=this.props;return e&&(Number.isFinite(e.minzoom)&&e.minzoom>n&&(t.minZoom=e.minzoom),Number.isFinite(e.maxzoom)&&(!Number.isFinite(i)||e.maxzoom<i)&&(t.maxZoom=e.maxzoom)),t}renderLayers(){var t;return null!==(t=this.state)&&void 0!==t&&t.data?super.renderLayers():null}getTileData(t){var e;const{data:n,binary:i}=this.state,{index:r,signal:o}=t,s=(0,lt.z0)(n,t);if(!s)return Promise.reject("Invalid URL");let a=this.getLoadOptions();const{fetch:l}=this.props;return a={...a,mimeType:"application/x-protobuf",mvt:{...null===(e=a)||void 0===e?void 0:e.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:r},gis:i?{format:"binary"}:{}},l(s,{propName:"data",layer:this,loadOptions:a,signal:o})}renderSubLayers(t){const{x:e,y:n,z:i}=t.tile.index,c=Math.pow(2,i),u=512/c,h=-u,d=512*e/c,f=512*(1-n/c),A=(new l.Z).scale([u,h,1]);t.autoHighlight=!1,this.context.viewport.resolution||(t.modelMatrix=A,t.coordinateOrigin=[d,f,0],t.coordinateSystem=r.Df.CARTESIAN,t.extensions=[...t.extensions||[],new a.Z]);const p=super.renderSubLayers(t);return!this.state.binary||p instanceof s.Z||o.Z.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),p}_updateAutoHighlight(t){const{uniqueIdProperty:e}=this.props,{hoveredFeatureId:n,hoveredFeatureLayerName:i}=this.state,r=t.object;let o=null,s=null;r&&(o=ht(r,e),s=dt(r));let{highlightColor:a}=this.props;"function"===typeof a&&(a=a(t)),n===o&&i===s||this.setState({highlightColor:a,hoveredFeatureId:o,hoveredFeatureLayerName:s})}getPickingInfo(t){const e=super.getPickingInfo(t),n=Boolean(this.context.viewport.resolution);if(this.state.binary&&-1!==e.index){const{data:n}=t.sourceLayer.props;e.object=(0,X.F_)(n,{globalFeatureId:e.index})}return e.object&&!n&&(e.object=At(e.object,e.tile.bbox,this.context.viewport)),e}getSubLayerPropsByTile(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(t){const{hoveredFeatureId:e,hoveredFeatureLayerName:n,binary:i}=this.state,{uniqueIdProperty:r,highlightedFeatureId:o}=this.props,s=t.content,a=ft(o);if(!(ft(e)||a))return-1;const l=a?o:e;return Array.isArray(s)?s.findIndex((t=>{const e=ht(t,r)===l,i=a||dt(t)===n;return e&&i})):s&&i?function(t,e,n,i){for(const r of rt){const o=t[r]&&ot(t[r],e,n,i);if(o>=0)return o}return-1}(s,r,l,a?"":n):-1}_pickObjects(t){const{deck:e,viewport:n}=this.context,i=n.width,r=n.height,o=n.x,s=n.y,a=[this.id];return e.pickObjects({x:o,y:s,width:i,height:r,layerIds:a,maxObjects:t})}getRenderedFeatures(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const e=this._pickObjects(t),n=new Set,i=[];for(const r of e){const t=ht(r.object,this.props.uniqueIdProperty);void 0===t?i.push(r.object):n.has(t)||(n.add(t),i.push(r.object))}return i}_setWGS84PropertyForTiles(){const t="dataInWGS84";this.state.tileset.selectedTiles.forEach((e=>{e.hasOwnProperty(t)||Object.defineProperty(e,t,{get:()=>{if(!e.content)return null;if(this.state.binary&&Array.isArray(e.content)&&!e.content.length)return[];const{bbox:t}=e;if(void 0===e._contentWGS84&&(0,lt.ob)(t)){const n=this.state.binary?(0,X.F_)(e.content):e.content;e._contentWGS84=n.map((e=>At(e,t,this.context.viewport)))}return e._contentWGS84}})}))}}function ht(t,e){return t.properties&&e?t.properties[e]:"id"in t?t.id:void 0}function dt(t){var e;return(null===(e=t.properties)||void 0===e?void 0:e.layerName)||null}function ft(t){return void 0!==t&&null!==t&&""!==t}function At(t,e,n){const i={...t,geometry:{type:t.geometry.type}};return Object.defineProperty(i.geometry,"coordinates",{get:()=>{const i=function(t,e,n){const i=[n.projectFlat([e.west,e.north]),n.projectFlat([e.east,e.south])];return{...t,coordinates:$[t.type](t.coordinates,i,n)}}(t.geometry,e,n);return i.coordinates}}),i}(0,i.Z)(ut,"layerName","MVTLayer"),(0,i.Z)(ut,"defaultProps",ct)},58062:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var i=n(64649),r=n(79366),o=n(18757),s=n(43610),a=n(95512),l=n(7623);const c={TilesetClass:a.Be,data:{type:"data",value:[]},dataComparator:l.zc.equal,renderSubLayers:{type:"function",value:t=>new s.Z(t)},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:t=>{}},onTileUnload:{type:"function",value:t=>{}},onTileError:{type:"function",value:t=>console.error(t)},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:a.cw,zRange:null,maxRequests:6,zoomOffset:0};class u extends r.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){var t,e;null===(t=this.state)||void 0===t||null===(e=t.tileset)||void 0===e||e.finalize()}get isLoaded(){var t,e,n;return Boolean(null===(t=this.state)||void 0===t||null===(e=t.tileset)||void 0===e||null===(n=e.selectedTiles)||void 0===n?void 0:n.every((t=>t.isLoaded&&t.layers&&t.layers.every((t=>t.isLoaded)))))}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){let{changeFlags:e}=t,{tileset:n}=this.state;const i=e.propsOrDataChanged||e.updateTriggersChanged,r=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getTileData);n?i&&(n.setOptions(this._getTilesetOptions()),r?n.reloadAll():n.tiles.forEach((t=>{t.layers=null}))):(n=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:n})),this._updateTileset()}_getTilesetOptions(){const{tileSize:t,maxCacheSize:e,maxCacheByteSize:n,refinementStrategy:i,extent:r,maxZoom:o,minZoom:s,maxRequests:a,zoomOffset:l}=this.props;return{maxCacheSize:e,maxCacheByteSize:n,maxZoom:o,minZoom:s,tileSize:t,refinementStrategy:i,extent:r,maxRequests:a,zoomOffset:l,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){const t=this.state.tileset,{zRange:e,modelMatrix:n}=this.props,i=t.update(this.context.viewport,{zRange:e,modelMatrix:n}),{isLoaded:r}=t,o=this.state.isLoaded!==r,s=this.state.frameNumber!==i;r&&(o||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=r}_onViewportLoad(){const{tileset:t}=this.state,{onViewportLoad:e}=this.props;e&&e(t.selectedTiles)}_onTileLoad(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}_onTileError(t,e){this.props.onTileError(t),e.layers=null,this.setNeedsUpdate()}_onTileUnload(t){this.props.onTileUnload(t)}getTileData(t){const{data:e,getTileData:n,fetch:i}=this.props,{signal:r}=t;return t.url="string"===typeof e||Array.isArray(e)?(0,l.z0)(e,t):null,n?n(t):i&&t.url?i(t.url,{propName:"data",layer:this,signal:r}):null}renderSubLayers(t){return this.props.renderSubLayers(t)}getSubLayerPropsByTile(t){return null}getPickingInfo(t){let{info:e,sourceLayer:n}=t;const i=n.props.tile;return e.picked&&(e.tile=i),e.sourceTile=i,e}_updateAutoHighlight(t){const e=t.sourceTile;if(e&&e.layers)for(const n of e.layers)n.updateAutoHighlight(t)}renderLayers(){return this.state.tileset.tiles.map((t=>{const e=this.getSubLayerPropsByTile(t);if(t.isLoaded||t.content)if(t.layers)e&&t.layers[0]&&Object.keys(e).some((n=>t.layers[0].props[n]!==e[n]))&&(t.layers=t.layers.map((t=>t.clone(e))));else{const n=this.renderSubLayers({...this.props,...this.getSubLayerProps({id:t.id,updateTriggers:this.props.updateTriggers}),data:t.content,_offset:0,tile:t});t.layers=(0,o.x)(n,Boolean).map((n=>n.clone({tile:t,...e})))}else;return t.layers}))}filterSubLayer(t){let{layer:e,cullRect:n}=t;const{tile:i}=e.props;return this.state.tileset.isTileVisible(i,n)}}(0,i.Z)(u,"defaultProps",c),(0,i.Z)(u,"layerName","TileLayer")},24669:(t,e,n)=>{"use strict";n.d(e,{o:()=>r});var i=n(64649);class r{constructor(t){(0,i.Z)(this,"index",void 0),(0,i.Z)(this,"isVisible",void 0),(0,i.Z)(this,"isSelected",void 0),(0,i.Z)(this,"parent",void 0),(0,i.Z)(this,"children",void 0),(0,i.Z)(this,"content",void 0),(0,i.Z)(this,"state",void 0),(0,i.Z)(this,"layers",void 0),(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"zoom",void 0),(0,i.Z)(this,"userData",void 0),(0,i.Z)(this,"boundingBox",void 0),(0,i.Z)(this,"_abortController",void 0),(0,i.Z)(this,"_loader",void 0),(0,i.Z)(this,"_loaderId",void 0),(0,i.Z)(this,"_isLoaded",void 0),(0,i.Z)(this,"_isCancelled",void 0),(0,i.Z)(this,"_needsReload",void 0),(0,i.Z)(this,"_bbox",void 0),this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(t){this._bbox||(this._bbox=t,this.boundingBox="west"in t?[[t.west,t.south],[t.east,t.north]]:[[t.left,t.top],[t.right,t.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then((()=>this.data)):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return Boolean(this._loader)&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){const t=this.content?this.content.byteLength:0;return Number.isFinite(t)||console.error("byteLength not defined in tile data"),t}async _loadData(t){let{getData:e,requestScheduler:n,onLoad:i,onError:r}=t;const{index:o,id:s,bbox:a,userData:l,zoom:c}=this,u=this._loaderId;this._abortController=new AbortController;const{signal:h}=this._abortController,d=await n.scheduleRequest(this,(t=>t.isSelected?1:-1));if(!d)return void(this._isCancelled=!0);if(this._isCancelled)return void d.done();let f,A=null;try{A=await e({index:o,id:s,bbox:a,userData:l,zoom:c,signal:h})}catch(p){f=p||!0}finally{d.done()}u===this._loaderId&&(this._loader=void 0,this.content=A,!this._isCancelled||A?(this._isLoaded=!0,this._isCancelled=!1,f?r(f,this):i(this)):this._isLoaded=!1)}loadData(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){var t;this.isLoaded||(this._isCancelled=!0,null===(t=this._abortController)||void 0===t||t.abort())}}},95512:(t,e,n)=>{"use strict";n.d(e,{cw:()=>h,Be:()=>A});var i=n(64649),r=n(65192),o=n(12987),s=n(47410),a=n(24669),l=n(7623);function c(t,e){if(t===e)return!0;if(Array.isArray(t)){const n=t.length;if(!e||e.length!==n)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}return!1}const u=2,h="best-available",d={[h]:function(t){for(const e of t)e.state=0;for(const e of t)e.isSelected&&!p(e)&&g(e);for(const e of t)e.isVisible=Boolean(e.state&u)},"no-overlap":function(t){for(const n of t)n.state=0;for(const n of t)n.isSelected&&p(n);const e=Array.from(t).sort(((t,e)=>t.zoom-e.zoom));for(const n of e)if(n.isVisible=Boolean(n.state&u),n.children&&(n.isVisible||1&n.state))for(const t of n.children)t.state=1;else n.isSelected&&g(n)},never:()=>{}},f={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}};class A{constructor(t){(0,i.Z)(this,"opts",void 0),(0,i.Z)(this,"_requestScheduler",void 0),(0,i.Z)(this,"_cache",void 0),(0,i.Z)(this,"_dirty",void 0),(0,i.Z)(this,"_tiles",void 0),(0,i.Z)(this,"_cacheByteSize",void 0),(0,i.Z)(this,"_viewport",void 0),(0,i.Z)(this,"_zRange",void 0),(0,i.Z)(this,"_selectedTiles",void 0),(0,i.Z)(this,"_frameNumber",void 0),(0,i.Z)(this,"_modelMatrix",void 0),(0,i.Z)(this,"_modelMatrixInverse",void 0),(0,i.Z)(this,"_maxZoom",void 0),(0,i.Z)(this,"_minZoom",void 0),(0,i.Z)(this,"onTileLoad",void 0),(0,i.Z)(this,"_getCullBounds",function(t){let e,n={};return i=>{for(const r in i)if(!c(i[r],n[r])){e=t(i),n=i;break}return e}}(l.XT)),this.opts={...f,...t},this.onTileLoad=t=>{var e,n;null===(e=(n=this.opts).onTileLoad)||void 0===e||e.call(n,t),this.opts.maxCacheByteSize&&(this._cacheByteSize+=t.byteLength,this._resizeCache())},this._requestScheduler=new r.Z({maxRequests:t.maxRequests,throttleRequests:Boolean(t.maxRequests&&t.maxRequests>0)}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new o.Z,this._modelMatrixInverse=new o.Z,this.setOptions(t)}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return null!==this._selectedTiles&&this._selectedTiles.every((t=>t.isLoaded))}get needsReload(){return null!==this._selectedTiles&&this._selectedTiles.some((t=>t.needsReload))}setOptions(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}finalize(){for(const t of this._cache.values())t.isLoading&&t.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(const t of this._cache.keys()){const e=this._cache.get(t);this._selectedTiles&&this._selectedTiles.includes(e)?e.setNeedsReload():this._cache.delete(t)}}update(t){let{zRange:e,modelMatrix:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{zRange:null,modelMatrix:null};const i=n?new o.Z(n):new o.Z,r=!i.equals(this._modelMatrix);if(this._viewport&&t.equals(this._viewport)&&(0,s.fS)(this._zRange,e)&&!r)this.needsReload&&(this._selectedTiles=this._selectedTiles.map((t=>this._getTile(t.index,!0))));else{r&&(this._modelMatrixInverse=i.clone().invert(),this._modelMatrix=i),this._viewport=t,this._zRange=e;const n=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:e,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=n.map((t=>this._getTile(t,!0))),this._dirty&&this._rebuildTree()}const a=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),a&&this._frameNumber++,this._frameNumber}isTileVisible(t,e){if(!t.isVisible)return!1;if(e&&this._viewport){const n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:e}),{bbox:i}=t;for(const[t,e,r,o]of n){let n;if("west"in i)n=i.west<r&&i.east>t&&i.south<o&&i.north>e;else{const s=Math.min(i.top,i.bottom),a=Math.max(i.top,i.bottom);n=i.left<r&&i.right>t&&s<o&&a>e}if(n)return!0}return!1}return!0}getTileIndices(t){let{viewport:e,maxZoom:n,minZoom:i,zRange:r,modelMatrix:o,modelMatrixInverse:s}=t;const{tileSize:a,extent:c,zoomOffset:u}=this.opts;return(0,l.rJ)({viewport:e,maxZoom:n,minZoom:i,zRange:r,tileSize:a,extent:c,modelMatrix:o,modelMatrixInverse:s,zoomOffset:u})}getTileId(t){return"".concat(t.x,"-").concat(t.y,"-").concat(t.z)}getTileZoom(t){return t.z}getTileMetadata(t){const{tileSize:e}=this.opts;return{bbox:(0,l.z_)(this._viewport,t.x,t.y,t.z,e)}}getParentIndex(t){return{x:Math.floor(t.x/2),y:Math.floor(t.y/2),z:t.z-1}}updateTileStates(){const t=this.opts.refinementStrategy||h,e=new Array(this._cache.size);let n=0;for(const i of this._cache.values())e[n++]=i.isVisible,i.isSelected=!1,i.isVisible=!1;for(const i of this._selectedTiles)i.isSelected=!0,i.isVisible=!0;("function"===typeof t?t:d[t])(Array.from(this._cache.values())),n=0;for(const i of this._cache.values())if(e[n++]!==i.isVisible)return!0;return!1}_pruneRequests(){const{maxRequests:t=0}=this.opts,e=[];let n=0;for(const i of this._cache.values())i.isLoading&&(n++,i.isSelected||i.isVisible||e.push(i));for(;t>0&&n>t&&e.length>0;){e.shift().abort(),n--}}_rebuildTree(){const{_cache:t}=this;for(const e of t.values())e.parent=null,e.children&&(e.children.length=0);for(const e of t.values()){const t=this._getNearestAncestor(e);e.parent=t,null!==t&&void 0!==t&&t.children&&t.children.push(e)}}_resizeCache(){const{_cache:t,opts:e}=this,n=e.maxCacheSize||(e.maxCacheByteSize?1/0:5*this.selectedTiles.length),i=e.maxCacheByteSize||1/0;if(t.size>n||this._cacheByteSize>i){for(const[s,a]of t){var r,o;if(!a.isVisible&&!a.isSelected)this._cacheByteSize-=e.maxCacheByteSize?a.byteLength:0,t.delete(s),null===(r=(o=this.opts).onTileUnload)||void 0===r||r.call(o,a);if(t.size<=n&&this._cacheByteSize<=i)break}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort(((t,e)=>t.zoom-e.zoom)),this._dirty=!1)}_getTile(t,e){const n=this.getTileId(t);let i=this._cache.get(n),r=!1;return!i&&e?(i=new a.o(t),Object.assign(i,this.getTileMetadata(i.index)),Object.assign(i,{id:n,zoom:this.getTileZoom(i.index)}),r=!0,this._cache.set(n,i),this._dirty=!0):i&&i.needsReload&&(r=!0),i&&r&&i.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),i}_getNearestAncestor(t){const{_minZoom:e=0}=this;let n=t.index;for(;this.getTileZoom(n)>e;){n=this.getParentIndex(n);const t=this._getTile(n);if(t)return t}return null}}function p(t){let e=t;for(;e;){if(e.isLoaded||e.content)return e.state|=u,!0;e=e.parent}return!1}function g(t){for(const e of t.children)e.isLoaded||e.content?e.state|=u:g(e)}},7623:(t,e,n)=>{"use strict";n.d(e,{XT:()=>I,rJ:()=>k,z0:()=>M,ob:()=>z,Xj:()=>U,hG:()=>F,z_:()=>O,zc:()=>T});var i=n(64649),r=n(12987),o=n(83427),s=n(18252),a=n(99007),l=n(62220);const c=Math.PI/180,u=180/Math.PI,h=6370972,d=256;function f(){const t=4018225162502676e-20,e=Math.PI/180*d;return{unitsPerMeter:[t,t,t],unitsPerMeter2:[0,0,0],metersPerUnit:[24886.609375,24886.609375,24886.609375],unitsPerDegree:[e,e,t],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/e,1/e,24886.609375]}}class A extends o.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{latitude:e=0,longitude:n=0,zoom:o=0,nearZMultiplier:s=.1,farZMultiplier:a=2,resolution:l=10}=t;let{height:u,altitude:h=1.5}=t;u=u||1,h=Math.max(.75,h);const d=(new r.Z).lookAt({eye:[0,-h,0],up:[0,0,1]}),A=Math.pow(2,o);d.rotateX(e*c),d.rotateZ(-n*c),d.scale(A/u);const p=Math.atan(.5/h),g=512*A/u;super({...t,height:u,viewMatrix:d,longitude:n,latitude:e,zoom:o,distanceScales:f(),fovyRadians:2*p,focalDistance:h,near:s,far:Math.min(2,1/g+1)*h*a}),(0,i.Z)(this,"longitude",void 0),(0,i.Z)(this,"latitude",void 0),(0,i.Z)(this,"resolution",void 0),this.latitude=e,this.longitude=n,this.resolution=l}get projectionMode(){return s.zG.GLOBE}getDistanceScales(){return this.distanceScales}getBounds(){const t={targetZ:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).z||0},e=this.unproject([0,this.height/2],t),n=this.unproject([this.width/2,0],t),i=this.unproject([this.width,this.height/2],t),r=this.unproject([this.width/2,this.height],t);return i[0]<this.longitude&&(i[0]+=360),e[0]>this.longitude&&(e[0]-=360),[Math.min(e[0],i[0],n[0],r[0]),Math.min(e[1],i[1],n[1],r[1]),Math.max(e[0],i[0],n[0],r[0]),Math.max(e[1],i[1],n[1],r[1])]}unproject(t){let{topLeft:e=!0,targetZ:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[i,r,o]=t,s=e?r:this.height-r,{pixelUnprojectionMatrix:l}=this;let c;if(Number.isFinite(o))c=p(l,[i,s,o,1]);else{const t=p(l,[i,s,-1,1]),e=p(l,[i,s,1,1]),r=((n||0)/h+1)*d,o=a.x9(a.lu([],t,e)),u=a.x9(t),f=a.x9(e),A=4*((4*u*f-(o-u-f)**2)/16)/o,g=(Math.sqrt(u-A)-Math.sqrt(Math.max(0,r*r-A)))/Math.sqrt(o);c=a.t7([],t,e,g)}const[u,f,A]=this.unprojectPosition(c);return Number.isFinite(o)?[u,f,A]:Number.isFinite(n)?[u,f,n]:[u,f]}projectPosition(t){const[e,n,i=0]=t,r=e*c,o=n*c,s=Math.cos(o),a=(i/h+1)*d;return[Math.sin(r)*s*a,-Math.cos(r)*s*a,Math.sin(o)*a]}unprojectPosition(t){const[e,n,i]=t,r=a.Zh(t),o=Math.asin(i/r);return[Math.atan2(e,-n)*u,o*u,(r/d-1)*h]}projectFlat(t){return t}unprojectFlat(t){return t}panByPosition(t,e){const n=this.unproject(e);return{longitude:t[0]-n[0]+this.longitude,latitude:t[1]-n[1]+this.latitude}}}function p(t,e){const n=l.fF([],e,t);return l.bA(n,n,1/n[3]),n}var g=n(52310),m=n(89019),y=n(75818);const v=512,_=3,b=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],x=b.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),w=x.concat([[.25,.5],[.75,.5]]);class C{constructor(t,e,n){(0,i.Z)(this,"x",void 0),(0,i.Z)(this,"y",void 0),(0,i.Z)(this,"z",void 0),(0,i.Z)(this,"childVisible",void 0),(0,i.Z)(this,"selected",void 0),(0,i.Z)(this,"_children",void 0),this.x=t,this.y=e,this.z=n}get children(){if(!this._children){const t=2*this.x,e=2*this.y,n=this.z+1;this._children=[new C(t,e,n),new C(t,e+1,n),new C(t+1,e,n),new C(t+1,e+1,n)]}return this._children}update(t){const{viewport:e,cullingVolume:n,elevationBounds:i,minZ:r,maxZ:o,bounds:s,offset:a,project:l}=t,c=this.getBoundingVolume(i,a,l);if(s&&!this.insideBounds(s))return!1;if(n.computeVisibility(c)<0)return!1;if(!this.childVisible){let{z:t}=this;if(t<o&&t>=r){const n=c.distanceTo(e.cameraPosition)*e.scale/e.height;t+=Math.floor(Math.log2(n))}if(t>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(const u of this.children)u.update(t);return!0}getSelected(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&t.push(this),this._children)for(const e of this._children)e.getSelected(t);return t}insideBounds(t){let[e,n,i,r]=t;const o=Math.pow(2,this.z),s=v/o;return this.x*s<i&&this.y*s<r&&(this.x+1)*s>e&&(this.y+1)*s>n}getBoundingVolume(t,e,n){if(n){const e=this.z<1?w:this.z<2?x:b,i=[];for(const r of e){const e=F(this.x+r[0],this.y+r[1],this.z);e[2]=t[0],i.push(n(e)),t[0]!==t[1]&&(e[2]=t[1],i.push(n(e)))}return(0,m.du)(i)}const i=Math.pow(2,this.z),r=v/i,o=this.x*r+e*v,s=v-(this.y+1)*r;return new m.Xx([o,s,t[0]],[o+r,s+r,t[1]])}}const B=512,E=[-1/0,-1/0,1/0,1/0],T={type:"object",value:null,validate:(t,e)=>e.optional&&null===t||"string"===typeof t||Array.isArray(t)&&t.every((t=>"string"===typeof t)),equal:(t,e)=>{if(t===e)return!0;if(!Array.isArray(t)||!Array.isArray(e))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}};function S(t,e){const n=[e.transformAsPoint([t[0],t[1]]),e.transformAsPoint([t[2],t[1]]),e.transformAsPoint([t[0],t[3]]),e.transformAsPoint([t[2],t[3]])];return[Math.min(...n.map((t=>t[0]))),Math.min(...n.map((t=>t[1]))),Math.max(...n.map((t=>t[0]))),Math.max(...n.map((t=>t[1])))]}function M(t,e){if(!t||!t.length)return null;const{index:n,id:i}=e;if(Array.isArray(t)){t=t[(r=i,Math.abs(r.split("").reduce(((t,e)=>(t<<5)-t+e.charCodeAt(0)|0),0))%t.length)]}var r;let o=t;for(const s of Object.keys(n)){const t=new RegExp("{".concat(s,"}"),"g");o=o.replace(t,String(n[s]))}return Number.isInteger(n.y)&&Number.isInteger(n.z)&&(o=o.replace(/\{-y\}/g,String(Math.pow(2,n.z)-n.y-1))),o}function I(t){let{viewport:e,z:n=0,cullRect:i}=t;return(e.subViewports||[e]).map((t=>P(t,n||0,i)))}function P(t,e,n){if(!Array.isArray(e)){const i=n.x-t.x,r=n.y-t.y,{width:o,height:s}=n,a={targetZ:e},l=t.unproject([i,r],a),c=t.unproject([i+o,r],a),u=t.unproject([i,r+s],a),h=t.unproject([i+o,r+s],a);return[Math.min(l[0],c[0],u[0],h[0]),Math.min(l[1],c[1],u[1],h[1]),Math.max(l[0],c[0],u[0],h[0]),Math.max(l[1],c[1],u[1],h[1])]}const i=P(t,e[0],n),r=P(t,e[1],n);return[Math.min(i[0],r[0]),Math.min(i[1],r[1]),Math.max(i[2],r[2]),Math.max(i[3],r[3])]}function D(t,e){return Math.pow(2,t)*B/e}function F(t,e,n){const i=D(n,B),r=t/i*360-180,o=Math.PI-2*Math.PI*e/i;return[r,180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)))]}function L(t,e,n,i){const r=D(n,i);return[t/r*B,e/r*B]}function O(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:B;if(t.isGeospatial){const[t,r]=F(e,n,i),[o,s]=F(e+1,n+1,i);return{west:t,north:r,east:o,south:s}}const[o,s]=L(e,n,i,r),[a,l]=L(e+1,n+1,i,r);return{left:o,top:s,right:a,bottom:l}}function R(t,e,n,i,r){const o=function(t,e,n){let i;if(e&&2===e.length){const[n,r]=e,o=t.getBounds({z:n}),s=t.getBounds({z:r});i=[Math.min(o[0],s[0]),Math.min(o[1],s[1]),Math.max(o[2],s[2]),Math.max(o[3],s[3])]}else i=t.getBounds();return t.isGeospatial?[Math.max(i[0],n[0]),Math.max(i[1],n[1]),Math.min(i[2],n[2]),Math.min(i[3],n[3])]:[Math.max(Math.min(i[0],n[2]),n[0]),Math.max(Math.min(i[1],n[3]),n[1]),Math.min(Math.max(i[2],n[0]),n[2]),Math.min(Math.max(i[3],n[1]),n[3])]}(t,null,i),s=D(e,n),[a,l,c,u]=function(t,e,n){if(n)return S(t,n).map((t=>t*e/B));return t.map((t=>t*e/B))}(o,s,r),h=[];for(let d=Math.floor(a);d<c;d++)for(let t=Math.floor(l);t<u;t++)h.push({x:d,y:t,z:e});return h}function k(t){let{viewport:e,maxZoom:n,minZoom:i,zRange:r,extent:o,tileSize:s=B,modelMatrix:a,modelMatrixInverse:l,zoomOffset:c=0}=t,u=e.isGeospatial?Math.round(e.zoom+Math.log2(B/s))+c:Math.ceil(e.zoom)+c;if("number"===typeof i&&Number.isFinite(i)&&u<i){if(!o)return[];u=i}"number"===typeof n&&Number.isFinite(n)&&u>n&&(u=n);let h=o;return a&&l&&o&&!e.isGeospatial&&(h=S(o,a)),e.isGeospatial?function(t,e,n,i){const r=t instanceof A&&t.resolution?t.projectPosition:null,o=Object.values(t.getFrustumPlanes()).map((t=>{let{normal:e,distance:n}=t;return new m.JO(e.clone().negate(),n)})),s=new m.Mh(o),a=t.distanceScales.unitsPerMeter[2],l=n&&n[0]*a||0,c=n&&n[1]*a||0,u=t instanceof g.Z&&t.pitch<=60?e:0;if(i){const[t,e,n,r]=i,o=(0,y.w5)([t,r]),s=(0,y.w5)([n,e]);i=[o[0],v-o[1],s[0],v-s[1]]}const h=new C(0,0,0),d={viewport:t,project:r,cullingVolume:s,elevationBounds:[l,c],minZ:u,maxZ:e,bounds:i,offset:0};if(h.update(d),t instanceof g.Z&&t.subViewports&&t.subViewports.length>1){for(d.offset=-1;h.update(d)&&!(--d.offset<-_););for(d.offset=1;h.update(d)&&!(++d.offset>_););}return h.getSelected()}(e,u,r,o):R(e,u,s,h||E,l)}function U(t){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)}function z(t){return Number.isFinite(t.west)&&Number.isFinite(t.north)&&Number.isFinite(t.east)&&Number.isFinite(t.south)}},84977:function(t,e){var n,i,r;i=[],void 0===(r="function"===typeof(n=function(){"use strict";function t(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function e(t){return!0===(t&&t.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),t.isLong=e;var n={},i={};function r(t,e){var r,o,a;return e?(a=0<=(t>>>=0)&&t<256)&&(o=i[t])?o:(r=s(t,(0|t)<0?-1:0,!0),a&&(i[t]=r),r):(a=-128<=(t|=0)&&t<128)&&(o=n[t])?o:(r=s(t,t<0?-1:0,!1),a&&(n[t]=r),r)}function o(t,e){if(isNaN(t)||!isFinite(t))return e?g:p;if(e){if(t<0)return g;if(t>=d)return b}else{if(t<=-f)return x;if(t+1>=f)return _}return t<0?o(-t,e).neg():s(t%h|0,t/h|0,e)}function s(e,n,i){return new t(e,n,i)}t.fromInt=r,t.fromNumber=o,t.fromBits=s;var a=Math.pow;function l(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return p;if("number"===typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return l(t.substring(1),e,n).neg();for(var r=o(a(n,8)),s=p,c=0;c<t.length;c+=8){var u=Math.min(8,t.length-c),h=parseInt(t.substring(c,c+u),n);if(u<8){var d=o(a(n,u));s=s.mul(d).add(o(h))}else s=(s=s.mul(r)).add(o(h))}return s.unsigned=e,s}function c(e){return e instanceof t?e:"number"===typeof e?o(e):"string"===typeof e?l(e):s(e.low,e.high,e.unsigned)}t.fromString=l,t.fromValue=c;var u=65536,h=u*u,d=h*h,f=d/2,A=r(1<<24),p=r(0);t.ZERO=p;var g=r(0,!0);t.UZERO=g;var m=r(1);t.ONE=m;var y=r(1,!0);t.UONE=y;var v=r(-1);t.NEG_ONE=v;var _=s(-1,2147483647,!1);t.MAX_VALUE=_;var b=s(-1,-1,!0);t.MAX_UNSIGNED_VALUE=b;var x=s(0,-2147483648,!1);t.MIN_VALUE=x;var w=t.prototype;return w.toInt=function(){return this.unsigned?this.low>>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},w.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(x)){var e=o(t),n=this.div(e),i=n.mul(e).sub(this);return n.toString(t)+i.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var r=o(a(t,6),this.unsigned),s=this,l="";;){var c=s.div(r),u=(s.sub(c.mul(r)).toInt()>>>0).toString(t);if((s=c).isZero())return u+l;for(;u.length<6;)u="0"+u;l=""+u+l}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},w.isZero=function(){return 0===this.high&&0===this.low},w.isNegative=function(){return!this.unsigned&&this.high<0},w.isPositive=function(){return this.unsigned||this.high>=0},w.isOdd=function(){return 1===(1&this.low)},w.isEven=function(){return 0===(1&this.low)},w.equals=function(t){return e(t)||(t=c(t)),(this.unsigned===t.unsigned||this.high>>>31!==1||t.high>>>31!==1)&&this.high===t.high&&this.low===t.low},w.eq=w.equals,w.notEquals=function(t){return!this.eq(t)},w.neq=w.notEquals,w.lessThan=function(t){return this.comp(t)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(t){return this.comp(t)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(t){return this.comp(t)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(t){return this.comp(t)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(t){if(e(t)||(t=c(t)),this.eq(t))return 0;var n=this.isNegative(),i=t.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(m)},w.neg=w.negate,w.add=function(t){e(t)||(t=c(t));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,o=65535&this.low,a=t.high>>>16,l=65535&t.high,u=t.low>>>16,h=0,d=0,f=0,A=0;return f+=(A+=o+(65535&t.low))>>>16,d+=(f+=r+u)>>>16,h+=(d+=i+l)>>>16,h+=n+a,s((f&=65535)<<16|(A&=65535),(h&=65535)<<16|(d&=65535),this.unsigned)},w.subtract=function(t){return e(t)||(t=c(t)),this.add(t.neg())},w.sub=w.subtract,w.multiply=function(t){if(this.isZero())return p;if(e(t)||(t=c(t)),t.isZero())return p;if(this.eq(x))return t.isOdd()?x:p;if(t.eq(x))return this.isOdd()?x:p;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(A)&&t.lt(A))return o(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,l=t.high>>>16,u=65535&t.high,h=t.low>>>16,d=65535&t.low,f=0,g=0,m=0,y=0;return m+=(y+=a*d)>>>16,g+=(m+=r*d)>>>16,m&=65535,g+=(m+=a*h)>>>16,f+=(g+=i*d)>>>16,g&=65535,f+=(g+=r*h)>>>16,g&=65535,f+=(g+=a*u)>>>16,f+=n*d+i*h+r*u+a*l,s((m&=65535)<<16|(y&=65535),(f&=65535)<<16|(g&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(t){if(e(t)||(t=c(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:p;var n,i,r;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return g;if(t.gt(this.shru(1)))return y;r=g}else{if(this.eq(x))return t.eq(m)||t.eq(v)?x:t.eq(x)?m:(n=this.shr(1).div(t).shl(1)).eq(p)?t.isNegative()?m:v:(i=this.sub(t.mul(n)),r=n.add(i.div(t)));if(t.eq(x))return this.unsigned?g:p;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();r=p}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),l=s<=48?1:a(2,s-48),u=o(n),h=u.mul(t);h.isNegative()||h.gt(i);)h=(u=o(n-=l,this.unsigned)).mul(t);u.isZero()&&(u=m),r=r.add(u),i=i.sub(h)}return r},w.div=w.divide,w.modulo=function(t){return e(t)||(t=c(t)),this.sub(this.div(t).mul(t))},w.mod=w.modulo,w.not=function(){return s(~this.low,~this.high,this.unsigned)},w.and=function(t){return e(t)||(t=c(t)),s(this.low&t.low,this.high&t.high,this.unsigned)},w.or=function(t){return e(t)||(t=c(t)),s(this.low|t.low,this.high|t.high,this.unsigned)},w.xor=function(t){return e(t)||(t=c(t)),s(this.low^t.low,this.high^t.high,this.unsigned)},w.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?s(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):s(0,this.low<<t-32,this.unsigned)},w.shl=w.shiftLeft,w.shiftRight=function(t){return e(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?s(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):s(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0===(t&=63))return this;var n=this.high;return t<32?s(this.low>>>t|n<<32-t,n>>>t,this.unsigned):s(32===t?n:n>>>t-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},w.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},w.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t})?n.apply(e,i):n)||(t.exports=r)},80248:(t,e,n)=>{"use strict";function i(t){if(!t)throw new Error("JSON conversion error ".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:""))}function r(t,e){const n=function(t){if("string"===typeof t){let e=s[t];return e||(e=t.split("."),s[t]=e),e}return Array.isArray(t)?t:[t]}(e);let i=t;for(const r of n)i=o(i)?i[r]:void 0;return i}function o(t){return null!==t&&"object"===typeof t}n.d(e,{Z:()=>b});const s={};var a=n(61521),l=n.n(a);const c={"-":t=>t};function u(t,e){if(t in c)return c[t];let n;const i=l().parse(t);return i.right||i.left||"Identifier"!==i.type?(h(i,(t=>{if("CallExpression"===t.type)throw new Error("Function calls not allowed in JSON expressions")})),n=t=>l().eval(i,t)):n=e=>r(e,t),c[t]=n,n}function h(t,e){if(Array.isArray(t))t.forEach((t=>h(t,e)));else if(t&&"object"===typeof t){t.type&&e(t);for(const n in t)h(t[n],e)}}const d="@@=",f="@@#",A="@@function",p=t=>t&&"object"===typeof t;class g{constructor(){this.typeKey="@@type",this.functionKey=A,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=u,this.preProcessClassProps=(t,e)=>e,this.postProcessConvertedJson=t=>t;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)this.merge(i)}merge(t){for(const e in t)switch(e){case"layers":case"views":Object.assign(this.classes,t[e]);break;default:if(e in this){const n=t[e];this[e]=p(this[e])?Object.assign(this[e],n):n}}}validate(t){return i(!this.typeKey||"string"===typeof this.typeKey),i(p(this.classes)),!0}}function m(t){return t.replace(d,"")}function y(t,e){const n={};for(const r in t){let e=t[r];"string"===typeof(i=e)&&i.startsWith(d)&&(e=m(e),e=u(e)),n[r]=e}var i;return n}function v(t,e,n){const i=n.classes[t],r=n.reactComponents[t];if(!i&&!r){const{log:i}=n;if(i){const n=JSON.stringify(e,null,0).slice(0,40);i.warn("JSON converter: No registered class of type ".concat(t,"(").concat(n,"...)  "))}return null}return i?function(t,e,n){n.preProcessClassProps&&(e=n.preProcessClassProps(t,e,n));return e=y(e),new t(e)}(i,e,n):function(t,e,n){const{React:i}=n,{children:r=[]}=e;delete e.children,n.preProcessClassProps&&(e=n.preProcessClassProps(t,e,n));return e=y(e),i.createElement(t,e,r)}(r,e,n)}const _=t=>t&&"object"===typeof t;class b{constructor(t){this.log=console,this.configuration={},this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(t)}finalize(){}setProps(t){"configuration"in t&&(this.configuration=t.configuration instanceof g?t.configuration:new g(t.configuration)),"onJSONChange"in t&&(this.onJSONChange=t.onJSONChange)}mergeConfiguration(t){this.configuration.merge(t)}convert(t){if(!t||t===this.json)return this.convertedJson;this.json=t;const e=function(t){return"string"===typeof t?JSON.parse(t):t}(t);let n=function(t,e){return e=new g(e),x(t,"",e)}(e,this.configuration);return n=this.configuration.postProcessConvertedJson(n),this.convertedJson=n,n}convertJson(t){return this.convert(t)}}function x(t,e,n){return Array.isArray(t)?t.map(((t,e)=>x(t,String(e),n))):function(t,e){const{typeKey:n}=e,i=_(t)&&Boolean(t[n]);return i}(t,n)?function(t,e){const{typeKey:n}=e,i=t[n];let r={...t};return delete r[n],r=w(r,e),v(i,r,e)}(t,n):_(t)?A in t?function(t,e){const{functionKey:n}=e,i=t[n];let r={...t};return delete r[n],r=w(r,e),function(t,e,n){const i=n.functions[t];if(!i){const{log:i}=n;if(i){const n=JSON.stringify(e,null,0).slice(0,40);i.warn("JSON converter: No registered function ".concat(t,"(").concat(n,"...)  "))}return null}return i(e)}(i,r,e)}(t,n):w(t,n):"string"===typeof t?function(t,e,n){if(t.startsWith(d)&&n.convertFunction)return t=t.replace(d,""),n.convertFunction(t,n);if(t.startsWith(f)){if(t=t.replace(f,""),n.constants[t])return n.constants[t];const[e,i]=t.split(".");return n.enumerations[e][i]}return t}(t,0,n):t}function w(t,e){i(_(t));const n={};for(const i in t){const r=t[i];n[i]=x(r,0,e)}return n}},73351:(t,e,n)=>{"use strict";n.d(e,{Z:()=>d});var i=n(64649),r=n(90031),o=n(2123),s=n(2578),a=n(18252),l=n(94557),c=n(69296);const u=[0,0,0,255],h={getSourcePosition:{type:"accessor",value:t=>t.sourcePosition},getTargetPosition:{type:"accessor",value:t=>t.targetPosition},getSourceColor:{type:"accessor",value:u},getTargetColor:{type:"accessor",value:u},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},greatCircle:!1,numSegments:{type:"number",value:50,min:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class d extends r.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}getBounds(){var t;return null===(t=this.getAttributeManager())||void 0===t?void 0:t.getBounds(["instanceSourcePositions","instanceTargetPositions"])}getShaders(){return super.getShaders({vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform bool greatCircle;\nuniform bool useShortestPath;\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int widthUnits;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\n\n  float deltaZ = targetZ - sourceZ;\n  float dh = distance * instanceHeights;\n  if (dh == 0.0) {\n    return sourceZ + deltaZ * ratio;\n  }\n  float unitZ = deltaZ / dh;\n  float p2 = unitZ * unitZ + 1.0;\n  float dir = step(deltaZ, 0.0);\n  float z0 = mix(sourceZ, targetZ, dir);\n  float r = mix(ratio, 1.0 - ratio, dir);\n  return sqrt(r * (p2 - r)) * dh + z0;\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n  vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n  dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n  return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n  return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\n  float distance = length(source.xy - target.xy);\n  float z = paraboloid(distance, source.z, target.z, segmentRatio);\n\n  float tiltAngle = radians(instanceTilts);\n  vec2 tiltDirection = normalize(target.xy - source.xy);\n  vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\n\n  return vec3(\n    mix(source.xy, target.xy, segmentRatio) + tilt,\n    z * cos(tiltAngle)\n  );\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n  vec2 sourceRadians = radians(source);\n  vec2 targetRadians = radians(target);\n  vec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\n  vec2 shd_sq = sin_half_delta * sin_half_delta;\n\n  float a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\n  return 2.0 * asin(sqrt(a));\n}\n\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\n  vec2 lngLat;\n  if(abs(angularDist - PI) < 0.001) {\n    lngLat = (1.0 - t) * source.xy + t * target.xy;\n  } else {\n    float a = sin((1.0 - t) * angularDist);\n    float b = sin(t * angularDist);\n    vec3 p = source3D.yxz * a + target3D.yxz * b;\n    lngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n  }\n\n  float z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\n\n  return vec3(lngLat, z);\n}\n\nvoid main(void) {\n  geometry.worldPosition = instanceSourcePositions;\n  geometry.worldPositionAlt = instanceTargetPositions;\n\n  float segmentIndex = positions.x;\n  float segmentRatio = getSegmentRatio(segmentIndex);\n  float prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\n  float nextSegmentRatio = getSegmentRatio(min(numSegments - 1.0, segmentIndex + 1.0));\n  float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n  isValid = 1.0;\n\n  uv = vec2(segmentRatio, positions.y);\n  geometry.uv = uv;\n  geometry.pickingColor = instancePickingColors;\n\n  vec4 curr;\n  vec4 next;\n  vec3 source;\n  vec3 target;\n\n  if ((greatCircle || project_uProjectionMode == PROJECTION_MODE_GLOBE) && project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n    source = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\n    target = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\n    float angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\n\n    vec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\n    vec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\n    vec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\n\n    if (abs(currPos.x - prevPos.x) > 180.0) {\n      indexDir = -1.0;\n      isValid = 0.0;\n    } else if (abs(currPos.x - nextPos.x) > 180.0) {\n      indexDir = 1.0;\n      isValid = 0.0;\n    }\n    nextPos = indexDir < 0.0 ? prevPos : nextPos;\n    nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n\n    if (isValid == 0.0) {\n      nextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\n      float t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\n      currPos = mix(currPos, nextPos, t);\n      segmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n    }\n\n    vec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\n    vec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\n  \n    curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\n    next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n  \n  } else {\n    vec3 source_world = instanceSourcePositions;\n    vec3 target_world = instanceTargetPositions;\n    if (useShortestPath) {\n      source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n      target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n\n      float deltaLng = target_world.x - source_world.x;\n      if (deltaLng > 180.) target_world.x -= 360.;\n      if (deltaLng < -180.) source_world.x -= 360.;\n    }\n    source = project_position(source_world, instanceSourcePositions64Low);\n    target = project_position(target_world, instanceTargetPositions64Low);\n    float antiMeridianX = 0.0;\n\n    if (useShortestPath) {\n      if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n        antiMeridianX = -(project_uCoordinateOrigin.x + 180.) / 360. * TILE_SIZE;\n      }\n      float thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);\n\n      if (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\n        isValid = 0.0;\n        indexDir = sign(segmentRatio - thresholdRatio);\n        segmentRatio = thresholdRatio;\n      }\n    }\n\n    nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n    vec3 currPos = interpolateFlat(source, target, segmentRatio);\n    vec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\n\n    if (useShortestPath) {\n      if (nextPos.x < antiMeridianX) {\n        currPos.x += TILE_SIZE;\n        nextPos.x += TILE_SIZE;\n      }\n    }\n\n    curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n    next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n    geometry.position = vec4(currPos, 1.0);\n  }\n  float widthPixels = clamp(\n    project_size_to_pixel(instanceWidths * widthScale, widthUnits),\n    widthMinPixels, widthMaxPixels\n  );\n  vec3 offset = vec3(\n    getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n    0.0);\n  DECKGL_FILTER_SIZE(offset, geometry);\n  DECKGL_FILTER_GL_POSITION(curr, geometry);\n  gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n\n  vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n  vColor = vec4(color.rgb, color.a * opacity);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nvoid main(void) {\n  if (isValid == 0.0) {\n    discard;\n  }\n\n  gl_FragColor = vColor;\n  geometry.uv = uv;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:u},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:u},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1},instanceHeights:{size:1,transition:!0,accessor:"getHeight",defaultValue:1},instanceTilts:{size:1,transition:!0,accessor:"getTilt",defaultValue:0}})}updateState(t){super.updateState(t);const{props:e,oldProps:n,changeFlags:i}=t;if(i.extensionsChanged||i.propsChanged&&e.numSegments!==n.numSegments){var r;const{gl:t}=this.context;null===(r=this.state.model)||void 0===r||r.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}}draw(t){let{uniforms:e}=t;const{widthUnits:n,widthScale:i,widthMinPixels:r,widthMaxPixels:o,greatCircle:s,wrapLongitude:l}=this.props;this.state.model.setUniforms(e).setUniforms({greatCircle:s,widthUnits:a.iI[n],widthScale:i,widthMinPixels:r,widthMaxPixels:o,useShortestPath:l}).draw()}_getModel(t){const{id:e,numSegments:n}=this.props;let i=[];for(let o=0;o<n;o++)i=i.concat([o,1,0,o,-1,0]);const r=new l.Z(t,{...this.getShaders(),id:e,geometry:new c.Z({drawMode:5,attributes:{positions:new Float32Array(i)}}),isInstanced:!0});return r.setUniforms({numSegments:n}),r}}(0,i.Z)(d,"layerName","ArcLayer"),(0,i.Z)(d,"defaultProps",h)},17377:(t,e,n)=>{"use strict";n.d(e,{Z:()=>y});var i=n(64649),r=n(18252),o=n(90031),s=n(2123),a=n(2578),l=n(94557),c=n(69296),u=n(75818),h=n(47410);const d=new Uint16Array([0,2,1,0,3,2]),f=new Float32Array([0,1,0,0,1,0,1,1]);function A(t,e){if(!e)return function(t){const e=new Float64Array(12);for(let n=0;n<t.length;n++)e[3*n+0]=t[n][0],e[3*n+1]=t[n][1],e[3*n+2]=t[n][2]||0;return{vertexCount:6,positions:e,indices:d,texCoords:f}}(t);const n=Math.max(Math.abs(t[0][0]-t[3][0]),Math.abs(t[1][0]-t[2][0])),i=Math.max(Math.abs(t[1][1]-t[0][1]),Math.abs(t[2][1]-t[3][1])),r=Math.ceil(n/e)+1,o=Math.ceil(i/e)+1,s=(r-1)*(o-1)*6,a=new Uint32Array(s),l=new Float32Array(r*o*2),c=new Float64Array(r*o*3);let u=0,h=0;for(let d=0;d<r;d++){const e=d/(r-1);for(let n=0;n<o;n++){const i=n/(o-1),r=p(t,e,i);c[3*u+0]=r[0],c[3*u+1]=r[1],c[3*u+2]=r[2]||0,l[2*u+0]=e,l[2*u+1]=1-i,d>0&&n>0&&(a[h++]=u-o,a[h++]=u-o-1,a[h++]=u-1,a[h++]=u-o,a[h++]=u-1,a[h++]=u),u++}}return{vertexCount:s,positions:c,indices:a,texCoords:l}}function p(t,e,n){return(0,h.t7)((0,h.t7)(t[0],t[1],n),(0,h.t7)(t[3],t[2],n),e)}const g="\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float desaturate;\nuniform vec4 transparentColor;\nuniform vec3 tintColor;\nuniform float opacity;\n\nuniform float coordinateConversion;\nuniform vec4 bounds;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n  float x = lnglat.x;\n  float y = clamp(lnglat.y, -89.9, 89.9);\n  return vec2(\n    radians(x) + PI,\n    PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n  ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n  xy /= WORLD_SCALE;\n  return degrees(vec2(\n    xy.x - PI,\n    atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n  ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n  float luminance = (color.r + color.g + color.b) * 0.333333333;\n  return mix(color, vec3(luminance), desaturate);\n}\n\n// apply tint\nvec3 color_tint(vec3 color) {\n  return color * tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n  if (transparentColor.a == 0.0) {\n    return vec4(color, alpha);\n  }\n  float blendedAlpha = alpha + transparentColor.a * (1.0 - alpha);\n  float highLightRatio = alpha / blendedAlpha;\n  vec3 blendedRGB = mix(transparentColor.rgb, color, highLightRatio);\n  return vec4(blendedRGB, blendedAlpha);\n}\n\nvec2 getUV(vec2 pos) {\n  return vec2(\n    (pos.x - bounds[0]) / (bounds[2] - bounds[0]),\n    (pos.y - bounds[3]) / (bounds[1] - bounds[3])\n  );\n}\n\n".concat("\nvec3 packUVsIntoRGB(vec2 uv) {\n  // Extract the top 8 bits. We want values to be truncated down so we can add a fraction\n  vec2 uv8bit = floor(uv * 256.);\n\n  // Calculate the normalized remainders of u and v parts that do not fit into 8 bits\n  // Scale and clamp to 0-1 range\n  vec2 uvFraction = fract(uv * 256.);\n  vec2 uvFraction4bit = floor(uvFraction * 16.);\n\n  // Remainder can be encoded in blue channel, encode as 4 bits for pixel coordinates\n  float fractions = uvFraction4bit.x + uvFraction4bit.y * 16.;\n\n  return vec3(uv8bit, fractions) / 255.;\n}\n","\n\nvoid main(void) {\n  vec2 uv = vTexCoord;\n  if (coordinateConversion < -0.5) {\n    vec2 lnglat = mercator_to_lnglat(vTexPos);\n    uv = getUV(lnglat);\n  } else if (coordinateConversion > 0.5) {\n    vec2 commonPos = lnglat_to_mercator(vTexPos);\n    uv = getUV(commonPos);\n  }\n  vec4 bitmapColor = texture2D(bitmapTexture, uv);\n\n  gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n  geometry.uv = uv;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n\n  if (picking_uActive && !picking_uAttribute) {\n    // Since instance information is not used, we can use picking color for pixel index\n    gl_FragColor.rgb = packUVsIntoRGB(uv);\n  }\n}\n"),m={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:r.Df.DEFAULT,desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]},textureParameters:{type:"object",ignore:!0}};class y extends o.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}getShaders(){return super.getShaders({vs:"\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nattribute vec2 texCoords;\nattribute vec3 positions;\nattribute vec3 positions64Low;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float coordinateConversion;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n  geometry.worldPosition = positions;\n  geometry.uv = texCoords;\n  geometry.pickingColor = pickingColor;\n\n  gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  vTexCoord = texCoords;\n\n  if (coordinateConversion < -0.5) {\n    vTexPos = geometry.position.xy + project_uCommonOrigin.xy;\n  } else if (coordinateConversion > 0.5) {\n    vTexPos = geometry.worldPosition.xy;\n  }\n\n  vec4 color = vec4(0.0);\n  DECKGL_FILTER_COLOR(color, geometry);\n}\n",fs:g,modules:[s.Z,a.Z]})}initializeState(){const t=this.getAttributeManager();t.remove(["instancePickingColors"]);const e=!0;t.add({indices:{size:1,isIndexed:!0,update:t=>t.value=this.state.mesh.indices,noAlloc:e},positions:{size:3,type:5130,fp64:this.use64bitPositions(),update:t=>t.value=this.state.mesh.positions,noAlloc:e},texCoords:{size:2,update:t=>t.value=this.state.mesh.texCoords,noAlloc:e}})}updateState(t){let{props:e,oldProps:n,changeFlags:i}=t;const r=this.getAttributeManager();if(i.extensionsChanged){var o;const{gl:t}=this.context;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(t),r.invalidateAll()}if(e.bounds!==n.bounds){const t=this.state.mesh,e=this._createMesh();this.state.model.setVertexCount(e.vertexCount);for(const n in e)t&&t[n]!==e[n]&&r.invalidate(n);this.setState({mesh:e,...this._getCoordinateUniforms()})}else e._imageCoordinateSystem!==n._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}getPickingInfo(t){const{image:e}=this.props,n=t.info;if(!n.color||!e)return n.bitmap=null,n;const{width:i,height:r}=e;n.index=0;const o=function(t){const[e,n,i]=t;return[(e+(15&i)/16)/256,(n+(240&i)/256)/256]}(n.color),s=[Math.floor(o[0]*i),Math.floor(o[1]*r)];return n.bitmap={size:{width:i,height:r},uv:o,pixel:s},n}disablePickingIndex(){this.setState({disablePicking:!0})}restorePickingColors(){this.setState({disablePicking:!1})}_updateAutoHighlight(t){super._updateAutoHighlight({...t,color:this.encodePickingColor(0)})}_createMesh(){const{bounds:t}=this.props;let e=t;return v(t)&&(e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]]]),A(e,this.context.viewport.resolution)}_getModel(t){return t?new l.Z(t,{...this.getShaders(),id:this.props.id,geometry:new c.Z({drawMode:4,vertexCount:6}),isInstanced:!1}):null}draw(t){const{uniforms:e,moduleParameters:n}=t,{model:i,coordinateConversion:r,bounds:o,disablePicking:s}=this.state,{image:a,desaturate:l,transparentColor:c,tintColor:u}=this.props;n.pickingActive&&s||a&&i&&i.setUniforms(e).setUniforms({bitmapTexture:a,desaturate:l,transparentColor:c.map((t=>t/255)),tintColor:u.slice(0,3).map((t=>t/255)),coordinateConversion:r,bounds:o}).draw()}_getCoordinateUniforms(){const{LNGLAT:t,CARTESIAN:e,DEFAULT:n}=r.Df;let{_imageCoordinateSystem:i}=this.props;if(i!==n){const{bounds:n}=this.props;if(!v(n))throw new Error("_imageCoordinateSystem only supports rectangular bounds");const r=this.context.viewport.resolution?t:e;if(i=i===t?t:e,i===t&&r===e)return{coordinateConversion:-1,bounds:n};if(i===e&&r===t){const t=(0,u.w5)([n[0],n[1]]),e=(0,u.w5)([n[2],n[3]]);return{coordinateConversion:1,bounds:[t[0],t[1],e[0],e[1]]}}}return{coordinateConversion:0,bounds:[0,0,0,0]}}}function v(t){return Number.isFinite(t[0])}(0,i.Z)(y,"layerName","BitmapLayer"),(0,i.Z)(y,"defaultProps",m)},35387:(t,e,n)=>{"use strict";n.d(e,{Z:()=>_});var i=n(64649),r=n(90031),o=n(2123),s=n(54976),a=n(2578),l=n(18252),c=n(28007),u=n(12308),h=n(70353),d=n(94557),f=n(21970),A=n(69296),p=n(79666),g=n(23595);class m extends A.Z{constructor(t){const{id:e=(0,p.hQ)("column-geometry")}=t,{indices:n,attributes:i}=function(t){const{radius:e,height:n=1,nradial:i=10}=t;let{vertices:r}=t;r&&(f.Z.assert(r.length>=i),r=r.flatMap((t=>[t[0],t[1]])),(0,g.Ny)(r,g.wG.COUNTER_CLOCKWISE));const o=n>0,s=i+1,a=o?3*s+1:i,l=2*Math.PI/i,c=new Uint16Array(o?3*i*2:0),u=new Float32Array(3*a),h=new Float32Array(3*a);let d=0;if(o){for(let t=0;t<s;t++){const o=t*l,s=t%i,a=Math.sin(o),c=Math.cos(o);for(let t=0;t<2;t++)u[d+0]=r?r[2*s]:c*e,u[d+1]=r?r[2*s+1]:a*e,u[d+2]=(.5-t)*n,h[d+0]=r?r[2*s]:c,h[d+1]=r?r[2*s+1]:a,d+=3}u[d+0]=u[d-3],u[d+1]=u[d-2],u[d+2]=u[d-1],d+=3}for(let f=o?0:1;f<s;f++){const t=Math.floor(f/2)*Math.sign(.5-f%2),o=t*l,s=(t+i)%i,a=Math.sin(o),c=Math.cos(o);u[d+0]=r?r[2*s]:c*e,u[d+1]=r?r[2*s+1]:a*e,u[d+2]=n/2,h[d+2]=1,d+=3}if(o){let t=0;for(let e=0;e<i;e++)c[t++]=2*e+0,c[t++]=2*e+2,c[t++]=2*e+0,c[t++]=2*e+1,c[t++]=2*e+1,c[t++]=2*e+3}return{indices:c,attributes:{POSITION:{size:3,value:u},NORMAL:{size:3,value:h}}}}(t);super({...t,id:e,indices:n,attributes:i})}}const y=[0,0,0,255],v={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,getPosition:{type:"accessor",value:t=>t.position},getFillColor:{type:"accessor",value:y},getLineColor:{type:"accessor",value:y},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class _ extends r.Z{getShaders(){const{gl:t}=this.context,e=!(0,c.D0)(t),n={},i=this.props.flatShading&&(0,u.U6)(t,h.h.GLSL_DERIVATIVES);return i&&(n.FLAT_SHADING=1),super.getShaders({vs:"#version 300 es\n\n#define SHADER_NAME column-layer-vertex-shader\n\nin vec3 positions;\nin vec3 normals;\n\nin vec3 instancePositions;\nin float instanceElevations;\nin vec3 instancePositions64Low;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin float instanceStrokeWidths;\n\nin vec3 instancePickingColors;\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform bool extruded;\nuniform bool stroked;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float edgeDistance;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int radiusUnits;\nuniform int widthUnits;\nout vec4 vColor;\n#ifdef FLAT_SHADING\nout vec4 position_commonspace;\n#endif\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n\n  vec4 color = isStroke ? instanceLineColors : instanceFillColors;\n  mat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n  float elevation = 0.0;\n  float strokeOffsetRatio = 1.0;\n\n  if (extruded) {\n    elevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n  } else if (stroked) {\n    float widthPixels = clamp(\n      project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\n      widthMinPixels, widthMaxPixels) / 2.0;\n    float halfOffset = project_pixel_size(widthPixels) / project_size(edgeDistance * coverage * radius);\n    if (isStroke) {\n      strokeOffsetRatio -= sign(positions.z) * halfOffset;\n    } else {\n      strokeOffsetRatio -= halfOffset;\n    }\n  }\n  float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\n  float dotRadius = radius * coverage * shouldRender;\n\n  geometry.pickingColor = instancePickingColors;\n  vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n  vec3 centroidPosition64Low = instancePositions64Low;\n  vec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius;\n  if (radiusUnits == UNIT_METERS) {\n    offset = project_size(offset);\n  }\n  vec3 pos = vec3(offset, 0.);\n  DECKGL_FILTER_SIZE(pos, geometry);\n\n  gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n  geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  if (extruded && !isStroke) {\n#ifdef FLAT_SHADING\n    position_commonspace = geometry.position;\n    vColor = vec4(color.rgb, color.a * opacity);\n#else\n    vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n    vColor = vec4(lightColor, color.a * opacity);\n#endif\n  } else {\n    vColor = vec4(color.rgb, color.a * opacity);\n  }\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nuniform vec3 project_uCameraPosition;\nuniform bool extruded;\nuniform bool isStroke;\n\nout vec4 fragColor;\n\nin vec4 vColor;\n#ifdef FLAT_SHADING\nin vec4 position_commonspace;\n#endif\n\nvoid main(void) {\n  fragColor = vColor;\n#ifdef FLAT_SHADING\n  if (extruded && !isStroke && !picking_uActive) {\n    vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n    fragColor.rgb = lighting_getLightColor(vColor.rgb, project_uCameraPosition, position_commonspace.xyz, normal);\n  }\n#endif\n  DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",defines:n,transpileToGLSL100:e,modules:[o.Z,i?s.s:s.N,a.Z]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:y},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:y},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState(t){super.updateState(t);const{props:e,oldProps:n,changeFlags:i}=t,r=i.extensionsChanged||e.flatShading!==n.flatShading;if(r){var o;const{gl:t}=this.context;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}(r||e.diskResolution!==n.diskResolution||e.vertices!==n.vertices||(e.extruded||e.stroked)!==(n.extruded||n.stroked))&&this._updateGeometry(e)}getGeometry(t,e,n){const i=new m({radius:1,height:n?2:0,vertices:e,nradial:t});let r=0;if(e)for(let o=0;o<t;o++){const n=e[o];r+=Math.sqrt(n[0]*n[0]+n[1]*n[1])/t}else r=1;return this.setState({edgeDistance:Math.cos(Math.PI/t)*r}),i}_getModel(t){return new d.Z(t,{...this.getShaders(),id:this.props.id,isInstanced:!0})}_updateGeometry(t){let{diskResolution:e,vertices:n,extruded:i,stroked:r}=t;const o=this.getGeometry(e,n,i||r);this.setState({fillVertexCount:o.attributes.POSITION.value.length/3,wireframeVertexCount:o.indices.value.length}),this.state.model.setProps({geometry:o})}draw(t){let{uniforms:e}=t;const{lineWidthUnits:n,lineWidthScale:i,lineWidthMinPixels:r,lineWidthMaxPixels:o,radiusUnits:s,elevationScale:a,extruded:c,filled:u,stroked:h,wireframe:d,offset:f,coverage:A,radius:p,angle:g}=this.props,{model:m,fillVertexCount:y,wireframeVertexCount:v,edgeDistance:_}=this.state;m.setUniforms(e).setUniforms({radius:p,angle:g/180*Math.PI,offset:f,extruded:c,stroked:h,coverage:A,elevationScale:a,edgeDistance:_,radiusUnits:l.iI[s],widthUnits:l.iI[n],widthScale:i,widthMinPixels:r,widthMaxPixels:o}),c&&d&&(m.setProps({isIndexed:!0}),m.setVertexCount(v).setDrawMode(1).setUniforms({isStroke:!0}).draw()),u&&(m.setProps({isIndexed:!1}),m.setVertexCount(y).setDrawMode(5).setUniforms({isStroke:!1}).draw()),!c&&h&&(m.setProps({isIndexed:!1}),m.setVertexCount(2*y/3).setDrawMode(5).setUniforms({isStroke:!0}).draw())}}(0,i.Z)(_,"layerName","ColumnLayer"),(0,i.Z)(_,"defaultProps",v)},90555:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(64649),r=n(34819),o=n(18252),s=n(35387);class a extends s.Z{getGeometry(t){return new r.Z}draw(t){let{uniforms:e}=t;const{elevationScale:n,extruded:i,offset:r,coverage:s,cellSize:a,angle:l,radiusUnits:c}=this.props;this.state.model.setUniforms(e).setUniforms({radius:a/2,radiusUnits:o.iI[c],angle:l,offset:r,extruded:i,coverage:s,elevationScale:n,edgeDistance:1,isWireframe:!1}).draw()}}(0,i.Z)(a,"layerName","GridCellLayer"),(0,i.Z)(a,"defaultProps",{cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",value:[1,1]}})},43610:(t,e,n)=>{"use strict";n.d(e,{Z:()=>C});var i=n(64649),r=n(79366),o=n(66535);var s=n(32296),a=n(87403),l=n(46233),c=n(69554),u=n(3453);const h={circle:{type:a.Z,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",pointBillboard:"billboard",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:s.Z,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",iconAlphaCutoff:"alphaCutoff",iconBillboard:"billboard",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:l.Z,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",textBillboard:"billboard",textFontSettings:"fontSettings",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},d={type:c.Z,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},f={type:u.Z,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",_full3d:"_full3d",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function A(t){let{type:e,props:n}=t;const i={};for(const r in n)i[r]=e.defaultProps[n[r]];return i}function p(t,e){const{transitions:n,updateTriggers:i}=t.props,r={updateTriggers:{},transitions:n&&{getPosition:n.geometry}};for(const o in e){const s=e[o];let a=t.props[o];o.startsWith("get")&&(a=t.getSubLayerAccessor(a),r.updateTriggers[s]=i[o],n&&(r.transitions[s]=n[o])),r[s]=a}return r}var g=n(21970);function m(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:r=0,endRow:o=t.length}=n;for(let s=r;s<o;s++){const n=t[s],{geometry:r}=n;if(r)if("GeometryCollection"===r.type){g.Z.assert(Array.isArray(r.geometries),"GeoJSON does not have geometries array");const{geometries:t}=r;for(let r=0;r<t.length;r++){y(t[r],i,e,n,s)}}else y(r,i,e,n,s)}return i}function y(t,e,n,i,r){const{type:o,coordinates:s}=t,{pointFeatures:a,lineFeatures:l,polygonFeatures:c,polygonOutlineFeatures:u}=e;if(function(t,e){let n=v[t];g.Z.assert(n,"Unknown GeoJSON type ".concat(t));for(;e&&--n>0;)e=e[0];return e&&Number.isFinite(e[0])}(o,s))switch(o){case"Point":a.push(n({geometry:t},i,r));break;case"MultiPoint":s.forEach((t=>{a.push(n({geometry:{type:"Point",coordinates:t}},i,r))}));break;case"LineString":l.push(n({geometry:t},i,r));break;case"MultiLineString":s.forEach((t=>{l.push(n({geometry:{type:"LineString",coordinates:t}},i,r))}));break;case"Polygon":c.push(n({geometry:t},i,r)),s.forEach((t=>{u.push(n({geometry:{type:"LineString",coordinates:t}},i,r))}));break;case"MultiPolygon":s.forEach((t=>{c.push(n({geometry:{type:"Polygon",coordinates:t}},i,r)),t.forEach((t=>{u.push(n({geometry:{type:"LineString",coordinates:t}},i,r))}))}))}else g.Z.warn("".concat(o," coordinates are malformed"))()}const v={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function _(t){return t.geometry.coordinates}function b(t,e){const n={points:{},lines:{},polygons:{},polygonsOutline:{}},{points:i,lines:r,polygons:o}=t,s=function(t,e){const n={points:null,lines:null,polygons:null};for(const i in n){const r=t[i].globalFeatureIds.value;n[i]=new Uint8ClampedArray(3*r.length);const o=[];for(let t=0;t<r.length;t++)e(r[t],o),n[i][3*t+0]=o[0],n[i][3*t+1]=o[1],n[i][3*t+2]=o[2]}return n}(t,e);return n.points.data={length:i.positions.value.length/i.positions.size,attributes:{...i.attributes,getPosition:i.positions,instancePickingColors:{size:3,value:s.points}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},n.lines.data={length:r.pathIndices.value.length-1,startIndices:r.pathIndices.value,attributes:{...r.attributes,getPath:r.positions,instancePickingColors:{size:3,value:s.lines}},properties:r.properties,numericProps:r.numericProps,featureIds:r.featureIds},n.lines._pathType="open",n.polygons.data={length:o.polygonIndices.value.length-1,startIndices:o.polygonIndices.value,attributes:{...o.attributes,getPolygon:o.positions,pickingColors:{size:3,value:s.polygons}},properties:o.properties,numericProps:o.numericProps,featureIds:o.featureIds},n.polygons._normalize=!1,o.triangles&&(n.polygons.data.attributes.indices=o.triangles.value),n.polygonsOutline.data={length:o.primitivePolygonIndices.value.length-1,startIndices:o.primitivePolygonIndices.value,attributes:{...o.attributes,getPath:o.positions,instancePickingColors:{size:3,value:s.polygons}},properties:o.properties,numericProps:o.numericProps,featureIds:o.featureIds},n.polygonsOutline._pathType="open",n}const x=["points","linestrings","polygons"],w={...A(h.circle),...A(h.icon),...A(h.text),...A(d),...A(f),stroked:!0,filled:!0,extruded:!1,wireframe:!1,_full3d:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:t=>t.properties.icon},getText:{type:"accessor",value:t=>t.properties.text},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}};class C extends r.Z{initializeState(){this.state={layerProps:{},features:{}}}updateState(t){let{props:e,changeFlags:n}=t;if(!n.dataChanged)return;const{data:i}=this.props,r=i&&"points"in i&&"polygons"in i&&"lines"in i;this.setState({binary:r}),r?this._updateStateBinary({props:e,changeFlags:n}):this._updateStateJSON({props:e,changeFlags:n})}_updateStateBinary(t){let{props:e,changeFlags:n}=t;const i=b(e.data,this.encodePickingColor);this.setState({layerProps:i})}_updateStateJSON(t){let{props:e,changeFlags:n}=t;const i=function(t){if(Array.isArray(t))return t;switch(g.Z.assert(t.type,"GeoJSON does not have type"),t.type){case"Feature":return[t];case"FeatureCollection":return g.Z.assert(Array.isArray(t.features),"GeoJSON does not have features array"),t.features;default:return[{geometry:t}]}}(e.data),r=this.getSubLayerRow.bind(this);let s={};const a={};if(Array.isArray(n.dataChanged)){const t=this.state.features;for(const e in t)s[e]=t[e].slice(),a[e]=[];for(const e of n.dataChanged){const n=m(i,r,e);for(const i in t)a[i].push((0,o.b)({data:s[i],getIndex:t=>t.__source.index,dataRange:e,replace:n[i]}))}}else s=m(i,r);const l=function(t,e){const n={points:{},lines:{},polygons:{},polygonsOutline:{}},{pointFeatures:i,lineFeatures:r,polygonFeatures:o,polygonOutlineFeatures:s}=t;return n.points.data=i,n.points._dataDiff=e.pointFeatures&&(()=>e.pointFeatures),n.points.getPosition=_,n.lines.data=r,n.lines._dataDiff=e.lineFeatures&&(()=>e.lineFeatures),n.lines.getPath=_,n.polygons.data=o,n.polygons._dataDiff=e.polygonFeatures&&(()=>e.polygonFeatures),n.polygons.getPolygon=_,n.polygonsOutline.data=s,n.polygonsOutline._dataDiff=e.polygonOutlineFeatures&&(()=>e.polygonOutlineFeatures),n.polygonsOutline.getPath=_,n}(s,a);this.setState({features:s,featuresDiff:a,layerProps:l})}getPickingInfo(t){const e=super.getPickingInfo(t),{index:n,sourceLayer:i}=e;return e.featureType=x.find((t=>i.id.startsWith("".concat(this.id,"-").concat(t,"-")))),n>=0&&i.id.startsWith("".concat(this.id,"-points-text"))&&this.state.binary&&(e.index=this.props.data.points.globalFeatureIds.value[n]),e}_updateAutoHighlight(t){const e="".concat(this.id,"-points-"),n="points"===t.featureType;for(const i of this.getSubLayers())i.id.startsWith(e)===n&&i.updateAutoHighlight(t)}_renderPolygonLayer(){const{extruded:t,wireframe:e}=this.props,{layerProps:n}=this.state,i="polygons-fill",r=this.shouldRenderSubLayer(i,n.polygons.data)&&this.getSubLayerClass(i,f.type);if(r){const o=p(this,f.props),s=t&&e;return s||delete o.getLineColor,o.updateTriggers.lineColors=s,new r(o,this.getSubLayerProps({id:i,updateTriggers:o.updateTriggers}),n.polygons)}return null}_renderLineLayers(){const{extruded:t,stroked:e}=this.props,{layerProps:n}=this.state,i="polygons-stroke",r="linestrings",o=!t&&e&&this.shouldRenderSubLayer(i,n.polygonsOutline.data)&&this.getSubLayerClass(i,d.type),s=this.shouldRenderSubLayer(r,n.lines.data)&&this.getSubLayerClass(r,d.type);if(o||s){const t=p(this,d.props);return[o&&new o(t,this.getSubLayerProps({id:i,updateTriggers:t.updateTriggers}),n.polygonsOutline),s&&new s(t,this.getSubLayerProps({id:r,updateTriggers:t.updateTriggers}),n.lines)]}return null}_renderPointLayers(){const{pointType:t}=this.props,{layerProps:e,binary:n}=this.state;let{highlightedObjectIndex:i}=this.props;!n&&Number.isFinite(i)&&(i=e.points.data.findIndex((t=>t.__source.index===i)));const r=new Set(t.split("+")),o=[];for(const s of r){const t="points-".concat(s),r=h[s],a=r&&this.shouldRenderSubLayer(t,e.points.data)&&this.getSubLayerClass(t,r.type);if(a){const l=p(this,r.props);let c=e.points;if("text"===s&&n){const{instancePickingColors:t,...e}=c.data.attributes;c={...c,data:{...c.data,attributes:e}}}o.push(new a(l,this.getSubLayerProps({id:t,updateTriggers:l.updateTriggers,highlightedObjectIndex:i}),c))}}return o}renderLayers(){const{extruded:t}=this.props,e=this._renderPolygonLayer();return[!t&&e,this._renderLineLayers(),this._renderPointLayers(),t&&e]}getSubLayerAccessor(t){const{binary:e}=this.state;return e&&"function"===typeof t?(e,n)=>{const{data:i,index:r}=n,o=function(t,e){if(!t)return null;const n="startIndices"in t?t.startIndices[e]:e,i=t.featureIds.value[n];return-1!==n?function(t,e,n){const i={properties:{...t.properties[e]}};for(const r in t.numericProps)i.properties[r]=t.numericProps[r].value[n];return i}(t,i,n):null}(i,r);return t(o,n)}:super.getSubLayerAccessor(t)}}(0,i.Z)(C,"layerName","GeoJsonLayer"),(0,i.Z)(C,"defaultProps",w)},32296:(t,e,n)=>{"use strict";n.d(e,{Z:()=>w});var i=n(64649),r=n(90031),o=n(2123),s=n(2578),a=n(18252),l=n(21970),c=n(94557),u=n(69296);var h=n(58300),d=n(56474),f=n(65959),A=n(73115);const p=()=>{},g={10241:9987,10240:9729,10242:33071,10243:33071};function m(t,e,n,i){const r=Math.min(n/e.width,i/e.height),o=Math.floor(e.width*r),s=Math.floor(e.height*r);return 1===r?{data:e,width:o,height:s}:(t.canvas.height=s,t.canvas.width=o,t.clearRect(0,0,o,s),t.drawImage(e,0,0,e.width,e.height,0,0,o,s),{data:t.canvas,width:o,height:s})}function y(t){return t&&(t.id||t.url)}function v(t,e,n){for(let i=0;i<e.length;i++){const{icon:r,xOffset:o}=e[i];t[y(r)]={...r,x:o,y:n}}}class _{constructor(t,e){let{onUpdate:n=p,onError:r=p}=e;(0,i.Z)(this,"gl",void 0),(0,i.Z)(this,"onUpdate",void 0),(0,i.Z)(this,"onError",void 0),(0,i.Z)(this,"_loadOptions",null),(0,i.Z)(this,"_texture",null),(0,i.Z)(this,"_externalTexture",null),(0,i.Z)(this,"_mapping",{}),(0,i.Z)(this,"_textureParameters",null),(0,i.Z)(this,"_pendingCount",0),(0,i.Z)(this,"_autoPacking",!1),(0,i.Z)(this,"_xOffset",0),(0,i.Z)(this,"_yOffset",0),(0,i.Z)(this,"_rowHeight",0),(0,i.Z)(this,"_buffer",4),(0,i.Z)(this,"_canvasWidth",1024),(0,i.Z)(this,"_canvasHeight",0),(0,i.Z)(this,"_canvas",null),this.gl=t,this.onUpdate=n,this.onError=r}finalize(){var t;null===(t=this._texture)||void 0===t||t.delete()}getTexture(){return this._texture||this._externalTexture}getIconMapping(t){const e=this._autoPacking?y(t):t;return this._mapping[e]||{}}setProps(t){let{loadOptions:e,autoPacking:n,iconAtlas:i,iconMapping:r,textureParameters:o}=t;var s;(e&&(this._loadOptions=e),void 0!==n&&(this._autoPacking=n),r&&(this._mapping=r),i)&&(null===(s=this._texture)||void 0===s||s.delete(),this._texture=null,this._externalTexture=i);o&&(this._textureParameters=o)}get isLoaded(){return 0===this._pendingCount}packIcons(t,e){if(!this._autoPacking||"undefined"===typeof document)return;const n=Object.values(function(t,e,n){if(!t||!e)return null;n=n||{};const i={},{iterable:r,objectInfo:o}=(0,A.jB)(t);for(const s of r){o.index++;const t=e(s,o),r=y(t);if(!t)throw new Error("Icon is missing.");if(!t.url)throw new Error("Icon url is missing.");i[r]||n[r]&&t.url===n[r].url||(i[r]={...t,source:s,sourceIndex:o.index})}return i}(t,e,this._mapping)||{});if(n.length>0){const{mapping:t,xOffset:e,yOffset:i,rowHeight:r,canvasHeight:o}=function(t){let{icons:e,buffer:n,mapping:i={},xOffset:r=0,yOffset:o=0,rowHeight:s=0,canvasWidth:a}=t,l=[];for(let u=0;u<e.length;u++){const t=e[u];if(!i[y(t)]){const{height:e,width:c}=t;r+c+n>a&&(v(i,l,o),r=0,o=s+o+n,s=0,l=[]),l.push({icon:t,xOffset:r}),r=r+c+n,s=Math.max(s,e)}}return l.length>0&&v(i,l,o),{mapping:i,rowHeight:s,xOffset:r,yOffset:o,canvasWidth:a,canvasHeight:(c=s+o+n,Math.pow(2,Math.ceil(Math.log2(c))))};var c}({icons:n,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=r,this._mapping=t,this._xOffset=e,this._yOffset=i,this._canvasHeight=o,this._texture||(this._texture=new h.Z(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:this._textureParameters||g})),this._texture.height!==this._canvasHeight&&(this._texture=function(t,e,n,i){const r=t.width,o=t.height,s=new h.Z(t.gl,{width:e,height:n,parameters:i});return(0,d.Lv)(t,s,{targetY:0,width:r,height:o}),t.delete(),s}(this._texture,this._canvasWidth,this._canvasHeight,this._textureParameters||g)),this.onUpdate(),this._canvas=this._canvas||document.createElement("canvas"),this._loadIcons(n)}}_loadIcons(t){const e=this._canvas.getContext("2d",{willReadFrequently:!0});for(const n of t)this._pendingCount++,(0,f.z)(n.url,this._loadOptions).then((t=>{const i=y(n),r=this._mapping[i],{x:o,y:s,width:a,height:l}=r,{data:c,width:u,height:h}=m(e,t,a,l);this._texture.setSubImageData({data:c,x:o+(a-u)/2,y:s+(l-h)/2,width:u,height:h}),r.width=u,r.height=h,this._texture.generateMipmap(),this.onUpdate()})).catch((t=>{this.onError({url:n.url,source:n.source,sourceIndex:n.sourceIndex,loadOptions:this._loadOptions,error:t})})).finally((()=>{this._pendingCount--}))}}const b=[0,0,0,255],x={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:t=>t.position},getIcon:{type:"accessor",value:t=>t.icon},getColor:{type:"accessor",value:b},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,optional:!0},textureParameters:{type:"object",ignore:!0}};class w extends r.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\nuniform int sizeUnits;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n  float angle_radian = angle * PI / 180.0;\n  float cos_angle = cos(angle_radian);\n  float sin_angle = sin(angle_radian);\n  mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n  return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  geometry.uv = positions;\n  geometry.pickingColor = instancePickingColors;\n  uv = positions;\n\n  vec2 iconSize = instanceIconFrames.zw;\n  float sizePixels = clamp(\n    project_size_to_pixel(instanceSizes * sizeScale, sizeUnits), \n    sizeMinPixels, sizeMaxPixels\n  );\n  float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n  vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n  pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n  pixelOffset += instancePixelOffset;\n  pixelOffset.y *= -1.0;\n\n  if (billboard)  {\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n    vec3 offset = vec3(pixelOffset, 0.0);\n    DECKGL_FILTER_SIZE(offset, geometry);\n    gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n  } else {\n    vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n    DECKGL_FILTER_SIZE(offset_common, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  }\n\n  vTextureCoords = mix(\n    instanceIconFrames.xy,\n    instanceIconFrames.xy + iconSize,\n    (positions.xy + 1.0) / 2.0\n  ) / iconsTextureDim;\n\n  vColor = instanceColors;\n  DECKGL_FILTER_COLOR(vColor, geometry);\n\n  vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n  geometry.uv = uv;\n\n  vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n  vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n  float a = texColor.a * opacity * vColor.a;\n\n  if (a < alphaCutoff) {\n    discard;\n  }\n\n  gl_FragColor = vec4(color, a);\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}initializeState(){this.state={iconManager:new _(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})};this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:b},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState(t){super.updateState(t);const{props:e,oldProps:n,changeFlags:i}=t,r=this.getAttributeManager(),{iconAtlas:o,iconMapping:s,data:a,getIcon:l,textureParameters:c}=e,{iconManager:u}=this.state,h=o||this.internalState.isAsyncPropLoading("iconAtlas");if(u.setProps({loadOptions:e.loadOptions,autoPacking:!h,iconAtlas:o,iconMapping:h?s:null,textureParameters:c}),h?n.iconMapping!==e.iconMapping&&r.invalidate("getIcon"):(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getIcon))&&u.packIcons(a,l),i.extensionsChanged){var d;const{gl:t}=this.context;null===(d=this.state.model)||void 0===d||d.delete(),this.state.model=this._getModel(t),r.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(t){super.finalizeState(t),this.state.iconManager.finalize()}draw(t){let{uniforms:e}=t;const{sizeScale:n,sizeMinPixels:i,sizeMaxPixels:r,sizeUnits:o,billboard:s,alphaCutoff:l}=this.props,{iconManager:c}=this.state,u=c.getTexture();u&&this.state.model.setUniforms(e).setUniforms({iconsTexture:u,iconsTextureDim:[u.width,u.height],sizeUnits:a.iI[o],sizeScale:n,sizeMinPixels:i,sizeMaxPixels:r,billboard:s,alphaCutoff:l}).draw()}_getModel(t){return new c.Z(t,{...this.getShaders(),id:this.props.id,geometry:new u.Z({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0})}_onUpdate(){this.setNeedsRedraw()}_onError(t){var e;const n=null===(e=this.getCurrentLayer())||void 0===e?void 0:e.props.onIconError;n?n(t):l.Z.error(t.error.message)()}getInstanceOffset(t){const{width:e,height:n,anchorX:i=e/2,anchorY:r=n/2}=this.state.iconManager.getIconMapping(t);return[e/2-i,n/2-r]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const{x:e,y:n,width:i,height:r}=this.state.iconManager.getIconMapping(t);return[e,n,i,r]}}(0,i.Z)(w,"defaultProps",x),(0,i.Z)(w,"layerName","IconLayer")},29378:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ArcLayer:()=>i.Z,BitmapLayer:()=>r.Z,ColumnLayer:()=>c.Z,GeoJsonLayer:()=>f.Z,GridCellLayer:()=>u.Z,IconLayer:()=>o.Z,LineLayer:()=>s.Z,PathLayer:()=>h.Z,PointCloudLayer:()=>a.Z,PolygonLayer:()=>d.Z,ScatterplotLayer:()=>l.Z,SolidPolygonLayer:()=>p.Z,TextLayer:()=>A.Z,_MultiIconLayer:()=>g.Z,_TextBackgroundLayer:()=>m.Z});var i=n(73351),r=n(17377),o=n(32296),s=n(24985),a=n(11162),l=n(87403),c=n(35387),u=n(90555),h=n(69554),d=n(94300),f=n(43610),A=n(46233),p=n(3453),g=n(20377),m=n(56394)},24985:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var i=n(64649),r=n(90031),o=n(2123),s=n(2578),a=n(18252),l=n(94557),c=n(69296);const u={getSourcePosition:{type:"accessor",value:t=>t.sourcePosition},getTargetPosition:{type:"accessor",value:t=>t.targetPosition},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class h extends r.Z{getBounds(){var t;return null===(t=this.getAttributeManager())||void 0===t?void 0:t.getBounds(["instanceSourcePositions","instanceTargetPositions"])}getShaders(){return super.getShaders({vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float useShortestPath;\nuniform int widthUnits;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n  vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n  dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n  return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvec3 splitLine(vec3 a, vec3 b, float x) {\n  float t = (x - a.x) / (b.x - a.x);\n  return vec3(x, mix(a.yz, b.yz, t));\n}\n\nvoid main(void) {\n  geometry.worldPosition = instanceSourcePositions;\n  geometry.worldPositionAlt = instanceTargetPositions;\n\n  vec3 source_world = instanceSourcePositions;\n  vec3 target_world = instanceTargetPositions;\n  vec3 source_world_64low = instanceSourcePositions64Low;\n  vec3 target_world_64low = instanceTargetPositions64Low;\n\n  if (useShortestPath > 0.5 || useShortestPath < -0.5) {\n    source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n    target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n    float deltaLng = target_world.x - source_world.x;\n\n    if (deltaLng * useShortestPath > 180.) {\n      source_world.x += 360. * useShortestPath;\n      source_world = splitLine(source_world, target_world, 180. * useShortestPath);\n      source_world_64low = vec3(0.0);\n    } else if (deltaLng * useShortestPath < -180.) {\n      target_world.x += 360. * useShortestPath;\n      target_world = splitLine(source_world, target_world, 180. * useShortestPath);\n      target_world_64low = vec3(0.0);\n    } else if (useShortestPath < 0.) {\n      gl_Position = vec4(0.);\n      return;\n    }\n  }\n  vec4 source_commonspace;\n  vec4 target_commonspace;\n  vec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);\n  vec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);\n  float segmentIndex = positions.x;\n  vec4 p = mix(source, target, segmentIndex);\n  geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n  uv = positions.xy;\n  geometry.uv = uv;\n  geometry.pickingColor = instancePickingColors;\n  float widthPixels = clamp(\n    project_size_to_pixel(instanceWidths * widthScale, widthUnits),\n    widthMinPixels, widthMaxPixels\n  );\n  vec3 offset = vec3(\n    getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n    0.0);\n  DECKGL_FILTER_SIZE(offset, geometry);\n  DECKGL_FILTER_GL_POSITION(p, geometry);\n  gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n  vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n  geometry.uv = uv;\n\n  gl_FragColor = vColor;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}updateState(t){if(super.updateState(t),t.changeFlags.extensionsChanged){var e;const{gl:t}=this.context;null===(e=this.state.model)||void 0===e||e.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}}draw(t){let{uniforms:e}=t;const{widthUnits:n,widthScale:i,widthMinPixels:r,widthMaxPixels:o,wrapLongitude:s}=this.props;this.state.model.setUniforms(e).setUniforms({widthUnits:a.iI[n],widthScale:i,widthMinPixels:r,widthMaxPixels:o,useShortestPath:s?1:0}).draw(),s&&this.state.model.setUniforms({useShortestPath:-1}).draw()}_getModel(t){return new l.Z(t,{...this.getShaders(),id:this.props.id,geometry:new c.Z({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0})}}(0,i.Z)(h,"layerName","LineLayer"),(0,i.Z)(h,"defaultProps",u)},69554:(t,e,n)=>{"use strict";n.d(e,{Z:()=>m});var i=n(64649),r=n(90031),o=n(2123),s=n(2578),a=n(18252),l=n(94557),c=n(69296),u=n(55678),h=n(23595);class d extends u.Z{constructor(t){super({...t,attributes:{positions:{size:3,padding:18,initialize:!0,type:t.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}})}get(t){return this.attributes[t]}getGeometryFromBuffer(t){return this.normalize?super.getGeometryFromBuffer(t):null}normalizeGeometry(t){return this.normalize?function(t,e,n,i){let r;if(Array.isArray(t[0])){const n=t.length*e;r=new Array(n);for(let i=0;i<t.length;i++)for(let n=0;n<e;n++)r[i*e+n]=t[i][n]||0}else r=t;return n?(0,h.dj)(r,{size:e,gridResolution:n}):i?(0,h.ct)(r,{size:e}):r}(t,this.positionSize,this.opts.resolution,this.opts.wrapLongitude):t}getGeometrySize(t){if(f(t)){let e=0;for(const n of t)e+=this.getGeometrySize(n);return e}const e=this.getPathLength(t);return e<2?0:this.isClosed(t)?e<3?0:e+2:e}updateGeometryAttributes(t,e){if(0!==e.geometrySize)if(t&&f(t))for(const n of t){const t=this.getGeometrySize(n);e.geometrySize=t,this.updateGeometryAttributes(n,e),e.vertexStart+=t}else this._updateSegmentTypes(t,e),this._updatePositions(t,e)}_updateSegmentTypes(t,e){const n=this.attributes.segmentTypes,i=!!t&&this.isClosed(t),{vertexStart:r,geometrySize:o}=e;n.fill(0,r,r+o),i?(n[r]=4,n[r+o-2]=4):(n[r]+=1,n[r+o-2]+=2),n[r+o-1]=4}_updatePositions(t,e){const{positions:n}=this.attributes;if(!n||!t)return;const{vertexStart:i,geometrySize:r}=e,o=new Array(3);for(let s=i,a=0;a<r;s++,a++)this.getPointOnPath(t,a,o),n[3*s]=o[0],n[3*s+1]=o[1],n[3*s+2]=o[2]}getPathLength(t){return t.length/this.positionSize}getPointOnPath(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const{positionSize:i}=this;e*i>=t.length&&(e+=1-t.length/i);const r=e*i;return n[0]=t[r],n[1]=t[r+1],n[2]=3===i&&t[r+2]||0,n}isClosed(t){if(!this.normalize)return Boolean(this.opts.loop);const{positionSize:e}=this,n=t.length-e;return t[0]===t[n]&&t[1]===t[n+1]&&(2===e||t[2]===t[n+2])}}function f(t){return Array.isArray(t[0])}const A=[0,0,0,255],p={widthUnits:"meters",widthScale:{type:"number",min:0,value:1},widthMinPixels:{type:"number",min:0,value:0},widthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},jointRounded:!1,capRounded:!1,miterLimit:{type:"number",min:0,value:4},billboard:!1,_pathType:null,getPath:{type:"accessor",value:t=>t.path},getColor:{type:"accessor",value:A},getWidth:{type:"accessor",value:1},rounded:{deprecatedFor:["jointRounded","capRounded"]}},g={enter:(t,e)=>e.length?e.subarray(e.length-t.length):t};class m extends r.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}getShaders(){return super.getShaders({vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec3 instanceLeftPositions64Low;\nattribute vec3 instanceStartPositions64Low;\nattribute vec3 instanceEndPositions64Low;\nattribute vec3 instanceRightPositions64Low;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float capType;\nuniform float miterLimit;\nuniform bool billboard;\nuniform int widthUnits;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n  return -(float(flag) * 2. - 1.);\n}\nvec3 getLineJoinOffset(\n  vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n  vec2 width\n) {\n  bool isEnd = positions.x > 0.0;\n  float sideOfPath = positions.y;\n  float isJoint = float(sideOfPath == 0.0);\n\n  vec3 deltaA3 = (currPoint - prevPoint);\n  vec3 deltaB3 = (nextPoint - currPoint);\n\n  mat3 rotationMatrix;\n  bool needsRotation = !billboard && project_needs_rotation(currPoint, rotationMatrix);\n  if (needsRotation) {\n    deltaA3 = deltaA3 * rotationMatrix;\n    deltaB3 = deltaB3 * rotationMatrix;\n  }\n  vec2 deltaA = deltaA3.xy / width;\n  vec2 deltaB = deltaB3.xy / width;\n\n  float lenA = length(deltaA);\n  float lenB = length(deltaB);\n\n  vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n  vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n  vec2 perpA = vec2(-dirA.y, dirA.x);\n  vec2 perpB = vec2(-dirB.y, dirB.x);\n  vec2 tangent = dirA + dirB;\n  tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n  vec2 miterVec = vec2(-tangent.y, tangent.x);\n  vec2 dir = isEnd ? dirA : dirB;\n  vec2 perp = isEnd ? perpA : perpB;\n  float L = isEnd ? lenA : lenB;\n  float sinHalfA = abs(dot(miterVec, perp));\n  float cosHalfA = abs(dot(dirA, miterVec));\n  float turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\n  float cornerPosition = sideOfPath * turnDirection;\n\n  float miterSize = 1.0 / max(sinHalfA, EPSILON);\n  miterSize = mix(\n    min(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),\n    miterSize,\n    step(0.0, cornerPosition)\n  );\n\n  vec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))\n    * (sideOfPath + isJoint * turnDirection);\n  bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\n  bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\n  bool isCap = isStartCap || isEndCap;\n  if (isCap) {\n    offsetVec = mix(perp * sideOfPath, dir * capType * 4.0 * flipIfTrue(isStartCap), isJoint);\n    vJointType = capType;\n  } else {\n    vJointType = jointType;\n  }\n  vPathLength = L;\n  vCornerOffset = offsetVec;\n  vMiterLength = dot(vCornerOffset, miterVec * turnDirection);\n  vMiterLength = isCap ? isJoint : vMiterLength;\n\n  vec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);\n  vPathPosition = vec2(\n    dot(offsetFromStartOfPath, perp),\n    dot(offsetFromStartOfPath, dir)\n  );\n  geometry.uv = vPathPosition;\n\n  float isValid = step(instanceTypes, 3.5);\n  vec3 offset = vec3(offsetVec * width * isValid, 0.0);\n\n  if (needsRotation) {\n    offset = rotationMatrix * offset;\n  }\n  return offset;\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n  if (position.w < EPSILON) {\n    float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n    position = refPosition + (position - refPosition) * r;\n  }\n}\n\nvoid main() {\n  geometry.pickingColor = instancePickingColors;\n\n  vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n\n  float isEnd = positions.x;\n\n  vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n  vec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);\n\n  vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n  vec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);\n\n  vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n  vec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);\n\n  geometry.worldPosition = currPosition;\n  vec2 widthPixels = vec2(clamp(\n    project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\n    widthMinPixels, widthMaxPixels) / 2.0);\n  vec3 width;\n\n  if (billboard) {\n    vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);\n    vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);\n    vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);\n\n    clipLine(prevPositionScreen, currPositionScreen);\n    clipLine(nextPositionScreen, currPositionScreen);\n    clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n    width = vec3(widthPixels, 0.0);\n    DECKGL_FILTER_SIZE(width, geometry);\n\n    vec3 offset = getLineJoinOffset(\n      prevPositionScreen.xyz / prevPositionScreen.w,\n      currPositionScreen.xyz / currPositionScreen.w,\n      nextPositionScreen.xyz / nextPositionScreen.w,\n      project_pixel_size_to_clipspace(width.xy)\n    );\n\n    DECKGL_FILTER_GL_POSITION(currPositionScreen, geometry);\n    gl_Position = vec4(currPositionScreen.xyz + offset * currPositionScreen.w, currPositionScreen.w);\n  } else {\n    prevPosition = project_position(prevPosition, prevPosition64Low);\n    currPosition = project_position(currPosition, currPosition64Low);\n    nextPosition = project_position(nextPosition, nextPosition64Low);\n\n    width = vec3(project_pixel_size(widthPixels), 0.0);\n    DECKGL_FILTER_SIZE(width, geometry);\n\n    vec3 offset = getLineJoinOffset(prevPosition, currPosition, nextPosition, width.xy);\n    geometry.position = vec4(currPosition + offset, 1.0);\n    gl_Position = project_common_position_to_clipspace(geometry.position);\n    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  }\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float miterLimit;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nvoid main(void) {\n  geometry.uv = vPathPosition;\n\n  if (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {\n    if (vJointType > 0.5 && length(vCornerOffset) > 1.0) {\n      discard;\n    }\n    if (vJointType < 0.5 && vMiterLength > miterLimit + 1.0) {\n      discard;\n    }\n  }\n  gl_FragColor = vColor;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}get wrapLongitude(){return!1}initializeState(){const t=!0;this.getAttributeManager().addInstanced({positions:{size:3,vertexOffset:1,type:5130,fp64:this.use64bitPositions(),transition:g,accessor:"getPath",update:this.calculatePositions,noAlloc:t,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:t},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:g,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:g,defaultValue:A},instancePickingColors:{size:3,type:5121,accessor:(t,e)=>{let{index:n,target:i}=e;return this.encodePickingColor(t&&t.__source?t.__source.index:n,i)}}}),this.setState({pathTesselator:new d({fp64:this.use64bitPositions()})})}updateState(t){super.updateState(t);const{props:e,changeFlags:n}=t,i=this.getAttributeManager();if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPath)){const{pathTesselator:t}=this.state,r=e.data.attributes||{};t.updateGeometry({data:e.data,geometryBuffer:r.getPath,buffers:r,normalize:!e._pathType,loop:"loop"===e._pathType,getGeometry:e.getPath,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:n.dataChanged}),this.setState({numInstances:t.instanceCount,startIndices:t.vertexStarts}),n.dataChanged||i.invalidateAll()}if(n.extensionsChanged){var r;const{gl:t}=this.context;null===(r=this.state.model)||void 0===r||r.delete(),this.state.model=this._getModel(t),i.invalidateAll()}}getPickingInfo(t){const e=super.getPickingInfo(t),{index:n}=e,{data:i}=this.props;return i[0]&&i[0].__source&&(e.object=i.find((t=>t.__source.index===n))),e}disablePickingIndex(t){const{data:e}=this.props;if(e[0]&&e[0].__source)for(let n=0;n<e.length;n++)e[n].__source.index===t&&this._disablePickingIndex(n);else super.disablePickingIndex(t)}draw(t){let{uniforms:e}=t;const{jointRounded:n,capRounded:i,billboard:r,miterLimit:o,widthUnits:s,widthScale:l,widthMinPixels:c,widthMaxPixels:u}=this.props;this.state.model.setUniforms(e).setUniforms({jointType:Number(n),capType:Number(i),billboard:r,widthUnits:a.iI[s],widthScale:l,miterLimit:o,widthMinPixels:c,widthMaxPixels:u}).draw()}_getModel(t){return new l.Z(t,{...this.getShaders(),id:this.props.id,geometry:new c.Z({drawMode:4,attributes:{indices:new Uint16Array([0,1,2,1,4,2,1,3,4,3,5,4]),positions:{value:new Float32Array([0,0,0,-1,0,1,1,-1,1,1,1,0]),size:2}}}),isInstanced:!0})}calculatePositions(t){const{pathTesselator:e}=this.state;t.startIndices=e.vertexStarts,t.value=e.get("positions")}calculateSegmentTypes(t){const{pathTesselator:e}=this.state;t.startIndices=e.vertexStarts,t.value=e.get("segmentTypes")}}(0,i.Z)(m,"defaultProps",p),(0,i.Z)(m,"layerName","PathLayer")},11162:(t,e,n)=>{"use strict";n.d(e,{Z:()=>A});var i=n(64649),r=n(90031),o=n(2123),s=n(54976),a=n(2578),l=n(18252),c=n(94557),u=n(69296);const h=[0,0,0,255],d=[0,0,1],f={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:t=>t.position},getNormal:{type:"accessor",value:d},getColor:{type:"accessor",value:h},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};class A extends r.Z{getShaders(){return super.getShaders({vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\nuniform int sizeUnits;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  geometry.normal = project_normal(instanceNormals);\n  unitPosition = positions.xy;\n  geometry.uv = unitPosition;\n  geometry.pickingColor = instancePickingColors;\n  vec3 offset = vec3(positions.xy * project_size_to_pixel(radiusPixels, sizeUnits), 0.0);\n  DECKGL_FILTER_SIZE(offset, geometry);\n\n  gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n  vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n  vColor = vec4(lightColor, instanceColors.a * opacity);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n  geometry.uv = unitPosition;\n\n  float distToCenter = length(unitPosition);\n\n  if (distToCenter > 1.0) {\n    discard;\n  }\n\n  gl_FragColor = vColor;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.N,a.Z]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:d},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:h}})}updateState(t){const{changeFlags:e,props:n}=t;if(super.updateState(t),e.extensionsChanged){var i;const{gl:t}=this.context;null===(i=this.state.model)||void 0===i||i.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}e.dataChanged&&function(t){const{header:e,attributes:n}=t;e&&n&&(t.length=e.vertexCount,n.POSITION&&(n.instancePositions=n.POSITION),n.NORMAL&&(n.instanceNormals=n.NORMAL),n.COLOR_0&&(n.instanceColors=n.COLOR_0))}(n.data)}draw(t){let{uniforms:e}=t;const{pointSize:n,sizeUnits:i}=this.props;this.state.model.setUniforms(e).setUniforms({sizeUnits:l.iI[i],radiusPixels:n}).draw()}_getModel(t){const e=[];for(let n=0;n<3;n++){const t=n/3*Math.PI*2;e.push(2*Math.cos(t),2*Math.sin(t),0)}return new c.Z(t,{...this.getShaders(),id:this.props.id,geometry:new u.Z({drawMode:4,attributes:{positions:new Float32Array(e)}}),isInstanced:!0})}}(0,i.Z)(A,"layerName","PointCloudLayer"),(0,i.Z)(A,"defaultProps",f)},94300:(t,e,n)=>{"use strict";n.d(e,{Z:()=>f});var i=n(64649),r=n(79366),o=n(21970),s=n(73115),a=n(3453),l=n(69554),c=n(32643),u=n(66535);const h=[0,0,0,255],d={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,_normalize:!0,_windingOrder:"CW",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,getPolygon:{type:"accessor",value:t=>t.polygon},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:h},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0};class f extends r.Z{initializeState(){this.state={paths:[]},this.props.getLineDashArray&&o.Z.removed("getLineDashArray","PathStyleExtension")()}updateState(t){let{changeFlags:e}=t;const n=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getPolygon);if(n&&Array.isArray(e.dataChanged)){const t=this.state.paths.slice(),n=e.dataChanged.map((e=>(0,u.b)({data:t,getIndex:t=>t.__source.index,dataRange:e,replace:this._getPaths(e)})));this.setState({paths:t,pathsDiff:n})}else n&&this.setState({paths:this._getPaths(),pathsDiff:null})}_getPaths(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{data:e,getPolygon:n,positionFormat:i,_normalize:r}=this.props,o=[],a="XY"===i?2:3,{startRow:l,endRow:u}=t,{iterable:h,objectInfo:d}=(0,s.jB)(e,l,u);for(const s of h){d.index++;let t=n(s,d);r&&(t=c.Fv(t,a));const{holeIndices:e}=t,i=t.positions||t;if(e)for(let n=0;n<=e.length;n++){const t=i.slice(e[n-1]||0,e[n]||i.length);o.push(this.getSubLayerRow({path:t},s,d.index))}else o.push(this.getSubLayerRow({path:i},s,d.index))}return o}renderLayers(){const{data:t,_dataDiff:e,stroked:n,filled:i,extruded:r,wireframe:o,_normalize:s,_windingOrder:c,elevationScale:u,transitions:d,positionFormat:f}=this.props,{lineWidthUnits:A,lineWidthScale:p,lineWidthMinPixels:g,lineWidthMaxPixels:m,lineJointRounded:y,lineMiterLimit:v,lineDashJustified:_}=this.props,{getFillColor:b,getLineColor:x,getLineWidth:w,getLineDashArray:C,getElevation:B,getPolygon:E,updateTriggers:T,material:S}=this.props,{paths:M,pathsDiff:I}=this.state,P=this.getSubLayerClass("fill",a.Z),D=this.getSubLayerClass("stroke",l.Z),F=this.shouldRenderSubLayer("fill",M)&&new P({_dataDiff:e,extruded:r,elevationScale:u,filled:i,wireframe:o,_normalize:s,_windingOrder:c,getElevation:B,getFillColor:b,getLineColor:r&&o?x:h,material:S,transitions:d},this.getSubLayerProps({id:"fill",updateTriggers:T&&{getPolygon:T.getPolygon,getElevation:T.getElevation,getFillColor:T.getFillColor,lineColors:r&&o,getLineColor:T.getLineColor}}),{data:t,positionFormat:f,getPolygon:E});return[!r&&F,!r&&n&&this.shouldRenderSubLayer("stroke",M)&&new D({_dataDiff:I&&(()=>I),widthUnits:A,widthScale:p,widthMinPixels:g,widthMaxPixels:m,jointRounded:y,miterLimit:v,dashJustified:_,_pathType:"loop",transitions:d&&{getWidth:d.getLineWidth,getColor:d.getLineColor,getPath:d.getPolygon},getColor:this.getSubLayerAccessor(x),getWidth:this.getSubLayerAccessor(w),getDashArray:this.getSubLayerAccessor(C)},this.getSubLayerProps({id:"stroke",updateTriggers:T&&{getWidth:T.getLineWidth,getColor:T.getLineColor,getDashArray:T.getLineDashArray}}),{data:M,positionFormat:f,getPath:t=>t.path}),r&&F]}}(0,i.Z)(f,"layerName","PolygonLayer"),(0,i.Z)(f,"defaultProps",d)},87403:(t,e,n)=>{"use strict";n.d(e,{Z:()=>d});var i=n(64649),r=n(90031),o=n(2123),s=n(2578),a=n(18252),l=n(94557),c=n(69296);const u=[0,0,0,255],h={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:"accessor",value:t=>t.position},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:u},getLineColor:{type:"accessor",value:u},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class d extends r.Z{getShaders(){return super.getShaders({vs:"#define SHADER_NAME scatterplot-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceRadius;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusScale;\nuniform float radiusMinPixels;\nuniform float radiusMaxPixels;\nuniform float lineWidthScale;\nuniform float lineWidthMinPixels;\nuniform float lineWidthMaxPixels;\nuniform float stroked;\nuniform bool filled;\nuniform bool antialiasing;\nuniform bool billboard;\nuniform int radiusUnits;\nuniform int lineWidthUnits;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  outerRadiusPixels = clamp(\n    project_size_to_pixel(radiusScale * instanceRadius, radiusUnits),\n    radiusMinPixels, radiusMaxPixels\n  );\n  float lineWidthPixels = clamp(\n    project_size_to_pixel(lineWidthScale * instanceLineWidths, lineWidthUnits),\n    lineWidthMinPixels, lineWidthMaxPixels\n  );\n  outerRadiusPixels += stroked * lineWidthPixels / 2.0;\n  float edgePadding = antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0;\n  unitPosition = edgePadding * positions.xy;\n  geometry.uv = unitPosition;\n  geometry.pickingColor = instancePickingColors;\n\n  innerUnitRadius = 1.0 - stroked * lineWidthPixels / outerRadiusPixels;\n  \n  if (billboard) {\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n    vec3 offset = edgePadding * positions * outerRadiusPixels;\n    DECKGL_FILTER_SIZE(offset, geometry);\n    gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n  } else {\n    vec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels);\n    DECKGL_FILTER_SIZE(offset, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\n    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  }\n  vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n  DECKGL_FILTER_COLOR(vFillColor, geometry);\n  vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n  DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME scatterplot-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool filled;\nuniform float stroked;\nuniform bool antialiasing;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\nvoid main(void) {\n  geometry.uv = unitPosition;\n\n  float distToCenter = length(unitPosition) * outerRadiusPixels;\n  float inCircle = antialiasing ? \n    smoothedge(distToCenter, outerRadiusPixels) : \n    step(distToCenter, outerRadiusPixels);\n\n  if (inCircle == 0.0) {\n    discard;\n  }\n\n  if (stroked > 0.5) {\n    float isLine = antialiasing ? \n      smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :\n      step(innerUnitRadius * outerRadiusPixels, distToCenter);\n\n    if (filled) {\n      gl_FragColor = mix(vFillColor, vLineColor, isLine);\n    } else {\n      if (isLine == 0.0) {\n        discard;\n      }\n      gl_FragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);\n    }\n  } else if (!filled) {\n    discard;\n  } else {\n    gl_FragColor = vFillColor;\n  }\n\n  gl_FragColor.a *= inCircle;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(t){if(super.updateState(t),t.changeFlags.extensionsChanged){var e;const{gl:t}=this.context;null===(e=this.state.model)||void 0===e||e.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}}draw(t){let{uniforms:e}=t;const{radiusUnits:n,radiusScale:i,radiusMinPixels:r,radiusMaxPixels:o,stroked:s,filled:l,billboard:c,antialiasing:u,lineWidthUnits:h,lineWidthScale:d,lineWidthMinPixels:f,lineWidthMaxPixels:A}=this.props;this.state.model.setUniforms(e).setUniforms({stroked:s?1:0,filled:l,billboard:c,antialiasing:u,radiusUnits:a.iI[n],radiusScale:i,radiusMinPixels:r,radiusMaxPixels:o,lineWidthUnits:a.iI[h],lineWidthScale:d,lineWidthMinPixels:f,lineWidthMaxPixels:A}).draw()}_getModel(t){return new l.Z(t,{...this.getShaders(),id:this.props.id,geometry:new c.Z({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0])}}}),isInstanced:!0})}}(0,i.Z)(d,"defaultProps",h),(0,i.Z)(d,"layerName","ScatterplotLayer")},32643:(t,e,n)=>{"use strict";n.d(e,{Fv:()=>f,Gd:()=>u,k8:()=>c,mD:()=>g});var i=n(25880),r=n.n(i),o=n(23595);const s=o.wG.CLOCKWISE,a=o.wG.COUNTER_CLOCKWISE,l={isClosed:!0};function c(t){return"positions"in t?t.positions:t}function u(t){return"holeIndices"in t?t.holeIndices:null}function h(t,e,n,i,r){let s=e;const a=n.length;for(let o=0;o<a;o++)for(let e=0;e<i;e++)t[s++]=n[o][e]||0;if(!function(t){const e=t[0],n=t[t.length-1];return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}(n))for(let o=0;o<i;o++)t[s++]=n[0][o]||0;return l.start=e,l.end=s,l.size=i,(0,o.Ny)(t,r,l),s}function d(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;s=s||n.length;const c=s-r;if(c<=0)return e;let u=e;for(let o=0;o<c;o++)t[u++]=n[r+o];if(!function(t,e,n,i){for(let r=0;r<e;r++)if(t[n+r]!==t[i-e+r])return!1;return!0}(n,i,r,s))for(let o=0;o<i;o++)t[u++]=n[r+o];return l.start=e,l.end=u,l.size=i,(0,o.Ny)(t,a,l),u}function f(t,e){!function(t){if(t=t&&t.positions||t,!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error("invalid polygon")}(t);const n=[],i=[];if("positions"in t){const{positions:r,holeIndices:o}=t;if(o){let t=0;for(let l=0;l<=o.length;l++)t=d(n,t,r,e,o[l-1],o[l],0===l?s:a),i.push(t);return i.pop(),{positions:n,holeIndices:i}}t=r}if(!function(t){return Array.isArray(t[0])}(t))return d(n,0,t,e,0,n.length,s),n;if(!function(t){return t.length>=1&&t[0].length>=2&&Number.isFinite(t[0][0])}(t)){let r=0;for(const[o,l]of t.entries())r=h(n,r,l,e,0===o?s:a),i.push(r);return i.pop(),{positions:n,holeIndices:i}}return h(n,0,t,e,s),n}function A(t,e,n){const i=t.length/3;let r=0;for(let o=0;o<i;o++){const s=(o+1)%i;r+=t[3*o+e]*t[3*s+n],r-=t[3*s+e]*t[3*o+n]}return Math.abs(r/2)}function p(t,e,n,i){const r=t.length/3;for(let o=0;o<r;o++){const r=3*o,s=t[r+0],a=t[r+1],l=t[r+2];t[r+e]=s,t[r+n]=a,t[r+i]=l}}function g(t,e,n,i){let o=u(t);o&&(o=o.map((t=>t/e)));let s=c(t);const a=i&&3===e;if(n){const t=s.length;s=s.slice();const i=[];for(let r=0;r<t;r+=e){i[0]=s[r],i[1]=s[r+1],a&&(i[2]=s[r+2]);const t=n(i);s[r]=t[0],s[r+1]=t[1],a&&(s[r+2]=t[2])}}if(a){const t=A(s,0,1),e=A(s,0,2),i=A(s,1,2);if(!t&&!e&&!i)return[];t>e&&t>i||(e>i?(n||(s=s.slice()),p(s,0,2,1)):(n||(s=s.slice()),p(s,2,0,1)))}return r()(s,o,e)}},3453:(t,e,n)=>{"use strict";n.d(e,{Z:()=>C});var i=n(64649),r=n(90031),o=n(2123),s=n(54976),a=n(2578),l=n(18252),c=n(12308),u=n(70353),h=n(94557),d=n(69296),f=n(32643),A=n(55678),p=n(23595);class g extends A.Z{constructor(t){const{fp64:e,IndexType:n=Uint32Array}=t;super({...t,attributes:{positions:{size:3,type:e?Float64Array:Float32Array},vertexValid:{type:Uint8ClampedArray,size:1},indices:{type:n,size:1}}})}get(t){const{attributes:e}=this;return"indices"===t?e.indices&&e.indices.subarray(0,this.vertexCount):e[t]}updateGeometry(t){super.updateGeometry(t);const e=this.buffers.indices;if(e)this.vertexCount=(e.value||e).length;else if(this.data&&!this.getGeometry)throw new Error("missing indices buffer")}normalizeGeometry(t){if(this.normalize){const e=f.Fv(t,this.positionSize);return this.opts.resolution?(0,p.WZ)(f.k8(e),f.Gd(e),{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0}):this.opts.wrapLongitude?(0,p.GU)(f.k8(e),f.Gd(e),{size:this.positionSize,maxLatitude:86,edgeTypes:!0}):e}return t}getGeometrySize(t){if(m(t)){let e=0;for(const n of t)e+=this.getGeometrySize(n);return e}return f.k8(t).length/this.positionSize}getGeometryFromBuffer(t){return this.normalize||!this.buffers.indices?super.getGeometryFromBuffer(t):null}updateGeometryAttributes(t,e){if(t&&m(t))for(const n of t){const t=this.getGeometrySize(n);e.geometrySize=t,this.updateGeometryAttributes(n,e),e.vertexStart+=t,e.indexStart=this.indexStarts[e.geometryIndex+1]}else this._updateIndices(t,e),this._updatePositions(t,e),this._updateVertexValid(t,e)}_updateIndices(t,e){let{geometryIndex:n,vertexStart:i,indexStart:r}=e;const{attributes:o,indexStarts:s,typedArrayManager:a}=this;let l=o.indices;if(!l||!t)return;let c=r;const u=f.mD(t,this.positionSize,this.opts.preproject,this.opts.full3d);l=a.allocate(l,r+u.length,{copy:!0});for(let h=0;h<u.length;h++)l[c++]=u[h]+i;s[n+1]=r+u.length,o.indices=l}_updatePositions(t,e){let{vertexStart:n,geometrySize:i}=e;const{attributes:{positions:r},positionSize:o}=this;if(!r||!t)return;const s=f.k8(t);for(let a=n,l=0;l<i;a++,l++){const t=s[l*o],e=s[l*o+1],n=o>2?s[l*o+2]:0;r[3*a]=t,r[3*a+1]=e,r[3*a+2]=n}}_updateVertexValid(t,e){let{vertexStart:n,geometrySize:i}=e;const{positionSize:r}=this,o=this.attributes.vertexValid,s=t&&f.Gd(t);if(t&&t.edgeTypes?o.set(t.edgeTypes,n):o.fill(1,n,n+i),s)for(let a=0;a<s.length;a++)o[n+s[a]/r-1]=0;o[n+i-1]=0}}function m(t){return Array.isArray(t)&&t.length>0&&!Number.isFinite(t[0])}const y="\nattribute vec2 vertexPositions;\nattribute float vertexValid;\n\nuniform bool extruded;\nuniform bool isWireframe;\nuniform float elevationScale;\nuniform float opacity;\n\nvarying vec4 vColor;\n\nstruct PolygonProps {\n  vec4 fillColors;\n  vec4 lineColors;\n  vec3 positions;\n  vec3 nextPositions;\n  vec3 pickingColors;\n  vec3 positions64Low;\n  vec3 nextPositions64Low;\n  float elevations;\n};\n\nvec3 project_offset_normal(vec3 vector) {\n  if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n    project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n    return normalize(vector * project_uCommonUnitsPerWorldUnit);\n  }\n  return project_normal(vector);\n}\n\nvoid calculatePosition(PolygonProps props) {\n#ifdef IS_SIDE_VERTEX\n  if(vertexValid < 0.5){\n    gl_Position = vec4(0.);\n    return;\n  }\n#endif\n\n  vec3 pos;\n  vec3 pos64Low;\n  vec3 normal;\n  vec4 colors = isWireframe ? props.lineColors : props.fillColors;\n\n  geometry.worldPosition = props.positions;\n  geometry.worldPositionAlt = props.nextPositions;\n  geometry.pickingColor = props.pickingColors;\n\n#ifdef IS_SIDE_VERTEX\n  pos = mix(props.positions, props.nextPositions, vertexPositions.x);\n  pos64Low = mix(props.positions64Low, props.nextPositions64Low, vertexPositions.x);\n#else\n  pos = props.positions;\n  pos64Low = props.positions64Low;\n#endif\n\n  if (extruded) {\n    pos.z += props.elevations * vertexPositions.y * elevationScale;\n  }\n  gl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position);\n\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  if (extruded) {\n  #ifdef IS_SIDE_VERTEX\n    normal = vec3(\n      props.positions.y - props.nextPositions.y + (props.positions64Low.y - props.nextPositions64Low.y),\n      props.nextPositions.x - props.positions.x + (props.nextPositions64Low.x - props.positions64Low.x),\n      0.0);\n    normal = project_offset_normal(normal);\n  #else\n    normal = project_normal(vec3(0.0, 0.0, 1.0));\n  #endif\n    geometry.normal = normal;\n    vec3 lightColor = lighting_getLightColor(colors.rgb, project_uCameraPosition, geometry.position.xyz, normal);\n    vColor = vec4(lightColor, colors.a * opacity);\n  } else {\n    vColor = vec4(colors.rgb, colors.a * opacity);\n  }\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",v="#define SHADER_NAME solid-polygon-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 positions64Low;\nattribute float elevations;\nattribute vec4 fillColors;\nattribute vec4 lineColors;\nattribute vec3 pickingColors;\n\n".concat(y,"\n\nvoid main(void) {\n  PolygonProps props;\n\n  props.positions = positions;\n  props.positions64Low = positions64Low;\n  props.elevations = elevations;\n  props.fillColors = fillColors;\n  props.lineColors = lineColors;\n  props.pickingColors = pickingColors;\n\n  calculatePosition(props);\n}\n"),_="#define SHADER_NAME solid-polygon-layer-vertex-shader-side\n#define IS_SIDE_VERTEX\n\n\nattribute vec3 instancePositions;\nattribute vec3 nextPositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 nextPositions64Low;\nattribute float instanceElevations;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\n".concat(y,"\n\nvoid main(void) {\n  PolygonProps props;\n\n  #if RING_WINDING_ORDER_CW == 1\n    props.positions = instancePositions;\n    props.positions64Low = instancePositions64Low;\n    props.nextPositions = nextPositions;\n    props.nextPositions64Low = nextPositions64Low;\n  #else\n    props.positions = nextPositions;\n    props.positions64Low = nextPositions64Low;\n    props.nextPositions = instancePositions;\n    props.nextPositions64Low = instancePositions64Low;\n  #endif\n  props.elevations = instanceElevations;\n  props.fillColors = instanceFillColors;\n  props.lineColors = instanceLineColors;\n  props.pickingColors = instancePickingColors;\n\n  calculatePosition(props);\n}\n"),b=[0,0,0,255],x={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,_windingOrder:"CW",_full3d:!1,elevationScale:{type:"number",min:0,value:1},getPolygon:{type:"accessor",value:t=>t.polygon},getElevation:{type:"accessor",value:1e3},getFillColor:{type:"accessor",value:b},getLineColor:{type:"accessor",value:b},material:!0},w={enter:(t,e)=>e.length?e.subarray(e.length-t.length):t};class C extends r.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}getShaders(t){return super.getShaders({vs:"top"===t?v:_,fs:"#define SHADER_NAME solid-polygon-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n  gl_FragColor = vColor;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",defines:{RING_WINDING_ORDER_CW:this.props._normalize||"CCW"!==this.props._windingOrder?1:0},modules:[o.Z,s.N,a.Z]})}get wrapLongitude(){return!1}initializeState(){const{gl:t,viewport:e}=this.context;let{coordinateSystem:n}=this.props;const{_full3d:i}=this.props;let r;e.isGeospatial&&n===l.Df.DEFAULT&&(n=l.Df.LNGLAT),n===l.Df.LNGLAT&&(r=i?e.projectPosition.bind(e):e.projectFlat.bind(e)),this.setState({numInstances:0,polygonTesselator:new g({preproject:r,fp64:this.use64bitPositions(),IndexType:!t||(0,c.ag)(t,u.h.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array})});const o=this.getAttributeManager(),s=!0;o.remove(["instancePickingColors"]),o.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:s},positions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:w,accessor:"getPolygon",update:this.calculatePositions,noAlloc:s,shaderAttributes:{positions:{vertexOffset:0,divisor:0},instancePositions:{vertexOffset:0,divisor:1},nextPositions:{vertexOffset:1,divisor:1}}},vertexValid:{size:1,divisor:1,type:5121,update:this.calculateVertexValid,noAlloc:s},elevations:{size:1,transition:w,accessor:"getElevation",shaderAttributes:{elevations:{divisor:0},instanceElevations:{divisor:1}}},fillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:w,accessor:"getFillColor",defaultValue:b,shaderAttributes:{fillColors:{divisor:0},instanceFillColors:{divisor:1}}},lineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:w,accessor:"getLineColor",defaultValue:b,shaderAttributes:{lineColors:{divisor:0},instanceLineColors:{divisor:1}}},pickingColors:{size:3,type:5121,accessor:(t,e)=>{let{index:n,target:i}=e;return this.encodePickingColor(t&&t.__source?t.__source.index:n,i)},shaderAttributes:{pickingColors:{divisor:0},instancePickingColors:{divisor:1}}}})}getPickingInfo(t){const e=super.getPickingInfo(t),{index:n}=e,{data:i}=this.props;return i[0]&&i[0].__source&&(e.object=i.find((t=>t.__source.index===n))),e}disablePickingIndex(t){const{data:e}=this.props;if(e[0]&&e[0].__source)for(let n=0;n<e.length;n++)e[n].__source.index===t&&this._disablePickingIndex(n);else super.disablePickingIndex(t)}draw(t){let{uniforms:e}=t;const{extruded:n,filled:i,wireframe:r,elevationScale:o}=this.props,{topModel:s,sideModel:a,polygonTesselator:l}=this.state,c={...e,extruded:Boolean(n),elevationScale:o};a&&(a.setInstanceCount(l.instanceCount-1),a.setUniforms(c),r&&(a.setDrawMode(3),a.setUniforms({isWireframe:!0}).draw()),i&&(a.setDrawMode(6),a.setUniforms({isWireframe:!1}).draw())),s&&(s.setVertexCount(l.vertexCount),s.setUniforms(c).draw())}updateState(t){super.updateState(t),this.updateGeometry(t);const{props:e,oldProps:n,changeFlags:i}=t,r=this.getAttributeManager();var o;(i.extensionsChanged||e.filled!==n.filled||e.extruded!==n.extruded)&&(null===(o=this.state.models)||void 0===o||o.forEach((t=>t.delete())),this.setState(this._getModels(this.context.gl)),r.invalidateAll())}updateGeometry(t){let{props:e,oldProps:n,changeFlags:i}=t;if(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getPolygon)){const{polygonTesselator:t}=this.state,n=e.data.attributes||{};t.updateGeometry({data:e.data,normalize:e._normalize,geometryBuffer:n.getPolygon,buffers:n,getGeometry:e.getPolygon,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:i.dataChanged,full3d:e._full3d}),this.setState({numInstances:t.instanceCount,startIndices:t.vertexStarts}),i.dataChanged||this.getAttributeManager().invalidateAll()}}_getModels(t){const{id:e,filled:n,extruded:i}=this.props;let r,o;if(n){const n=this.getShaders("top");n.defines.NON_INSTANCED_MODEL=1,r=new h.Z(t,{...n,id:"".concat(e,"-top"),drawMode:4,attributes:{vertexPositions:new Float32Array([0,1])},uniforms:{isWireframe:!1,isSideVertex:!1},vertexCount:0,isIndexed:!0})}return i&&(o=new h.Z(t,{...this.getShaders("side"),id:"".concat(e,"-side"),geometry:new d.Z({drawMode:1,vertexCount:4,attributes:{vertexPositions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),instanceCount:0,isInstanced:1}),o.userData.excludeAttributes={indices:!0}),{models:[o,r].filter(Boolean),topModel:r,sideModel:o}}calculateIndices(t){const{polygonTesselator:e}=this.state;t.startIndices=e.indexStarts,t.value=e.get("indices")}calculatePositions(t){const{polygonTesselator:e}=this.state;t.startIndices=e.vertexStarts,t.value=e.get("positions")}calculateVertexValid(t){t.value=this.state.polygonTesselator.get("vertexValid")}}(0,i.Z)(C,"defaultProps",x),(0,i.Z)(C,"layerName","SolidPolygonLayer")},20377:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var i=n(64649),r=n(21970),o=n(32296);const s=.75,a=[];class l extends o.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}getShaders(){return{...super.getShaders(),fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float sdfBuffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n  geometry.uv = uv;\n\n  if (!picking_uActive) {\n    float alpha = texture2D(iconsTexture, vTextureCoords).a;\n    vec4 color = vColor;\n    if (sdf) {\n      float distance = alpha;\n      alpha = smoothstep(sdfBuffer - gamma, sdfBuffer + gamma, distance);\n\n      if (outlineBuffer > 0.0) {\n        float inFill = alpha;\n        float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n        color = mix(outlineColor, vColor, inFill);\n        alpha = inBorder;\n      }\n    }\n    float a = alpha * color.a;\n    \n    if (a < alphaCutoff) {\n      discard;\n    }\n\n    gl_FragColor = vec4(color.rgb, a * opacity);\n  }\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"}}initializeState(){super.initializeState();this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(t,e)=>{let{index:n,target:i}=e;return this.encodePickingColor(n,i)}}})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;let{outlineColor:i}=e;i!==n.outlineColor&&(i=i.map((t=>t/255)),i[3]=Number.isFinite(i[3])?i[3]:1,this.setState({outlineColor:i})),!e.sdf&&e.outlineWidth&&r.Z.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:e,smoothing:n,outlineWidth:i}=this.props,{outlineColor:r}=this.state,o=i?Math.max(n,s*(1-i)):-1;if(t.uniforms={...t.uniforms,sdfBuffer:s,outlineBuffer:o,gamma:n,sdf:Boolean(e),outlineColor:r},super.draw(t),e&&i){const{iconManager:t}=this.state;t.getTexture()&&this.state.model.draw({uniforms:{outlineBuffer:s}})}}getInstanceOffset(t){return t?Array.from(t).flatMap((t=>super.getInstanceOffset(t))):a}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).flatMap((t=>super.getInstanceIconFrame(t))):a}}(0,i.Z)(l,"defaultProps",{getIconOffsets:{type:"accessor",value:t=>t.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}}),(0,i.Z)(l,"layerName","MultiIconLayer")},56394:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var i=n(64649),r=n(90031),o=n(2123),s=n(2578),a=n(18252),l=n(94557),c=n(69296);const u={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:t=>t.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};class h extends r.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\nuniform int sizeUnits;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n  float angle_radian = radians(angle);\n  float cos_angle = cos(angle_radian);\n  float sin_angle = sin(angle_radian);\n  mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n  return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  geometry.uv = positions;\n  geometry.pickingColor = instancePickingColors;\n  uv = positions;\n  vLineWidth = instanceLineWidths;\n  float sizePixels = clamp(\n    project_size_to_pixel(instanceSizes * sizeScale, sizeUnits),\n    sizeMinPixels, sizeMaxPixels\n  );\n\n  dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n  vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n  pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n  pixelOffset += instancePixelOffsets;\n  pixelOffset.y *= -1.0;\n\n  if (billboard)  {\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n    vec3 offset = vec3(pixelOffset, 0.0);\n    DECKGL_FILTER_SIZE(offset, geometry);\n    gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n  } else {\n    vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n    DECKGL_FILTER_SIZE(offset_common, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  }\n  vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n  DECKGL_FILTER_COLOR(vFillColor, geometry);\n  vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n  DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n  geometry.uv = uv;\n\n  vec2 pixelPosition = uv * dimensions;\n  if (stroked) {\n    float distToEdge = min(\n      min(pixelPosition.x, dimensions.x - pixelPosition.x),\n      min(pixelPosition.y, dimensions.y - pixelPosition.y)\n    );\n    float isBorder = smoothedge(distToEdge, vLineWidth);\n    gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n  } else {\n    gl_FragColor = vFillColor;\n  }\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(t){super.updateState(t);const{changeFlags:e}=t;if(e.extensionsChanged){var n;const{gl:t}=this.context;null===(n=this.state.model)||void 0===n||n.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}}draw(t){let{uniforms:e}=t;const{billboard:n,sizeScale:i,sizeUnits:r,sizeMinPixels:o,sizeMaxPixels:s,getLineWidth:l}=this.props;let{padding:c}=this.props;c.length<4&&(c=[c[0],c[1],c[0],c[1]]),this.state.model.setUniforms(e).setUniforms({billboard:n,stroked:Boolean(l),padding:c,sizeUnits:a.iI[r],sizeScale:i,sizeMinPixels:o,sizeMaxPixels:s}).draw()}_getModel(t){return new l.Z(t,{...this.getShaders(),id:this.props.id,geometry:new c.Z({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0})}}(0,i.Z)(h,"defaultProps",u),(0,i.Z)(h,"layerName","TextBackgroundLayer")},46233:(t,e,n)=>{"use strict";n.d(e,{Z:()=>M});var i=n(64649),r=n(79366),o=n(21970),s=n(73115),a=n(20377);const l=1e20;class c{constructor(){let{fontSize:t=24,buffer:e=3,radius:n=8,cutoff:i=.25,fontFamily:r="sans-serif",fontWeight:o="normal",fontStyle:s="normal"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.buffer=e,this.cutoff=i,this.radius=n;const a=this.size=t+4*e,l=this._createCanvas(a),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font="".concat(s," ").concat(o," ").concat(t,"px ").concat(r),c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:n,actualBoundingBoxDescent:i,actualBoundingBoxLeft:r,actualBoundingBoxRight:o}=this.ctx.measureText(t),s=Math.ceil(n),a=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-r))),c=Math.min(this.size-this.buffer,s+Math.ceil(i)),h=a+2*this.buffer,d=c+2*this.buffer,f=Math.max(h*d,0),A=new Uint8ClampedArray(f),p={data:A,width:h,height:d,glyphWidth:a,glyphHeight:c,glyphTop:s,glyphLeft:0,glyphAdvance:e};if(0===a||0===c)return p;const{ctx:g,buffer:m,gridInner:y,gridOuter:v}=this;g.clearRect(m,m,a,c),g.fillText(t,m,m+s);const _=g.getImageData(m,m,a,c);v.fill(l,0,f),y.fill(0,0,f);for(let u=0;u<c;u++)for(let t=0;t<a;t++){const e=_.data[4*(u*a+t)+3]/255;if(0===e)continue;const n=(u+m)*h+t+m;if(1===e)v[n]=0,y[n]=l;else{const t=.5-e;v[n]=t>0?t*t:0,y[n]=t<0?t*t:0}}u(v,0,0,h,d,h,this.f,this.v,this.z),u(y,m,m,a,c,h,this.f,this.v,this.z);for(let l=0;l<f;l++){const t=Math.sqrt(v[l])-Math.sqrt(y[l]);A[l]=Math.round(255-255*(t/this.radius+this.cutoff))}return p}}function u(t,e,n,i,r,o,s,a,l){for(let c=e;c<e+i;c++)h(t,n*o+c,o,r,s,a,l);for(let c=n;c<n+r;c++)h(t,c*o+e,1,i,s,a,l)}function h(t,e,n,i,r,o,s){o[0]=0,s[0]=-l,s[1]=l,r[0]=t[e];for(let a=1,c=0,u=0;a<i;a++){r[a]=t[e+a*n];const i=a*a;do{const t=o[c];u=(r[a]-r[t]+i-t*t)/(a-t)/2}while(u<=s[c]&&--c>-1);c++,o[c]=a,s[c]=u,s[c+1]=l}for(let a=0,l=0;a<i;a++){for(;s[l+1]<a;)l++;const i=o[l],c=a-i;t[e+a*n]=r[i]+c*c}}const d=32,f=[];function A(t,e,n,i){let r=0;for(let s=e;s<n;s++){var o;r+=(null===(o=i[t[s]])||void 0===o?void 0:o.layoutWidth)||0}return r}function p(t,e,n,i,r,o){let s=e,a=0;for(let l=e;l<n;l++){const e=A(t,l,l+1,r);a+e>i&&(s<l&&o.push(l),s=l,a=0),a+=e}return a}function g(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;void 0===o&&(o=t.length);const s=[];return"break-all"===e?p(t,r,o,n,i,s):function(t,e,n,i,r,o){let s=e,a=e,l=e,c=0;for(let u=e;u<n;u++)if(" "===t[u]?l=u+1:" "!==t[u+1]&&u+1!==n||(l=u+1),l>a){let e=A(t,a,l,r);c+e>i&&(s<a&&(o.push(a),s=a,c=0),e>i&&(e=p(t,a,l,i,r,o),s=o[o.length-1])),a=l,c+=e}}(t,r,o,n,i,s),s}function m(t,e,n,i,r,s){let a=0,l=0;for(let c=e;c<n;c++){const e=t[c],n=i[e];n?(l||(l=n.layoutHeight),r[c]=a+n.layoutWidth/2,a+=n.layoutWidth):(o.Z.warn("Missing character: ".concat(e," (").concat(e.codePointAt(0),")"))(),r[c]=a,a+=d)}s[0]=a,s[1]=l}class y{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;(0,i.Z)(this,"limit",void 0),(0,i.Z)(this,"_cache",{}),(0,i.Z)(this,"_order",[]),this.limit=t}get(t){const e=this._cache[t];return e&&(this._deleteOrder(t),this._appendOrder(t)),e}set(t,e){this._cache[t]?(this.delete(t),this._cache[t]=e,this._appendOrder(t)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[t]=e,this._appendOrder(t))}delete(t){this._cache[t]&&(delete this._cache[t],this._deleteOrder(t))}_deleteOrder(t){const e=this._order.indexOf(t);e>=0&&this._order.splice(e,1)}_appendOrder(t){this._order.push(t)}}const v={fontFamily:"Monaco, monospace",fontWeight:"normal",characterSet:function(){const t=[];for(let e=32;e<128;e++)t.push(String.fromCharCode(e));return t}(),fontSize:64,buffer:4,sdf:!1,cutoff:.25,radius:12,smoothing:.1};let _=new y(3);function b(t,e){for(let n=0;n<t.length;n++)e.data[4*n+3]=t[n]}function x(t,e,n,i){t.font="".concat(i," ").concat(n,"px ").concat(e),t.fillStyle="#000",t.textBaseline="alphabetic",t.textAlign="left"}class w{constructor(){(0,i.Z)(this,"props",{...v}),(0,i.Z)(this,"_key",void 0),(0,i.Z)(this,"_atlas",void 0)}get texture(){return this._atlas}get mapping(){return this._atlas&&this._atlas.mapping}get scale(){const{fontSize:t,buffer:e}=this.props;return(1.2*t+2*e)/t}setProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(this.props,t),this._key=this._getKey();const e=function(t,e){let n;n="string"===typeof e?new Set(Array.from(e)):new Set(e);const i=_.get(t);if(!i)return n;for(const r in i.mapping)n.has(r)&&n.delete(r);return n}(this._key,this.props.characterSet),n=_.get(this._key);if(n&&0===e.size)return void(this._atlas!==n&&(this._atlas=n));const i=this._generateFontAtlas(e,n);this._atlas=i,_.set(this._key,i)}_generateFontAtlas(t,e){const{fontFamily:n,fontWeight:i,fontSize:r,buffer:o,sdf:s,radius:a,cutoff:l}=this.props;let u=e&&e.data;u||(u=document.createElement("canvas"),u.width=1024);const h=u.getContext("2d",{willReadFrequently:!0});x(h,n,r,i);const{mapping:d,canvasHeight:f,xOffset:A,yOffset:p}=function(t){let{characterSet:e,getFontWidth:n,fontHeight:i,buffer:r,maxCanvasWidth:o,mapping:s={},xOffset:a=0,yOffset:l=0}=t,c=0,u=a;const h=i+2*r;for(const f of e)if(!s[f]){const t=n(f);u+t+2*r>o&&(u=0,c++),s[f]={x:u+r,y:l+c*h+r,width:t,height:h,layoutWidth:t,layoutHeight:i},u+=t+2*r}return{mapping:s,xOffset:u,yOffset:l+c*h,canvasHeight:(d=l+(c+1)*h,Math.pow(2,Math.ceil(Math.log2(d))))};var d}({getFontWidth:t=>h.measureText(t).width,fontHeight:1.2*r,buffer:o,characterSet:t,maxCanvasWidth:1024,...e&&{mapping:e.mapping,xOffset:e.xOffset,yOffset:e.yOffset}});if(u.height!==f){const t=h.getImageData(0,0,u.width,u.height);u.height=f,h.putImageData(t,0,0)}if(x(h,n,r,i),s){const e=new c({fontSize:r,buffer:o,radius:a,cutoff:l,fontFamily:n,fontWeight:"".concat(i)});for(const n of t){const{data:t,width:i,height:o,glyphTop:s}=e.draw(n);d[n].width=i,d[n].layoutOffsetY=.9*r-s;const a=h.createImageData(i,o);b(t,a),h.putImageData(a,d[n].x,d[n].y)}}else for(const c of t)h.fillText(c,d[c].x,d[c].y+o+.9*r);return{xOffset:A,yOffset:p,mapping:d,data:u,width:u.width,height:u.height}}_getKey(){const{fontFamily:t,fontWeight:e,fontSize:n,buffer:i,sdf:r,radius:o,cutoff:s}=this.props;return r?"".concat(t," ").concat(e," ").concat(n," ").concat(i," ").concat(o," ").concat(s):"".concat(t," ").concat(e," ").concat(n," ").concat(i)}}var C=n(56394);const B={start:1,middle:0,end:-1},E={top:1,center:0,bottom:-1},T=[0,0,0,255],S={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:T},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:v.characterSet},fontFamily:v.fontFamily,fontWeight:v.fontWeight,lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:T},fontSettings:{type:"object",value:{},compare:1},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:t=>t.text},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:T},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};class M extends r.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0),(0,i.Z)(this,"getBoundingRect",((t,e)=>{let{size:[n,i]}=this.transformParagraph(t,e);const{fontSize:r}=this.state.fontAtlasManager.props;n/=r,i/=r;const{getTextAnchor:o,getAlignmentBaseline:s}=this.props;return[(B["function"===typeof o?o(t,e):o]-1)*n/2,(E["function"===typeof s?s(t,e):s]-1)*i/2,n,i]})),(0,i.Z)(this,"getIconOffsets",((t,e)=>{const{getTextAnchor:n,getAlignmentBaseline:i}=this.props,{x:r,y:o,rowWidth:s,size:[a,l]}=this.transformParagraph(t,e),c=B["function"===typeof n?n(t,e):n],u=E["function"===typeof i?i(t,e):i],h=r.length,d=new Array(2*h);let f=0;for(let A=0;A<h;A++){const t=(1-c)*(a-s[A])/2;d[f++]=(c-1)*a/2+t+r[A],d[f++]=(u-1)*l/2+o[A]}return d}))}initializeState(){this.state={styleVersion:0,fontAtlasManager:new w},this.props.maxWidth>0&&o.Z.warn("v8.9 breaking change: TextLayer maxWidth is now relative to text size")()}updateState(t){const{props:e,oldProps:n,changeFlags:i}=t;(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getText))&&this._updateText();(this._updateFontAtlas()||e.lineHeight!==n.lineHeight||e.wordBreak!==n.wordBreak||e.maxWidth!==n.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo(t){let{info:e}=t;return e.object=e.index>=0?this.props.data[e.index]:null,e}_updateFontAtlas(){const{fontSettings:t,fontFamily:e,fontWeight:n}=this.props,{fontAtlasManager:i,characterSet:r}=this.state,o={...t,characterSet:r,fontFamily:e,fontWeight:n};if(!i.mapping)return i.setProps(o),!0;for(const s in o)if(o[s]!==i.props[s])return i.setProps(o),!0;return!1}_updateText(){var t;const{data:e,characterSet:n}=this.props,i=null===(t=e.attributes)||void 0===t?void 0:t.getText;let r,{getText:o}=this.props,a=e.startIndices;const l="auto"===n&&new Set;if(i&&a){const{texts:t,characterCount:n}=function(t){let{value:e,length:n,stride:i,offset:r,startIndices:o,characterSet:s}=t;const a=e.BYTES_PER_ELEMENT,l=i?i/a:1,c=r?r/a:0,u=o[n]||Math.ceil((e.length-c)/l),h=s&&new Set,d=new Array(n);let f=e;if(l>1||c>0){f=new(0,e.constructor)(u);for(let t=0;t<u;t++)f[t]=e[t*l+c]}for(let A=0;A<n;A++){const t=o[A],e=o[A+1]||u,n=f.subarray(t,e);d[A]=String.fromCodePoint.apply(null,n),h&&n.forEach(h.add,h)}if(h)for(const A of h)s.add(String.fromCodePoint(A));return{texts:d,characterCount:u}}({...ArrayBuffer.isView(i)?{value:i}:i,length:e.length,startIndices:a,characterSet:l});r=n,o=(e,n)=>{let{index:i}=n;return t[i]}}else{const{iterable:t,objectInfo:n}=(0,s.jB)(e);a=[0],r=0;for(const e of t){n.index++;const t=Array.from(o(e,n)||"");l&&t.forEach(l.add,l),r+=t.length,a.push(r)}}this.setState({getText:o,startIndices:a,numInstances:r,characterSet:l||n})}transformParagraph(t,e){const{fontAtlasManager:n}=this.state,i=n.mapping,r=this.state.getText,{wordBreak:o,lineHeight:s,maxWidth:a}=this.props;return function(t,e,n,i,r){const o=Array.from(t),s=o.length,a=new Array(s),l=new Array(s),c=new Array(s),u=("break-word"===n||"break-all"===n)&&isFinite(i)&&i>0,h=[0,0],d=[0,0];let A=0,p=0,y=0;for(let _=0;_<=s;_++){const t=o[_];if("\n"!==t&&_!==s||(y=_),y>p){const t=u?g(o,n,i,r,p,y):f;for(let n=0;n<=t.length;n++){const i=0===n?p:t[n-1],s=n<t.length?t[n]:y;m(o,i,s,r,a,d);for(let t=i;t<s;t++){var v;const e=(null===(v=r[o[t]])||void 0===v?void 0:v.layoutOffsetY)||0;l[t]=A+d[1]/2+e,c[t]=d[0]}A+=d[1]*e,h[0]=Math.max(h[0],d[0])}p=y}"\n"===t&&(a[p]=0,l[p]=0,c[p]=0,p++)}return h[1]=A,{x:a,y:l,rowWidth:c,size:h}}(r(t,e)||"",s,o,a*n.props.fontSize,i)}renderLayers(){const{startIndices:t,numInstances:e,getText:n,fontAtlasManager:{scale:i,texture:r,mapping:o},styleVersion:s}=this.state,{data:l,_dataDiff:c,getPosition:u,getColor:h,getSize:d,getAngle:f,getPixelOffset:A,getBackgroundColor:p,getBorderColor:g,getBorderWidth:m,backgroundPadding:y,background:_,billboard:b,fontSettings:x,outlineWidth:w,outlineColor:B,sizeScale:E,sizeUnits:T,sizeMinPixels:S,sizeMaxPixels:M,transitions:I,updateTriggers:P}=this.props,D=this.getSubLayerClass("characters",a.Z),F=this.getSubLayerClass("background",C.Z);return[_&&new F({getFillColor:p,getLineColor:g,getLineWidth:m,padding:y,getPosition:u,getSize:d,getAngle:f,getPixelOffset:A,billboard:b,sizeScale:E,sizeUnits:T,sizeMinPixels:S,sizeMaxPixels:M,transitions:I&&{getPosition:I.getPosition,getAngle:I.getAngle,getSize:I.getSize,getFillColor:I.getBackgroundColor,getLineColor:I.getBorderColor,getLineWidth:I.getBorderWidth,getPixelOffset:I.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:P.getPosition,getAngle:P.getAngle,getSize:P.getSize,getFillColor:P.getBackgroundColor,getLineColor:P.getBorderColor,getLineWidth:P.getBorderWidth,getPixelOffset:P.getPixelOffset,getBoundingRect:{getText:P.getText,getTextAnchor:P.getTextAnchor,getAlignmentBaseline:P.getAlignmentBaseline,styleVersion:s}}}),{data:l.attributes&&l.attributes.background?{length:l.length,attributes:l.attributes.background}:l,_dataDiff:c,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new D({sdf:x.sdf,smoothing:Number.isFinite(x.smoothing)?x.smoothing:v.smoothing,outlineWidth:w/(x.radius||v.radius),outlineColor:B,iconAtlas:r,iconMapping:o,getPosition:u,getColor:h,getSize:d,getAngle:f,getPixelOffset:A,billboard:b,sizeScale:E*i,sizeUnits:T,sizeMinPixels:S*i,sizeMaxPixels:M*i,transitions:I&&{getPosition:I.getPosition,getAngle:I.getAngle,getColor:I.getColor,getSize:I.getSize,getPixelOffset:I.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{all:P.getText,getPosition:P.getPosition,getAngle:P.getAngle,getColor:P.getColor,getSize:P.getSize,getPixelOffset:P.getPixelOffset,getIconOffsets:{getTextAnchor:P.getTextAnchor,getAlignmentBaseline:P.getAlignmentBaseline,styleVersion:s}}}),{data:l,_dataDiff:c,startIndices:t,numInstances:e,getIconOffsets:this.getIconOffsets,getIcon:n})]}static set fontAtlasCacheLimit(t){!function(t){o.Z.assert(Number.isFinite(t)&&t>=3,"Invalid cache limit"),_=new y(t)}(t)}}(0,i.Z)(M,"defaultProps",S),(0,i.Z)(M,"layerName","TextLayer")},66535:(t,e,n)=>{"use strict";function i(t){let{data:e,getIndex:n,dataRange:i,replace:r}=t;const{startRow:o=0,endRow:s=1/0}=i,a=e.length;let l=a,c=a;for(let d=0;d<a;d++){const t=n(e[d]);if(l>d&&t>=o&&(l=d),t>=s){c=d;break}}let u=l;const h=c-l!==r.length?e.slice(c):void 0;for(let d=0;d<r.length;d++)e[u++]=r[d];if(h){for(let t=0;t<h.length;t++)e[u++]=h[t];e.length=u}return{startRow:l,endRow:l+r.length}}n.d(e,{b:()=>i})},47203:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ScenegraphLayer:()=>r.Z,SimpleMeshLayer:()=>i.Z});var i=n(36800),r=n(1231)},1231:(t,e,n)=>{"use strict";n.d(e,{Z:()=>Un});var i={};n.r(i),n.d(i,{readFileAsArrayBuffer:()=>K,readFileAsText:()=>q,requireFromFile:()=>X,requireFromString:()=>Y});var r={};n.r(r),n.d(r,{decode:()=>oe,name:()=>re});var o={};n.r(o),n.d(o,{name:()=>ce,preprocess:()=>ue});var s={};n.r(s),n.d(s,{name:()=>de,preprocess:()=>fe});var a={};n.r(a),n.d(a,{decode:()=>ve,encode:()=>_e,name:()=>me,preprocess:()=>ye});var l={};n.r(l),n.d(l,{decode:()=>De,name:()=>Se});var c={};n.r(c),n.d(c,{decode:()=>Ue,encode:()=>ze,name:()=>ke});var u={};n.r(u),n.d(u,{decode:()=>Ze,encode:()=>je,name:()=>Ne});var h={};n.r(h),n.d(h,{decode:()=>Je,encode:()=>We,name:()=>He});var d={};n.r(d),n.d(d,{decode:()=>Xe,name:()=>qe});var f=n(64649),A=n(90031),p=n(2123),g=n(2578),m=n(21970),y=n(28007),v=n(78032),_=n(431),b=n(12987),x=n(79666),w=n(81301);class C{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e}=t;this.id=e||(0,x.hQ)(this.constructor.name),this.display=!0,this.position=new _.Z,this.rotation=new _.Z,this.scale=new _.Z(1,1,1),this.matrix=new b.Z,this.userData={},this.props={},this._setScenegraphNodeProps(t)}delete(){}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")}getBounds(){return null}setPosition(t){return(0,w.h)(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return(0,w.h)(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return(0,w.h)(3===t.length,"setScale requires vector argument"),this.scale=t,this}setMatrix(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(t):this.matrix=t}setMatrixComponents(t){let{position:e,rotation:n,scale:i,update:r=!0}=t;return e&&this.setPosition(e),n&&this.setRotation(n),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const t=this.position,e=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(e),this.matrix.scale(n),this}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{position:e,rotation:n,scale:i}=t;return e&&this.setPosition(e),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}getCoordinateUniforms(t,e){(0,w.h)(t),e=e||this.matrix;const n=new b.Z(t).multiplyRight(e),i=n.invert(),r=i.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}_setScenegraphNodeProps(t){"display"in t&&(this.display=t.display),"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}}var B=n(33839),E=n(77462);class T extends C{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;y.cM.assert(e.every((t=>t instanceof C)),"every child must an instance of ScenegraphNode"),super(t),this.children=e}add(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)Array.isArray(i)?this.add(...i):this.children.push(i);return this}remove(t){const e=this.children,n=e.indexOf(t);return n>-1&&e.splice(n,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach((t=>t.delete())),this.removeAll(),super.delete()}getBounds(){const t=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse(((e,n)=>{let{worldMatrix:i}=n;const r=e.getBounds();if(!r)return;const[o,s]=r,a=new _.Z(o).add(s).divide([2,2,2]);i.transformAsPoint(a,a);const l=new _.Z(s).subtract(o).divide([2,2,2]);i.transformAsVector(l,l);for(let c=0;c<8;c++){const e=new _.Z(1&c?-1:1,2&c?-1:1,4&c?-1:1).multiply(l).add(a);for(let n=0;n<3;n++)t[0][n]=Math.min(t[0][n],e[n]),t[1][n]=Math.max(t[1][n],e[n])}})),Number.isFinite(t[0][0])?t:null}traverse(t){let{worldMatrix:e=new b.Z}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new b.Z(e).multiplyRight(this.matrix);for(const i of this.children)i instanceof T?i.traverse(t,{worldMatrix:n}):t(i,{worldMatrix:n})}}var S=n(34980);const M={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},I={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function P(t){if(!t._animation){const e=I[t.componentType],n=M[t.type],i=n*t.count,{buffer:r,byteOffset:o}=t.bufferView.data,s=new e(r,o+(t.byteOffset||0),i);if(1===n)t._animation=Array.from(s);else{const e=[];for(let t=0;t<s.length;t+=n)e.push(Array.from(s.slice(t,t+n)));t._animation=e}}return t._animation}const D=new b.Z;const F=new S.Z;function L(t,e,n,i){let{input:r,interpolation:o,output:s}=e;const a=t%r[r.length-1],l=r.findIndex((t=>t>=a)),c=Math.max(0,l-1);if(!Array.isArray(n[i]))switch(i){case"translation":n[i]=[0,0,0];break;case"rotation":n[i]=[0,0,0,1];break;case"scale":n[i]=[1,1,1];break;default:y.cM.warn("Bad animation path ".concat(i))()}(0,w.h)(n[i].length===s[c].length);const u=r[c],h=r[l];switch(o){case"STEP":!function(t,e,n){for(let i=0;i<n.length;i++)t[e][i]=n[i]}(n,i,s[c]);break;case"LINEAR":if(h>u){const t=(a-u)/(h-u);!function(t,e,n,i,r){if("rotation"===e){F.slerp({start:n,target:i,ratio:r});for(let n=0;n<F.length;n++)t[e][n]=F[n]}else for(let o=0;o<n.length;o++)t[e][o]=r*i[o]+(1-r)*n[o]}(n,i,s[c],s[l],t)}break;case"CUBICSPLINE":if(h>u){const t=(a-u)/(h-u),e=h-u;!function(t,e,n){let{p0:i,outTangent0:r,inTangent1:o,p1:s,tDiff:a,ratio:l}=n;for(let c=0;c<t[e].length;c++){const n=r[c]*a,u=o[c]*a;t[e][c]=(2*Math.pow(l,3)-3*Math.pow(l,2)+1)*i[c]+(Math.pow(l,3)-2*Math.pow(l,2)+l)*n+(-2*Math.pow(l,3)+3*Math.pow(l,2))*s[c]+(Math.pow(l,3)-Math.pow(l,2))*u}}(n,i,{p0:s[3*c+1],outTangent0:s[3*c+2],inTangent1:s[3*l+0],p1:s[3*l+1],tDiff:e,ratio:t})}break;default:y.cM.warn("Interpolation ".concat(o," not supported"))()}}class O{constructor(t){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,t)}animate(t){if(!this.playing)return;const e=(t/1e3-this.startTime)*this.speed;this.channels.forEach((t=>{let{sampler:n,target:i,path:r}=t;L(e,n,i,r),function(t,e){if(e.matrix.identity(),t.translation&&e.matrix.translate(t.translation),t.rotation){const n=D.fromQuaternion(t.rotation);e.matrix.multiplyRight(n)}t.scale&&e.matrix.scale(t.scale)}(i,i._node)}))}}class R{constructor(t){this.animations=t.animations.map(((e,n)=>{const i=e.name||"Animation-".concat(n),r=e.samplers.map((e=>{let{input:n,interpolation:i="LINEAR",output:r}=e;return{input:P(t.accessors[n]),interpolation:i,output:P(t.accessors[r])}})),o=e.channels.map((e=>{let{sampler:n,target:i}=e;return{sampler:r[n],target:t.nodes[i.node],path:i.path}}));return new O({name:i,channels:o})}))}animate(t){this.setTime(t)}setTime(t){this.animations.forEach((e=>e.animate(t)))}getAnimations(){return this.animations}}var k=n(94557);class U extends C{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e),this.onBeforeRender=null,this.AfterRender=null,t instanceof k.Z?(this.model=t,this._setModelNodeProps(e)):this.model=new k.Z(t,e),this.bounds=null,this.managedResources=e.managedResources||[]}setProps(t){return super.setProps(t),this._setModelNodeProps(t),this}getBounds(){return this.bounds}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach((t=>t.delete())),this.managedResources=[]}draw(){return this.model.draw(...arguments)}setUniforms(){return this.model.setUniforms(...arguments),this}setAttributes(){return this.model.setAttributes(...arguments),this}updateModuleSettings(){return this.model.updateModuleSettings(...arguments),this}_setModelNodeProps(t){this.model.setProps(t)}}var z=n(92086);function G(t,e){return(0,y.D0)(t)?"#version 300 es\n".concat(e):e}const N={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Z={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class j{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.options=Object.assign({},Z,e)}instantiate(t){this.gltf=t;return(t.scenes||[]).map((t=>this.createScene(t)))}createAnimator(){return Array.isArray(this.gltf.animations)?new R(this.gltf):null}createScene(t){const e=(t.nodes||[]).map((t=>this.createNode(t)));return new T({id:t.name||t.id,children:e})}createNode(t){if(!t._node){const e=(t.children||[]).map((t=>this.createNode(t)));t.mesh&&e.push(this.createMesh(t.mesh));const n=new T({id:t.name||t.id,children:e});if(t.matrix)n.setMatrix(t.matrix);else{if(n.matrix.identity(),t.translation&&n.matrix.translate(t.translation),t.rotation){const e=(new b.Z).fromQuaternion(t.rotation);n.matrix.multiplyRight(e)}t.scale&&n.matrix.scale(t.scale)}t._node=n}return t._node}createMesh(t){if(!t._mesh){const e=(t.primitives||[]).map(((e,n)=>this.createPrimitive(e,n,t))),n=new T({id:t.name||t.id,children:e});t._mesh=n}return t._mesh}getVertexCount(t){y.cM.warn("getVertexCount() not found")()}createPrimitive(t,e,n){const i=function(t,e){const{id:n,drawMode:i,vertexCount:r,attributes:o,modelOptions:s}=e,a=new z.Z(t,e);y.cM.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(o).map((t=>t.buffer)));const c=new U(t,{id:n,drawMode:i,vertexCount:r,modules:[v.b],parameters:a.parameters,vs:G(t,"\n#if (__VERSION__ < 300)\n  #define _attr attribute\n#else\n  #define _attr in\n#endif\n\n  _attr vec4 POSITION;\n\n  #ifdef HAS_NORMALS\n    _attr vec4 NORMAL;\n  #endif\n\n  #ifdef HAS_TANGENTS\n    _attr vec4 TANGENT;\n  #endif\n\n  #ifdef HAS_UV\n    _attr vec2 TEXCOORD_0;\n  #endif\n\n  void main(void) {\n    vec4 _NORMAL = vec4(0.);\n    vec4 _TANGENT = vec4(0.);\n    vec2 _TEXCOORD_0 = vec2(0.);\n\n    #ifdef HAS_NORMALS\n      _NORMAL = NORMAL;\n    #endif\n\n    #ifdef HAS_TANGENTS\n      _TANGENT = TANGENT;\n    #endif\n\n    #ifdef HAS_UV\n      _TEXCOORD_0 = TEXCOORD_0;\n    #endif\n\n    pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n    gl_Position = u_MVPMatrix * POSITION;\n  }\n"),fs:G(t,"\n#if (__VERSION__ < 300)\n  #define fragmentColor gl_FragColor\n#else\n  out vec4 fragmentColor;\n#endif\n\n  void main(void) {\n    fragmentColor = pbr_filterColor(vec4(0));\n  }\n"),managedResources:l,...s,defines:{...a.defines,...s.defines}});return c.setProps({attributes:o}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:t.name||"".concat(n.name||n.id,"-primitive-").concat(e),drawMode:t.mode||4,vertexCount:t.indices?t.indices.count:this.getVertexCount(t.attributes),attributes:this.createAttributes(t.attributes,t.indices),material:t.material},this.options));return i.bounds=[t.attributes.POSITION.min,t.attributes.POSITION.max],i}createAttributes(t,e){const n={};return Object.keys(t).forEach((e=>{n[e]=this.createAccessor(t[e],this.createBuffer(t[e],this.gl.ARRAY_BUFFER))})),e&&(n.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),y.cM.info(4,"glTF Attributes",{attributes:t,indices:e,generated:n})(),n}createBuffer(t,e){t.bufferView||(t.bufferView={});const{bufferView:n}=t;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[e]||(n.lumaBuffers[e]=new B.Z(this.gl,{id:"from-".concat(n.id),data:n.data||t.value,target:e})),n.lumaBuffers[e]}createAccessor(t,e){return new E.Z({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:N[t.type]})}createSampler(t){return t}needsPOT(){return!1}}const V={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof n.g&&n.g,document:"undefined"!==typeof document&&document},H=V.global||V.self||V.window||{},J="object"!==typeof process||"[object process]"!==String(process)||process.browser,W="function"===typeof importScripts,Q=("undefined"!==typeof window&&window.orientation,"undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version)),K=(Q&&parseFloat(Q[1]),null),q=null,X=null,Y=null;const $="3.4.15",tt={};async function et(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e&&(t=function(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};if(i[t])return i[t];if(!J)return"modules/".concat(e,"/dist/libs/").concat(t);if(n.CDN)return function(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(e,"@").concat($,"/dist/libs/").concat(t);if(W)return"../src/libs/".concat(t);return"modules/".concat(e,"/src/libs/").concat(t)}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})),tt[t]=tt[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!J)try{return i&&X&&await X(t)}catch{return null}if(W)return importScripts(t);const e=await fetch(t);return function(t,e){if(!J)return Y&&Y(t,e);if(W)return eval.call(H,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(i){n.text=t}return document.body.appendChild(n),null}(await e.text(),t)}(t),await tt[t]}const nt="3.4.15",it="https://unpkg.com/@loaders.gl/textures@".concat(nt,"/dist/libs/basis_encoder.wasm"),rt="https://unpkg.com/@loaders.gl/textures@".concat(nt,"/dist/libs/basis_encoder.js");let ot,st;async function at(t){const e=t.modules||{};return e.basis?e.basis:(ot=ot||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await et("basis_transcoder.js","textures",t),await et("basis_transcoder.wasm","textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise((e=>{t(n).then((t=>{const{BasisFile:n,initializeBasis:i}=t;i(),e({BasisFile:n})}))}))}(e,n)}(t),await ot)}async function lt(t){const e=t.modules||{};return e.basisEncoder?e.basisEncoder:(st=st||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await et(rt,"textures",t),await et(it,"textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise((e=>{t(n).then((t=>{const{BasisFile:n,KTX2File:i,initializeBasis:r,BasisEncoder:o}=t;r(),e({BasisFile:n,KTX2File:i,BasisEncoder:o})}))}))}(e,n)}(t),await st)}const ct=33776,ut=33779,ht=35840,dt=35842,ft=36196,At=37808,pt=["","WEBKIT_","MOZ_"],gt={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let mt=null;function yt(t){if(!mt){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,mt=new Set;for(const e of pt)for(const n in gt)if(t&&t.getExtension("".concat(e).concat(n))){const t=gt[n];mt.add(t)}}return mt}n(88687);const vt=[171,75,84,88,32,50,48,187,13,10,26,10];const _t={etc1:{basisFormat:0,compressed:!0,format:ft},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ct},bc3:{basisFormat:3,compressed:!0,format:ut},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:ht},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:dt},"astc-4x4":{basisFormat:10,compressed:!0,format:At},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function bt(t,e,n){const i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");const t=i.getNumImages(),e=[];for(let r=0;r<t;r++){const t=i.getNumLevels(r),o=[];for(let e=0;e<t;e++)o.push(xt(i,r,e,n));e.push(o)}return e}finally{i.close(),i.delete()}}function xt(t,e,n,i){const r=t.getImageWidth(e,n),o=t.getImageHeight(e,n),s=t.getHasAlpha(),{compressed:a,format:l,basisFormat:c}=Bt(i,s),u=t.getImageTranscodedSizeInBytes(e,n,c),h=new Uint8Array(u);if(!t.transcodeImage(h,e,n,c,0,0))throw new Error("failed to start Basis transcoding");return{width:r,height:o,data:h,compressed:a,format:l,hasAlpha:s}}function wt(t,e,n){const i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");const t=i.getLevels(),e=[];for(let r=0;r<t;r++){e.push(Ct(i,r,n));break}return[e]}finally{i.close(),i.delete()}}function Ct(t,e,n){const{alphaFlag:i,height:r,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:l}=Bt(n,i),c=t.getImageTranscodedSizeInBytes(e,0,0,l),u=new Uint8Array(c);if(!t.transcodeImage(u,e,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:r,data:u,compressed:s,levelSize:c,hasAlpha:i,format:a}}function Bt(t,e){let n=t&&t.basis&&t.basis.format;return"auto"===n&&(n=Et()),"object"===typeof n&&(n=e?n.alpha:n.noAlpha),n=n.toLowerCase(),_t[n]}function Et(){const t=yt();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}const Tt={name:"Basis",id:J?"basis":"basis-nodejs",module:"textures",version:"3.4.15",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},St={...Tt,parse:async function(t,e){if("auto"===e.basis.containerFormat){if(function(t){const e=new Uint8Array(t);return!(e.byteLength<vt.length||e[0]!==vt[0]||e[1]!==vt[1]||e[2]!==vt[2]||e[3]!==vt[3]||e[4]!==vt[4]||e[5]!==vt[5]||e[6]!==vt[6]||e[7]!==vt[7]||e[8]!==vt[8]||e[9]!==vt[9]||e[10]!==vt[10]||e[11]!==vt[11])}(t)){return wt((await lt(e)).KTX2File,t,e)}const{BasisFile:n}=await at(e);return bt(n,t,e)}if("encoder"===e.basis.module){const n=await lt(e);return"ktx2"===e.basis.containerFormat?wt(n.KTX2File,t,e):bt(n.BasisFile,t,e)}{const{BasisFile:n}=await at(e);return bt(n,t,e)}}};var Mt=n(29518),It=n(27036),Pt=n(52194);function Dt(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function Ft(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const n=e.baseUri||e.uri;if(!n)throw new Error("'baseUri' must be provided to resolve relative url ".concat(t));return n.substr(0,n.lastIndexOf("/")+1)+t}function Lt(t,e,n){const i=t.bufferViews[n];Dt(i);const r=e[i.buffer];Dt(r);const o=(i.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,o,i.byteLength)}var Ot=n(90042),Rt=n(83497);const kt=["SCALAR","VEC2","VEC3","VEC4"],Ut=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],zt=new Map(Ut),Gt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Zt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function jt(t){return kt[t-1]||kt[0]}function Vt(t){const e=zt.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Ht(t,e){const n=Zt[t.componentType],i=Gt[t.type],r=Nt[t.componentType],o=t.count*i,s=t.count*i*r;return Dt(s>=0&&s<=e.byteLength),{ArrayType:n,length:o,byteLength:s}}const Jt={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class Wt{constructor(t){(0,f.Z)(this,"gltf",void 0),(0,f.Z)(this,"sourceBuffers",void 0),(0,f.Z)(this,"byteLength",void 0),this.gltf=t||{json:{...Jt},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){const e=this.getUsedExtensions().find((e=>e===t)),n=this.json.extensions||{};return e?n[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find((e=>e===t))?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"===typeof e)return e;const n=this.json[t]&&this.json[t][e];if(!n)throw new Error("glTF file error: Could not find ".concat(t,"[").concat(e,"]"));return n}getTypedArrayForBufferView(t){const e=(t=this.getBufferView(t)).buffer,n=this.gltf.buffers[e];Dt(n);const i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,{ArrayType:i,length:r}=Ht(t,e);return new i(n,e.byteOffset+t.byteOffset,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,i=e.byteOffset||0;return new Uint8Array(n,i,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,n){return t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}setObjectExtension(t,e,n){(t.extensions||{})[e]=n}removeObjectExtension(t,e){const n=t.extensions||{},i=n[e];return delete n[e],i}addExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Dt(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Dt(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((e=>e===t))||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((e=>e===t))||this.json.extensionsRequired.push(t)}removeExtension(t){if(!this.getExtension(t))return;this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);const e=this.json.extensionsRemoved;e.includes(t)||e.push(t)}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:n}=t;this.json.nodes=this.json.nodes||[];const i={mesh:e};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:n,material:i,mode:r=4}=t,o={primitives:[{attributes:this._addAttributes(e),mode:r}]};if(n){const t=this._addIndices(n);o.primitives[0].indices=t}return Number.isFinite(i)&&(o.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const n=(0,Ot.I)(t),i=e||(null===n||void 0===n?void 0:n.mimeType),r={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}addBufferView(t){const e=t.byteLength;Dt(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=(0,Rt.Pk)(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(t,e){const n={bufferView:t,type:jt(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3};const n=this.addBufferView(t);let i={min:e.min,max:e.max};i.min&&i.max||(i=this._getAccessorMinMax(t,e.size));const r={size:e.size,componentType:Vt(t),count:Math.round(t.length/e.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(r,e))}addTexture(t){const{imageIndex:e}=t,n={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const n=this.byteLength,i=new ArrayBuffer(n),r=new Uint8Array(i);let o=0;for(const s of this.sourceBuffers||[])o=(0,Rt.T_)(s,r,o);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}_removeStringFromArray(t,e){let n=!0;for(;n;){const i=t.indexOf(e);i>-1?t.splice(i,1):n=!1}}_addAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={};for(const n in t){const i=t[n],r=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);e[r]=o}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const n={min:null,max:null};if(t.length<e)return n;n.min=[],n.max=[];const i=t.subarray(0,e);for(const r of i)n.min.push(r),n.max.push(r);for(let r=e;r<t.length;r+=e)for(let i=0;i<e;i++)n.min[0+i]=Math.min(n.min[0+i],t[r+i]),n.max[0+i]=Math.max(n.max[0+i],t[r+i]);return n}}const Qt="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",Kt="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",qt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Xt=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Yt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},$t={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};let te;async function ee(){return te||(te=async function(){let t=Qt;WebAssembly.validate(qt)&&(t=Kt,console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(function(t){const e=new Uint8Array(t.length);for(let i=0;i<t.length;++i){const n=t.charCodeAt(i);e[i]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let n=0;for(let i=0;i<t.length;++i)e[n++]=e[i]<60?Xt[e[i]]:64*(e[i]-60)+e[++i];return e.buffer.slice(0,n)}(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}()),te}function ne(t,e,n,i,r,o,s){const a=t.exports.sbrk,l=i+3&-4,c=a(l*r),u=a(o.length),h=new Uint8Array(t.exports.memory.buffer);h.set(o,u);const d=e(c,i,r,u,o.length);if(0===d&&s&&s(c,l,r),n.set(h.subarray(c,c+i*r)),a(c-a(0)),0!==d)throw new Error("Malformed buffer data: ".concat(d))}const ie="EXT_meshopt_compression",re=ie;async function oe(t,e){var n;const i=new Wt(t);if(null===e||void 0===e||null===(n=e.gltf)||void 0===n||!n.decompressMeshes)return;const r=[];for(const o of t.json.bufferViews||[])r.push(se(i,o));await Promise.all(r),i.removeExtension(ie)}async function se(t,e){const n=t.getObjectExtension(e,ie);if(n){const{byteOffset:i=0,byteLength:r=0,byteStride:o,count:s,mode:a,filter:l="NONE",buffer:c}=n,u=t.gltf.buffers[c],h=new Uint8Array(u.arrayBuffer,u.byteOffset+i,r),d=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);return await async function(t,e,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NONE";const s=await ee();ne(s,s.exports[$t[r]],t,e,n,i,s.exports[Yt[o||"NONE"]])}(d,s,o,h,a,l),d}return null}var ae=n(12746);const le="EXT_texture_webp",ce=le;function ue(t,e){const n=new Wt(t);if(!(0,ae.V)("image/webp")){if(n.getRequiredExtensions().includes(le))throw new Error("gltf: Required extension ".concat(le," not supported by browser"));return}const{json:i}=n;for(const r of i.textures||[]){const t=n.getObjectExtension(r,le);t&&(r.source=t.source),n.removeObjectExtension(r,le)}n.removeExtension(le)}const he="KHR_texture_basisu",de=he;function fe(t,e){const n=new Wt(t),{json:i}=n;for(const r of i.textures||[]){const t=n.getObjectExtension(r,he);t&&(r.source=t.source),n.removeObjectExtension(r,he)}n.removeExtension(he)}var Ae=n(34957);function pe(t){const{buffer:e,size:n,count:i}=function(t){let e=t,n=1,i=0;t&&t.value&&(e=t.value,n=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return null;if(Array.isArray(t))return new e(t);if(n&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),i=e.length/n);return{buffer:e,size:n,count:i}}(t);return{value:e,size:n,byteOffset:0,count:i,type:jt(n),componentType:Vt(e)}}const ge="KHR_draco_mesh_compression",me=ge;function ye(t,e,n){const i=new Wt(t);for(const r of we(i))i.getObjectExtension(r,ge)}async function ve(t,e,n){var i;if(null===e||void 0===e||null===(i=e.gltf)||void 0===i||!i.decompressMeshes)return;const r=new Wt(t),o=[];for(const s of we(r))r.getObjectExtension(s,ge)&&o.push(be(r,s,e,n));await Promise.all(o),r.removeExtension(ge)}function _e(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new Wt(t);for(const i of n.json.meshes||[])xe(i,e),n.addRequiredExtension(ge)}async function be(t,e,n,i){const r=t.getObjectExtension(e,ge);if(!r)return;const o=t.getTypedArrayForBufferView(r.bufferView),s=(0,Pt.qv)(o.buffer,o.byteOffset),{parse:a}=i,l={...n};delete l["3d-tiles"];const c=await a(s,Ae.VJ,l,i),u=function(t){const e={};for(const n in t){const i=t[n];if("indices"!==n){const t=pe(i);e[n]=t}}return e}(c.attributes);for(const[h,d]of Object.entries(u))if(h in e.attributes){const n=e.attributes[h],i=t.getAccessor(n);null!==i&&void 0!==i&&i.min&&null!==i&&void 0!==i&&i.max&&(d.min=i.min,d.max=i.max)}e.attributes=u,c.indices&&(e.indices=pe(c.indices)),function(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(e)}function xe(t,e){var n;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!r.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const s=r.DracoWriter.encodeSync({attributes:t}),a=null===o||void 0===o||null===(n=o.parseSync)||void 0===n?void 0:n.call(o,{attributes:t}),l=r._addFauxAttributes(a.attributes),c=r.addBufferView(s);return{primitives:[{attributes:l,mode:i,extensions:{[ge]:{bufferView:c,attributes:l}}}]}}function*we(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}var Ce=n(73518);const Be={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ee={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};const Te="KHR_texture_transform",Se=Te,Me=new _.Z,Ie=new Ce.Z,Pe=new Ce.Z;async function De(t,e){if(!new Wt(t).getExtension(Te))return;const n=t.json.materials||[];for(let i=0;i<n.length;i++)Fe(i,t)}function Fe(t,e){var n,i,r;const o=[],s=null===(n=e.json.materials)||void 0===n?void 0:n[t],a=null===s||void 0===s||null===(i=s.pbrMetallicRoughness)||void 0===i?void 0:i.baseColorTexture;a&&Le(e,t,a,o);const l=null===s||void 0===s?void 0:s.emissiveTexture;l&&Le(e,t,l,o);const c=null===s||void 0===s?void 0:s.normalTexture;c&&Le(e,t,c,o);const u=null===s||void 0===s?void 0:s.occlusionTexture;u&&Le(e,t,u,o);const h=null===s||void 0===s||null===(r=s.pbrMetallicRoughness)||void 0===r?void 0:r.metallicRoughnessTexture;h&&Le(e,t,h,o)}function Le(t,e,n,i){const r=function(t,e){var n;const i=null===(n=t.extensions)||void 0===n?void 0:n[Te],{texCoord:r=0}=t,{texCoord:o=r}=i,s=-1!==e.findIndex((t=>{let[e,n]=t;return e===r&&n===o}));if(!s){const n=function(t){const{offset:e=[0,0],rotation:n=0,scale:i=[1,1]}=t,r=(new Ce.Z).set(1,0,0,0,1,0,e[0],e[1],1),o=Ie.set(Math.cos(n),Math.sin(n),0,-Math.sin(n),Math.cos(n),0,0,0,1),s=Pe.set(i[0],0,0,0,i[1],0,0,0,1);return r.multiplyRight(o).multiplyRight(s)}(i);return r!==o&&(t.texCoord=o),e.push([r,o]),{originalTexCoord:r,texCoord:o,matrix:n}}return null}(n,i);if(!r)return;const o=t.json.meshes||[];for(const s of o)for(const n of s.primitives){const i=n.material;Number.isFinite(i)&&e===i&&Oe(t,n,r)}}function Oe(t,e,n){const{originalTexCoord:i,texCoord:r,matrix:o}=n,s=e.attributes["TEXCOORD_".concat(i)];if(Number.isFinite(s)){var a;const n=null===(a=t.json.accessors)||void 0===a?void 0:a[s];if(n&&n.bufferView){var l;const s=null===(l=t.json.bufferViews)||void 0===l?void 0:l[n.bufferView];if(s){const{arrayBuffer:a,byteOffset:l}=t.buffers[s.buffer],c=(l||0)+(n.byteOffset||0)+(s.byteOffset||0),{ArrayType:u,length:h}=Ht(n,s),d=Ee[n.componentType],f=Be[n.type],A=s.byteStride||d*f,p=new Float32Array(h);for(let t=0;t<n.count;t++){const e=new u(a,c+t*A,2);Me.set(e[0],e[1],1),Me.transformByMatrix3(o),p.set([Me[0],Me[1]],t*f)}i===r?function(t,e,n,i){t.componentType=5126,n.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength}),e.buffer=n.length-1,e.byteLength=i.buffer.byteLength,e.byteOffset=0,delete e.byteStride}(n,s,t.buffers,p):function(t,e,n,i,r){i.buffers.push({arrayBuffer:r.buffer,byteOffset:0,byteLength:r.buffer.byteLength});const o=i.json.bufferViews;if(!o)return;o.push({buffer:i.buffers.length-1,byteLength:r.buffer.byteLength,byteOffset:0});const s=i.json.accessors;if(!s)return;s.push({bufferView:(null===o||void 0===o?void 0:o.length)-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),n.attributes["TEXCOORD_".concat(t)]=s.length-1}(r,n,e,t,p)}}}}const Re="KHR_lights_punctual",ke=Re;async function Ue(t){const e=new Wt(t),{json:n}=e,i=e.getExtension(Re);i&&(e.json.lights=i.lights,e.removeExtension(Re));for(const r of n.nodes||[]){const t=e.getObjectExtension(r,Re);t&&(r.light=t.light),e.removeObjectExtension(r,Re)}}async function ze(t){const e=new Wt(t),{json:n}=e;if(n.lights){const t=e.addExtension(Re);Dt(!t.lights),t.lights=n.lights,delete n.lights}if(e.json.lights){for(const t of e.json.lights){const n=t.node;e.addObjectExtension(n,Re,t)}delete e.json.lights}}const Ge="KHR_materials_unlit",Ne=Ge;async function Ze(t){const e=new Wt(t),{json:n}=e;for(const i of n.materials||[]){i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,Ge)}e.removeExtension(Ge)}function je(t){const e=new Wt(t),{json:n}=e;if(e.materials)for(const i of n.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,Ge,{}),e.addExtension(Ge))}const Ve="KHR_techniques_webgl",He=Ve;async function Je(t){const e=new Wt(t),{json:n}=e,i=e.getExtension(Ve);if(i){const t=function(t,e){const{programs:n=[],shaders:i=[],techniques:r=[]}=t,o=new TextDecoder;return i.forEach((t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=o.decode(e.getTypedArrayForBufferView(t.bufferView))})),n.forEach((t=>{t.fragmentShader=i[t.fragmentShader],t.vertexShader=i[t.vertexShader]})),r.forEach((t=>{t.program=n[t.program]})),r}(i,e);for(const i of n.materials||[]){const n=e.getObjectExtension(i,Ve);n&&(i.technique=Object.assign({},n,t[n.technique]),i.technique.values=Qe(i.technique,e)),e.removeObjectExtension(i,Ve)}e.removeExtension(Ve)}}async function We(t,e){}function Qe(t,e){const n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((e=>{t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)})),Object.keys(n).forEach((t=>{"object"===typeof n[t]&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))})),n}const Ke="EXT_feature_metadata",qe=Ke;async function Xe(t){!function(t){var e;const n=t.getExtension(Ke),i=null===n||void 0===n||null===(e=n.schema)||void 0===e?void 0:e.classes,r=null===n||void 0===n?void 0:n.featureTables;(null===n||void 0===n?void 0:n.featureTextures)&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.');if(i&&r)for(const o in i){const e=i[o],n=tn(r,o);n&&Ye(t,n,e)}}(new Wt(t))}function Ye(t,e,n){for(const r in n.properties){var i;const o=n.properties[r],s=null===e||void 0===e||null===(i=e.properties)||void 0===i?void 0:i[r],a=e.count;if(s){const e=$e(t,o,a,s);s.data=e}}}function $e(t,e,n,i){const r=i.bufferView;let o=t.getTypedArrayForBufferView(r);switch(e.type){case"STRING":{const e=i.stringOffsetBufferView;o=function(t,e,n){const i=[],r=new TextDecoder("utf8");let o=0;const s=4;for(let a=0;a<n;a++){const n=e[(a+1)*s]-e[a*s],l=t.subarray(o,n+o),c=r.decode(l);i.push(c),o+=n}return i}(o,t.getTypedArrayForBufferView(e),n);break}}return o}function tn(t,e){for(const n in t){const i=t[n];if(i.class===e)return i}return null}const en=[r,o,s,a,c,u,h,l,d];function nn(t,e){var n;const i=(null===e||void 0===e||null===(n=e.gltf)||void 0===n?void 0:n.excludeExtensions)||{};return!(t in i&&!i[t])}const rn="KHR_binary_glTF";const on={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},sn={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class an{constructor(){(0,f.Z)(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),(0,f.Z)(this,"json",void 0)}normalize(t,e){this.json=t.json;const n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(n.asset.version))}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(t){const e=new Wt(t),{json:n}=e;for(const i of n.images||[]){const t=e.getObjectExtension(i,rn);t&&Object.assign(i,t),e.removeObjectExtension(i,rn)}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,e.removeExtension(rn)}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in on)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const n=t[e];if(n&&!Array.isArray(n)){t[e]=[];for(const i in n){const r=n[i];r.id=r.id||i;const o=t[e].length;t[e].push(r),this.idToIndexMap[e][i]=o}}}_convertObjectIdsToArrayIndices(t){for(const e in on)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:n,material:i}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");n&&(e.indices=this._convertIdToIndex(n,"accessor")),i&&(e.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map((t=>this._convertIdToIndex(t,"node")))),t.meshes&&(t.meshes=t.meshes.map((t=>this._convertIdToIndex(t,"mesh"))))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map((t=>this._convertIdToIndex(t,"node"))))}_convertIdsToIndices(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute ".concat(e)),t[e]=[]);for(const n of t[e])for(const t in n){const e=n[t],i=this._convertIdToIndex(e,t);n[t]=i}}_convertIdToIndex(t,e){const n=sn[e];if(n in this.idToIndexMap){const i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error("gltf v1: failed to resolve ".concat(e," with id ").concat(t));return i}return t}_updateObjects(t){for(const e of this.json.buffers)delete e.type}_updateMaterial(t){for(const r of t.materials){var e,n,i;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const o=(null===(e=r.values)||void 0===e?void 0:e.tex)||(null===(n=r.values)||void 0===n?void 0:n.texture2d_0)||(null===(i=r.values)||void 0===i?void 0:i.diffuseTex),s=t.textures.findIndex((t=>t.id===o));-1!==s&&(r.pbrMetallicRoughness.baseColorTexture={index:s})}}}const ln={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},cn={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},un=10240,hn=10241,dn=10242,fn=10243,An=10497,pn={magFilter:un,minFilter:hn,wrapS:dn,wrapT:fn},gn={[un]:9729,[hn]:9986,[dn]:An,[fn]:An};class mn{constructor(){(0,f.Z)(this,"baseUri",""),(0,f.Z)(this,"json",{}),(0,f.Z)(this,"buffers",[]),(0,f.Z)(this,"images",[])}postProcess(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{json:n,buffers:i=[],images:r=[],baseUri:o=""}=t;return Dt(n),this.baseUri=o,this.json=n,this.buffers=i,this.images=r,this._resolveTree(this.json,e),this.json}_resolveTree(t){t.bufferViews&&(t.bufferViews=t.bufferViews.map(((t,e)=>this._resolveBufferView(t,e)))),t.images&&(t.images=t.images.map(((t,e)=>this._resolveImage(t,e)))),t.samplers&&(t.samplers=t.samplers.map(((t,e)=>this._resolveSampler(t,e)))),t.textures&&(t.textures=t.textures.map(((t,e)=>this._resolveTexture(t,e)))),t.accessors&&(t.accessors=t.accessors.map(((t,e)=>this._resolveAccessor(t,e)))),t.materials&&(t.materials=t.materials.map(((t,e)=>this._resolveMaterial(t,e)))),t.meshes&&(t.meshes=t.meshes.map(((t,e)=>this._resolveMesh(t,e)))),t.nodes&&(t.nodes=t.nodes.map(((t,e)=>this._resolveNode(t,e)))),t.skins&&(t.skins=t.skins.map(((t,e)=>this._resolveSkin(t,e)))),t.scenes&&(t.scenes=t.scenes.map(((t,e)=>this._resolveScene(t,e)))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"===typeof e)return e;const n=this.json[t]&&this.json[t][e];return n||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),n}_resolveScene(t,e){return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map((t=>this.getNode(t))),t}_resolveNode(t,e){return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map((t=>this.getNode(t)))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce(((t,e)=>{const n=this.getMesh(e);return t.id=n.id,t.primitives=t.primitives.concat(n.primitives),t}),{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map((t=>{const e=(t={...t}).attributes;t.attributes={};for(const n in e)t.attributes[n]=this.getAccessor(e[n]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t}))),t}_resolveMaterial(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture={...t.normalTexture},t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture={...t.occlustionTexture},t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture={...t.emmisiveTexture},t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness={...t.pbrMetallicRoughness};const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture={...e.baseColorTexture},e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture={...e.metallicRoughnessTexture},e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){var n,i;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(n=t.componentType,cn[n]),t.components=(i=t.type,ln[i]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:n,byteLength:i}=Ht(t,t.bufferView),r=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset;let o=e.arrayBuffer.slice(r,r+i);t.bufferView.byteStride&&(o=this._getValueFromInterleavedBuffer(e,r,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new n(o)}return t}_getValueFromInterleavedBuffer(t,e,n,i,r){const o=new Uint8Array(r*i);for(let s=0;s<r;s++){const r=e+s*n;o.set(new Uint8Array(t.arrayBuffer.slice(r,r+i)),s*i)}return o.buffer}_resolveTexture(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.getSampler(t.sampler):gn,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||"sampler-".concat(e),t.parameters={};for(const n in t){const e=this._enumSamplerParameter(n);void 0!==e&&(t.parameters[e]=t[n])}return t}_enumSamplerParameter(t){return pn[t]}_resolveImage(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const n=this.images[e];return n&&(t.image=n),t}_resolveBufferView(t,e){const n=t.buffer,i={id:"bufferView-".concat(e),...t,buffer:this.buffers[n]},r=this.buffers[n].arrayBuffer;let o=this.buffers[n].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),i.data=new Uint8Array(r,o,t.byteLength),i}_resolveCamera(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}var yn=n(57370);const vn=1735152710,_n=12,bn=8,xn=1313821514,wn=5130562,Cn=0,Bn=1,En=0,Tn=!0;function Sn(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=new DataView(e),o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(t.getUint8(e+0))).concat(String.fromCharCode(t.getUint8(e+1))).concat(String.fromCharCode(t.getUint8(e+2))).concat(String.fromCharCode(t.getUint8(e+3)))}(r,n+0),s=r.getUint32(n+4,Tn),a=r.getUint32(n+8,Tn);switch(Object.assign(t,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:o,version:s,json:{},binChunks:[]}),n+=_n,t.version){case 1:return function(t,e,n){(0,yn.h)(t.header.byteLength>_n+bn);const i=e.getUint32(n+0,Tn),r=e.getUint32(n+4,Tn);return n+=bn,(0,yn.h)(r===En),Mn(t,e,n,i),n+=i,n+=In(t,e,n,t.header.byteLength),n}(t,r,n);case 2:return function(t,e,n,i){return(0,yn.h)(t.header.byteLength>_n+bn),function(t,e,n,i){for(;n+8<=t.header.byteLength;){const r=e.getUint32(n+0,Tn),o=e.getUint32(n+4,Tn);switch(n+=bn,o){case xn:Mn(t,e,n,r);break;case wn:In(t,e,n,r);break;case Cn:i.strict||Mn(t,e,n,r);break;case Bn:i.strict||In(t,e,n,r)}n+=(0,Rt.Pk)(r,4)}}(t,e,n,i),n+t.header.byteLength}(t,r,n,i={});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}function Mn(t,e,n,i){const r=new Uint8Array(e.buffer,n,i),o=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(o),(0,Rt.Pk)(i,4)}function In(t,e,n,i){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:e.buffer}),(0,Rt.Pk)(i,4)}async function Pn(t,e){var n,i,r,o;let s=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;!function(t,e,n,i){i.uri&&(t.baseUri=i.uri);if(e instanceof ArrayBuffer&&!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=new DataView(t),{magic:r=vn}=n,o=i.getUint32(e,!1);return o===r||o===vn}(e,n,i)){e=(new TextDecoder).decode(e)}if("string"===typeof e)t.json=(0,It.R)(e);else if(e instanceof ArrayBuffer){const r={};n=Sn(r,e,n,i.glb),Dt("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),t._glb=r,t.json=r.json}else Dt(!1,"GLTF: must be ArrayBuffer or string");const r=t.json.buffers||[];if(t.buffers=new Array(r.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}const o=t.json.images||[];t.images=new Array(o.length).fill({})}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(new an).normalize(t,e)}(t,{normalize:null===s||void 0===s||null===(n=s.gltf)||void 0===n?void 0:n.normalize}),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=en.filter((t=>nn(t.name,e)));for(const o of i){var r;null===(r=o.preprocess)||void 0===r||r.call(o,t,e,n)}}(t,s,a);const l=[];if(null!==s&&void 0!==s&&null!==(i=s.gltf)&&void 0!==i&&i.loadBuffers&&t.json.buffers&&await async function(t,e,n){const i=t.json.buffers||[];for(let s=0;s<i.length;++s){const a=i[s];if(a.uri){var r,o;const{fetch:i}=n;Dt(i);const l=Ft(a.uri,e),c=await(null===n||void 0===n||null===(r=n.fetch)||void 0===r?void 0:r.call(n,l)),u=await(null===c||void 0===c||null===(o=c.arrayBuffer)||void 0===o?void 0:o.call(c));t.buffers[s]={arrayBuffer:u,byteOffset:0,byteLength:u.byteLength},delete a.uri}else null===t.buffers[s]&&(t.buffers[s]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}(t,s,a),null!==s&&void 0!==s&&null!==(r=s.gltf)&&void 0!==r&&r.loadImages){const e=async function(t,e,n){const i=function(t){const e=new Set,n=t.json.textures||[];for(const i of n)void 0!==i.source&&e.add(i.source);return Array.from(e).sort()}(t),r=t.json.images||[],o=[];for(const s of i)o.push(Dn(t,r[s],s,e,n));return await Promise.all(o)}(t,s,a);l.push(e)}const c=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=en.filter((t=>nn(t.name,e)));for(const o of i){var r;await(null===(r=o.decode)||void 0===r?void 0:r.call(o,t,e,n))}}(t,s,a);return l.push(c),await Promise.all(l),null!==s&&void 0!==s&&null!==(o=s.gltf)&&void 0!==o&&o.postProcess?function(t,e){return(new mn).postProcess(t,e)}(t,s):t}async function Dn(t,e,n,i,r){const{fetch:o,parse:s}=r;let a;if(e.uri&&!e.hasOwnProperty("bufferView")){const t=Ft(e.uri,i),n=await o(t);a=await n.arrayBuffer(),e.bufferView={data:a}}if(Number.isFinite(e.bufferView)){const n=Lt(t.json,t.buffers,e.bufferView);a=(0,Pt.qv)(n.buffer,n.byteOffset,n.byteLength)}Dt(a,"glTF image has no data");let l=await s(a,[Mt.S,St],{mimeType:e.mimeType,basis:i.basis||{format:Et()}},r);l&&l[0]&&(l={compressed:!0,mipmaps:!1,width:l[0].width,height:l[0].height,data:l[0]}),t.images=t.images||[],t.images[n]=l}const Fn={name:"glTF",id:"gltf",module:"gltf",version:"3.4.15",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;e={...Fn.options,...e},e.gltf={...Fn.options.gltf,...e.gltf};const{byteOffset:i=0}=e;return await Pn({},t,i,e,n)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};async function Ln(t){const e=[];return t.scenes.forEach((t=>{t.traverse((t=>{Object.values(t.model.getUniforms()).forEach((t=>{!1===t.loaded&&e.push(t)}))}))})),await async function(t){for(;t();)await new Promise((t=>requestAnimationFrame(t)))}((()=>e.some((t=>!t.loaded))))}var On=n(7614);const Rn=[255,255,255,255],kn={scenegraph:{type:"object",value:null,async:!0},getScene:t=>t&&t.scenes?"object"===typeof t.scene?t.scene:t.scenes[t.scene||0]:t,getAnimator:t=>t&&t.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:Rn},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[Fn]};class Un extends A.Z{constructor(){super(...arguments),(0,f.Z)(this,"state",void 0)}getShaders(){const t=[p.Z,g.Z];return"pbr"===this.props._lighting&&t.push(v.b),super.getShaders({vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n  in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n  #ifdef HAS_NORMALS\n    in vec4 NORMAL;\n  #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n  #ifdef HAS_UV\n    out vec2 vTEXCOORD_0;\n  #endif\n#endif\nvoid main(void) {\n  #if defined(HAS_UV) && !defined(MODULE_PBR)\n    vTEXCOORD_0 = TEXCOORD_0;\n    geometry.uv = vTEXCOORD_0;\n  #endif\n\n  geometry.worldPosition = instancePositions;\n  geometry.pickingColor = instancePickingColors;\n\n  vec3 normal = vec3(0.0, 0.0, 1.0);\n  #ifdef MODULE_PBR\n    #ifdef HAS_NORMALS\n      normal = instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz;\n    #endif\n  #endif\n\n  float originalSize = project_size_to_pixel(sizeScale);\n  float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n  vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n  if(composeModelMatrix) {\n    DECKGL_FILTER_SIZE(pos, geometry);\n    geometry.normal = project_normal(normal);\n    geometry.worldPosition += pos;\n    gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n  }\n  else {\n    pos = project_size(pos);\n    DECKGL_FILTER_SIZE(pos, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n    geometry.normal = project_normal(normal);\n  }\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  #ifdef MODULE_PBR\n    pbr_vPosition = geometry.position.xyz;\n    #ifdef HAS_NORMALS\n      pbr_vNormal = geometry.normal;\n    #endif\n\n    #ifdef HAS_UV\n      pbr_vUV = TEXCOORD_0;\n    #else\n      pbr_vUV = vec2(0., 0.);\n    #endif\n    geometry.uv = pbr_vUV;\n  #endif\n\n  vColor = instanceColors;\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n  #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n    in vec2 vTEXCOORD_0;\n    uniform sampler2D u_BaseColorSampler;\n  #endif\n#endif\n\nvoid main(void) {\n  #ifdef MODULE_PBR\n    fragmentColor = vColor * pbr_filterColor(vec4(0));\n    geometry.uv = pbr_vUV;\n  #else\n    #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n      fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n      geometry.uv = vTEXCOORD_0;\n    #else\n      fragmentColor = vColor;\n    #endif\n  #endif\n\n  fragmentColor.a *= opacity;\n  DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:Rn,transition:!0},instanceModelMatrix:On.P})}updateState(t){super.updateState(t);const{props:e,oldProps:n}=t;e.scenegraph!==n.scenegraph?this._updateScenegraph():e._animations!==n._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}finalizeState(t){super.finalizeState(t),this._deleteScenegraph()}get isLoaded(){var t;return(null===(t=this.state)||void 0===t?void 0:t.scenegraph)&&super.isLoaded}_updateScenegraph(){const t=this.props,{gl:e}=this.context;let n=null;if(t.scenegraph instanceof C)n={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const i=t.scenegraph,r=function(t,e,n){const i=new j(t,n);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(e,i,this._getModelOptions());n={gltf:i,...r},Ln(r).then((()=>this.setNeedsRedraw()))}else t.scenegraph&&(m.Z.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),n=t.scenegraph);const i={layer:this,gl:e},r=t.getScene(n,i),o=t.getAnimator(n,i);r instanceof C?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,o,t._animations),this.setState({scenegraph:r,animator:o})):null!==r&&m.Z.warn("invalid scenegraph:",r)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const e=this.getAttributeManager().getAttributes();t.traverse((t=>{this._setModelAttributes(t.model,e)}))}}_applyAnimationsProp(t,e,n){if(!t||!e||!n)return;const i=e.getAnimations();Object.keys(n).sort().forEach((t=>{const e=n[t];if("*"===t)i.forEach((t=>{Object.assign(t,e)}));else if(Number.isFinite(Number(t))){const n=Number(t);n>=0&&n<i.length?Object.assign(i[n],e):m.Z.warn("animation ".concat(t," not found"))()}else{const n=i.find((e=>{let{name:n}=e;return n===t}));n?Object.assign(n,e):m.Z.warn("animation ".concat(t," not found"))()}}))}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof C&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let e=null;return t&&(e="function"===typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:e,modelOptions:{isInstanced:!0,transpileToGLSL100:!(0,y.D0)(this.context.gl),...this.getShaders()},useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse((e=>{this._setModelAttributes(e.model,t)}))}draw(t){let{moduleParameters:e=null,parameters:n={},context:i}=t;if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(i.timeline.getTime()),this.setNeedsRedraw());const{viewport:r}=this.context,{sizeScale:o,sizeMinPixels:s,sizeMaxPixels:a,opacity:l,coordinateSystem:c}=this.props,u=this.getNumInstances();this.state.scenegraph.traverse(((t,i)=>{let{worldMatrix:h}=i;t.model.setInstanceCount(u),t.updateModuleSettings(e),t.draw({parameters:n,uniforms:{sizeScale:o,opacity:l,sizeMinPixels:s,sizeMaxPixels:a,composeModelMatrix:(0,On.X)(r,c),sceneModelMatrix:h,u_Camera:t.model.getUniforms().project_uCameraPosition}})}))}}(0,f.Z)(Un,"defaultProps",kn),(0,f.Z)(Un,"layerName","ScenegraphLayer")},36800:(t,e,n)=>{"use strict";n.d(e,{Z:()=>_});var i=n(64649),r=n(21970),o=n(90031),s=n(2123),a=n(54976),l=n(2578),c=n(69296),u=n(28007),h=n(58300),d=n(94557),f=n(12308),A=n(70353),p=n(7614);var g=n(38395);function m(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),r.Z.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function y(t,e){if(t.attributes)return m(t.attributes,e),t instanceof c.Z?t:new c.Z(t);if(t.positions||t.POSITION)return m(t,e),new c.Z({attributes:t});throw Error("Invalid mesh")}const v={mesh:{type:"object",value:null,async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},textureParameters:{type:"object",ignore:!0}};class _ extends o.Z{constructor(){super(...arguments),(0,i.Z)(this,"state",void 0)}getShaders(){const t=!(0,u.D0)(this.context.gl),e={};return(0,f.U6)(this.context.gl,A.h.GLSL_DERIVATIVES)&&(e.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  geometry.uv = texCoords;\n  geometry.pickingColor = instancePickingColors;\n\n  vTexCoord = texCoords;\n  cameraPosition = project_uCameraPosition;\n  vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n  vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n  if (composeModelMatrix) {\n    DECKGL_FILTER_SIZE(pos, geometry);\n    normals_commonspace = project_normal(instanceModelMatrix * normals);\n    geometry.worldPosition += pos;\n    gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n    geometry.position = position_commonspace;\n  }\n  else {\n    pos = project_size(pos);\n    DECKGL_FILTER_SIZE(pos, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n    geometry.position = position_commonspace;\n    normals_commonspace = project_normal(instanceModelMatrix * normals);\n  }\n\n  geometry.normal = normals_commonspace;\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n  geometry.uv = vTexCoord;\n\n  vec3 normal;\n  if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n    normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n    normal = vec3(0.0, 0.0, 1.0);\n#endif\n  } else {\n    normal = normals_commonspace;\n  }\n\n  vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n  DECKGL_FILTER_COLOR(color, geometry);\n\n  vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n  fragColor = vec4(lightColor, color.a * opacity);\n}\n",modules:[s.Z,a.s,l.Z],transpileToGLSL100:t,defines:e})}getBounds(){var t;if(this.props._instanced)return super.getBounds();let e=this.state.positionBounds;if(e)return e;const{mesh:n}=this.props;if(!n)return null;if(e=null===(t=n.header)||void 0===t?void 0:t.boundingBox,!e){const{attributes:t}=y(n,this.props._useMeshColors);t.POSITION=t.POSITION||t.positions,e=(0,g.v)(t)}return this.state.positionBounds=e,e}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:p.P}),this.setState({emptyTexture:new h.Z(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState(t){super.updateState(t);const{props:e,oldProps:n,changeFlags:i}=t;if(e.mesh!==n.mesh||i.extensionsChanged){var r;if(this.state.positionBounds=null,null===(r=this.state.model)||void 0===r||r.delete(),e.mesh){this.state.model=this.getModel(e.mesh);const t=e.mesh.attributes||e.mesh;this.setState({hasNormals:Boolean(t.NORMAL||t.normals)})}this.getAttributeManager().invalidateAll()}e.texture!==n.texture&&this.setTexture(e.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(t){super.finalizeState(t),this.state.emptyTexture.delete()}draw(t){let{uniforms:e}=t;if(!this.state.model)return;const{viewport:n}=this.context,{sizeScale:i,coordinateSystem:r,_instanced:o}=this.props;this.state.model.setUniforms(e).setUniforms({sizeScale:i,composeModelMatrix:!o||(0,p.X)(n,r),flatShading:!this.state.hasNormals}).draw()}get isLoaded(){var t;return(null===(t=this.state)||void 0===t?void 0:t.model)&&super.isLoaded}getModel(t){const e=new d.Z(this.context.gl,{...this.getShaders(),id:this.props.id,geometry:y(t,this.props._useMeshColors),isInstanced:!0}),{texture:n}=this.props,{emptyTexture:i}=this.state;return e.setUniforms({sampler:n||i,hasTexture:Boolean(n)}),e}setTexture(t){const{emptyTexture:e,model:n}=this.state;n&&n.setUniforms({sampler:t||e,hasTexture:Boolean(t)})}}(0,i.Z)(_,"defaultProps",v),(0,i.Z)(_,"layerName","SimpleMeshLayer")},7614:(t,e,n)=>{"use strict";n.d(e,{P:()=>u,X:()=>h});var i=n(73115),r=n(18252);const o=Math.PI/180,s=new Float32Array(16),a=new Float32Array(12);function l(t,e,n){const i=e[0]*o,r=e[1]*o,s=e[2]*o,a=Math.sin(s),l=Math.sin(i),c=Math.sin(r),u=Math.cos(s),h=Math.cos(i),d=Math.cos(r),f=n[0],A=n[1],p=n[2];t[0]=f*d*h,t[1]=f*c*h,t[2]=f*-l,t[3]=A*(-c*u+d*l*a),t[4]=A*(d*u+c*l*a),t[5]=A*h*a,t[6]=p*(c*a+d*l*u),t[7]=p*(-d*a+c*l*u),t[8]=p*h*u}function c(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}const u={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(t,e){let{startRow:n,endRow:r}=e;const{data:o,getOrientation:u,getScale:h,getTranslation:d,getTransformMatrix:f}=this.props,A=Array.isArray(f),p=A&&16===f.length,g=Array.isArray(h),m=Array.isArray(u),y=Array.isArray(d),v=p||!A&&Boolean(f(o[0]));t.constant=v?p:m&&g&&y;const _=t.value;if(t.constant){let e;if(v)s.set(f),e=c(s);else{e=a;l(e,u,h),e.set(d,9)}t.value=new Float32Array(e)}else{let e=n*t.size;const{iterable:A,objectInfo:b}=(0,i.jB)(o,n,r);for(const t of A){let n;if(b.index++,v)s.set(p?f:f(t,b)),n=c(s);else{n=a;l(n,m?u:u(t,b),g?h:h(t,b)),n.set(y?d:d(t,b),9)}_[e++]=n[0],_[e++]=n[1],_[e++]=n[2],_[e++]=n[3],_[e++]=n[4],_[e++]=n[5],_[e++]=n[6],_[e++]=n[7],_[e++]=n[8],_[e++]=n[9],_[e++]=n[10],_[e++]=n[11]}}}};function h(t,e){return e===r.Df.CARTESIAN||e===r.Df.METER_OFFSETS||e===r.Df.DEFAULT&&!t.isGeospatial}},70145:(t,e,n)=>{"use strict";n.d(e,{Z:()=>Ee});var i=n(66845),r=n(64649);let o=1,s=1;class a{constructor(){this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}addChannel(t){const{delay:e=0,duration:n=Number.POSITIVE_INFINITY,rate:i=1,repeat:r=1}=t,s=o++,a={time:0,delay:e,duration:n,rate:i,repeat:r};return this._setChannelTime(a,this.time),this.channels.set(s,a),s}removeChannel(t){this.channels.delete(t);for(const[e,n]of this.animations)n.channel===t&&this.detachAnimation(e)}isFinished(t){const e=this.channels.get(t);return void 0!==e&&this.time>=e.delay+e.duration*e.repeat}getTime(t){if(void 0===t)return this.time;const e=this.channels.get(t);return void 0===e?-1:e.time}setTime(t){this.time=Math.max(0,t);const e=this.channels.values();for(const i of e)this._setChannelTime(i,this.time);const n=this.animations.values();for(const i of n){const{animation:t,channel:e}=i;t.setTime(this.getTime(e))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,e){const n=s++;return this.animations.set(n,{animation:t,channel:e}),t.setTime(this.getTime(e)),n}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,e){const n=e-t.delay;n>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,n)%t.duration,t.time*=t.rate)}}var l=n(48915),c=n(21970),u=n(23427),h=n(18757),d=n(92138),f=n(49125);class A{constructor(t,e,n){(0,r.Z)(this,"id",void 0),(0,r.Z)(this,"context",void 0),(0,r.Z)(this,"isLoaded",void 0),(0,r.Z)(this,"persistent",void 0),(0,r.Z)(this,"_loadCount",0),(0,r.Z)(this,"_subscribers",new Set),(0,r.Z)(this,"_data",void 0),(0,r.Z)(this,"_loader",void 0),(0,r.Z)(this,"_error",void 0),(0,r.Z)(this,"_content",void 0),this.id=t,this.context=n,this.setData(e)}subscribe(t){this._subscribers.add(t)}unsubscribe(t){this._subscribers.delete(t)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then((()=>this.getData()))}setData(t,e){if(t===this._data&&!e)return;this._data=t;const n=++this._loadCount;let i=t;"string"===typeof t&&(i=(0,f.z)(t)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then((t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=void 0,this._content=t)})).catch((t=>{this._loadCount===n&&(this.isLoaded=!0,this._error=t||!0)}))):(this.isLoaded=!0,this._error=void 0,this._content=t);for(const r of this._subscribers)r.onChange(this.getData())}}class p{constructor(t){let{gl:e,protocol:n}=t;(0,r.Z)(this,"protocol",void 0),(0,r.Z)(this,"_context",void 0),(0,r.Z)(this,"_resources",void 0),(0,r.Z)(this,"_consumers",void 0),(0,r.Z)(this,"_pruneRequest",void 0),this.protocol=n||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(t){return!!t.startsWith(this.protocol)||t in this._resources}add(t){let{resourceId:e,data:n,forceUpdate:i=!1,persistent:r=!0}=t,o=this._resources[e];o?o.setData(n,i):(o=new A(e,n,this._context),this._resources[e]=o),o.persistent=r}remove(t){const e=this._resources[t];e&&(e.delete(),delete this._resources[t])}unsubscribe(t){let{consumerId:e}=t;const n=this._consumers[e];if(n){for(const t in n){const e=n[t],i=this._resources[e.resourceId];i&&i.unsubscribe(e)}delete this._consumers[e],this.prune()}}subscribe(t){let{resourceId:e,onChange:n,consumerId:i,requestId:r="default"}=t;const{_resources:o,protocol:s}=this;e.startsWith(s)&&(e=e.replace(s,""),o[e]||this.add({resourceId:e,data:null,persistent:!1}));const a=o[e];if(this._track(i,r,a,n),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout((()=>this._prune()),0))}finalize(){for(const t in this._resources)this._resources[t].delete()}_track(t,e,n,i){const r=this._consumers,o=r[t]=r[t]||{},s=o[e]||{},a=s.resourceId&&this._resources[s.resourceId];a&&(a.unsubscribe(s),this.prune()),n&&(o[e]=s,s.onChange=i,s.resourceId=n.id,n.subscribe(s))}_prune(){this._pruneRequest=null;for(const t of Object.keys(this._resources)){const e=this._resources[t];e.persistent||e.inUse()||(e.delete(),delete this._resources[t])}}}var g=n(83427),m=n(37330),y=n(66199);const v=[y.Z],_=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function b(t){const e=m.Z.getDefaultProgramManager(t);for(const n of v)e.addDefaultModule(n);for(const n of _)e.addShaderHook(n);return e}class x{constructor(t){let{deck:e,stats:n,viewport:i,timeline:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,r.Z)(this,"layers",void 0),(0,r.Z)(this,"context",void 0),(0,r.Z)(this,"resourceManager",void 0),(0,r.Z)(this,"_lastRenderedLayers",[]),(0,r.Z)(this,"_needsRedraw",!1),(0,r.Z)(this,"_needsUpdate",!1),(0,r.Z)(this,"_nextLayers",null),(0,r.Z)(this,"_debug",!1),(0,r.Z)(this,"activateViewport",(t=>{(0,u.Z)("layerManager.activateViewport",this,t),t&&(this.context.viewport=t)})),this.layers=[],this.resourceManager=new p({gl:t,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,gl:t,deck:e,programManager:t&&b(t),stats:n||new d.Z({id:"deck.gl"}),viewport:i||new g.Z({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:o||new a,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(const t of this.layers)this._finalizeLayer(t)}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);for(const n of this.layers){const i=n.getNeedsRedraw(t);e=e||i}return e}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(t){this._needsRedraw=this._needsRedraw||t}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t}getLayers(){let{layerIds:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t?this.layers.filter((e=>t.find((t=>0===e.id.indexOf(t))))):this.layers}setProps(t){"debug"in t&&(this._debug=t.debug),"userData"in t&&(this.context.userData=t.userData),"layers"in t&&(this._nextLayers=t.layers),"onError"in t&&(this.context.onError=t.onError)}setLayers(t,e){(0,u.Z)("layerManager.setLayers",this,e,t),this._lastRenderedLayers=t;const n=(0,h.x)(t,Boolean);for(const i of n)i.context=this.context;this._updateLayers(this.layers,n)}updateLayers(){const t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(this._nextLayers||this._lastRenderedLayers,t)),this._nextLayers=null}_handleError(t,e,n){n.raiseError(e,"".concat(t," of ").concat(n))}_updateLayers(t,e){const n={};for(const o of t)n[o.id]?c.Z.warn("Multiple old layers with same id ".concat(o.id))():n[o.id]=o;const i=[];this._updateSublayersRecursively(e,n,i),this._finalizeOldLayers(n);let r=!1;for(const o of i)if(o.hasUniformTransition()){r="Uniform transition in ".concat(o);break}this._needsUpdate=r,this.layers=i}_updateSublayersRecursively(t,e,n){for(const r of t){r.context=this.context;const t=e[r.id];null===t&&c.Z.warn("Multiple new layers with same id ".concat(r.id))(),e[r.id]=null;let o=null;try{this._debug&&t!==r&&r.validateProps(),t?(this._transferLayerState(t,r),this._updateLayer(r)):this._initializeLayer(r),n.push(r),o=r.isComposite?r.getSubLayers():null}catch(i){this._handleError("matching",i,r)}o&&this._updateSublayersRecursively(o,e,n)}}_finalizeOldLayers(t){for(const e in t){const n=t[e];n&&this._finalizeLayer(n)}}_initializeLayer(t){try{t._initialize(),t.lifecycle=l.dt.INITIALIZED}catch(e){this._handleError("initialization",e,t)}}_transferLayerState(t,e){e._transferState(t),e.lifecycle=l.dt.MATCHED,e!==t&&(t.lifecycle=l.dt.AWAITING_GC)}_updateLayer(t){try{t._update()}catch(e){this._handleError("update",e,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle=l.dt.AWAITING_FINALIZATION;try{t._finalize(),t.lifecycle=l.dt.FINALIZED}catch(e){this._handleError("finalization",e,t)}}}var w=n(98949);class C{constructor(t){(0,r.Z)(this,"width",void 0),(0,r.Z)(this,"height",void 0),(0,r.Z)(this,"views",void 0),(0,r.Z)(this,"viewState",void 0),(0,r.Z)(this,"controllers",void 0),(0,r.Z)(this,"timeline",void 0),(0,r.Z)(this,"_viewports",void 0),(0,r.Z)(this,"_viewportMap",void 0),(0,r.Z)(this,"_isUpdating",void 0),(0,r.Z)(this,"_needsRedraw",void 0),(0,r.Z)(this,"_needsUpdate",void 0),(0,r.Z)(this,"_eventManager",void 0),(0,r.Z)(this,"_eventCallbacks",void 0),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="First render",this._needsUpdate="Initialize",this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}finalize(){for(const t in this.controllers){const e=this.controllers[t];e&&e.finalize()}this.controllers={}}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}updateViewStates(){for(const t in this.controllers){const e=this.controllers[t];e&&e.updateTransition()}}getViewports(t){return t?this._viewports.filter((e=>e.containsPixel(t))):this._viewports}getViews(){const t={};return this.views.forEach((e=>{t[e.id]=e})),t}getView(t){return this.views.find((e=>e.id===t))}getViewState(t){const e="string"===typeof t?this.getView(t):t,n=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(n):n}getViewport(t){return this._viewportMap[t]}unproject(t,e){const n=this.getViewports(),i={x:t[0],y:t[1]};for(let r=n.length-1;r>=0;--r){const o=n[r];if(o.containsPixel(i)){const n=t.slice();return n[0]-=o.x,n[1]-=o.y,o.unproject(n,e)}}return null}setProps(t){t.views&&this._setViews(t.views),t.viewState&&this._setViewState(t.viewState),("width"in t||"height"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(t,e){t===this.width&&e===this.height||(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}_setViews(t){t=(0,h.x)(t,Boolean);this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}_setViewState(t){if(t){!(0,w.v)(t,this.viewState,3)&&this.setNeedsUpdate("viewState changed"),this.viewState=t}else c.Z.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(t,e){this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange({...e,viewId:t})}_createController(t,e){return new(0,e.type)({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:e=>{var n;return null===(n=this.getView(t.id))||void 0===n?void 0:n.makeViewport({viewState:e,width:this.width,height:this.height})}})}_updateController(t,e,n,i){const r=t.controller;if(r&&n){const o={...e,...r,id:t.id,x:n.x,y:n.y,width:n.width,height:n.height};return i&&i.constructor===r.type||(i=this._createController(t,o)),i&&i.setProps(o),i}return null}_rebuildViewports(){const{views:t}=this,e=this.controllers;this._viewports=[],this.controllers={};let n=!1;for(let i=t.length;i--;){const r=t[i],o=this.getViewState(r),s=r.makeViewport({viewState:o,width:this.width,height:this.height});let a=e[r.id];const l=Boolean(r.controller);l&&!a&&(n=!0),!n&&l||!a||(a.finalize(),a=null),this.controllers[r.id]=this._updateController(r,o,s,a),s&&this._viewports.unshift(s)}for(const i in e){const t=e[i];t&&!this.controllers[i]&&t.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach((t=>{t.id&&(this._viewportMap[t.id]=this._viewportMap[t.id]||t)}))}_diffViews(t,e){return t.length!==e.length||t.some(((n,i)=>!t[i].equals(e[i])))}}const B=/([0-9]+\.?[0-9]*)(%|px)/;function E(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=B.exec(t);if(e&&e.length>=3){const t="%"===e[2],n=parseFloat(e[1]);return{position:t?n/100:n,relative:t}}default:throw new Error("Could not parse position string ".concat(t))}}function T(t,e){return t.relative?Math.round(t.position*e):t.position}var S=n(12997);class M{constructor(t){(0,r.Z)(this,"id",void 0),(0,r.Z)(this,"viewportInstance",void 0),(0,r.Z)(this,"_x",void 0),(0,r.Z)(this,"_y",void 0),(0,r.Z)(this,"_width",void 0),(0,r.Z)(this,"_height",void 0),(0,r.Z)(this,"_padding",void 0),(0,r.Z)(this,"props",void 0);const{id:e,x:n=0,y:i=0,width:o="100%",height:s="100%",padding:a=null,viewportInstance:l}=t||{};(0,S.Z)(!l||l instanceof g.Z),this.viewportInstance=l,this.id=e||this.constructor.displayName||"view",this.props={...t,id:this.id},this._x=E(n),this._y=E(i),this._width=E(o),this._height=E(s),this._padding=a&&{left:E(a.left||0),right:E(a.right||0),top:E(a.top||0),bottom:E(a.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(t){return this===t||(this.viewportInstance?!!t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):this.ViewportType===t.ViewportType&&(0,w.v)(this.props,t.props,2))}makeViewport(t){let{width:e,height:n,viewState:i}=t;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:n});return r.height&&r.width?new this.ViewportType({...i,...this.props,...r}):null}getViewStateId(){const{viewState:t}=this.props;return"string"===typeof t?t:(null===t||void 0===t?void 0:t.id)||this.id}filterViewState(t){if(this.props.viewState&&"object"===typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const e={...t};for(const t in this.props.viewState)"id"!==t&&(e[t]=this.props.viewState[t]);return e}return t}getDimensions(t){let{width:e,height:n}=t;const i={x:T(this._x,e),y:T(this._y,n),width:T(this._width,e),height:T(this._height,n)};return this._padding&&(i.padding={left:T(this._padding.left,e),top:T(this._padding.top,n),right:T(this._padding.right,e),bottom:T(this._padding.bottom,n)}),i}get controller(){const t=this.props.controller;return t?!0===t?{type:this.ControllerType}:"function"===typeof t?{type:t}:{type:this.ControllerType,...t}:null}}var I=n(52310),P=n(47410),D=n(99188);const F=()=>{},L=2,O=3,R=t=>t,k=1;class U{constructor(t){(0,r.Z)(this,"getControllerState",void 0),(0,r.Z)(this,"props",void 0),(0,r.Z)(this,"propsInTransition",void 0),(0,r.Z)(this,"transition",void 0),(0,r.Z)(this,"onViewStateChange",void 0),(0,r.Z)(this,"onStateChange",void 0),(0,r.Z)(this,"_onTransitionUpdate",(t=>{const{time:e,settings:{interpolator:n,startProps:i,endProps:r,duration:o,easing:s}}=t,a=s(e/o),l=n.interpolateProps(i,r,a);this.propsInTransition=this.getControllerState({...this.props,...l}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})})),this.getControllerState=t.getControllerState,this.propsInTransition=null,this.transition=new D.Z(t.timeline),this.onViewStateChange=t.onViewStateChange||F,this.onStateChange=t.onStateChange||F}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(t){let e=!1;const n=this.props;if(this.props=t,!n||this._shouldIgnoreViewportChange(n,t))return!1;if(this._isTransitionEnabled(t)){let i=n;if(this.transition.inProgress){const{interruption:t,endProps:e}=this.transition.settings;i={...n,...t===L?e:this.propsInTransition||n}}this._triggerTransition(i,t),e=!0}else this.transition.cancel();return e}updateTransition(){this.transition.update()}_isTransitionEnabled(t){const{transitionDuration:e,transitionInterpolator:n}=t;return(e>0||"auto"===e)&&Boolean(n)}_isUpdateDueToCurrentTransition(t){return!(!this.transition.inProgress||!this.propsInTransition)&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}_shouldIgnoreViewportChange(t,e){return this.transition.inProgress?this.transition.settings.interruption===O||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}_triggerTransition(t,e){const n=this.getControllerState(t),i=this.getControllerState(e).shortestPathFrom(n),r=e.transitionInterpolator,o=r.getDuration?r.getDuration(t,e):e.transitionDuration;if(0===o)return;const s=r.initializeProps(t,i);this.propsInTransition={};const a={duration:o,easing:e.transitionEasing||R,interpolator:r,interruption:e.transitionInterruption||k,startProps:s.start,endProps:s.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)};this.transition.start(a),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(t){return e=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),null===t||void 0===t||t(e)}}}class z{constructor(t){(0,r.Z)(this,"_propsToCompare",void 0),(0,r.Z)(this,"_propsToExtract",void 0),(0,r.Z)(this,"_requiredProps",void 0);const{compare:e,extract:n,required:i}=t;this._propsToCompare=e,this._propsToExtract=n||e,this._requiredProps=i}arePropsEqual(t,e){for(const n of this._propsToCompare)if(!(n in t)||!(n in e)||!(0,P.fS)(t[n],e[n]))return!1;return!0}initializeProps(t,e){const n={},i={};for(const r of this._propsToExtract)(r in t||r in e)&&(n[r]=t[r],i[r]=e[r]);return this._checkRequiredProps(n),this._checkRequiredProps(i),{start:n,end:i}}getDuration(t,e){return e.transitionDuration}_checkRequiredProps(t){this._requiredProps&&this._requiredProps.forEach((e=>{const n=t[e];(0,S.Z)(Number.isFinite(n)||Array.isArray(n),"".concat(e," is required for transition"))}))}}const G=["longitude","latitude","zoom","bearing","pitch"],N=["longitude","latitude","zoom"];class Z extends z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=Array.isArray(t)?t:t.transitionProps,n=Array.isArray(t)?{}:t;n.transitionProps=Array.isArray(e)?{compare:e,required:e}:e||{compare:G,required:N},super(n.transitionProps),(0,r.Z)(this,"opts",void 0),this.opts=n}initializeProps(t,e){const n=super.initializeProps(t,e),{makeViewport:i,around:r}=this.opts;if(i&&r){const o=i(t),s=i(e),a=o.unproject(r);n.start.around=r,Object.assign(n.end,{around:s.project(a),aroundPosition:a,width:e.width,height:e.height})}return n}interpolateProps(t,e,n){const i={};for(const r of this._propsToExtract)i[r]=(0,P.t7)(t[r]||0,e[r]||0,n);if(e.aroundPosition&&this.opts.makeViewport){const r=this.opts.makeViewport({...e,...i});Object.assign(i,r.panByPosition(e.aroundPosition,(0,P.t7)(t.around,e.around,n)))}return i}}const j={transitionDuration:0},V=t=>1-(1-t)*(1-t),H=["wheel"],J=["panstart","panmove","panend"],W=["pinchstart","pinchmove","pinchend"],Q=["tripanstart","tripanmove","tripanend"],K=["doubletap"],q=["keydown"],X={};class Y{constructor(t){(0,r.Z)(this,"props",void 0),(0,r.Z)(this,"state",{}),(0,r.Z)(this,"transitionManager",void 0),(0,r.Z)(this,"eventManager",void 0),(0,r.Z)(this,"onViewStateChange",void 0),(0,r.Z)(this,"onStateChange",void 0),(0,r.Z)(this,"makeViewport",void 0),(0,r.Z)(this,"_controllerState",void 0),(0,r.Z)(this,"_events",{}),(0,r.Z)(this,"_interactionState",{isDragging:!1}),(0,r.Z)(this,"_customEvents",[]),(0,r.Z)(this,"_eventStartBlocked",null),(0,r.Z)(this,"_panMove",!1),(0,r.Z)(this,"invertPan",!1),(0,r.Z)(this,"dragMode","rotate"),(0,r.Z)(this,"inertia",0),(0,r.Z)(this,"scrollZoom",!0),(0,r.Z)(this,"dragPan",!0),(0,r.Z)(this,"dragRotate",!0),(0,r.Z)(this,"doubleClickZoom",!0),(0,r.Z)(this,"touchZoom",!0),(0,r.Z)(this,"touchRotate",!1),(0,r.Z)(this,"keyboard",!0),this.transitionManager=new U({...t,getControllerState:t=>new this.ControllerState(t),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=t.eventManager,this.onViewStateChange=t.onViewStateChange||(()=>{}),this.onStateChange=t.onStateChange||(()=>{}),this.makeViewport=t.makeViewport}set events(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.props&&this.setProps(this.props)}finalize(){for(const e in this._events){var t;if(this._events[e])null===(t=this.eventManager)||void 0===t||t.off(e,this.handleEvent)}this.transitionManager.finalize()}handleEvent(t){this._controllerState=void 0;const e=this._eventStartBlocked;switch(t.type){case"panstart":return!e&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!e&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!e&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(t){const{x:e,y:n}=this.props,{offsetCenter:i}=t;return[i.x-e,i.y-n]}isPointInBounds(t,e){const{width:n,height:i}=this.props;if(e&&e.handled)return!1;const r=t[0]>=0&&t[0]<=n&&t[1]>=0&&t[1]<=i;return r&&e&&e.stopPropagation(),r}isFunctionKeyPressed(t){const{srcEvent:e}=t;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(t){const e=setTimeout((()=>{this._eventStartBlocked===e&&(this._eventStartBlocked=null)}),t);this._eventStartBlocked=e}setProps(t){t.dragMode&&(this.dragMode=t.dragMode),this.props=t,"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);const{inertia:e}=t;this.inertia=Number.isFinite(e)?e:!0===e?300:0;const{scrollZoom:n=!0,dragPan:i=!0,dragRotate:r=!0,doubleClickZoom:o=!0,touchZoom:s=!0,touchRotate:a=!1,keyboard:l=!0}=t,c=Boolean(this.onViewStateChange);this.toggleEvents(H,c&&n),this.toggleEvents(J,c),this.toggleEvents(W,c&&(s||a)),this.toggleEvents(Q,c&&a),this.toggleEvents(K,c&&o),this.toggleEvents(q,c&&l),this.scrollZoom=n,this.dragPan=i,this.dragRotate=r,this.doubleClickZoom=o,this.touchZoom=s,this.touchRotate=a,this.keyboard=l}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(t,e){this.eventManager&&t.forEach((t=>{this._events[t]!==e&&(this._events[t]=e,e?this.eventManager.on(t,this.handleEvent):this.eventManager.off(t,this.handleEvent))}))}updateViewport(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={...t.getViewportProps(),...e},r=this.controllerState!==t;if(this.state=t.getState(),this._setInteractionState(n),r){const t=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:t})}}_onTransition(t){this.onViewStateChange({...t,interactionState:this._interactionState})}_setInteractionState(t){Object.assign(this._interactionState,t),this.onStateChange(this._interactionState)}_onPanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;let n=this.isFunctionKeyPressed(t)||t.rightButton||!1;(this.invertPan||"pan"===this.dragMode)&&(n=!n);const i=this.controllerState[n?"panStart":"rotateStart"]({pos:e});return this._panMove=n,this.updateViewport(i,j,{isDragging:!0}),!0}_onPan(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}_onPanEnd(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}_onPanMove(t){if(!this.dragPan)return!1;const e=this.getCenter(t),n=this.controllerState.pan({pos:e});return this.updateViewport(n,j,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(t){const{inertia:e}=this;if(this.dragPan&&e&&t.velocity){const n=this.getCenter(t),i=[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2],r=this.controllerState.pan({pos:i}).panEnd();this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:V},{isDragging:!1,isPanning:!0})}else{const t=this.controllerState.panEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(t){if(!this.dragRotate)return!1;const e=this.getCenter(t),n=this.controllerState.rotate({pos:e});return this.updateViewport(n,j,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(t){const{inertia:e}=this;if(this.dragRotate&&e&&t.velocity){const n=this.getCenter(t),i=[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2],r=this.controllerState.rotate({pos:i}).rotateEnd();this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:V},{isDragging:!1,isRotating:!0})}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(t){if(!this.scrollZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;t.srcEvent.preventDefault();const{speed:n=.01,smooth:i=!1}=!0===this.scrollZoom?{}:this.scrollZoom,{delta:r}=t;let o=2/(1+Math.exp(-Math.abs(r*n)));r<0&&0!==o&&(o=1/o);const s=this.controllerState.zoom({pos:e,scale:o});return this.updateViewport(s,{...this._getTransitionProps({around:e}),transitionDuration:i?250:1},{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.rotateStart({pos:e});return this.updateViewport(n,j,{isDragging:!0}),!0}_onTriplePan(t){if(!this.touchRotate)return!1;if(!this.isDragging())return!1;const e=this.getCenter(t);e[0]-=t.deltaX;const n=this.controllerState.rotate({pos:e});return this.updateViewport(n,j,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this;if(this.touchRotate&&e&&t.velocityY){const n=this.getCenter(t),i=[n[0],n[1]+=t.velocityY*e/2],r=this.controllerState.rotate({pos:i});this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:V},{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return X._startPinchRotation=t.rotation,X._lastPinchEvent=t,this.updateViewport(n,j,{isDragging:!0}),!0}_onPinch(t){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;let e=this.controllerState;if(this.touchZoom){const{scale:n}=t,i=this.getCenter(t);e=e.zoom({pos:i,scale:n})}if(this.touchRotate){const{rotation:n}=t;e=e.rotate({deltaAngleX:X._startPinchRotation-n})}return this.updateViewport(e,j,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),X._lastPinchEvent=t,!0}_onPinchEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this,{_lastPinchEvent:n}=X;if(this.touchZoom&&e&&n&&t.scale!==n.scale){const i=this.getCenter(t);let r=this.controllerState.rotateEnd();const o=Math.log2(t.scale),s=(o-Math.log2(n.scale))/(t.deltaTime-n.deltaTime),a=Math.pow(2,o+s*e/2);r=r.zoom({pos:i,scale:a}).zoomEnd(),this.updateViewport(r,{...this._getTransitionProps({around:i}),transitionDuration:e,transitionEasing:V},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{const t=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return X._startPinchRotation=null,X._lastPinchEvent=null,!0}_onDoubleTap(t){if(!this.doubleClickZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const n=this.isFunctionKeyPressed(t),i=this.controllerState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(t){if(!this.keyboard)return!1;const e=this.isFunctionKeyPressed(t),{zoomSpeed:n,moveSpeed:i,rotateSpeedX:r,rotateSpeedY:o}=!0===this.keyboard?{}:this.keyboard,{controllerState:s}=this;let a;const l={};switch(t.srcEvent.code){case"Minus":a=e?s.zoomOut(n).zoomOut(n):s.zoomOut(n),l.isZooming=!0;break;case"Equal":a=e?s.zoomIn(n).zoomIn(n):s.zoomIn(n),l.isZooming=!0;break;case"ArrowLeft":e?(a=s.rotateLeft(r),l.isRotating=!0):(a=s.moveLeft(i),l.isPanning=!0);break;case"ArrowRight":e?(a=s.rotateRight(r),l.isRotating=!0):(a=s.moveRight(i),l.isPanning=!0);break;case"ArrowUp":e?(a=s.rotateUp(o),l.isRotating=!0):(a=s.moveUp(i),l.isPanning=!0);break;case"ArrowDown":e?(a=s.rotateDown(o),l.isRotating=!0):(a=s.moveDown(i),l.isPanning=!0);break;default:return!1}return this.updateViewport(a,this._getTransitionProps(),l),!0}_getTransitionProps(t){const{transition:e}=this;return e&&e.transitionInterpolator?t?{...e,transitionInterpolator:new Z({...t,...e.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:e:j}}class ${constructor(t,e){(0,r.Z)(this,"_viewportProps",void 0),(0,r.Z)(this,"_state",void 0),this._viewportProps=this.applyConstraints(t),this._state=e}getViewportProps(){return this._viewportProps}getState(){return this._state}}var tt=n(75818);class et extends ${constructor(t){const{width:e,height:n,latitude:i,longitude:o,zoom:s,bearing:a=0,pitch:l=0,altitude:c=1.5,position:u=[0,0,0],maxZoom:h=20,minZoom:d=0,maxPitch:f=60,minPitch:A=0,startPanLngLat:p,startZoomLngLat:g,startRotatePos:m,startBearing:y,startPitch:v,startZoom:_,normalize:b=!0}=t;(0,S.Z)(Number.isFinite(o)),(0,S.Z)(Number.isFinite(i)),(0,S.Z)(Number.isFinite(s)),super({width:e,height:n,latitude:i,longitude:o,zoom:s,bearing:a,pitch:l,altitude:c,maxZoom:h,minZoom:d,maxPitch:f,minPitch:A,normalize:b,position:u},{startPanLngLat:p,startZoomLngLat:g,startRotatePos:m,startBearing:y,startPitch:v,startZoom:_}),(0,r.Z)(this,"makeViewport",void 0),this.makeViewport=t.makeViewport}panStart(t){let{pos:e}=t;return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan(t){let{pos:e,startPos:n}=t;const i=this.getState().startPanLngLat||this._unproject(n);if(!i)return this;const r=this.makeViewport(this.getViewportProps()).panByPosition(i,e);return this._getUpdatedState(r)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart(t){let{pos:e}=t;return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate(t){let{pos:e,deltaAngleX:n=0,deltaAngleY:i=0}=t;const{startRotatePos:r,startBearing:o,startPitch:s}=this.getState();if(!r||void 0===o||void 0===s)return this;let a;return a=e?this._getNewRotation(e,r,s,o):{bearing:o+n,pitch:s+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart(t){let{pos:e}=t;return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom(t){let{pos:e,startPos:n,scale:i}=t,{startZoom:r,startZoomLngLat:o}=this.getState();if(o||(r=this.getViewportProps().zoom,o=this._unproject(n)||this._unproject(e)),!o)return this;const{maxZoom:s,minZoom:a}=this.getViewportProps();let l=r+Math.log2(i);l=(0,P.uZ)(l,a,s);const c=this.makeViewport({...this.getViewportProps(),zoom:l});return this._getUpdatedState({zoom:l,...c.panByPosition(o,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(t)}zoomOut(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(1/t)}moveLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([t,0])}moveRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([-t,0])}moveUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,t])}moveDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,-t])}rotateLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing-t})}rotateRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing+t})}rotateUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch+t})}rotateDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch-t})}shortestPathFrom(t){const e=t.getViewportProps(),n={...this.getViewportProps()},{bearing:i,longitude:r}=n;return Math.abs(i-e.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-e.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}applyConstraints(t){const{maxZoom:e,minZoom:n,zoom:i}=t;t.zoom=(0,P.uZ)(i,n,e);const{maxPitch:r,minPitch:o,pitch:s}=t;t.pitch=(0,P.uZ)(s,o,r);const{normalize:a=!0}=t;return a&&Object.assign(t,(0,tt.QA)(t)),t}_zoomFromCenter(t){const{width:e,height:n}=this.getViewportProps();return this.zoom({pos:[e/2,n/2],scale:t})}_panFromCenter(t){const{width:e,height:n}=this.getViewportProps();return this.pan({startPos:[e/2,n/2],pos:[e/2+t[0],n/2+t[1]]})}_getUpdatedState(t){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}_unproject(t){const e=this.makeViewport(this.getViewportProps());return t&&e.unproject(t)}_getNewRotation(t,e,n,i){const r=t[0]-e[0],o=t[1]-e[1],s=t[1],a=e[1],{width:l,height:c}=this.getViewportProps(),u=r/l;let h=0;o>0?Math.abs(c-a)>5&&(h=o/(a-c)*1.2):o<0&&a>5&&(h=1-s/a),h=(0,P.uZ)(h,-1,1);const{minPitch:d,maxPitch:f}=this.getViewportProps();let A=n;return h>0?A=n+h*(f-n):h<0&&(A=n-h*(d-n)),{pitch:A,bearing:i+180*u}}}class nt extends Y{constructor(){super(...arguments),(0,r.Z)(this,"ControllerState",et),(0,r.Z)(this,"transition",{transitionDuration:300,transitionInterpolator:new Z({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})}),(0,r.Z)(this,"dragMode","pan")}setProps(t){t.position=t.position||[0,0,0];const e=this.props;super.setProps(t);(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...t,...this.state}))}}class it extends M{get ViewportType(){return I.Z}get ControllerType(){return nt}}(0,r.Z)(it,"displayName","MapView");var rt=n(58300);const ot=[255,255,255],st=1;let at=0;class lt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.Z)(this,"id",void 0),(0,r.Z)(this,"color",void 0),(0,r.Z)(this,"intensity",void 0),(0,r.Z)(this,"type","ambient");const{color:e=ot}=t,{intensity:n=st}=t;this.id=t.id||"ambient-".concat(at++),this.color=e,this.intensity=n}}var ct=n(431);const ut=[255,255,255],ht=1,dt=[0,0,-1];let ft=0;class At{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.Z)(this,"id",void 0),(0,r.Z)(this,"color",void 0),(0,r.Z)(this,"intensity",void 0),(0,r.Z)(this,"type","directional"),(0,r.Z)(this,"direction",void 0),(0,r.Z)(this,"shadow",void 0);const{color:e=ut}=t,{intensity:n=ht}=t,{direction:i=dt}=t,{_shadow:o=!1}=t;this.id=t.id||"directional-".concat(ft++),this.color=e,this.intensity=n,this.type="directional",this.direction=new ct.Z(i).normalize().toArray(),this.shadow=o}getProjectedLight(t){return this}}var pt=n(12987);class gt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"pass"};(0,r.Z)(this,"id",void 0),(0,r.Z)(this,"gl",void 0),(0,r.Z)(this,"props",void 0);const{id:n}=e;this.id=n,this.gl=t,this.props={...e}}setProps(t){Object.assign(this.props,t)}render(t){}cleanup(){}}var mt=n(28007),yt=n(97756);class vt extends gt{constructor(){super(...arguments),(0,r.Z)(this,"_lastRenderIndex",-1)}render(t){const e=this.gl;return(0,mt.dR)(e,{framebuffer:t.target}),this._drawLayers(t)}_drawLayers(t){const{target:e,moduleParameters:n,viewports:i,views:r,onViewportActive:o,clearStack:s=!0,clearCanvas:a=!0}=t;t.pass=t.pass||"unknown";const l=this.gl;a&&function(t,e){const n=e?e.width:t.drawingBufferWidth,i=e?e.height:t.drawingBufferHeight;(0,mt.dR)(t,{viewport:[0,0,n,i]}),t.clear(16640)}(l,e),s&&(this._lastRenderIndex=-1);const c=[];for(const u of i){const i=r&&r[u.id];null===o||void 0===o||o(u);const s=this._getDrawLayerParams(u,t),a=u.subViewports||[u];for(const r of a){const o=this._drawLayersInViewport(l,{target:e,moduleParameters:n,viewport:r,view:i,pass:t.pass,layers:t.layers},s);c.push(o)}}return c}_getDrawLayerParams(t,e){let{layers:n,pass:i,isPicking:r=!1,layerFilter:o,cullRect:s,effects:a,moduleParameters:l}=e,c=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const u=[],h=_t(this._lastRenderIndex+1),d={layer:n[0],viewport:t,isPicking:r,renderPass:i,cullRect:s},f={};for(let A=0;A<n.length;A++){const e=n[A],r=this._shouldDrawLayer(e,d,o,f),s={shouldDrawLayer:r};r&&!c&&(s.layerRenderIndex=h(e,r),s.moduleParameters=this._getModuleParameters(e,a,i,l),s.layerParameters=this.getLayerParameters(e,A,t)),u[A]=s}return u}_drawLayersInViewport(t,e,n){let{layers:i,moduleParameters:r,pass:o,target:s,viewport:a,view:l}=e;const c=function(t,e){let{moduleParameters:n,target:i,viewport:r}=e;const o=i&&"default-framebuffer"!==i.id,s=n&&n.devicePixelRatio||(0,mt.w)(t),a=o?i.height:t.drawingBufferHeight,l=r;return[l.x*s,a-(l.y+l.height)*s,l.width*s,l.height*s]}(t,{moduleParameters:r,target:s,viewport:a});if(l&&l.props.clear){const e=!0===l.props.clear?{color:!0,depth:!0}:l.props.clear;(0,mt.s8)(t,{scissorTest:!0,scissor:c},(()=>(0,yt.Z)(t,e)))}const u={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};(0,mt.dR)(t,{viewport:c});for(let d=0;d<i.length;d++){const t=i[d],{shouldDrawLayer:e,layerRenderIndex:r,moduleParameters:s,layerParameters:l}=n[d];if(e&&t.props.pickable&&u.pickableCount++,t.isComposite)u.compositeCount++;else if(e){u.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,r),s.viewport=a;try{t._drawLayer({moduleParameters:s,uniforms:{layerIndex:r},parameters:l})}catch(h){t.raiseError(h,"drawing ".concat(t," to ").concat(o))}}}return u}shouldDrawLayer(t){return!0}getModuleParameters(t,e){return null}getLayerParameters(t,e,n){return t.props.parameters}_shouldDrawLayer(t,e,n,i){if(!(t.props.visible&&this.shouldDrawLayer(t)))return!1;e.layer=t;let r=t.parent;for(;r;){if(!r.props.visible||!r.filterSubLayer(e))return!1;e.layer=r,r=r.parent}if(n){const t=e.layer.id;if(t in i||(i[t]=n(e)),!i[t])return!1}return t.activateViewport(e.viewport),!0}_getModuleParameters(t,e,n,i){var r;const o=Object.assign(Object.create((null===(r=t.internalState)||void 0===r?void 0:r.propsInTransition)||t.props),{autoWrapLongitude:t.wrapLongitude,viewport:t.context.viewport,mousePosition:t.context.mousePosition,pickingActive:0,devicePixelRatio:(0,mt.w)(this.gl)});if(e)for(const a of e){var s;Object.assign(o,null===(s=a.getModuleParameters)||void 0===s?void 0:s.call(a,t))}return Object.assign(o,this.getModuleParameters(t,e),i)}}function _t(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={},i=(r,o)=>{const s=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in n){const t=n[l]=n[l]||_t(e[l],e);c=t(r,o),n[a]=t}else Number.isFinite(s)?(c=s+(e[l]||0),n[a]=null):c=t;return o&&c>=t&&(t=c+1),e[a]=c,c};return i}var bt=n(38332),xt=n(79078);class wt extends vt{constructor(t,e){super(t,e),(0,r.Z)(this,"shadowMap",void 0),(0,r.Z)(this,"depthBuffer",void 0),(0,r.Z)(this,"fbo",void 0),this.shadowMap=new rt.Z(t,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new bt.Z(t,{format:33189,width:1,height:1}),this.fbo=new xt.Z(t,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(t){const e=this.fbo;(0,mt.s8)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},(()=>{const n=t.viewports[0],i=(0,mt.w)(this.gl),r=n.width*i,o=n.height*i;r===e.width&&o===e.height||e.resize({width:r,height:o}),super.render({...t,target:e,pass:"shadow"})}))}shouldDrawLayer(t){return!1!==t.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}var Ct=n(18252),Bt=n(18188);const Et=(0,Bt.Z)((function(t){let{viewport:e,center:n}=t;return new pt.Z(e.viewProjectionMatrix).invert().transform(n)})),Tt=(0,Bt.Z)((function(t){let{viewport:e,shadowMatrices:n}=t;const i=[],r=e.pixelUnprojectionMatrix,o=e.isGeospatial?void 0:1,s=[[0,0,o],[e.width,0,o],[0,e.height,o],[e.width,e.height,o],[0,0,-1],[e.width,0,-1],[0,e.height,-1],[e.width,e.height,-1]].map((t=>function(t,e){const[n,i,r]=t,o=(0,tt.CT)([n,i,r],e);if(Number.isFinite(r))return o;return[o[0],o[1],0]}(t,r)));for(const a of n){const t=a.clone().translate(new ct.Z(e.center).negate()),n=s.map((e=>t.transform(e))),r=(new pt.Z).ortho({left:Math.min(...n.map((t=>t[0]))),right:Math.max(...n.map((t=>t[0]))),bottom:Math.min(...n.map((t=>t[1]))),top:Math.max(...n.map((t=>t[1]))),near:Math.min(...n.map((t=>-t[2]))),far:Math.max(...n.map((t=>-t[2])))});i.push(r.multiplyRight(a))}return i})),St=[0,0,0,1],Mt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];const It={name:"shadow",dependencies:[y.Z],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n  if (shadow_uDrawShadowMap) {\n    return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n  }\n  if (shadow_uUseShadowMap) {\n    for (int i = 0; i < max_lights; i++) {\n      if(i < int(shadow_uLightCount)) {\n        vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n        shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n      }\n    }\n  }\n  return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0,  0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n  vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n  float z = dot(rgbaDepth, bitUnpackShift);\n  return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n  if (shadow_uDrawShadowMap) {\n    vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n    rgbaDepth -= rgbaDepth.gbaa * bitMask;\n    return rgbaDepth;\n  }\n  if (shadow_uUseShadowMap) {\n    float shadowAlpha = 0.0;\n    shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n    if(shadow_uLightCount > 1.0) {\n      shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n    }\n    shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n    float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n    return vec4(\n      mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n      blendedAlpha\n    );\n  }\n  return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n    position = shadow_setVertexPosition(geometry.position);\n    ","fs:DECKGL_FILTER_COLOR":"\n    color = shadow_filterShadowColor(color);\n    "},getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"viewport"in t&&(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0)?function(t,e){const{shadowEnabled:n=!0}=t;if(!n||!t.shadowMatrices||!t.shadowMatrices.length)return{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1};const i={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||St,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},r=Et({viewport:t.viewport,center:e.project_uCenter}),o=[],s=Tt({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice();for(let a=0;a<t.shadowMatrices.length;a++){const n=s[a],i=n.clone().translate(new ct.Z(t.viewport.center).negate());e.project_uCoordinateSystem===Ct.Df.LNGLAT&&e.project_uProjectionMode===Ct.zG.WEB_MERCATOR?(s[a]=i,o[a]=r):(s[a]=n.clone().multiplyRight(Mt),o[a]=i.transform(r))}for(let a=0;a<s.length;a++)i["shadow_uViewProjectionMatrices[".concat(a,"]")]=s[a],i["shadow_uProjectCenters[".concat(a,"]")]=o[a],t.shadowMaps&&t.shadowMaps.length>0?i["shadow_uShadowMap".concat(a)]=t.shadowMaps[a]:i["shadow_uShadowMap".concat(a)]=t.dummyShadowMap;return i}(t,e):{}}},Pt={color:[255,255,255],intensity:1},Dt=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],Ft=[0,0,0,200/255];class Lt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.Z)(this,"id","lighting-effect"),(0,r.Z)(this,"props",void 0),(0,r.Z)(this,"shadowColor",Ft),(0,r.Z)(this,"shadow",void 0),(0,r.Z)(this,"ambientLight",void 0),(0,r.Z)(this,"directionalLights",void 0),(0,r.Z)(this,"pointLights",void 0),(0,r.Z)(this,"shadowPasses",[]),(0,r.Z)(this,"shadowMaps",[]),(0,r.Z)(this,"dummyShadowMap",null),(0,r.Z)(this,"programManager",void 0),(0,r.Z)(this,"shadowMatrices",void 0),this.setProps(t)}setProps(t){this.ambientLight=null,this.directionalLights=[],this.pointLights=[];for(const e in t){const n=t[e];switch(n.type){case"ambient":this.ambientLight=n;break;case"directional":this.directionalLights.push(n);break;case"point":this.pointLights.push(n)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some((t=>t.shadow)),this.props=t}preRender(t,e){let{layers:n,layerFilter:i,viewports:r,onViewportActive:o,views:s}=e;if(this.shadow){this.shadowMatrices=this._calculateMatrices(),0===this.shadowPasses.length&&this._createShadowPasses(t),this.programManager||(this.programManager=m.Z.getDefaultProgramManager(t),It&&this.programManager.addDefaultModule(It)),this.dummyShadowMap||(this.dummyShadowMap=new rt.Z(t,{width:1,height:1}));for(let t=0;t<this.shadowPasses.length;t++){this.shadowPasses[t].render({layers:n,layerFilter:i,viewports:r,onViewportActive:o,views:s,moduleParameters:{shadowLightId:t,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}})}}}getModuleParameters(t){const e=this.shadow?{shadowMaps:this.shadowMaps,dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{};return e.lightSources={ambientLight:this.ambientLight,directionalLights:this.directionalLights.map((e=>e.getProjectedLight({layer:t}))),pointLights:this.pointLights.map((e=>e.getProjectedLight({layer:t})))},e}cleanup(){for(const t of this.shadowPasses)t.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(It),this.programManager=null)}_calculateMatrices(){const t=[];for(const e of this.directionalLights){const n=(new pt.Z).lookAt({eye:new ct.Z(e.direction).negate()});t.push(n)}return t}_createShadowPasses(t){for(let e=0;e<this.directionalLights.length;e++){const n=new wt(t);this.shadowPasses[e]=n,this.shadowMaps[e]=n.shadowMap}}_applyDefaultLights(){const{ambientLight:t,pointLights:e,directionalLights:n}=this;t||0!==e.length||0!==n.length||(this.ambientLight=new lt(Pt),this.directionalLights.push(new At(Dt[0]),new At(Dt[1])))}}const Ot=new Lt;class Rt{constructor(){(0,r.Z)(this,"effects",void 0),(0,r.Z)(this,"_resolvedEffects",[]),(0,r.Z)(this,"_defaultEffects",[]),(0,r.Z)(this,"_needsRedraw",void 0),this.effects=[],this._needsRedraw="Initial render",this._setEffects([])}addDefaultEffect(t){const e=this._defaultEffects;if(!e.find((e=>e.id===t.id))){const n=e.findIndex((e=>function(t,e){var n,i;return(null!==(n=t.order)&&void 0!==n?n:1/0)-(null!==(i=e.order)&&void 0!==i?i:1/0)}(e,t)>0));n<0?e.push(t):e.splice(n,0,t),this._setEffects(this.effects)}}setProps(t){"effects"in t&&((0,w.v)(t.effects,this.effects,1)||this._setEffects(t.effects))}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}getEffects(){return this._resolvedEffects}_setEffects(t){const e={};for(const i of this.effects)e[i.id]=i;const n=[];for(const i of t){const t=e[i.id];t&&t!==i?t.setProps?(t.setProps(i.props),n.push(t)):(t.cleanup(),n.push(i)):n.push(i),delete e[i.id]}for(const i in e)e[i].cleanup();this.effects=n,this._resolvedEffects=n.concat(this._defaultEffects),t.some((t=>t instanceof Lt))||this._resolvedEffects.push(Ot),this._needsRedraw="effects changed"}finalize(){for(const t of this._resolvedEffects)t.cleanup();this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}}class kt extends vt{shouldDrawLayer(t){const{operation:e}=t.props;return e.includes("draw")||e.includes("terrain")}}const Ut={blendFunc:[1,0,32771,0],blendEquation:32774};class zt extends vt{constructor(){super(...arguments),(0,r.Z)(this,"pickZ",void 0),(0,r.Z)(this,"_colorEncoderState",null)}render(t){return"pickingFBO"in t?this._drawPickingBuffer(t):super.render(t)}_drawPickingBuffer(t){let{layers:e,layerFilter:n,views:i,viewports:r,onViewportActive:o,pickingFBO:s,deviceRect:{x:a,y:l,width:c,height:u},cullRect:h,effects:d,pass:f="picking",pickZ:A,moduleParameters:p}=t;const g=this.gl;this.pickZ=A;const m=this._resetColorEncoder(A),y=(0,mt.s8)(g,{scissorTest:!0,scissor:[a,l,c,u],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0],...Ut,blend:!A},(()=>super.render({target:s,layers:e,layerFilter:n,views:i,viewports:r,onViewportActive:o,cullRect:h,effects:null===d||void 0===d?void 0:d.filter((t=>t.useInPicking)),pass:f,isPicking:!0,moduleParameters:p})));this._colorEncoderState=null;return{decodePickingColor:m&&Gt.bind(null,m),stats:y}}shouldDrawLayer(t){const{pickable:e,operation:n}=t.props;return e&&n.includes("draw")||n.includes("terrain")||n.includes("mask")}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(t,e,n){const i={...t.props.parameters},{pickable:r,operation:o}=t.props;return this._colorEncoderState?r&&o.includes("draw")&&(Object.assign(i,Ut),i.blend=!0,i.blendColor=function(t,e,n){const{byLayer:i,byAlpha:r}=t;let o,s=i.get(e);s?(s.viewports.push(n),o=s.a):(o=i.size+1,o<=255?(s={a:o,layer:e,viewports:[n]},i.set(e,s),r[o]=s):(c.Z.warn("Too many pickable layers, only picking the first 255")(),o=0));return[0,0,0,o/255]}(this._colorEncoderState,t,n)):i.blend=!1,o.includes("terrain")&&(i.blend=!1),i}_resetColorEncoder(t){return this._colorEncoderState=t?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}}function Gt(t,e){const n=t.byAlpha[e[3]];return n&&{pickedLayer:n.layer,pickedViewports:n.viewports,pickedObjectIndex:n.layer.decodePickingColor(e)}}class Nt{constructor(t){(0,r.Z)(this,"gl",void 0),(0,r.Z)(this,"layerFilter",void 0),(0,r.Z)(this,"drawPickingColors",void 0),(0,r.Z)(this,"drawLayersPass",void 0),(0,r.Z)(this,"pickLayersPass",void 0),(0,r.Z)(this,"renderCount",void 0),(0,r.Z)(this,"_needsRedraw",void 0),(0,r.Z)(this,"renderBuffers",void 0),(0,r.Z)(this,"lastPostProcessEffect",void 0),this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new kt(t),this.pickLayersPass=new zt(t),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(t){this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(t){if(!t.viewports.length)return;const e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,n={layerFilter:this.layerFilter,isPicking:this.drawPickingColors,...t,target:t.target||xt.Z.getDefaultFramebuffer(this.gl)};n.effects&&this._preRender(n.effects,n);const i=this.lastPostProcessEffect?this.renderBuffers[0]:n.target,r=e.render({...n,target:i});n.effects&&this._postRender(n.effects,n),this.renderCount++,(0,u.Z)("deckRenderer.renderLayers",this,r,t)}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}finalize(){const{renderBuffers:t}=this;for(const e of t)e.delete();t.length=0}_preRender(t,e){this.lastPostProcessEffect=null,e.preRenderStats=e.preRenderStats||{};for(const n of t)e.preRenderStats[n.id]=n.preRender(this.gl,e),n.postRender&&(this.lastPostProcessEffect=n.id);this.lastPostProcessEffect&&this._resizeRenderBuffers()}_resizeRenderBuffers(){const{renderBuffers:t}=this;0===t.length&&t.push(new xt.Z(this.gl),new xt.Z(this.gl));for(const e of t)e.resize()}_postRender(t,e){const{renderBuffers:n}=this,i={...e,inputBuffer:n[0],swapBuffer:n[1],target:null};for(const r of t)if(r.postRender){if(r.id===this.lastPostProcessEffect){i.target=e.target,r.postRender(this.gl,i);break}const t=r.postRender(this.gl,i);i.inputBuffer=t,i.swapBuffer=t===n[0]?n[1]:n[0]}}}var Zt=n(56474);const jt={pickedColor:null,pickedObjectIndex:-1};function Vt(t){let{pickedColors:e,decodePickingColor:n,deviceX:i,deviceY:r,deviceRadius:o,deviceRect:s}=t;const{x:a,y:l,width:u,height:h}=s;let d=o*o,f=-1,A=0;for(let c=0;c<h;c++){const t=c+l-r,n=t*t;if(n>d)A+=4*u;else for(let r=0;r<u;r++){if(e[A+3]-1>=0){const t=r+a-i,e=t*t+n;e<=d&&(d=e,f=A)}A+=4}}if(f>=0){const t=e.slice(f,f+4),i=n(t);if(i){const e=Math.floor(f/4/u),n=f/4-e*u;return{...i,pickedColor:t,pickedX:a+n,pickedY:l+e}}c.Z.error("Picked non-existent layer. Is picking buffer corrupt?")()}return jt}function Ht(t){let e,{pickInfo:n,viewports:i,pixelRatio:r,x:o,y:s,z:a}=t,l=i[0];if(i.length>1&&(l=function(t,e){for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.containsPixel(e))return i}return t[0]}((null===n||void 0===n?void 0:n.pickedViewports)||i,{x:o,y:s})),l){const t=[o-l.x,s-l.y];void 0!==a&&(t[2]=a),e=l.unproject(t)}return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:e,devicePixel:n&&"pickedX"in n?[n.pickedX,n.pickedY]:void 0,pixelRatio:r}}function Jt(t){const{pickInfo:e,lastPickedInfo:n,mode:i,layers:r}=t,{pickedColor:o,pickedLayer:s,pickedObjectIndex:a}=e,l=s?[s]:[];if("hover"===i){const t=n.index,e=n.layerId,i=s?s.props.id:null;if(i!==e||a!==t){if(i!==e){const t=r.find((t=>t.props.id===e));t&&l.unshift(t)}n.layerId=i,n.index=a,n.info=null}}const c=Ht(t),u=new Map;return u.set(null,c),l.forEach((t=>{let e={...c};t===s&&(e.color=o,e.index=a,e.picked=!0),e=Wt({layer:t,info:e,mode:i});const r=e.layer;t===s&&"hover"===i&&(n.info=e),u.set(r.id,e),"hover"===i&&r.updateAutoHighlight(e)})),u}function Wt(t){let{layer:e,info:n,mode:i}=t;for(;e&&n;){const t=n.layer||null;n.sourceLayer=t,n.layer=e,n=e.getPickingInfo({info:n,mode:i,sourceLayer:t}),e=e.parent}return n}class Qt{constructor(t){(0,r.Z)(this,"gl",void 0),(0,r.Z)(this,"pickingFBO",void 0),(0,r.Z)(this,"depthFBO",void 0),(0,r.Z)(this,"pickLayersPass",void 0),(0,r.Z)(this,"layerFilter",void 0),(0,r.Z)(this,"lastPickedInfo",void 0),(0,r.Z)(this,"_pickable",!0),this.gl=t,this.pickLayersPass=new zt(t),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"_pickable"in t&&(this._pickable=t._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(t){return this._pickClosestObject(t)}pickObjects(t){return this._pickVisibleObjects(t)}getLastPickedObject(t){let{x:e,y:n,layers:i,viewports:r}=t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info;const s=o&&o.layer&&o.layer.id,a=o&&o.viewport&&o.viewport.id,l=s?i.find((t=>t.id===s)):null,c=a&&r.find((t=>t.id===a))||r[0],u=c&&c.unproject([e-c.x,n-c.y]),h={x:e,y:n,viewport:c,coordinate:u,layer:l};return{...o,...h}}_resizeBuffer(){var t,e;const{gl:n}=this;if(!this.pickingFBO&&(this.pickingFBO=new xt.Z(n),xt.Z.isSupported(n,{colorBufferFloat:!0}))){const t=new xt.Z(n);t.attach({36064:new rt.Z(n,{format:(0,mt.D0)(n)?34836:6408,type:5126})}),this.depthFBO=t}null===(t=this.pickingFBO)||void 0===t||t.resize({width:n.canvas.width,height:n.canvas.height}),null===(e=this.depthFBO)||void 0===e||e.resize({width:n.canvas.width,height:n.canvas.height})}_getPickable(t){if(!1===this._pickable)return null;const e=t.filter((t=>this.pickLayersPass.shouldDrawLayer(t)&&!t.isComposite));return e.length?e:null}_pickClosestObject(t){let{layers:e,views:n,viewports:i,x:r,y:o,radius:s=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:u,effects:h}=t;const d=this._getPickable(e),f=(0,mt.w)(this.gl);if(!d)return{result:[],emptyInfo:Ht({viewports:i,x:r,y:o,pixelRatio:f})};this._resizeBuffer();const A=(0,mt.JY)(this.gl,[r,o],!0),p=[A.x+Math.floor(A.width/2),A.y+Math.floor(A.height/2)],g=Math.round(s*f),{width:m,height:y}=this.pickingFBO,v=this._getPickingRect({deviceX:p[0],deviceY:p[1],deviceRadius:g,deviceWidth:m,deviceHeight:y}),_={x:r-s,y:o-s,width:2*s+1,height:2*s+1};let b;const x=[],w=new Set;for(let C=0;C<a;C++){let t,e;if(v){t=Vt({...this._drawAndSample({layers:d,views:n,viewports:i,onViewportActive:u,deviceRect:v,cullRect:_,effects:h,pass:"picking:".concat(l)}),deviceX:p[0],deviceY:p[1],deviceRadius:g,deviceRect:v})}else t={pickedColor:null,pickedObjectIndex:-1};if(t.pickedLayer&&c&&this.depthFBO){const{pickedColors:r}=this._drawAndSample({layers:[t.pickedLayer],views:n,viewports:i,onViewportActive:u,deviceRect:{x:t.pickedX,y:t.pickedY,width:1,height:1},cullRect:_,effects:h,pass:"picking:".concat(l,":z")},!0);r[3]&&(e=r[0])}t.pickedLayer&&C+1<a&&(w.add(t.pickedLayer),t.pickedLayer.disablePickingIndex(t.pickedObjectIndex)),b=Jt({pickInfo:t,lastPickedInfo:this.lastPickedInfo,mode:l,layers:d,viewports:i,x:r,y:o,z:e,pixelRatio:f});for(const n of b.values())n.layer&&x.push(n);if(!t.pickedColor)break}for(const C of w)C.restorePickingColors();return{result:x,emptyInfo:b.get(null)}}_pickVisibleObjects(t){let{layers:e,views:n,viewports:i,x:r,y:o,width:s=1,height:a=1,mode:l="query",maxObjects:u=null,onViewportActive:h,effects:d}=t;const f=this._getPickable(e);if(!f)return[];this._resizeBuffer();const A=(0,mt.w)(this.gl),p=(0,mt.JY)(this.gl,[r,o],!0),g=p.x,m=p.y+p.height,y=(0,mt.JY)(this.gl,[r+s,o+a],!0),v=y.x+y.width,_=y.y,b={x:g,y:_,width:v-g,height:m-_},x=function(t){let{pickedColors:e,decodePickingColor:n}=t;const i=new Map;if(e)for(let r=0;r<e.length;r+=4)if(e[r+3]-1>=0){const t=e.slice(r,r+4),o=t.join(",");if(!i.has(o)){const e=n(t);e?i.set(o,{...e,color:t}):c.Z.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Array.from(i.values())}(this._drawAndSample({layers:f,views:n,viewports:i,onViewportActive:h,deviceRect:b,cullRect:{x:r,y:o,width:s,height:a},effects:d,pass:"picking:".concat(l)})),w=new Map,C=Number.isFinite(u);for(let c=0;c<x.length;c++){var B;if(C&&u&&w.size>=u)break;const t=x[c];let e={color:t.pickedColor,layer:null,index:t.pickedObjectIndex,picked:!0,x:r,y:o,pixelRatio:A};e=Wt({layer:t.pickedLayer,info:e,mode:l});const n=null!==(B=e.object)&&void 0!==B?B:"".concat(e.layer.id,"[").concat(e.index,"]");w.has(n)||w.set(n,e)}return Array.from(w.values())}_drawAndSample(t){let{layers:e,views:n,viewports:i,onViewportActive:r,deviceRect:o,cullRect:s,effects:a,pass:l}=t,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const u=c?this.depthFBO:this.pickingFBO,h={layers:e,layerFilter:this.layerFilter,views:n,viewports:i,onViewportActive:r,pickingFBO:u,deviceRect:o,cullRect:s,effects:a,pass:l,pickZ:c,preRenderStats:{}};for(const y of a)y.useInPicking&&(h.preRenderStats[y.id]=y.preRender(this.gl,h));const{decodePickingColor:d}=this.pickLayersPass.render(h),{x:f,y:A,width:p,height:g}=o,m=new(c?Float32Array:Uint8Array)(p*g*4);return(0,Zt.z6)(u,{sourceX:f,sourceY:A,sourceWidth:p,sourceHeight:g,target:m}),{pickedColors:m,decodePickingColor:d}}_getPickingRect(t){let{deviceX:e,deviceY:n,deviceRadius:i,deviceWidth:r,deviceHeight:o}=t;const s=Math.max(0,e-i),a=Math.max(0,n-i),l=Math.min(r,e+i+1)-s,c=Math.min(o,n+i+1)-a;return l<=0||c<=0?null:{x:s,y:a,width:l,height:c}}}const Kt={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"};class qt{constructor(t){(0,r.Z)(this,"el",null),(0,r.Z)(this,"isVisible",!1);const e=t.parentElement;e&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Kt),e.appendChild(this.el))}setTooltip(t,e,n){const i=this.el;if(i){if("string"===typeof t)i.innerText=t;else{if(!t)return this.isVisible=!1,void(i.style.display="none");t.text&&(i.innerText=t.text),t.html&&(i.innerHTML=t.html),t.className&&(i.className=t.className)}this.isVisible=!0,i.style.display="block",i.style.transform="translate(".concat(e,"px, ").concat(n,"px)"),t&&"object"===typeof t&&"style"in t&&Object.assign(i.style,t.style)}}remove(){this.el&&(this.el.remove(),this.el=null)}}var Xt=n(28321),Yt=n(11821),$t=n(29518);const te={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){const e=t[0],n=t[t.length-1];return"{"===e&&"}"===n||"["===e&&"]"===n},parseTextSync:JSON.parse};const ee=function(){const t="8.9.36",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error("deck.gl - multiple versions detected: ".concat(e," vs ").concat(t));return e||(c.Z.log(1,"deck.gl ".concat(t))(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:c.Z,_registerLoggers:u.z},(0,Yt.fh)([te,[$t.S,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}();var ne=n(93594),ie=n(48546),re=n(81301),oe=n(35572),se=n(12308),ae=n(70353);class le extends oe.Z{get[Symbol.toStringTag](){return"Query"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(0,mt.D0)(t),i=(0,se.ag)(t,ae.h.TIMER_QUERY);let r=n||i;for(const o of e)switch(o){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:(0,re.h)(!1)}return r}constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery(){let{conservative:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.begin(t?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;let e=0;return this._pollingPromise=new Promise(((n,i)=>{const r=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):e++>t?(i("Timed out"),this._pollingPromise=null):requestAnimationFrame(r)};requestAnimationFrame(r)})),this._pollingPromise}_createHandle(){return le.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const ce=(0,n(11515).Z)()&&"undefined"!==typeof document;let ue=0;class he{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{onCreateContext:e=(t=>(0,mt.s9)(t)),onAddHTML:n=null,onInitialize:i=(()=>{}),onRender:r=(()=>{}),onFinalize:o=(()=>{}),onError:s,gl:a=null,glOptions:l={},debug:c=!1,createFramebuffer:u=!1,autoResizeViewport:h=!0,autoResizeDrawingBuffer:d=!0,stats:f=ie.lR.get("animation-loop-".concat(ue++))}=t;let{useDevicePixels:A=!0}=t;"useDevicePixelRatio"in t&&(mt.cM.deprecated("useDevicePixelRatio","useDevicePixels")(),A=t.useDevicePixelRatio),this.props={onCreateContext:e,onAddHTML:n,onInitialize:i,onRender:r,onFinalize:o,onError:s,gl:a,glOptions:l,debug:c,createFramebuffer:u},this.gl=a,this.needsRedraw=null,this.timeline=null,this.stats=f,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:h,autoResizeDrawingBuffer:d,useDevicePixels:A}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(t){return(0,re.h)("string"===typeof t),this.needsRedraw=this.needsRedraw||t,this}setProps(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}start(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._running)return this;this._running=!0;const e=this._getPageLoadPromise().then((()=>!this._running||this._initialized?null:(this._createWebGLContext(t),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=le.isSupported(this.gl,["timers"])?new le(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps)))).then((t=>{this._running&&(this._addCallbackData(t||{}),!1!==t&&this._startLoop())}));return this.props.onError&&e.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise((t=>{this._resolveNextFrame=t}))),this._nextFramePromise}async toDataURL(){return this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.gl.canvas.toDataURL()}isContextLost(){return this.gl.isContextLost()}onCreateContext(){return this.props.onCreateContext(...arguments)}onInitialize(){return this.props.onInitialize(...arguments)}onRender(){return this.props.onRender(...arguments)}onFinalize(){return this.props.onFinalize(...arguments)}getHTMLControlValue(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=document.getElementById(t);return n?Number(n.value):e}setViewParameters(){return mt.cM.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const t=()=>{this._running&&(this.redraw(),this._animationFrameId=this._requestAnimationFrame(t))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(t)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=ce?new Promise(((t,e)=>{ce&&"complete"===document.readyState?t(document):window.addEventListener("load",(()=>{t(document)}))})):Promise.resolve({})),this._pageLoadPromise}_setDisplay(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_cancelAnimationFrame(t){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(t):(e=t,"undefined"!==typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e));var e}_requestAnimationFrame(t){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(t):(e=t,"undefined"!==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60));var e}_renderFrame(){this.display?this.display._renderFrame(...arguments):this.onRender(...arguments)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:t,height:e,aspect:n}=this._getSizeAndAspect();t===this.animationProps.width&&e===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),n!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=e,this.animationProps.aspect=n,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(t){"object"===typeof t&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}_createWebGLContext(t){if(this.offScreen=t.canvas&&"undefined"!==typeof OffscreenCanvas&&t.canvas instanceof OffscreenCanvas,t=Object.assign({},t,this.props.glOptions),this.gl=this.props.gl?(0,mt.yW)(this.props.gl,t):this.onCreateContext(t),!(0,mt.UF)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(0,mt.kL)(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";const e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",t.appendChild(this.gl.canvas),t.appendChild(e);const n=this.props.onAddHTML(e);n&&(e.innerHTML=n)}}_getSizeAndAspect(){const t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight;let n=1;const{canvas:i}=this.gl;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:t>0&&e>0&&(n=t/e),{width:t,height:e,aspect:n}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&(0,mt.aQ)(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new xt.Z(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:t}=this.gl;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}_onMouseleave(t){this.animationProps._mousePosition=null}}var de=n(48331);function fe(){}const Ae={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,glOptions:{},parameters:{},parent:null,gl:null,canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,onWebGLInitialized:fe,onResize:fe,onViewStateChange:fe,onInteractionStateChange:fe,onBeforeRender:fe,onAfterRender:fe,onLoad:fe,onError:t=>c.Z.error(t.message,t.cause)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:t=>{let{isDragging:e}=t;return e?"grabbing":"grab"},getTooltip:null,debug:!1,drawPickingColors:!1};class pe{constructor(t){(0,r.Z)(this,"props",void 0),(0,r.Z)(this,"width",0),(0,r.Z)(this,"height",0),(0,r.Z)(this,"userData",{}),(0,r.Z)(this,"canvas",null),(0,r.Z)(this,"viewManager",null),(0,r.Z)(this,"layerManager",null),(0,r.Z)(this,"effectManager",null),(0,r.Z)(this,"deckRenderer",null),(0,r.Z)(this,"deckPicker",null),(0,r.Z)(this,"eventManager",null),(0,r.Z)(this,"tooltip",null),(0,r.Z)(this,"metrics",void 0),(0,r.Z)(this,"animationLoop",void 0),(0,r.Z)(this,"stats",void 0),(0,r.Z)(this,"viewState",void 0),(0,r.Z)(this,"cursorState",void 0),(0,r.Z)(this,"_needsRedraw",void 0),(0,r.Z)(this,"_pickRequest",void 0),(0,r.Z)(this,"_lastPointerDownInfo",null),(0,r.Z)(this,"_metricsCounter",void 0),(0,r.Z)(this,"_onPointerMove",(t=>{const{_pickRequest:e}=this;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;{const n=t.offsetCenter;if(!n)return;e.x=n.x,e.y=n.y,e.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t})),(0,r.Z)(this,"_onEvent",(t=>{const e=Ct.FP[t.type],n=t.offsetCenter;if(!e||!n||!this.layerManager)return;const i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),{layer:o}=r,s=o&&(o[e.handler]||o.props[e.handler]),a=this.props[e.handler];let l=!1;s&&(l=s.call(o,r,t)),!l&&a&&a(r,t)})),(0,r.Z)(this,"_onPointerDown",(t=>{const e=t.offsetCenter,n=this._pick("pickObject","pickObject Time",{x:e.x,y:e.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=n.result[0]||n.emptyInfo})),this.props={...Ae,...t},t=this.props,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this.cursorState={isHovering:!1,isDragging:!1},t.viewState&&t.initialViewState&&c.Z.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,ne.Z)()&&c.Z.warn("IE 11 is not supported")(),this.viewState=t.initialViewState,t.gl||"undefined"!==typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new d.Z({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),t._typedArrayManagerProps&&Xt.Z.setOptions(t._typedArrayManagerProps),this.animationLoop.start()}finalize(){var t,e,n,i,r,o,s,a,l;(null===(t=this.animationLoop)||void 0===t||t.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,null===(e=this.layerManager)||void 0===e||e.finalize(),this.layerManager=null,null===(n=this.viewManager)||void 0===n||n.finalize(),this.viewManager=null,null===(i=this.effectManager)||void 0===i||i.finalize(),this.effectManager=null,null===(r=this.deckRenderer)||void 0===r||r.finalize(),this.deckRenderer=null,null===(o=this.deckPicker)||void 0===o||o.finalize(),this.deckPicker=null,null===(s=this.eventManager)||void 0===s||s.destroy(),this.eventManager=null,null===(a=this.tooltip)||void 0===a||a.remove(),this.tooltip=null,this.props.canvas||this.props.gl||!this.canvas)||(null===(l=this.canvas.parentElement)||void 0===l||l.removeChild(this.canvas),this.canvas=null)}setProps(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&c.Z.removed("onLayerHover","onHover")(),"onLayerClick"in t&&c.Z.removed("onLayerClick","onClick")(),t.initialViewState&&!(0,w.v)(this.props.initialViewState,t.initialViewState,3)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);const e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);const n=this.viewManager.needsRedraw(t),i=this.layerManager.needsRedraw(t),r=this.effectManager.needsRedraw(t),o=this.deckRenderer.needsRedraw(t);return e=e||n||i||r||o,e}redraw(t){if(!this.layerManager)return;let e=this.needsRedraw({clearRedrawFlags:!0});e=t||e,e&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}get isInitialized(){return null!==this.viewManager}getViews(){return(0,S.Z)(this.viewManager),this.viewManager.views}getViewports(t){return(0,S.Z)(this.viewManager),this.viewManager.getViewports(t)}getCanvas(){return this.canvas}pickObject(t){const e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}pickMultipleObjects(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}pickObjects(t){return this._pick("pickObjects","pickObjects Time",t)}_addResources(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(const n in t)this.layerManager.resourceManager.add({resourceId:n,data:t[n],forceUpdate:e})}_removeResources(t){for(const e of t)this.layerManager.resourceManager.remove(e)}_addDefaultEffect(t){this.effectManager.addDefaultEffect(t)}_pick(t,e,n){(0,S.Z)(this.deckPicker);const{stats:i}=this;i.get("Pick Count").incrementCount(),i.get(e).timeStart();const r=this.deckPicker[t]({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...n});return i.get(e).timeEnd(),r}_createCanvas(t){let e=t.canvas;if("string"===typeof e&&(e=document.getElementById(e),(0,S.Z)(e)),!e){e=document.createElement("canvas"),e.id=t.id||"deckgl-overlay";(t.parent||document.body).appendChild(e)}return Object.assign(e.style,t.style),e}_setCanvasSize(t){if(!this.canvas)return;const{width:e,height:n}=t;if(e||0===e){const t=Number.isFinite(e)?"".concat(e,"px"):e;this.canvas.style.width=t}if(n||0===n){var i;const e=Number.isFinite(n)?"".concat(n,"px"):n;this.canvas.style.position=(null===(i=t.style)||void 0===i?void 0:i.position)||"absolute",this.canvas.style.height=e}}_updateCanvasSize(){var t,e;const{canvas:n}=this;if(!n)return;const i=null!==(t=n.clientWidth)&&void 0!==t?t:n.width,r=null!==(e=n.clientHeight)&&void 0!==e?e:n.height;var o,s;i===this.width&&r===this.height||(this.width=i,this.height=r,null===(o=this.viewManager)||void 0===o||o.setProps({width:i,height:r}),null===(s=this.layerManager)||void 0===s||s.activateViewport(this.getViewports()[0]),this.props.onResize({width:i,height:r}))}_createAnimationLoop(t){const{width:e,height:n,gl:i,glOptions:r,debug:o,onError:s,onBeforeRender:a,onAfterRender:l,useDevicePixels:c}=t;return new he({width:e,height:n,useDevicePixels:c,autoResizeDrawingBuffer:!i,autoResizeViewport:!1,gl:i,onCreateContext:t=>(0,mt.s9)({...r,...t,canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()}),onInitialize:t=>this._setGLContext(t.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:a,onAfterRender:l,onError:s})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let t=this.props.views||[new it({id:"default-view"})];return t=Array.isArray(t)?t:[t],t.length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}_onContextLost(){const{onError:t}=this.props;this.animationLoop&&t&&t(new Error("WebGL context is lost"))}_pickAndCallback(){const{_pickRequest:t}=this;if(t.event){const{result:n,emptyInfo:i}=this._pick("pickObject","pickObject Time",t);this.cursorState.isHovering=n.length>0;let r=i,o=!1;for(const s of n){var e;r=s,o=(null===(e=s.layer)||void 0===e?void 0:e.onHover(s,t.event))||o}if(!o&&this.props.onHover&&this.props.onHover(r,t.event),this.props.getTooltip&&this.tooltip){const t=this.props.getTooltip(r);this.tooltip.setTooltip(t,r.x,r.y)}t.event=null}}_updateCursor(){const t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.cursorState))}_setGLContext(t){if(this.layerManager)return;this.canvas||(this.canvas=t.canvas,(0,mt.yW)(t,{enable:!0,copyState:!0})),this.tooltip=new qt(this.canvas),(0,mt.dR)(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);const e=new a;e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new de.Q(this.props.parent||t.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const i in Ct.FP)this.eventManager.on(i,this._onEvent);this.viewManager=new C({timeline:e,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const n=this.viewManager.getViewports()[0];this.layerManager=new x(t,{deck:this,stats:this.stats,viewport:n,timeline:e}),this.effectManager=new Rt,this.deckRenderer=new Nt(t),this.deckPicker=new Qt(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,e){const{gl:n}=this.layerManager.context;(0,mt.dR)(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",effects:this.effectManager.getEffects(),...e}),this.props.onAfterRender({gl:n})}_onRenderFrame(t){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),c.Z.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(t){const e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState={...this.viewState,[t.viewId]:e},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(t){this.cursorState.isDragging=t.isDragging||!1,this.props.onInteractionStateChange(t)}_getFrameStats(){const{stats:t}=this;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();const e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:t,stats:e}=this;t.fps=e.get("frameRate").getHz(),t.setPropsTime=e.get("setProps Time").time,t.updateAttributesTime=e.get("Update Attributes").time,t.framesRedrawn=e.get("Redraw Count").count,t.pickTime=e.get("pickObject Time").time+e.get("pickMultipleObjects Time").time+e.get("pickObjects Time").time,t.pickCount=e.get("Pick Count").count,t.gpuTime=e.get("GPU Time").time,t.cpuTime=e.get("CPU Time").time,t.gpuTimePerFrame=e.get("GPU Time").getAverageTime(),t.cpuTimePerFrame=e.get("CPU Time").getAverageTime();const n=ie.lR.get("Memory Usage");t.bufferMemory=n.get("Buffer Memory").count,t.textureMemory=n.get("Texture Memory").count,t.renderbufferMemory=n.get("Renderbuffer Memory").count,t.gpuMemory=n.get("GPU Memory").count}}(0,r.Z)(pe,"defaultProps",Ae),(0,r.Z)(pe,"VERSION",ee);const ge="undefined"!==typeof window?i.useLayoutEffect:i.useEffect;function me(t,e){for(;t;){if(t===e)return!0;t=Object.getPrototypeOf(t)}return!1}var ye=n(90031);const ve={position:"absolute",zIndex:-1};function _e(t,e){if("function"===typeof t)return t(e);if(Array.isArray(t))return t.map((t=>_e(t,e)));if(be(t)){if(function(t){var e;return null===(e=t.props)||void 0===e?void 0:e.mapStyle}(t))return e.style=ve,(0,i.cloneElement)(t,e);if(function(t){const e=t.type;return e&&e.deckGLViewProps}(t))return(0,i.cloneElement)(t,e)}return t}function be(t){return t&&"object"===typeof t&&"type"in t||!1}function xe(t){if("function"===typeof t)return(0,i.createElement)(M,{},t);if(Array.isArray(t))return t.map(xe);if(be(t)){if(t.type===i.Fragment)return xe(t.props.children);if(me(t.type,M))return t}return t}const we={mixBlendMode:null};function Ce(t){t.redrawReason&&(t.deck._drawLayers(t.redrawReason),t.redrawReason=null)}const Be=(0,i.forwardRef)(((t,e)=>{const[n,r]=(0,i.useState)(0),o=(0,i.useRef)({control:null,version:n,forceUpdate:()=>r((t=>t+1))}).current,s=(0,i.useRef)(null),a=(0,i.useRef)(null),l=(0,i.useMemo)((()=>function(t){let{children:e,layers:n=[],views:r=null}=t;const o=[],s=[],a={};return i.Children.forEach(xe(e),(t=>{if(be(t)){const e=t.type;if(me(e,ye.Z)){const n=function(t,e){const n={},i=t.defaultProps||{};for(const r in e)i[r]!==e[r]&&(n[r]=e[r]);return new t(n)}(e,t.props);s.push(n)}else o.push(t);if(me(e,M)&&e!==M&&t.props.id){const n=new e(t.props);a[n.id]=n}}else t&&o.push(t)})),Object.keys(a).length>0&&(Array.isArray(r)?r.forEach((t=>{a[t.id]=t})):r&&(a[r.id]=r),r=Object.values(a)),n=s.length>0?[...s,...n]:n,{layers:n,children:o,views:r}}(t)),[t.layers,t.views,t.children]);let c=!0;const u=e=>{var n;return c&&t.viewState?(o.viewStateUpdateRequested=e,null):(o.viewStateUpdateRequested=null,null===(n=t.onViewStateChange)||void 0===n?void 0:n.call(t,e))},h=e=>{var n;c?o.interactionStateUpdateRequested=e:(o.interactionStateUpdateRequested=null,null===(n=t.onInteractionStateChange)||void 0===n||n.call(t,e))},d=(0,i.useMemo)((()=>{const e={...t,style:null,width:"100%",height:"100%",parent:s.current,canvas:a.current,layers:l.layers,views:l.views,onViewStateChange:u,onInteractionStateChange:h};return delete e._customRender,o.deck&&o.deck.setProps(e),e}),[t]);(0,i.useEffect)((()=>{const e=t.Deck||pe;return o.deck=function(t,e,n){const i=new e({...n,_customRender:e=>{t.redrawReason=e;const n=i.getViewports();t.lastRenderedViewports!==n?t.forceUpdate():Ce(t)}});return i}(o,e,{...d,parent:s.current,canvas:a.current}),()=>{var t;return null===(t=o.deck)||void 0===t?void 0:t.finalize()}}),[]),ge((()=>{Ce(o);const{viewStateUpdateRequested:t,interactionStateUpdateRequested:e}=o;t&&u(t),e&&h(e)})),(0,i.useImperativeHandle)(e,(()=>function(t){return{get deck(){return t.deck},pickObject:e=>t.deck.pickObject(e),pickMultipleObjects:e=>t.deck.pickMultipleObjects(e),pickObjects:e=>t.deck.pickObjects(e)}}(o)),[]);const f=o.deck&&o.deck.isInitialized?o.deck.getViewports():void 0,{ContextProvider:A,width:p,height:g,id:m,style:y}=t,{containerStyle:v,canvasStyle:_}=(0,i.useMemo)((()=>function(t){let{width:e,height:n,style:i}=t;const r={position:"absolute",zIndex:0,left:0,top:0,width:e,height:n},o={left:0,top:0};if(i)for(const s in i)s in we?o[s]=i[s]:r[s]=i[s];return{containerStyle:r,canvasStyle:o}}({width:p,height:g,style:y})),[p,g,y]);if(!o.viewStateUpdateRequested&&o.lastRenderedViewports===f||o.version!==n){o.lastRenderedViewports=f,o.version=n;const t=function(t){let{children:e,deck:n,ContextProvider:r}=t;const{viewManager:o}=n||{};if(!o||!o.views.length)return[];const s={},a=o.views[0].id;for(const i of e){let t=a,e=i;be(i)&&me(i.type,M)&&(t=i.props.id||a,e=i.props.children);const n=o.getViewport(t),r=o.getViewState(t);if(n){r.padding=n.padding;const{x:i,y:o,width:a,height:l}=n;e=_e(e,{x:i,y:o,width:a,height:l,viewport:n,viewState:r}),s[t]||(s[t]={viewport:n,children:[]}),s[t].children.push(e)}}return Object.keys(s).map((t=>{const{viewport:e,children:o}=s[t],{x:a,y:l,width:c,height:u}=e,h={position:"absolute",left:a,top:l,width:c,height:u},d="view-".concat(t),f=(0,i.createElement)("div",{key:d,id:d,style:h},...o);if(r){const o={viewport:e,container:n.canvas.offsetParent,eventManager:n.eventManager,onViewStateChange:e=>{e.viewId=t,n._onViewStateChange(e)}};return(0,i.createElement)(r,{key:d,value:o},f)}return f}))}({children:l.children,deck:o.deck,ContextProvider:A}),e=(0,i.createElement)("canvas",{key:"canvas",id:m||"deckgl-overlay",ref:a,style:_});o.control=(0,i.createElement)("div",{id:"".concat(m||"deckgl","-wrapper"),ref:s,style:v},[e,t])}return c=!1,o.control}));Be.defaultProps=pe.defaultProps;const Ee=Be},78788:(t,e,n)=>{"use strict";n.d(e,{D0:()=>l,Ew:()=>c,Kn:()=>o,Lj:()=>u,Os:()=>d,Ss:()=>s,TW:()=>a,zH:()=>h});const i=t=>"boolean"===typeof t,r=t=>"function"===typeof t,o=t=>null!==t&&"object"===typeof t,s=t=>o(t)&&t.constructor==={}.constructor,a=t=>t&&"function"===typeof t[Symbol.iterator],l=t=>t&&"function"===typeof t[Symbol.asyncIterator],c=t=>"undefined"!==typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,u=t=>"undefined"!==typeof Blob&&t instanceof Blob,h=t=>t&&"object"===typeof t&&t.isBuffer,d=t=>(t=>"undefined"!==typeof ReadableStream&&t instanceof ReadableStream||o(t)&&r(t.tee)&&r(t.cancel)&&r(t.getReader))(t)||(t=>o(t)&&r(t.read)&&r(t.pipe)&&i(t.readable))(t)},65959:(t,e,n)=>{"use strict";n.d(e,{z:()=>q});var i=n(78788),r=n(35669),o=n(97385),s=n(73599);const a="3.2.13";var l=n(89596),c=n(64649);class u{}const h=new Map;function d(t){(0,s.h)(t.source&&!t.url||!t.source&&t.url);let e=h.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return f((e=t,"try {\n  importScripts('".concat(e,"');\n} catch (error) {\n  console.error(error);\n  throw error;\n}")));var e}(t.url),h.set(t.url,e)),t.source&&(e=f(t.source),h.set(t.source,e))),(0,s.h)(e),e}function f(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function A(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;const i=n||new Set;if(t){if(p(t))i.add(t);else if(p(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===typeof t)for(const r in t)A(t[r],e,i)}else;return void 0===n?Array.from(i):[]}function p(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!==typeof MessagePort&&t instanceof MessagePort||("undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}const g=()=>{};class m{static isSupported(){return"undefined"!==typeof Worker&&l.jU||"undefined"!==typeof u&&!l.jU}constructor(t){(0,c.Z)(this,"name",void 0),(0,c.Z)(this,"source",void 0),(0,c.Z)(this,"url",void 0),(0,c.Z)(this,"terminated",!1),(0,c.Z)(this,"worker",void 0),(0,c.Z)(this,"onMessage",void 0),(0,c.Z)(this,"onError",void 0),(0,c.Z)(this,"_loadableURL","");const{name:e,source:n,url:i}=t;(0,s.h)(n||i),this.name=e,this.source=n,this.url=i,this.onMessage=g,this.onError=t=>console.log(t),this.worker=l.jU?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=g,this.onError=g,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||A(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+="worker ".concat(this.name," from ").concat(this.url,". "),t.message&&(e+="".concat(t.message," in ")),t.lineno&&(e+=":".concat(t.lineno,":").concat(t.colno)),new Error(e)}_createBrowserWorker(){this._loadableURL=d({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}_createNodeWorker(){let t;if(this.url){const e=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);t=new u(e,{eval:!1})}else{if(!this.source)throw new Error("no worker");t=new u(this.source,{eval:!0})}return t.on("message",(t=>{this.onMessage(t)})),t.on("error",(t=>{this.onError(t)})),t.on("exit",(t=>{})),t}}class y{constructor(t,e){(0,c.Z)(this,"name",void 0),(0,c.Z)(this,"workerThread",void 0),(0,c.Z)(this,"isRunning",!0),(0,c.Z)(this,"result",void 0),(0,c.Z)(this,"_resolve",(()=>{})),(0,c.Z)(this,"_reject",(()=>{})),this.name=t,this.workerThread=e,this.result=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){(0,s.h)(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){(0,s.h)(this.isRunning),this.isRunning=!1,this._reject(t)}}class v{static isSupported(){return m.isSupported()}constructor(t){(0,c.Z)(this,"name","unnamed"),(0,c.Z)(this,"source",void 0),(0,c.Z)(this,"url",void 0),(0,c.Z)(this,"maxConcurrency",1),(0,c.Z)(this,"maxMobileConcurrency",1),(0,c.Z)(this,"onDebug",(()=>{})),(0,c.Z)(this,"reuseWorkers",!0),(0,c.Z)(this,"props",{}),(0,c.Z)(this,"jobQueue",[]),(0,c.Z)(this,"idleQueue",[]),(0,c.Z)(this,"count",0),(0,c.Z)(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach((t=>t.destroy())),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}async startJob(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e,n)=>t.done(n),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(t,e)=>t.error(e);const i=new Promise((i=>(this.jobQueue.push({name:t,onMessage:e,onError:n,onStart:i}),this)));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const t=this._getAvailableWorker();if(!t)return;const e=this.jobQueue.shift();if(e){this.onDebug({message:"Starting job",name:e.name,workerThread:t,backlog:this.jobQueue.length});const n=new y(e.name,t);t.onMessage=t=>e.onMessage(n,t.type,t.payload),t.onError=t=>e.onError(n,t),e.onStart(n);try{await n.result}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const t="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new m({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return l.tq?this.maxMobileConcurrency:this.maxConcurrency}}const _={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class b{static isSupported(){return m.isSupported()}static getWorkerFarm(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b._workerFarm=b._workerFarm||new b({}),b._workerFarm.setProps(t),b._workerFarm}constructor(t){(0,c.Z)(this,"props",void 0),(0,c.Z)(this,"workerPools",new Map),this.props={..._},this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:n,url:i}=t;let r=this.workerPools.get(e);return r||(r=new v({name:e,source:n,url:i}),r.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}(0,c.Z)(b,"_workerFarm",void 0);const x="latest";async function w(t,e,n,i,r){const o=t.id,a=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e[t.id]||{},i="".concat(t.id,"-worker.js");let r=n.workerUrl;if(r||"compression"!==t.id||(r=e.workerUrl),"test"===e._workerType&&(r="modules/".concat(t.module,"/dist/").concat(i)),!r){let e=t.version;"latest"===e&&(e=x);const n=e?"@".concat(e):"";r="https://unpkg.com/@loaders.gl/".concat(t.module).concat(n,"/dist/").concat(i)}return(0,s.h)(r),r}(t,n),l=b.getWorkerFarm(n).getWorkerPool({name:o,url:a});n=JSON.parse(JSON.stringify(n)),i=JSON.parse(JSON.stringify(i||{}));const c=await l.startJob("process-on-worker",C.bind(null,r));c.postMessage("process",{input:e,options:n,context:i});const u=await c.result;return await u.result}async function C(t,e,n,i){switch(n){case"done":e.done(i);break;case"error":e.error(new Error(i.error));break;case"process":const{id:o,input:s,options:a}=i;try{const n=await t(s,a);e.postMessage("done",{id:o,result:n})}catch(r){const t=r instanceof Error?r.message:"unknown error";e.postMessage("error",{id:o,error:t})}break;default:console.warn("parse-with-worker unknown message ".concat(n))}}n(72709);function B(t){return t&&"object"===typeof t&&t.isBuffer}function E(t){if(B(t))return function(t){if(B(t))return new Uint8Array(t.buffer,t.byteOffset,t.length).slice().buffer;return t}(t);if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return 0===t.byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if("string"===typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"===typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}async function T(t){const e=[];for await(const n of t)e.push(n);return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e.map((t=>t instanceof ArrayBuffer?new Uint8Array(t):t)),r=i.reduce(((t,e)=>t+e.byteLength),0),o=new Uint8Array(r);let s=0;for(const a of i)o.set(a,s),s+=a.byteLength;return o.buffer}(...e)}const S=262144;const M=262144;const I=1048576;var P=n(27759);function D(t,e){return P.jU?async function*(t,e){const n=t.getReader();let i;try{for(;;){const t=i||n.read();null!==e&&void 0!==e&&e._streamReadAhead&&(i=n.read());const{done:r,value:o}=await t;if(r)return;yield E(o)}}catch(r){n.releaseLock()}}(t,e):async function*(t,e){for await(const n of t)yield E(n)}(t)}function F(t,e){if("string"===typeof t)return function*(t,e){const n=(null===e||void 0===e?void 0:e.chunkSize)||S;let i=0;const r=new TextEncoder;for(;i<t.length;){const e=Math.min(t.length-i,n),o=t.slice(i,i+e);i+=e,yield r.encode(o)}}(t,e);if(t instanceof ArrayBuffer)return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const{chunkSize:n=M}=e;let i=0;for(;i<t.byteLength;){const e=Math.min(t.byteLength-i,n),r=new ArrayBuffer(e),o=new Uint8Array(t,i,e);new Uint8Array(r).set(o),i+=e,yield r}}()}(t,e);if((0,i.Lj)(t))return async function*(t,e){const n=(null===e||void 0===e?void 0:e.chunkSize)||I;let i=0;for(;i<t.size;){const e=i+n,r=await t.slice(i,e).arrayBuffer();i=e,yield r}}(t,e);if((0,i.Os)(t))return D(t,e);if((0,i.Ew)(t)){return D(t.body,e)}throw new Error("makeIterator")}var L=n(73309);const O="Cannot convert supplied data type";async function R(t,e,n){const r=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"===typeof t||r)return function(t,e,n){if(e.text&&"string"===typeof t)return t;if((0,i.zH)(t)&&(t=t.buffer),t instanceof ArrayBuffer){const n=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let n=t.buffer;const i=t.byteLength||t.length;return 0===t.byteOffset&&i===n.byteLength||(n=n.slice(t.byteOffset,t.byteOffset+i)),n}throw new Error(O)}(t,e);if((0,i.Lj)(t)&&(t=await(0,L.L1)(t)),(0,i.Ew)(t)){const n=t;return await(0,L.mm)(n),e.binary?await n.arrayBuffer():await n.text()}if((0,i.Os)(t)&&(t=F(t,n)),(0,i.TW)(t)||(0,i.D0)(t))return T(t);throw new Error(O)}var k=n(44037);const U=new(n(87294).Z)({id:"loaders.gl"});var z=n(19754);const G=/\.([^.]+)$/;function N(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;if(!Z(t))return null;if(e&&!Array.isArray(e))return(0,r.T)(e);let o=[];e&&(o=o.concat(e)),null!==n&&void 0!==n&&n.ignoreRegisteredLoaders||o.push(...(0,z.kO)()),function(t){for(const e of t)(0,r.T)(e)}(o);const s=function(t,e,n,i){const{url:r,type:o}=(0,k.l)(t),s=r||(null===i||void 0===i?void 0:i.url);let a=null,l="";null!==n&&void 0!==n&&n.mimeType&&(a=V(e,null===n||void 0===n?void 0:n.mimeType),l="match forced by supplied MIME type ".concat(null===n||void 0===n?void 0:n.mimeType));var c;a=a||function(t,e){const n=e&&G.exec(e),i=n&&n[1];return i?function(t,e){e=e.toLowerCase();for(const n of t)for(const t of n.extensions)if(t.toLowerCase()===e)return n;return null}(t,i):null}(e,s),l=l||(a?"matched url ".concat(s):""),a=a||V(e,o),l=l||(a?"matched MIME type ".concat(o):""),a=a||function(t,e){if(!e)return null;for(const n of t)if("string"===typeof e){if(H(e,n))return n}else if(ArrayBuffer.isView(e)){if(J(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer){if(J(e,0,n))return n}return null}(e,t),l=l||(a?"matched initial data ".concat(W(t)):""),a=a||V(e,null===n||void 0===n?void 0:n.fallbackMimeType),l=l||(a?"matched fallback MIME type ".concat(o):""),l&&U.log(1,"selectLoader selected ".concat(null===(c=a)||void 0===c?void 0:c.name,": ").concat(l,"."));return a}(t,o,n,i);if(!s&&(null===n||void 0===n||!n.nothrow))throw new Error(j(t));return s}function Z(t){return!(t instanceof Response&&204===t.status)}function j(t){const{url:e,type:n}=(0,k.l)(t);let i="No valid loader found (";i+=e?"".concat(function(t){const e=t&&t.lastIndexOf("/");return e>=0?t.substr(e+1):""}(e),", "):"no url provided, ",i+="MIME type: ".concat(n?'"'.concat(n,'"'):"not provided",", ");const r=t?W(t):"";return i+=r?' first bytes: "'.concat(r,'"'):"first bytes: not available",i+=")",i}function V(t,e){for(const n of t){if(n.mimeTypes&&n.mimeTypes.includes(e))return n;if(e==="application/x.".concat(n.id))return n}return null}function H(t,e){if(e.testText)return e.testText(t);return(Array.isArray(e.tests)?e.tests:[e.tests]).some((e=>t.startsWith(e)))}function J(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some((i=>function(t,e,n,i){if(i instanceof ArrayBuffer)return function(t,e,n){if(n=n||t.byteLength,t.byteLength<n||e.byteLength<n)return!1;const i=new Uint8Array(t),r=new Uint8Array(e);for(let o=0;o<i.length;++o)if(i[o]!==r[o])return!1;return!0}(i,t,i.byteLength);switch(typeof i){case"function":return i(t,n);case"string":return i===Q(t,e,i.length);default:return!1}}(t,e,n,i)))}function W(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"===typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return Q(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return Q(t,0,e)}return""}function Q(t,e,n){if(t.byteLength<e+n)return"";const i=new DataView(t);let r="";for(let o=0;o<n;o++)r+=String.fromCharCode(i.getUint8(e+o));return r}async function K(t,e,n,c){(0,s.h)(!c||"object"===typeof c),!e||Array.isArray(e)||(0,r.C)(e)||(c=void 0,n=e,e=void 0),t=await t,n=n||{};const{url:u}=(0,k.l)(t),h=function(t,e){if(!e&&t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...t]:t}return n&&n.length?n:null}(e,c),d=await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(!Z(t))return null;let o=N(t,e,{...n,nothrow:!0},r);if(o)return o;if((0,i.Lj)(t)&&(o=N(t=await t.slice(0,10).arrayBuffer(),e,n,r)),!o&&(null===n||void 0===n||!n.nothrow))throw new Error(j(t));return o}(t,h,n);return d?(c=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(n)return n;const i={fetch:(0,o.bV)(e,t),...t};return Array.isArray(i.loaders)||(i.loaders=null),i}({url:u,parse:K,loaders:h},n=(0,o.GR)(n,d,h,u),c),await async function(t,e,n,r){if(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;(0,s.h)(t,"no worker provided");const n=t.version}(t),(0,i.Ew)(e)){const t=e,{ok:n,redirected:i,status:o,statusText:s,type:a,url:l}=t,c=Object.fromEntries(t.headers.entries());r.response={headers:c,ok:n,redirected:i,status:o,statusText:s,type:a,url:l}}if(e=await R(e,t,n),t.parseTextSync&&"string"===typeof e)return n.dataType="text",t.parseTextSync(e,n,r,t);if(function(t,e){return!!b.isSupported()&&!!(l.jU||null!==e&&void 0!==e&&e._nodeWorkers)&&t.worker&&(null===e||void 0===e?void 0:e.worker)}(t,n))return await w(t,e,n,r,K);if(t.parseText&&"string"===typeof e)return await t.parseText(e,n,r,t);if(t.parse)return await t.parse(e,n,r,t);throw(0,s.h)(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"))}(d,t,n,c)):null}async function q(t,e,n,s){Array.isArray(e)||(0,r.C)(e)||(void 0,n=e,e=void 0);const a=(0,o.bV)(n);let l=t;return"string"===typeof t&&(l=await a(t)),(0,i.Lj)(t)&&(l=await a(t)),await K(l,e,n)}},19754:(t,e,n)=>{"use strict";n.d(e,{fh:()=>s,kO:()=>a});var i=n(35669),r=n(97385);const o=()=>{const t=(0,r.rx)();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function s(t){const e=o();t=Array.isArray(t)?t:[t];for(const n of t){const t=(0,i.T)(n);e.find((e=>t===e))||e.unshift(t)}}function a(){return o()}},35669:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function r(t){var e;if(!t)return!1;Array.isArray(t)&&(t=t[0]);return Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions)}function o(t){var e,n;let o;return i(t,"null loader"),i(r(t),"invalid loader"),Array.isArray(t)&&(o=t[1],t=t[0],t={...t,options:{...t.options,...o}}),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(n=t)&&void 0!==n&&n.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}n.d(e,{C:()=>r,T:()=>o})},97385:(t,e,n)=>{"use strict";n.d(e,{bV:()=>m,rx:()=>A,GR:()=>g});var i=n(78788);let r="";const o={};var s=n(73309);async function a(t,e){if("string"===typeof t){t=function(t){for(const e in o)if(t.startsWith(e)){const n=o[e];t=t.replace(e,n)}return t.startsWith("http://")||t.startsWith("https://")||(t="".concat(r).concat(t)),t}(t);let n=e;return null!==e&&void 0!==e&&e.fetch&&"function"!==typeof(null===e||void 0===e?void 0:e.fetch)&&(n=e.fetch),await fetch(t,n)}return await(0,s.L1)(t)}var l=n(64649);const c=new(n(87294).Z)({id:"loaders.gl"});class u{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}var h=n(27759);const d={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){(0,l.Z)(this,"console",void 0),this.console=console}log(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.log.bind(this.console,...e)}info(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.info.bind(this.console,...e)}warn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.warn.bind(this.console,...e)}error(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:h.jU,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},f={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function A(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state=t._state||{},t._state}const p=()=>{const t=A();return t.globalOptions=t.globalOptions||{...d},t.globalOptions};function g(t,e,n,i){return n=n||[],function(t,e){y(t,null,d,f,e);for(const n of e){const i=t&&t[n.id]||{},r=n.options&&n.options[n.id]||{},o=n.deprecatedOptions&&n.deprecatedOptions[n.id]||{};y(i,n.id,r,o,e)}}(t,n=Array.isArray(n)?n:[n]),_(e,t,i)}function m(t,e){const n=p(),r=t||n;return"function"===typeof r.fetch?r.fetch:(0,i.Kn)(r.fetch)?t=>a(t,r):null!==e&&void 0!==e&&e.fetch?null===e||void 0===e?void 0:e.fetch:a}function y(t,e,n,r,o){const s=e||"Top level",a=e?"".concat(e,"."):"";for(const l in t){const u=!e&&(0,i.Kn)(t[l]);if(!(l in n)&&!("baseUri"===l&&!e)&&!("workerUrl"===l&&e))if(l in r)c.warn("".concat(s," loader option '").concat(a).concat(l,"' no longer supported, use '").concat(r[l],"'"))();else if(!u){const t=v(l,o);c.warn("".concat(s," loader option '").concat(a).concat(l,"' not recognized. ").concat(t))()}}}function v(t,e){const n=t.toLowerCase();let i="";for(const r of e)for(const e in r.options){if(t===e)return"Did you mean '".concat(r.id,".").concat(e,"'?");const o=e.toLowerCase();(n.startsWith(o)||o.startsWith(n))&&(i=i||"Did you mean '".concat(r.id,".").concat(e,"'?"))}return i}function _(t,e,n){const i={...t.options||{}};return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(i,n),null===i.log&&(i.log=new u),b(i,p()),b(i,e),i}function b(t,e){for(const n in e)if(n in e){const r=e[n];(0,i.Ss)(r)&&(0,i.Ss)(t[n])?t[n]={...t[n],...e[n]}:t[n]=e[n]}}},44037:(t,e,n)=>{"use strict";n.d(e,{C:()=>u,l:()=>c});var i=n(78788);const r=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,o=/^([-\w.]+\/[-\w.+]+)/;function s(t){const e=o.exec(t);return e?e[1]:t}function a(t){const e=r.exec(t);return e?e[1]:""}const l=/\?.*/;function c(t){if((0,i.Ew)(t)){const e=h(t.url||"");return{url:e,type:s(t.headers.get("content-type")||"")||a(e)}}return(0,i.Lj)(t)?{url:h(t.name||""),type:t.type||""}:"string"===typeof t?{url:h(t),type:a(t)}:{url:"",type:""}}function u(t){return(0,i.Ew)(t)?t.headers["content-length"]||-1:(0,i.Lj)(t)?t.size:"string"===typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function h(t){return t.replace(l,"")}},73309:(t,e,n)=>{"use strict";n.d(e,{L1:()=>o,mm:()=>s});var i=n(78788),r=n(44037);async function o(t){if((0,i.Ew)(t))return t;const e={},n=(0,r.C)(t);n>=0&&(e["content-length"]=String(n));const{url:o,type:s}=(0,r.l)(t);s&&(e["content-type"]=s);const a=await async function(t){const e=5;if("string"===typeof t)return"data:,".concat(t.slice(0,e));if(t instanceof Blob){const e=t.slice(0,5);return await new Promise((t=>{const n=new FileReader;n.onload=e=>{var n;return t(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.result)},n.readAsDataURL(e)}))}if(t instanceof ArrayBuffer){const n=function(t){let e="";const n=new Uint8Array(t);for(let i=0;i<n.byteLength;i++)e+=String.fromCharCode(n[i]);return btoa(e)}(t.slice(0,e));return"data:base64,".concat(n)}return null}(t);a&&(e["x-first-bytes"]=a),"string"===typeof t&&(t=(new TextEncoder).encode(t));const l=new Response(t,{headers:e});return Object.defineProperty(l,"url",{value:o}),l}async function s(t){if(!t.ok){const e=await async function(t){let e="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): ");try{const n=t.headers.get("Content-Type");let i=t.statusText;n.includes("application/json")&&(i+=" ".concat(await t.text())),e+=i,e=e.length>60?"".concat(e.slice(0,60),"..."):e}catch(n){}return e}(t);throw new Error(e)}}},27759:(t,e,n)=>{"use strict";n.d(e,{jU:()=>i});"undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof n.g&&n.g,"undefined"!==typeof document&&document;const i=Boolean("object"!==typeof process||"[object process]"!==String(process)||process.browser),r="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);r&&parseFloat(r[1])},61355:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const n={};for(let i=0;i<e.length;i++)n[e[i]]=t[i];return n}function r(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t[e[i]];return n}n.d(e,{w:()=>T});var o=n(64649);let s;class a extends Array{enqueue(t){return this.push(t)}dequeue(){return this.shift()}}s=Symbol.asyncIterator;class l{constructor(){(0,o.Z)(this,"_values",void 0),(0,o.Z)(this,"_settlers",void 0),(0,o.Z)(this,"_closed",void 0),this._values=new a,this._settlers=new a,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[s](){return this}enqueue(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");const e=this._settlers.dequeue();t instanceof Error?e.reject(t):e.resolve({value:t})}else this._values.enqueue(t)}next(){if(this._values.length>0){const t=this._values.dequeue();return t instanceof Error?Promise.reject(t):Promise.resolve({value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise(((t,e)=>{this._settlers.enqueue({resolve:t,reject:e})}))}}class c{constructor(t,e){if((0,o.Z)(this,"schema",void 0),(0,o.Z)(this,"options",void 0),(0,o.Z)(this,"length",0),(0,o.Z)(this,"rows",null),(0,o.Z)(this,"cursor",0),(0,o.Z)(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}addObjectRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}getBatch(){let t=this.rows;if(!t)return null;t=t.slice(0,this.length),this.rows=null;return{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}}}class u{constructor(t,e){if((0,o.Z)(this,"schema",void 0),(0,o.Z)(this,"options",void 0),(0,o.Z)(this,"length",0),(0,o.Z)(this,"objectRows",null),(0,o.Z)(this,"arrayRows",null),(0,o.Z)(this,"cursor",0),(0,o.Z)(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"object-row-table":const n=i(t,this._headers);this.addObjectRow(n,e);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=t,this.length++}}addObjectRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"array-row-table":const n=r(t,this._headers);this.addArrayRow(n,e);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=t,this.length++}}getBatch(){let t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}class h{constructor(t,e){(0,o.Z)(this,"schema",void 0),(0,o.Z)(this,"length",0),(0,o.Z)(this,"allocated",0),(0,o.Z)(this,"columns",{}),this.schema=t,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(t){this._reallocateColumns();let e=0;for(const n in this.columns)this.columns[n][this.length]=t[e++];this.length++}addObjectRow(t){this._reallocateColumns();for(const e in t)this.columns[e][this.length]=t[e];this.length++}getBatch(){this._pruneColumns();const t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(const e in this.schema){const n=this.schema[e];t[n.name]=this.columns[n.index]}this.columns={};return{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={};for(const t in this.schema){const e=this.schema[t],n=e.type||Float32Array,i=this.columns[e.index];if(i&&ArrayBuffer.isView(i)){const t=new n(this.allocated);t.set(i),this.columns[e.index]=t}else i?(i.length=this.allocated,this.columns[e.index]=i):this.columns[e.index]=new n(this.allocated)}}}_pruneColumns(){for(const[t,e]of Object.entries(this.columns))this.columns[t]=e.slice(0,this.length)}}const d={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},f="TableBatchBuilder";class A{constructor(t,e){(0,o.Z)(this,"schema",void 0),(0,o.Z)(this,"options",void 0),(0,o.Z)(this,"aggregator",null),(0,o.Z)(this,"batchCount",0),(0,o.Z)(this,"bytesUsed",0),(0,o.Z)(this,"isChunkComplete",!1),(0,o.Z)(this,"lastBatchEmittedMs",Date.now()),(0,o.Z)(this,"totalLength",0),(0,o.Z)(this,"totalBytes",0),(0,o.Z)(this,"rowBytes",0),this.schema=t,this.options={...d,...e}}limitReached(){var t,e;return!!(Boolean(null===(t=this.options)||void 0===t?void 0:t.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(e=this.options)||void 0===e?void 0:e._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}addRow(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}addArrayRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addArrayRow(t)}addObjectRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addObjectRow(t)}chunkComplete(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"===typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}getFullBatch(t){return this._isFull()?this._getBatch(t):null}getFinalBatch(t){return this._getBatch(t)}_estimateRowMB(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}_isFull(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs)&&(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(t){if(!this.aggregator)return null;null!==t&&void 0!==t&&t.bytesUsed&&(this.bytesUsed=t.bytesUsed);const e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}_getTableBatchType(){switch(this.options.shape){case"row-table":return c;case"array-row-table":case"object-row-table":return u;case"columnar-table":return h;case"arrow-table":if(!A.ArrowBatch)throw new Error(f);return A.ArrowBatch;default:throw new Error(f)}}}(0,o.Z)(A,"ArrowBatch",void 0);const p={parse:function(t,e,n){var i=(e=e||{}).dynamicTyping||!1;w(i)&&(e.dynamicTypingFunction=i,i={});if(e.dynamicTyping=i,e.transform=!!w(e.transform)&&e.transform,e.worker&&p.WORKERS_SUPPORTED){var r=newWorker();return r.userStep=e.step,r.userChunk=e.chunk,r.userComplete=e.complete,r.userError=e.error,e.step=w(e.step),e.chunk=w(e.chunk),e.complete=w(e.complete),e.error=w(e.error),delete e.worker,void r.postMessage({input:t,config:e,workerId:r.id})}var o=null;"string"===typeof t&&(o=new y(e));o||(o=new n(e));return o.stream(t)},unparse:function(t,e){var n=!1,i=!0,r=",",o="\r\n",s='"',a=s+s,l=!1,c=null;!function(){if("object"!==typeof e)return;"string"!==typeof e.delimiter||p.BAD_DELIMITERS.filter((function(t){return-1!==e.delimiter.indexOf(t)})).length||(r=e.delimiter);("boolean"===typeof e.quotes||Array.isArray(e.quotes))&&(n=e.quotes);"boolean"!==typeof e.skipEmptyLines&&"string"!==typeof e.skipEmptyLines||(l=e.skipEmptyLines);"string"===typeof e.newline&&(o=e.newline);"string"===typeof e.quoteChar&&(s=e.quoteChar);"boolean"===typeof e.header&&(i=e.header);if(Array.isArray(e.columns)){if(0===e.columns.length)throw new Error("Option columns is empty");c=e.columns}void 0!==e.escapeChar&&(a=e.escapeChar+s)}();var u=new RegExp(_(s),"g");"string"===typeof t&&(t=JSON.parse(t));if(Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return d(null,t,l);if("object"===typeof t[0])return d(c||h(t[0]),t,l)}else if("object"===typeof t)return"string"===typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:h(t.data[0])),Array.isArray(t.data[0])||"object"===typeof t.data[0]||(t.data=[t.data])),d(t.fields||[],t.data||[],l);throw new Error("Unable to serialize unrecognized input");function h(t){if("object"!==typeof t)return[];var e=[];for(var n in t)e.push(n);return e}function d(t,e,n){var s="";"string"===typeof t&&(t=JSON.parse(t)),"string"===typeof e&&(e=JSON.parse(e));var a=Array.isArray(t)&&t.length>0,l=!Array.isArray(e[0]);if(a&&i){for(var c=0;c<t.length;c++)c>0&&(s+=r),s+=f(t[c],c);e.length>0&&(s+=o)}for(var u=0;u<e.length;u++){var h=a?t.length:e[u].length,d=!1,A=a?0===Object.keys(e[u]).length:0===e[u].length;if(n&&!a&&(d="greedy"===n?""===e[u].join("").trim():1===e[u].length&&0===e[u][0].length),"greedy"===n&&a){for(var p=[],g=0;g<h;g++){var m=l?t[g]:g;p.push(e[u][m])}d=""===p.join("").trim()}if(!d){for(var y=0;y<h;y++){y>0&&!A&&(s+=r);var v=a&&l?t[y]:y;s+=f(e[u][v],y)}u<e.length-1&&(!n||h>0&&!A)&&(s+=o)}}return s}function f(t,e){if("undefined"===typeof t||null===t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);t=t.toString().replace(u,a);var i="boolean"===typeof n&&n||Array.isArray(n)&&n[e]||function(t,e){for(var n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return!0;return!1}(t,p.BAD_DELIMITERS)||t.indexOf(r)>-1||" "===t.charAt(0)||" "===t.charAt(t.length-1);return i?s+t+s:t}},RECORD_SEP:String.fromCharCode(30),UNIT_SEP:String.fromCharCode(31),BYTE_ORDER_MARK:"\ufeff",BAD_DELIMITERS:["\r","\n",'"',"\ufeff"],WORKERS_SUPPORTED:!1,NODE_STREAM_INPUT:1,LocalChunkSize:10485760,RemoteChunkSize:5242880,DefaultDelimiter:",",Parser:b,ParserHandle:v,ChunkStreamer:m,StringStreamer:y},g=p;function m(t){this._handle=null,this._finished=!1,this._completed=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=x(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null);this._handle=new v(e),this._handle.streamer=this,this._config=e}.call(this,t),this.parseChunk=function(t,e){if(this.isFirstChunk&&w(this._config.beforeFirstChunk)){var n=this._config.beforeFirstChunk(t);void 0!==n&&(t=n)}this.isFirstChunk=!1;var i=this._partialLine+t;this._partialLine="";var r=this._handle.parse(i,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var o=r.meta.cursor;this._finished||(this._partialLine=i.substring(o-this._baseIndex),this._baseIndex=o),r&&r.data&&(this._rowCount+=r.data.length);var s=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(w(this._config.chunk)&&!e){if(this._config.chunk(r,this._handle),this._handle.paused()||this._handle.aborted())return;r=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(r.data),this._completeResults.errors=this._completeResults.errors.concat(r.errors),this._completeResults.meta=r.meta),this._completed||!s||!w(this._config.complete)||r&&r.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),s||r&&r.meta.paused||this._nextChunk(),r}},this._sendError=function(t){w(this._config.error)&&this._config.error(t)}}function y(t){var e;t=t||{},m.call(this,t),this.stream=function(t){return e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t=this._config.chunkSize,n=t?e.substr(0,t):e;return e=t?e.substr(t):"",this._finished=!e,this.parseChunk(n)}}}function v(t){var e,n,i,r=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,o=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,s=this,a=0,l=0,c=!1,u=!1,h=[],d={data:[],errors:[],meta:{}};if(w(t.step)){var f=t.step;t.step=function(e){if(d=e,m())g();else{if(g(),!d.data||0===d.data.length)return;a+=e.data.length,t.preview&&a>t.preview?n.abort():f(d,s)}}}function A(e){return"greedy"===t.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function g(){if(d&&i&&(v("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+p.DefaultDelimiter+"'"),i=!1),t.skipEmptyLines)for(var e=0;e<d.data.length;e++)A(d.data[e])&&d.data.splice(e--,1);return m()&&function(){if(!d)return;function e(e){w(t.transformHeader)&&(e=t.transformHeader(e)),h.push(e)}if(Array.isArray(d.data[0])){for(var n=0;m()&&n<d.data.length;n++)d.data[n].forEach(e);d.data.splice(0,1)}else d.data.forEach(e)}(),function(){if(!d||!d.data||!t.header&&!t.dynamicTyping&&!t.transform)return d;function e(e,n){var i,r=t.header?{}:[];for(i=0;i<e.length;i++){var o=i,s=e[i];t.header&&(o=i>=h.length?"__parsed_extra":h[i]),t.transform&&(s=t.transform(s,o)),s=y(o,s),"__parsed_extra"===o?(r[o]=r[o]||[],r[o].push(s)):r[o]=s}return t.header&&(i>h.length?v("FieldMismatch","TooManyFields","Too many fields: expected "+h.length+" fields but parsed "+i,l+n):i<h.length&&v("FieldMismatch","TooFewFields","Too few fields: expected "+h.length+" fields but parsed "+i,l+n)),r}var n=1;!d.data[0]||Array.isArray(d.data[0])?(d.data=d.data.map(e),n=d.data.length):d.data=e(d.data,0);t.header&&d.meta&&(d.meta.fields=h);return l+=n,d}()}function m(){return t.header&&0===h.length}function y(e,n){return function(e){return t.dynamicTypingFunction&&void 0===t.dynamicTyping[e]&&(t.dynamicTyping[e]=t.dynamicTypingFunction(e)),!0===(t.dynamicTyping[e]||t.dynamicTyping)}(e)?"true"===n||"TRUE"===n||"false"!==n&&"FALSE"!==n&&(r.test(n)?parseFloat(n):o.test(n)?new Date(n):""===n?null:n):n}function v(t,e,n,i){d.errors.push({type:t,code:e,message:n,row:i})}this.parse=function(r,o,s){var a=t.quoteChar||'"';if(t.newline||(t.newline=function(t,e){t=t.substr(0,1048576);var n=new RegExp(_(e)+"([^]*?)"+_(e),"gm");t=t.replace(n,"");var i=t.split("\r"),r=t.split("\n"),o=r.length>1&&r[0].length<i[0].length;if(1===i.length||o)return"\n";for(var s=0,a=0;a<i.length;a++)"\n"===i[a][0]&&s++;return s>=i.length/2?"\r\n":"\r"}(r,a)),i=!1,t.delimiter)w(t.delimiter)&&(t.delimiter=t.delimiter(r),d.meta.delimiter=t.delimiter);else{var l=function(e,n,i,r,o){var s,a,l;o=o||[",","\t","|",";",p.RECORD_SEP,p.UNIT_SEP];for(var c=0;c<o.length;c++){var u=o[c],h=0,d=0,f=0;l=void 0;for(var g=new b({comments:r,delimiter:u,newline:n,preview:10}).parse(e),m=0;m<g.data.length;m++)if(i&&A(g.data[m]))f++;else{var y=g.data[m].length;d+=y,"undefined"!==typeof l?y>1&&(h+=Math.abs(y-l),l=y):l=0}g.data.length>0&&(d/=g.data.length-f),("undefined"===typeof a||h>a)&&d>1.99&&(a=h,s=u)}return t.delimiter=s,{successful:!!s,bestDelimiter:s}}(r,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);l.successful?t.delimiter=l.bestDelimiter:(i=!0,t.delimiter=p.DefaultDelimiter),d.meta.delimiter=t.delimiter}var u=x(t);return t.preview&&t.header&&u.preview++,e=r,n=new b(u),d=n.parse(e,o,s),g(),c?{meta:{paused:!0}}:d||{meta:{paused:!1}}},this.paused=function(){return c},this.pause=function(){c=!0,n.abort(),e=e.substr(n.getCharIndex())},this.resume=function(){c=!1,s.streamer.parseChunk(e,!0)},this.aborted=function(){return u},this.abort=function(){u=!0,n.abort(),d.meta.aborted=!0,w(t.complete)&&t.complete(d),e=""}}function _(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(t){var e,n=(t=t||{}).delimiter,i=t.newline,r=t.comments,o=t.step,s=t.preview,a=t.fastMode,l=e=void 0===t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(l=t.escapeChar),("string"!==typeof n||p.BAD_DELIMITERS.indexOf(n)>-1)&&(n=","),r===n)throw new Error("Comment character same as delimiter");!0===r?r="#":("string"!==typeof r||p.BAD_DELIMITERS.indexOf(r)>-1)&&(r=!1),"\n"!==i&&"\r"!==i&&"\r\n"!==i&&(i="\n");var c=0,u=!1;this.parse=function(t,h,d){if("string"!==typeof t)throw new Error("Input must be a string");var f=t.length,A=n.length,p=i.length,g=r.length,m=w(o);c=0;var y=[],v=[],b=[],x=0;if(!t)return R();if(a||!1!==a&&-1===t.indexOf(e)){for(var C=t.split(i),B=0;B<C.length;B++){if(b=C[B],c+=b.length,B!==C.length-1)c+=i.length;else if(d)return R();if(!r||b.substr(0,g)!==r){if(m){if(y=[],D(b.split(n)),k(),u)return R()}else D(b.split(n));if(s&&B>=s)return y=y.slice(0,s),R(!0)}}return R()}for(var E,T=t.indexOf(n,c),S=t.indexOf(i,c),M=new RegExp(_(l)+_(e),"g");;)if(t[c]!==e)if(r&&0===b.length&&t.substr(c,g)===r){if(-1===S)return R();c=S+p,S=t.indexOf(i,c),T=t.indexOf(n,c)}else if(-1!==T&&(T<S||-1===S))b.push(t.substring(c,T)),c=T+A,T=t.indexOf(n,c);else{if(-1===S)break;if(b.push(t.substring(c,S)),O(S+p),m&&(k(),u))return R();if(s&&y.length>=s)return R(!0)}else{for(E=c,c++;;){if(-1===(E=t.indexOf(e,E+1)))return d||v.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:y.length,index:c}),L();if(E===f-1)return L(t.substring(c,E).replace(M,e));if(e!==l||t[E+1]!==l){if(e===l||0===E||t[E-1]!==l){var I=F(-1===S?T:Math.min(T,S));if(t[E+1+I]===n){if(b.push(t.substring(c,E).replace(M,e)),c=E+1+I+A,T=t.indexOf(n,c),S=t.indexOf(i,c),m&&(k(),u))return R();if(s&&y.length>=s)return R(!0);break}var P=F(S);if(t.substr(E+1+P,p)===i){if(b.push(t.substring(c,E).replace(M,e)),O(E+1+P+p),T=t.indexOf(n,c),m&&(k(),u))return R();if(s&&y.length>=s)return R(!0);break}v.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:y.length,index:c}),E++}}else E++}if(m&&(k(),u))return R();if(s&&y.length>=s)return R(!0)}return L();function D(t){y.push(t),x=c}function F(e){var n=0;if(-1!==e){var i=t.substring(E+1,e);i&&""===i.trim()&&(n=i.length)}return n}function L(e){return d||("undefined"===typeof e&&(e=t.substr(c)),b.push(e),c=f,D(b),m&&k()),R()}function O(e){c=e,D(b),b=[],S=t.indexOf(i,c)}function R(t,e){return{data:e||!1?y[0]:y,errors:v,meta:{delimiter:n,linebreak:i,aborted:u,truncated:!!t,cursor:x+(h||0)}}}function k(){o(R(void 0,!0)),y=[],v=[]}},this.abort=function(){u=!0},this.getCharIndex=function(){return c}}function x(t){if("object"!==typeof t||null===t)return t;var e=Array.isArray(t)?[]:{};for(var n in t)e[n]=x(t[n]);return e}function w(t){return"function"===typeof t}y.prototype=Object.create(y.prototype),y.prototype.constructor=y;const{ChunkStreamer:C}=g;function B(t){t=t||{},C.call(this,t),this.textDecoder=new TextDecoder(this._config.encoding),this.stream=async function(t){this._input=t;try{for await(const e of t)this.parseChunk(this.getStringChunk(e));this._finished=!0,this.parseChunk("")}catch(e){this._sendError(e)}},this._nextChunk=function(){},this.getStringChunk=function(t){return"string"===typeof t?t:this.textDecoder.decode(t,{stream:!0})}}B.prototype=Object.create(C.prototype),B.prototype.constructor=B;const E={csv:{shape:"object-row-table",optimizeMemoryUsage:!1,header:"auto",columnPrefix:"column",quoteChar:'"',escapeChar:'"',dynamicTyping:!0,comments:!1,skipEmptyLines:!0,delimitersToGuess:[",","\t","|",";"]}},T={id:"csv",module:"csv",name:"CSV",version:"3.2.13",extensions:["csv","tsv","dsv"],mimeTypes:["text/csv","text/tab-separated-values","text/dsv"],category:"table",parse:async(t,e)=>S((new TextDecoder).decode(t),e),parseText:(t,e)=>S(t,e),parseInBatches:function(t,e){var n;"auto"===(e={...e}).batchSize&&(e.batchSize=4e3);const i={...E.csv,...null===(n=e)||void 0===n?void 0:n.csv},r=new l;let o=!0,s=null,a=null,c=null;const u={...i,header:!1,download:!1,chunkSize:5242880,skipEmptyLines:!1,step(t){let n=t.data;if(i.skipEmptyLines){if(""===n.flat().join("").trim())return}const l=t.meta.cursor;if(o&&!s){if("auto"===i.header?M(n):Boolean(i.header))return void(s=n.map(I()))}o&&(o=!1,s||(s=P(i.columnPrefix,n.length)),c=function(t,e){const n=e?{}:[];for(let i=0;i<t.length;i++){const r=e&&e[i]||i;switch(typeof t[i]){case"number":case"boolean":n[r]={name:String(r),index:i,type:Float32Array};break;default:n[r]={name:String(r),index:i,type:Array}}}return n}(n,s)),i.optimizeMemoryUsage&&(n=JSON.parse(JSON.stringify(n))),a=a||new A(c,{shape:i.shape||"array-row-table",...e});try{a.addRow(n);const t=a&&a.getFullBatch({bytesUsed:l});t&&r.enqueue(t)}catch(u){r.enqueue(u)}},complete(t){try{const e=t.meta.cursor,n=a&&a.getFinalBatch({bytesUsed:e});n&&r.enqueue(n)}catch(e){r.enqueue(e)}r.close()}};return g.parse(t,u,B),r},options:E};async function S(t,e){const n={...E.csv,...null===e||void 0===e?void 0:e.csv},o=function(t){const e=g.parse(t,{download:!1,dynamicTyping:!0,preview:1});return e.data[0]}(t),s="auto"===n.header?M(o):Boolean(n.header),a={...n,header:s,download:!1,transformHeader:s?I():void 0,error:t=>{throw new Error(t)}},l=g.parse(t,a);let{data:c}=l;const u=l.meta.fields||P(n.columnPrefix,o.length);switch(n.shape){case"object-row-table":c=c.map((t=>Array.isArray(t)?i(t,u):t));break;case"array-row-table":c=c.map((t=>Array.isArray(t)?t:r(t,u)))}return c}function M(t){return t&&t.every((t=>"string"===typeof t))}function I(){const t=new Set;return e=>{let n=e,i=1;for(;t.has(n);)n="".concat(e,".").concat(i),i++;return t.add(n),n}}function P(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[];for(let i=0;i<e;i++)n.push("".concat(t).concat(i+1));return n}},34957:(t,e,n)=>{"use strict";n.d(e,{VJ:()=>ot});var i={};n.r(i),n.d(i,{readFileAsArrayBuffer:()=>J,readFileAsText:()=>W,requireFromFile:()=>Q,requireFromString:()=>K});const r={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof n.g&&n.g,document:"undefined"!==typeof document&&document},o=r.global||r.self||r.window||{},s="object"!==typeof process||"[object process]"!==String(process)||process.browser,a="function"===typeof importScripts,l=("undefined"!==typeof window&&window.orientation,"undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version)),c=(l&&parseFloat(l[1]),"3.4.15"),u={draco:{decoderType:"object"===typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},h={name:"Draco",id:s?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:c,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:u};var d=n(64649),f=n(38395);class A{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;(0,d.Z)(this,"name",void 0),(0,d.Z)(this,"type",void 0),(0,d.Z)(this,"nullable",void 0),(0,d.Z)(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=n,this.metadata=i}get typeId(){return this.type&&this.type.typeId}clone(){return new A(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let p,g,m,y,v,_,b,x,w=function(t){return t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth",t}({});class C{static isNull(t){return t&&t.typeId===w.Null}static isInt(t){return t&&t.typeId===w.Int}static isFloat(t){return t&&t.typeId===w.Float}static isBinary(t){return t&&t.typeId===w.Binary}static isUtf8(t){return t&&t.typeId===w.Utf8}static isBool(t){return t&&t.typeId===w.Bool}static isDecimal(t){return t&&t.typeId===w.Decimal}static isDate(t){return t&&t.typeId===w.Date}static isTime(t){return t&&t.typeId===w.Time}static isTimestamp(t){return t&&t.typeId===w.Timestamp}static isInterval(t){return t&&t.typeId===w.Interval}static isList(t){return t&&t.typeId===w.List}static isStruct(t){return t&&t.typeId===w.Struct}static isUnion(t){return t&&t.typeId===w.Union}static isFixedSizeBinary(t){return t&&t.typeId===w.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===w.FixedSizeList}static isMap(t){return t&&t.typeId===w.Map}static isDictionary(t){return t&&t.typeId===w.Dictionary}get typeId(){return w.NONE}compareTo(t){return this===t}}Symbol.toStringTag;Symbol.toStringTag;p=Symbol.toStringTag;class B extends C{constructor(t,e){super(),(0,d.Z)(this,"isSigned",void 0),(0,d.Z)(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return w.Int}get[p](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class E extends B{constructor(){super(!0,8)}}class T extends B{constructor(){super(!0,16)}}class S extends B{constructor(){super(!0,32)}}class M extends B{constructor(){super(!1,8)}}class I extends B{constructor(){super(!1,16)}}class P extends B{constructor(){super(!1,32)}}const D=32,F=64;g=Symbol.toStringTag;class L extends C{constructor(t){super(),(0,d.Z)(this,"precision",void 0),this.precision=t}get typeId(){return w.Float}get[g](){return"Float"}toString(){return"Float".concat(this.precision)}}class O extends L{constructor(){super(D)}}class R extends L{constructor(){super(F)}}Symbol.toStringTag;Symbol.toStringTag;m=Symbol.toStringTag;y=Symbol.toStringTag;v=Symbol.toStringTag;_=Symbol.toStringTag;b=Symbol.toStringTag;class k extends C{constructor(t,e){super(),(0,d.Z)(this,"listSize",void 0),(0,d.Z)(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return w.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[b](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}x=Symbol.toStringTag;function U(t,e,n){const i=function(t){switch(t.constructor){case Int8Array:return new E;case Uint8Array:return new M;case Int16Array:return new T;case Uint16Array:return new I;case Int32Array:return new S;case Uint32Array:return new P;case Float32Array:return new O;case Float64Array:return new R;default:throw new Error("array type not supported")}}(e.value),r=n||function(t){const e=new Map;"byteOffset"in t&&e.set("byteOffset",t.byteOffset.toString(10));"byteStride"in t&&e.set("byteStride",t.byteStride.toString(10));"normalized"in t&&e.set("normalized",t.normalized.toString());return e}(e);return new A(t,new k(e.size,new A("value",i)),!1,r)}class z{constructor(t,e){(0,d.Z)(this,"fields",void 0),(0,d.Z)(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const n of t)e[n.name]&&console.warn("Schema: duplicated field name",n.name,n),e[n.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(){const t=Object.create(null);for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];for(const o of n)t[o]=!0;const r=this.fields.filter((e=>t[e.name]));return new z(r,this.metadata)}selectAt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e.map((t=>this.fields[t])).filter(Boolean);return new z(i,this.metadata)}assign(t){let e,n=this.metadata;if(t instanceof z){const i=t;e=i.fields,n=G(G(new Map,this.metadata),i.metadata)}else e=t;const i=Object.create(null);for(const o of this.fields)i[o.name]=o;for(const o of e)i[o.name]=o;const r=Object.values(i);return new z(r,n)}}function G(t,e){return new Map([...t||new Map,...e||new Map])}function N(t,e,n){return U(t,e,n?Z(n.metadata):void 0)}function Z(t){const e=new Map;for(const n in t)e.set("".concat(n,".string"),JSON.stringify(t[n]));return e}const j={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},V={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class H{constructor(t){(0,d.Z)(this,"draco",void 0),(0,d.Z)(this,"decoder",void 0),(0,d.Z)(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const i=this.decoder.GetEncodedGeometryType(n),r=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(i){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(n,r);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(n,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!r.ptr){const e="DRACO decompression failed: ".concat(t.error_msg());throw new Error(e)}const o=this._getDracoLoaderData(r,i,e),s=this._getMeshData(r,o,e),a=(0,f.v)(s.attributes),l=function(t,e,n){const i=Z(e.metadata),r=[],o=function(t){const e={};for(const n in t){const i=t[n];e[i.name||"undefined"]=i}return e}(e.attributes);for(const s in t){const e=N(s,t[s],o[s]);r.push(e)}if(n){const t=N("indices",n);r.push(t)}return new z(r,i)}(s.attributes,o,s.indices);return{loader:"draco",loaderData:o,header:{vertexCount:r.num_points(),boundingBox:a},...s,schema:l}}finally{this.draco.destroy(n),r&&this.draco.destroy(r)}}_getDracoLoaderData(t,e,n){const i=this._getTopLevelMetadata(t),r=this._getDracoAttributes(t,n);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:r}}_getDracoAttributes(t,e){const n={};for(let i=0;i<t.num_attributes();i++){const r=this.decoder.GetAttribute(t,i),o=this._getAttributeMetadata(t,i);n[r.unique_id()]={unique_id:r.unique_id(),attribute_type:r.attribute_type(),data_type:r.data_type(),num_components:r.num_components(),byte_offset:r.byte_offset(),byte_stride:r.byte_stride(),normalized:r.normalized(),attribute_index:i,metadata:o};const s=this._getQuantizationTransform(r,e);s&&(n[r.unique_id()].quantization_transform=s);const a=this._getOctahedronTransform(r,e);a&&(n[r.unique_id()].octahedron_transform=a)}return n}_getMeshData(t,e,n){const i=this._getMeshAttributes(e,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");return t instanceof this.draco.Mesh?"triangle-strip"===n.topology?{topology:"triangle-strip",mode:4,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,e,n){const i={};for(const r of Object.values(t.attributes)){const t=this._deduceAttributeName(r,n);r.name=t;const{value:o,size:s}=this._getAttributeValues(e,r);i[t]={value:o,size:s,byteOffset:r.byte_offset,byteStride:r.byte_stride,normalized:r.normalized}}return i}_getTriangleListIndices(t){const e=3*t.num_faces(),n=4*e,i=this.draco._malloc(n);try{return this.decoder.GetTrianglesUInt32Array(t,n,i),new Uint32Array(this.draco.HEAPF32.buffer,i,e).slice()}finally{this.draco._free(i)}}_getTriangleStripIndices(t){const e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){const e=t.size(),n=new Int32Array(e);for(let i=0;i<e;i++)n[i]=t.GetValue(i);return n}(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){const n=V[e.data_type],i=e.num_components,r=t.num_points()*i,o=r*n.BYTES_PER_ELEMENT,s=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}(this.draco,n);let a;const l=this.draco._malloc(o);try{const i=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,i,s,o,l),a=new n(this.draco.HEAPF32.buffer,l,r).slice()}finally{this.draco._free(l)}return{value:a,size:i}}_deduceAttributeName(t,e){const n=t.unique_id;for(const[o,s]of Object.entries(e.extraAttributes||{}))if(s===n)return o;const i=t.attribute_type;for(const o in j){if(this.draco[o]===i)return j[o]}const r=e.attributeNameEntry||"name";return t.metadata[r]?t.metadata[r].string:"CUSTOM_ATTRIBUTE_".concat(n)}_getTopLevelMetadata(t){const e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){const n=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};const e={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){const n=this.metadataQuerier.GetEntryName(t,i);e[n]=this._getDracoMetadataField(t,n)}return e}_getDracoMetadataField(t,e){const n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,n);const i=function(t){const e=t.size(),n=new Int32Array(e);for(let i=0;i<e;i++)n[i]=t.GetValue(i);return n}(n);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){const{quantizedAttributes:e=[],octahedronAttributes:n=[]}=t,i=[...e,...n];for(const r of i)this.decoder.SkipAttributeTransform(this.draco[r])}_getQuantizationTransform(t,e){const{quantizedAttributes:n=[]}=e,i=t.attribute_type();if(n.map((t=>this.decoder[t])).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map((t=>e.min_value(t)))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:n=[]}=e,i=t.attribute_type();if(n.map((t=>this.decoder[t])).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}const J=null,W=null,Q=null,K=null;const q="3.4.15",X={};async function Y(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e&&(t=function(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};if(i[t])return i[t];if(!s)return"modules/".concat(e,"/dist/libs/").concat(t);if(n.CDN)return function(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(e,"@").concat(q,"/dist/libs/").concat(t);if(a)return"../src/libs/".concat(t);return"modules/".concat(e,"/src/libs/").concat(t)}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})),X[t]=X[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!s)try{return i&&Q&&await Q(t)}catch{return null}if(a)return importScripts(t);const e=await fetch(t);return function(t,e){if(!s)return K&&K(t,e);if(a)return eval.call(o,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(i){n.text=t}return document.body.appendChild(n),null}(await e.text(),t)}(t),await X[t]}const $="https://www.gstatic.com/draco/versioned/decoders/".concat("1.5.5"),tt="".concat($,"/draco_decoder.js"),et="".concat($,"/draco_wasm_wrapper.js"),nt="".concat($,"/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat("1.4.1","/javascript/draco_encoder.js");let it;async function rt(t){const e=t.modules||{};return it=e.draco3d?it||e.draco3d.createDecoderModule({}).then((t=>({draco:t}))):it||async function(t){let e,n;if("js"===(t.draco&&t.draco.decoderType))e=await Y(tt,"draco",t);else[e,n]=await Promise.all([await Y(et,"draco",t),await Y(nt,"draco",t)]);return e=e||globalThis.DracoDecoderModule,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise((e=>{t({...n,onModuleLoaded:t=>e({draco:t})})}))}(e,n)}(t),await it}const ot={...h,parse:async function(t,e){const{draco:n}=await rt(e),i=new H(n);try{return i.parseSync(t,null===e||void 0===e?void 0:e.draco)}finally{i.destroy()}}}},10625:(t,e,n)=>{"use strict";function i(t,e){const n=null===e||void 0===e?void 0:e.globalFeatureId;return void 0!==n?function(t,e){const n=s(t);for(const i of n){let t=0,n=i.featureIds.value[0];for(let r=0;r<i.featureIds.value.length;r++){const o=i.featureIds.value[r];if(o!==n){if(e===i.globalFeatureIds.value[t])return a(i,t,r);t=r,n=o}}if(e===i.globalFeatureIds.value[t])return a(i,t,i.featureIds.value.length)}throw new Error("featureId:".concat(e," not found"))}(t,n):r(t,null===e||void 0===e?void 0:e.type)}function r(t,e){return function(t){const e=[];for(const n of t){if(0===n.featureIds.value.length)continue;let t=0,i=n.featureIds.value[0];for(let r=0;r<n.featureIds.value.length;r++){const o=n.featureIds.value[r];o!==i&&(e.push(a(n,t,r)),t=r,i=o)}e.push(a(n,t,n.featureIds.value.length))}return e}(s(t,e))}function o(t,e,n){switch(t.type){case"Point":return function(t,e,n){const{positions:i}=t,r=c(i,e,n);if(r.length>1)return{type:"MultiPoint",coordinates:r};return{type:"Point",coordinates:r[0]}}(t,e,n);case"LineString":return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;const{positions:i}=t,r=t.pathIndices.value.filter((t=>t>=e&&t<=n));if(!(r.length>2)){return{type:"LineString",coordinates:c(i,r[0],r[1])}}const o=[];for(let s=0;s<r.length-1;s++){const t=c(i,r[s],r[s+1]);o.push(t)}return{type:"MultiLineString",coordinates:o}}(t,e,n);case"Polygon":return l(t,e,n);default:throw new Error("Unsupported geometry type: ".concat(null===t||void 0===t?void 0:t.type))}}function s(t,e){if(!Boolean(t.points||t.lines||t.polygons))return t.type=e||function(t){if(t.pathIndices)return"LineString";if(t.polygonIndices)return"Polygon";return"Point"}(t),[t];const n=[];return t.points&&(t.points.type="Point",n.push(t.points)),t.lines&&(t.lines.type="LineString",n.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",n.push(t.polygons)),n}function a(t,e,n){const i=o(t,e,n),r=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=Object.assign({},t.properties[t.featureIds.value[e]]);for(const i in t.numericProps)n[i]=t.numericProps[i].value[e];return n}(t,e,n),s=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.fields&&t.fields[t.featureIds.value[e]]}(t,e,n);return{type:"Feature",geometry:i,properties:r,...s}}function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;const{positions:i}=t,r=t.polygonIndices.value.filter((t=>t>=e&&t<=n)),o=t.primitivePolygonIndices.value.filter((t=>t>=e&&t<=n));if(!(r.length>2)){const t=[];for(let e=0;e<o.length-1;e++){const n=c(i,o[e],o[e+1]);t.push(n)}return{type:"Polygon",coordinates:t}}const s=[];for(let a=0;a<r.length-1;a++){const e=l(t,r[a],r[a+1]).coordinates;s.push(e)}return{type:"MultiPolygon",coordinates:s}}function c(t,e,n){e=e||0,n=n||t.value.length/t.size;const i=[];for(let r=e;r<n;r++){const e=Array();for(let n=r*t.size;n<(r+1)*t.size;n++)e.push(Number(t.value[n]));i.push(e)}return i}n.d(e,{F_:()=>i})},56264:(t,e,n)=>{"use strict";n.d(e,{E:()=>Nn});var i={};n.r(i),n.d(i,{decode:()=>Vt,name:()=>jt});var r={};n.r(r),n.d(r,{name:()=>qt,preprocess:()=>Xt});var o={};n.r(o),n.d(o,{name:()=>$t,preprocess:()=>te});var s={};n.r(s),n.d(s,{decode:()=>Je,encode:()=>We,name:()=>Ve,preprocess:()=>He});var a={};n.r(a),n.d(a,{decode:()=>$e,encode:()=>tn,name:()=>Ye});var l={};n.r(l),n.d(l,{decode:()=>rn,encode:()=>on,name:()=>nn});var c={};n.r(c),n.d(c,{decode:()=>ln,encode:()=>cn,name:()=>an});var u=n(89596),h=n(72672),d=n(73599);const f="3.2.13",A={};async function p(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e&&(t=function(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};if(i[t])return i[t];if(!u.jU)return"modules/".concat(e,"/dist/libs/").concat(t);if(n.CDN)return(0,d.h)(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(e,"@").concat(f,"/dist/libs/").concat(t);if(u.hJ)return"../src/libs/".concat(t);return"modules/".concat(e,"/src/libs/").concat(t)}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})),A[t]=A[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!u.jU)try{return h&&h.requireFromFile&&await h.requireFromFile(t)}catch{return null}if(u.hJ)return importScripts(t);const e=await fetch(t);return function(t,e){if(!u.jU)return h.requireFromString&&h.requireFromString(t,e);if(u.hJ)return eval.call(u.CO,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(i){n.text=t}return document.body.appendChild(n),null}(await e.text(),t)}(t),await A[t]}const g="3.2.13",m="https://unpkg.com/@loaders.gl/textures@".concat(g,"/dist/libs/basis_encoder.wasm"),y="https://unpkg.com/@loaders.gl/textures@".concat(g,"/dist/libs/basis_encoder.js");let v,_;async function b(t){const e=t.modules||{};return e.basis?e.basis:(v=v||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await p("basis_transcoder.js","textures",t),await p("basis_transcoder.wasm","textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise((e=>{t(n).then((t=>{const{BasisFile:n,initializeBasis:i}=t;i(),e({BasisFile:n})}))}))}(e,n)}(t),await v)}async function x(t){const e=t.modules||{};return e.basisEncoder?e.basisEncoder:(_=_||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await p(y,"textures",t),await p(m,"textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise((e=>{t(n).then((t=>{const{BasisFile:n,KTX2File:i,initializeBasis:r,BasisEncoder:o}=t;r(),e({BasisFile:n,KTX2File:i,BasisEncoder:o})}))}))}(e,n)}(t),await _)}const w=33776,C=33779,B=35840,E=35842,T=36196,S=37808,M=["","WEBKIT_","MOZ_"],I={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let P=null;function D(t){if(!P){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,P=new Set;for(const e of M)for(const n in I)if(t&&t.getExtension("".concat(e).concat(n))){const t=I[n];P.add(t)}}return P}n(88687);const F=[171,75,84,88,32,50,48,187,13,10,26,10];const L={etc1:{basisFormat:0,compressed:!0,format:T},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:w},bc3:{basisFormat:3,compressed:!0,format:C},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:B},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:E},"astc-4x4":{basisFormat:10,compressed:!0,format:S},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function O(t,e,n){const i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");const t=i.getNumImages(),e=[];for(let r=0;r<t;r++){const t=i.getNumLevels(r),o=[];for(let e=0;e<t;e++)o.push(R(i,r,e,n));e.push(o)}return e}finally{i.close(),i.delete()}}function R(t,e,n,i){const r=t.getImageWidth(e,n),o=t.getImageHeight(e,n),s=t.getHasAlpha(),{compressed:a,format:l,basisFormat:c}=z(i,s),u=t.getImageTranscodedSizeInBytes(e,n,c),h=new Uint8Array(u);if(!t.transcodeImage(h,e,n,c,0,0))throw new Error("failed to start Basis transcoding");return{width:r,height:o,data:h,compressed:a,format:l,hasAlpha:s}}function k(t,e,n){const i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");const t=i.getLevels(),e=[];for(let r=0;r<t;r++){e.push(U(i,r,n));break}return[e]}finally{i.close(),i.delete()}}function U(t,e,n){const{alphaFlag:i,height:r,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:l}=z(n,i),c=t.getImageTranscodedSizeInBytes(e,0,0,l),u=new Uint8Array(c);if(!t.transcodeImage(u,e,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:r,data:u,compressed:s,hasAlpha:i,format:a}}function z(t,e){let n=t&&t.basis&&t.basis.format;return"auto"===n&&(n=G()),"object"===typeof n&&(n=e?n.alpha:n.noAlpha),n=n.toLowerCase(),L[n]}function G(){const t=D();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}const N={name:"Basis",id:"basis",module:"textures",version:"3.2.13",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},Z={...N,parse:async function(t,e){if("auto"===e.basis.containerFormat){if(function(t){const e=new Uint8Array(t);return!(e.byteLength<F.length||e[0]!==F[0]||e[1]!==F[1]||e[2]!==F[2]||e[3]!==F[3]||e[4]!==F[4]||e[5]!==F[5]||e[6]!==F[6]||e[7]!==F[7]||e[8]!==F[8]||e[9]!==F[9]||e[10]!==F[10]||e[11]!==F[11])}(t)){return k((await x(e)).KTX2File,t,e)}const{BasisFile:n}=await b(e);return O(n,t,e)}if("encoder"===e.basis.module){const n=await x(e);return"ktx2"===e.basis.containerFormat?k(n.KTX2File,t,e):O(n.BasisFile,t,e)}{const{BasisFile:n}=await b(e);return O(n,t,e)}}};function j(t,e){if(!t)throw new Error(e||"loader assertion failed.")}"undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof n.g&&n.g,"undefined"!==typeof document&&document;const V=Boolean("object"!==typeof process||"[object process]"!==String(process)||process.browser),H="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:J}=(H&&parseFloat(H[1]),globalThis),W="undefined"!==typeof Image,Q="undefined"!==typeof ImageBitmap,K=Boolean(J),q=!!V||K;function X(t){const e=$(t);if(!e)throw new Error("Not an image");return e}function Y(t){switch(X(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function $(t){return"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!==typeof Image&&t instanceof Image?"image":t&&"object"===typeof t&&t.data&&t.width&&t.height?"data":null}const tt=/^data:image\/svg\+xml/,et=/\.svg((\?|#).*)?$/;function nt(t){return t&&(tt.test(t)||et.test(t))}function it(t,e){if(nt(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function rt(t,e,n){const i=function(t,e){if(nt(e)){let e=(new TextDecoder).decode(t);try{"function"===typeof unescape&&"function"===typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(n){throw new Error(n.message)}return"data:image/svg+xml;base64,".concat(btoa(e))}return it(t,e)}(t,n),r=self.URL||self.webkitURL,o="string"!==typeof i&&r.createObjectURL(i);try{return await async function(t,e){const n=new Image;if(n.src=t,e.image&&e.image.decode&&n.decode)return await n.decode(),n;return await new Promise(((e,i)=>{try{n.onload=()=>e(n),n.onerror=e=>i(new Error("Could not load image ".concat(t,": ").concat(e)))}catch(r){i(r)}}))}(o||i,e)}finally{o&&r.revokeObjectURL(o)}}const ot={};let st=!0;async function at(t,e,n){let i;if(nt(n)){i=await rt(t,e,n)}else i=it(t,n);const r=e&&e.imagebitmap;return await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(t){for(const e in t||ot)return!1;return!0}(e)&&st||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(n){console.warn(n),st=!1}return await createImageBitmap(t)}(i,r)}const lt=!1,ct=!0;function ut(t){const e=ht(t);return function(t){const e=ht(t),n=e.byteLength>=24&&2303741511===e.getUint32(0,lt);if(!n)return null;return{mimeType:"image/png",width:e.getUint32(16,lt),height:e.getUint32(20,lt)}}(e)||function(t){const e=ht(t),n=e.byteLength>=3&&65496===e.getUint16(0,lt)&&255===e.getUint8(2);if(!n)return null;const{tableMarkers:i,sofMarkers:r}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let n=65504;n<65520;++n)t.add(n);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let o=2;for(;o+9<e.byteLength;){const t=e.getUint16(o,lt);if(r.has(t))return{mimeType:"image/jpeg",height:e.getUint16(o+5,lt),width:e.getUint16(o+7,lt)};if(!i.has(t))return null;o+=2,o+=e.getUint16(o,lt)}return null}(e)||function(t){const e=ht(t),n=e.byteLength>=10&&1195984440===e.getUint32(0,lt);if(!n)return null;return{mimeType:"image/gif",width:e.getUint16(6,ct),height:e.getUint16(8,ct)}}(e)||function(t){const e=ht(t),n=e.byteLength>=14&&16973===e.getUint16(0,lt)&&e.getUint32(2,ct)===e.byteLength;if(!n)return null;return{mimeType:"image/bmp",width:e.getUint32(18,ct),height:e.getUint32(22,ct)}}(e)}function ht(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}const dt={id:"image",module:"images",name:"Images",version:"3.2.13",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(t,e,n){const i=((e=e||{}).image||{}).type||"auto",{url:r}=n||{};let o;switch(function(t){switch(t){case"auto":case"data":return function(){if(Q)return"imagebitmap";if(W)return"image";if(q)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return Q||W||q;case"imagebitmap":return Q;case"image":return W;case"data":return q;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}(i)){case"imagebitmap":o=await at(t,e,r);break;case"image":o=await rt(t,e,r);break;case"data":o=await async function(t,e){const{mimeType:n}=ut(t)||{},i=globalThis._parseImageNode;return j(i),await i(t,n)}(t);break;default:j(!1)}return"data"===i&&(o=Y(o)),o},tests:[t=>Boolean(ut(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};function ft(t,e,n){if(t.byteLength<=e+n)return"";const i=new DataView(t);let r="";for(let o=0;o<n;o++)r+=String.fromCharCode(i.getUint8(e+o));return r}function At(t){try{return JSON.parse(t)}catch(e){throw new Error('Failed to parse JSON from data starting with "'.concat(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"===typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return ft(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer)return ft(t,0,e);return""}(t),'"'))}}function pt(t,e,n){const i=void 0!==n?new Uint8Array(t).subarray(e,e+n):new Uint8Array(t).subarray(e);return new Uint8Array(i).buffer}function gt(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function mt(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const n=e.baseUri||e.uri;if(!n)throw new Error("'baseUri' must be provided to resolve relative url ".concat(t));return n.substr(0,n.lastIndexOf("/")+1)+t}function yt(t,e,n){const i=t.bufferViews[n];gt(i);const r=e[i.buffer];gt(r);const o=(i.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,o,i.byteLength)}var vt=n(64649);function _t(t,e){return j(t>=0),j(e>0),t+(e-1)&~(e-1)}function bt(t,e,n){let i;if(t instanceof ArrayBuffer)i=new Uint8Array(t);else{const e=t.byteOffset,n=t.byteLength;i=new Uint8Array(t.buffer||t.arrayBuffer,e,n)}return e.set(i,n),n+_t(i.byteLength,4)}const xt=["SCALAR","VEC2","VEC3","VEC4"],wt=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Ct=new Map(wt),Bt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Et={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Tt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function St(t){return xt[t-1]||xt[0]}function Mt(t){const e=Ct.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function It(t,e){const n=Tt[t.componentType],i=Bt[t.type],r=Et[t.componentType],o=t.count*i,s=t.count*i*r;return gt(s>=0&&s<=e.byteLength),{ArrayType:n,length:o,byteLength:s}}const Pt={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class Dt{constructor(t){(0,vt.Z)(this,"gltf",void 0),(0,vt.Z)(this,"sourceBuffers",void 0),(0,vt.Z)(this,"byteLength",void 0),this.gltf=t||{json:{...Pt},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){const e=this.getUsedExtensions().find((e=>e===t)),n=this.json.extensions||{};return e?n[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find((e=>e===t))?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"===typeof e)return e;const n=this.json[t]&&this.json[t][e];if(!n)throw new Error("glTF file error: Could not find ".concat(t,"[").concat(e,"]"));return n}getTypedArrayForBufferView(t){const e=(t=this.getBufferView(t)).buffer,n=this.gltf.buffers[e];gt(n);const i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,{ArrayType:i,length:r}=It(t,e);return new i(n,e.byteOffset+t.byteOffset,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,i=e.byteOffset||0;return new Uint8Array(n,i,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,n){return t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}setObjectExtension(t,e,n){(t.extensions||{})[e]=n}removeObjectExtension(t,e){const n=t.extensions||{},i=n[e];return delete n[e],i}addExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gt(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gt(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((e=>e===t))||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((e=>e===t))||this.json.extensionsRequired.push(t)}removeExtension(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:n}=t;this.json.nodes=this.json.nodes||[];const i={mesh:e};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:n,material:i,mode:r=4}=t,o={primitives:[{attributes:this._addAttributes(e),mode:r}]};if(n){const t=this._addIndices(n);o.primitives[0].indices=t}return Number.isFinite(i)&&(o.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const n=ut(t),i=e||(null===n||void 0===n?void 0:n.mimeType),r={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}addBufferView(t){const e=t.byteLength;gt(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=_t(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(t,e){const n={bufferView:t,type:St(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3};const n=this.addBufferView(t);let i={min:e.min,max:e.max};i.min&&i.max||(i=this._getAccessorMinMax(t,e.size));const r={size:e.size,componentType:Mt(t),count:Math.round(t.length/e.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(r,e))}addTexture(t){const{imageIndex:e}=t,n={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const n=this.byteLength,i=new ArrayBuffer(n),r=new Uint8Array(i);let o=0;for(const s of this.sourceBuffers||[])o=bt(s,r,o);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}_removeStringFromArray(t,e){let n=!0;for(;n;){const i=t.indexOf(e);i>-1?t.splice(i,1):n=!1}}_addAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={};for(const n in t){const i=t[n],r=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);e[r]=o}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const n={min:null,max:null};if(t.length<e)return n;n.min=[],n.max=[];const i=t.subarray(0,e);for(const r of i)n.min.push(r),n.max.push(r);for(let r=e;r<t.length;r+=e)for(let i=0;i<e;i++)n.min[0+i]=Math.min(n.min[0+i],t[r+i]),n.max[0+i]=Math.max(n.max[0+i],t[r+i]);return n}}const Ft="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",Lt="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",Ot=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Rt=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),kt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Ut={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};let zt;async function Gt(){return zt||(zt=async function(){let t=Ft;WebAssembly.validate(Ot)&&(t=Lt,console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(function(t){const e=new Uint8Array(t.length);for(let i=0;i<t.length;++i){const n=t.charCodeAt(i);e[i]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let n=0;for(let i=0;i<t.length;++i)e[n++]=e[i]<60?Rt[e[i]]:64*(e[i]-60)+e[++i];return e.buffer.slice(0,n)}(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}()),zt}function Nt(t,e,n,i,r,o,s){const a=t.exports.sbrk,l=i+3&-4,c=a(l*r),u=a(o.length),h=new Uint8Array(t.exports.memory.buffer);h.set(o,u);const d=e(c,i,r,u,o.length);if(0===d&&s&&s(c,l,r),n.set(h.subarray(c,c+i*r)),a(c-a(0)),0!==d)throw new Error("Malformed buffer data: ".concat(d))}const Zt="EXT_meshopt_compression",jt=Zt;async function Vt(t,e){var n;const i=new Dt(t);if(null===e||void 0===e||null===(n=e.gltf)||void 0===n||!n.decompressMeshes)return;const r=[];for(const o of t.json.bufferViews||[])r.push(Ht(i,o));await Promise.all(r),i.removeExtension(Zt)}async function Ht(t,e){const n=t.getObjectExtension(e,Zt);if(n){const{byteOffset:i=0,byteLength:r=0,byteStride:o,count:s,mode:a,filter:l="NONE",buffer:c}=n,u=t.gltf.buffers[c],h=new Uint8Array(u.arrayBuffer,u.byteOffset+i,r),d=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);return await async function(t,e,n,i,r){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NONE";const s=await Gt();Nt(s,s.exports[Ut[r]],t,e,n,i,s.exports[kt[o||"NONE"]])}(d,s,o,h,a,l),d}return null}const Jt=["image/png","image/jpeg","image/gif"],Wt={};function Qt(t){return void 0===Wt[t]&&(Wt[t]=function(t){switch(t){case"image/webp":return function(){if(!V)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch{return!1}}();case"image/svg":return V;default:if(!V){const{_parseImageNode:e}=globalThis;return Boolean(e)&&Jt.includes(t)}return!0}}(t)),Wt[t]}const Kt="EXT_texture_webp",qt=Kt;function Xt(t,e){const n=new Dt(t);if(!Qt("image/webp")){if(n.getRequiredExtensions().includes(Kt))throw new Error("gltf: Required extension ".concat(Kt," not supported by browser"));return}const{json:i}=n;for(const r of i.textures||[]){const t=n.getObjectExtension(r,Kt);t&&(r.source=t.source),n.removeObjectExtension(r,Kt)}n.removeExtension(Kt)}const Yt="KHR_texture_basisu",$t=Yt;function te(t,e){const n=new Dt(t),{json:i}=n;for(const r of i.textures||[]){const t=n.getObjectExtension(r,Yt);t&&(r.source=t.source),n.removeObjectExtension(r,Yt)}n.removeExtension(Yt)}const ee="3.2.13",ne={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:ee,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};class ie{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;(0,vt.Z)(this,"name",void 0),(0,vt.Z)(this,"type",void 0),(0,vt.Z)(this,"nullable",void 0),(0,vt.Z)(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=n,this.metadata=i}get typeId(){return this.type&&this.type.typeId}clone(){return new ie(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let re,oe,se,ae,le,ce,ue,he,de;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(re||(re={}));class fe{static isNull(t){return t&&t.typeId===re.Null}static isInt(t){return t&&t.typeId===re.Int}static isFloat(t){return t&&t.typeId===re.Float}static isBinary(t){return t&&t.typeId===re.Binary}static isUtf8(t){return t&&t.typeId===re.Utf8}static isBool(t){return t&&t.typeId===re.Bool}static isDecimal(t){return t&&t.typeId===re.Decimal}static isDate(t){return t&&t.typeId===re.Date}static isTime(t){return t&&t.typeId===re.Time}static isTimestamp(t){return t&&t.typeId===re.Timestamp}static isInterval(t){return t&&t.typeId===re.Interval}static isList(t){return t&&t.typeId===re.List}static isStruct(t){return t&&t.typeId===re.Struct}static isUnion(t){return t&&t.typeId===re.Union}static isFixedSizeBinary(t){return t&&t.typeId===re.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===re.FixedSizeList}static isMap(t){return t&&t.typeId===re.Map}static isDictionary(t){return t&&t.typeId===re.Dictionary}get typeId(){return re.NONE}compareTo(t){return this===t}}Symbol.toStringTag;Symbol.toStringTag;oe=Symbol.toStringTag;class Ae extends fe{constructor(t,e){super(),(0,vt.Z)(this,"isSigned",void 0),(0,vt.Z)(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return re.Int}get[oe](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class pe extends Ae{constructor(){super(!0,8)}}class ge extends Ae{constructor(){super(!0,16)}}class me extends Ae{constructor(){super(!0,32)}}class ye extends Ae{constructor(){super(!1,8)}}class ve extends Ae{constructor(){super(!1,16)}}class _e extends Ae{constructor(){super(!1,32)}}const be=32,xe=64;se=Symbol.toStringTag;class we extends fe{constructor(t){super(),(0,vt.Z)(this,"precision",void 0),this.precision=t}get typeId(){return re.Float}get[se](){return"Float"}toString(){return"Float".concat(this.precision)}}class Ce extends we{constructor(){super(be)}}class Be extends we{constructor(){super(xe)}}Symbol.toStringTag;Symbol.toStringTag;ae=Symbol.toStringTag;le=Symbol.toStringTag;ce=Symbol.toStringTag;ue=Symbol.toStringTag;he=Symbol.toStringTag;class Ee extends fe{constructor(t,e){super(),(0,vt.Z)(this,"listSize",void 0),(0,vt.Z)(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return re.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[he](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}de=Symbol.toStringTag;function Te(t,e,n){const i=function(t){switch(t.constructor){case Int8Array:return new pe;case Uint8Array:return new ye;case Int16Array:return new ge;case Uint16Array:return new ve;case Int32Array:return new me;case Uint32Array:return new _e;case Float32Array:return new Ce;case Float64Array:return new Be;default:throw new Error("array type not supported")}}(e.value),r=n||function(t){const e=new Map;"byteOffset"in t&&e.set("byteOffset",t.byteOffset.toString(10));"byteStride"in t&&e.set("byteStride",t.byteStride.toString(10));"normalized"in t&&e.set("normalized",t.normalized.toString());return e}(e);return new ie(t,new Ee(e.size,new ie("value",i)),!1,r)}class Se{constructor(t,e){(0,vt.Z)(this,"fields",void 0),(0,vt.Z)(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const n of t)e[n.name]&&console.warn("Schema: duplicated field name",n.name,n),e[n.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(){const t=Object.create(null);for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];for(const o of n)t[o]=!0;const r=this.fields.filter((e=>t[e.name]));return new Se(r,this.metadata)}selectAt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e.map((t=>this.fields[t])).filter(Boolean);return new Se(i,this.metadata)}assign(t){let e,n=this.metadata;if(t instanceof Se){const i=t;e=i.fields,n=Me(Me(new Map,this.metadata),i.metadata)}else e=t;const i=Object.create(null);for(const o of this.fields)i[o.name]=o;for(const o of e)i[o.name]=o;const r=Object.values(i);return new Se(r,n)}}function Me(t,e){return new Map([...t||new Map,...e||new Map])}function Ie(t,e,n){return Te(t,e,n?Pe(n.metadata):void 0)}function Pe(t){const e=new Map;for(const n in t)e.set("".concat(n,".string"),JSON.stringify(t[n]));return e}const De={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Fe={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class Le{constructor(t){(0,vt.Z)(this,"draco",void 0),(0,vt.Z)(this,"decoder",void 0),(0,vt.Z)(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const i=this.decoder.GetEncodedGeometryType(n),r=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(i){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(n,r);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(n,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!r.ptr){const e="DRACO decompression failed: ".concat(t.error_msg());throw new Error(e)}const o=this._getDracoLoaderData(r,i,e),s=this._getMeshData(r,o,e),a=function(t){let e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let c=0;c<l;c+=3){const t=a[c],l=a[c+1],u=a[c+2];e=t<e?t:e,n=l<n?l:n,i=u<i?u:i,r=t>r?t:r,o=l>o?l:o,s=u>s?u:s}return[[e,n,i],[r,o,s]]}(s.attributes),l=function(t,e,n){const i=Pe(e.metadata),r=[],o=function(t){const e={};for(const n in t){const i=t[n];e[i.name||"undefined"]=i}return e}(e.attributes);for(const s in t){const e=Ie(s,t[s],o[s]);r.push(e)}if(n){const t=Ie("indices",n);r.push(t)}return new Se(r,i)}(s.attributes,o,s.indices);return{loader:"draco",loaderData:o,header:{vertexCount:r.num_points(),boundingBox:a},...s,schema:l}}finally{this.draco.destroy(n),r&&this.draco.destroy(r)}}_getDracoLoaderData(t,e,n){const i=this._getTopLevelMetadata(t),r=this._getDracoAttributes(t,n);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:r}}_getDracoAttributes(t,e){const n={};for(let i=0;i<t.num_attributes();i++){const r=this.decoder.GetAttribute(t,i),o=this._getAttributeMetadata(t,i);n[r.unique_id()]={unique_id:r.unique_id(),attribute_type:r.attribute_type(),data_type:r.data_type(),num_components:r.num_components(),byte_offset:r.byte_offset(),byte_stride:r.byte_stride(),normalized:r.normalized(),attribute_index:i,metadata:o};const s=this._getQuantizationTransform(r,e);s&&(n[r.unique_id()].quantization_transform=s);const a=this._getOctahedronTransform(r,e);a&&(n[r.unique_id()].octahedron_transform=a)}return n}_getMeshData(t,e,n){const i=this._getMeshAttributes(e,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");return t instanceof this.draco.Mesh?"triangle-strip"===n.topology?{topology:"triangle-strip",mode:4,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,e,n){const i={};for(const r of Object.values(t.attributes)){const t=this._deduceAttributeName(r,n);r.name=t;const{value:o,size:s}=this._getAttributeValues(e,r);i[t]={value:o,size:s,byteOffset:r.byte_offset,byteStride:r.byte_stride,normalized:r.normalized}}return i}_getTriangleListIndices(t){const e=3*t.num_faces(),n=4*e,i=this.draco._malloc(n);try{return this.decoder.GetTrianglesUInt32Array(t,n,i),new Uint32Array(this.draco.HEAPF32.buffer,i,e).slice()}finally{this.draco._free(i)}}_getTriangleStripIndices(t){const e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){const e=t.size(),n=new Int32Array(e);for(let i=0;i<e;i++)n[i]=t.GetValue(i);return n}(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){const n=Fe[e.data_type],i=e.num_components,r=t.num_points()*i,o=r*n.BYTES_PER_ELEMENT,s=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}(this.draco,n);let a;const l=this.draco._malloc(o);try{const i=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,i,s,o,l),a=new n(this.draco.HEAPF32.buffer,l,r).slice()}finally{this.draco._free(l)}return{value:a,size:i}}_deduceAttributeName(t,e){const n=t.unique_id;for(const[o,s]of Object.entries(e.extraAttributes||{}))if(s===n)return o;const i=t.attribute_type;for(const o in De){if(this.draco[o]===i)return De[o]}const r=e.attributeNameEntry||"name";return t.metadata[r]?t.metadata[r].string:"CUSTOM_ATTRIBUTE_".concat(n)}_getTopLevelMetadata(t){const e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){const n=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};const e={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){const n=this.metadataQuerier.GetEntryName(t,i);e[n]=this._getDracoMetadataField(t,n)}return e}_getDracoMetadataField(t,e){const n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,n);const i=function(t){const e=t.size(),n=new Int32Array(e);for(let i=0;i<e;i++)n[i]=t.GetValue(i);return n}(n);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){const{quantizedAttributes:e=[],octahedronAttributes:n=[]}=t,i=[...e,...n];for(const r of i)this.decoder.SkipAttributeTransform(this.draco[r])}_getQuantizationTransform(t,e){const{quantizedAttributes:n=[]}=e,i=t.attribute_type();if(n.map((t=>this.decoder[t])).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map((t=>e.min_value(t)))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:n=[]}=e,i=t.attribute_type();if(n.map((t=>this.decoder[t])).includes(i)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}const Oe="1.4.1",Re="https://www.gstatic.com/draco/versioned/decoders/".concat(Oe,"/draco_decoder.js"),ke="https://www.gstatic.com/draco/versioned/decoders/".concat(Oe,"/draco_wasm_wrapper.js"),Ue="https://www.gstatic.com/draco/versioned/decoders/".concat(Oe,"/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat(Oe,"/javascript/draco_encoder.js");let ze;async function Ge(t){const e=t.modules||{};return ze=e.draco3d?ze||e.draco3d.createDecoderModule({}).then((t=>({draco:t}))):ze||async function(t){let e,n;if("js"===(t.draco&&t.draco.decoderType))e=await p(Re,"draco",t);else[e,n]=await Promise.all([await p(ke,"draco",t),await p(Ue,"draco",t)]);return e=e||globalThis.DracoDecoderModule,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise((e=>{t({...n,onModuleLoaded:t=>e({draco:t})})}))}(e,n)}(t),await ze}u.jU;const Ne={...ne,parse:async function(t,e){const{draco:n}=await Ge(e),i=new Le(n);try{return i.parseSync(t,null===e||void 0===e?void 0:e.draco)}finally{i.destroy()}}};function Ze(t){const{buffer:e,size:n,count:i}=function(t){let e=t,n=1,i=0;t&&t.value&&(e=t.value,n=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return null;if(Array.isArray(t))return new e(t);if(n&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),i=e.length/n);return{buffer:e,size:n,count:i}}(t);return{value:e,size:n,byteOffset:0,count:i,type:St(n),componentType:Mt(e)}}const je="KHR_draco_mesh_compression",Ve=je;function He(t,e,n){const i=new Dt(t);for(const r of qe(i))i.getObjectExtension(r,je)}async function Je(t,e,n){var i;if(null===e||void 0===e||null===(i=e.gltf)||void 0===i||!i.decompressMeshes)return;const r=new Dt(t),o=[];for(const s of qe(r))r.getObjectExtension(s,je)&&o.push(Qe(r,s,e,n));await Promise.all(o),r.removeExtension(je)}function We(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new Dt(t);for(const i of n.json.meshes||[])Ke(i,e),n.addRequiredExtension(je)}async function Qe(t,e,n,i){const r=t.getObjectExtension(e,je);if(!r)return;const o=t.getTypedArrayForBufferView(r.bufferView),s=pt(o.buffer,o.byteOffset),{parse:a}=i,l={...n};delete l["3d-tiles"];const c=await a(s,Ne,l,i),u=function(t){const e={};for(const n in t){const i=t[n];if("indices"!==n){const t=Ze(i);e[n]=t}}return e}(c.attributes);for(const[h,d]of Object.entries(u))if(h in e.attributes){const n=e.attributes[h],i=t.getAccessor(n);null!==i&&void 0!==i&&i.min&&null!==i&&void 0!==i&&i.max&&(d.min=i.min,d.max=i.max)}e.attributes=u,c.indices&&(e.indices=Ze(c.indices)),function(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(e)}function Ke(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;var o;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const s=i.DracoWriter.encodeSync({attributes:t}),a=null===r||void 0===r||null===(o=r.parseSync)||void 0===o?void 0:o.call(r,{attributes:t}),l=i._addFauxAttributes(a.attributes),c=i.addBufferView(s);return{primitives:[{attributes:l,mode:n,extensions:{[je]:{bufferView:c,attributes:l}}}]}}function*qe(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}const Xe="KHR_lights_punctual",Ye=Xe;async function $e(t){const e=new Dt(t),{json:n}=e,i=e.getExtension(Xe);i&&(e.json.lights=i.lights,e.removeExtension(Xe));for(const r of n.nodes||[]){const t=e.getObjectExtension(r,Xe);t&&(r.light=t.light),e.removeObjectExtension(r,Xe)}}async function tn(t){const e=new Dt(t),{json:n}=e;if(n.lights){const t=e.addExtension(Xe);gt(!t.lights),t.lights=n.lights,delete n.lights}if(e.json.lights){for(const t of e.json.lights){const n=t.node;e.addObjectExtension(n,Xe,t)}delete e.json.lights}}const en="KHR_materials_unlit",nn=en;async function rn(t){const e=new Dt(t),{json:n}=e;e.removeExtension(en);for(const i of n.materials||[]){i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,en)}}function on(t){const e=new Dt(t),{json:n}=e;if(e.materials)for(const i of n.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,en,{}),e.addExtension(en))}const sn="KHR_techniques_webgl",an=sn;async function ln(t){const e=new Dt(t),{json:n}=e,i=e.getExtension(sn);if(i){const t=function(t,e){const{programs:n=[],shaders:i=[],techniques:r=[]}=t,o=new TextDecoder;return i.forEach((t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=o.decode(e.getTypedArrayForBufferView(t.bufferView))})),n.forEach((t=>{t.fragmentShader=i[t.fragmentShader],t.vertexShader=i[t.vertexShader]})),r.forEach((t=>{t.program=n[t.program]})),r}(i,e);for(const i of n.materials||[]){const n=e.getObjectExtension(i,sn);n&&(i.technique=Object.assign({},n,t[n.technique]),i.technique.values=un(i.technique,e)),e.removeObjectExtension(i,sn)}e.removeExtension(sn)}}async function cn(t,e){}function un(t,e){const n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((e=>{t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)})),Object.keys(n).forEach((t=>{"object"===typeof n[t]&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))})),n}const hn=[i,r,o,s,a,l,c];function dn(t,e){var n;const i=(null===e||void 0===e||null===(n=e.gltf)||void 0===n?void 0:n.excludeExtensions)||{};return!(t in i&&!i[t])}const fn="KHR_binary_glTF";const An={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},pn={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class gn{constructor(){(0,vt.Z)(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),(0,vt.Z)(this,"json",void 0)}normalize(t,e){this.json=t.json;const n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(n.asset.version))}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(t){const e=new Dt(t),{json:n}=e;for(const i of n.images||[]){const t=e.getObjectExtension(i,fn);t&&Object.assign(i,t),e.removeObjectExtension(i,fn)}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,e.removeExtension(fn)}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in An)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const n=t[e];if(n&&!Array.isArray(n)){t[e]=[];for(const i in n){const r=n[i];r.id=r.id||i;const o=t[e].length;t[e].push(r),this.idToIndexMap[e][i]=o}}}_convertObjectIdsToArrayIndices(t){for(const e in An)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:n,material:i}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");n&&(e.indices=this._convertIdToIndex(n,"accessor")),i&&(e.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map((t=>this._convertIdToIndex(t,"node")))),t.meshes&&(t.meshes=t.meshes.map((t=>this._convertIdToIndex(t,"mesh"))))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map((t=>this._convertIdToIndex(t,"node"))))}_convertIdsToIndices(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute ".concat(e)),t[e]=[]);for(const n of t[e])for(const t in n){const e=n[t],i=this._convertIdToIndex(e,t);n[t]=i}}_convertIdToIndex(t,e){const n=pn[e];if(n in this.idToIndexMap){const i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error("gltf v1: failed to resolve ".concat(e," with id ").concat(t));return i}return t}_updateObjects(t){for(const e of this.json.buffers)delete e.type}_updateMaterial(t){for(const r of t.materials){var e,n,i;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const o=(null===(e=r.values)||void 0===e?void 0:e.tex)||(null===(n=r.values)||void 0===n?void 0:n.texture2d_0)||(null===(i=r.values)||void 0===i?void 0:i.diffuseTex),s=t.textures.findIndex((t=>t.id===o));-1!==s&&(r.pbrMetallicRoughness.baseColorTexture={index:s})}}}const mn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},yn={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},vn=10240,_n=10241,bn=10242,xn=10243,wn=10497,Cn={magFilter:vn,minFilter:_n,wrapS:bn,wrapT:xn},Bn={[vn]:9729,[_n]:9986,[bn]:wn,[xn]:wn};class En{constructor(){(0,vt.Z)(this,"baseUri",""),(0,vt.Z)(this,"json",{}),(0,vt.Z)(this,"buffers",[]),(0,vt.Z)(this,"images",[])}postProcess(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{json:n,buffers:i=[],images:r=[],baseUri:o=""}=t;return gt(n),this.baseUri=o,this.json=n,this.buffers=i,this.images=r,this._resolveTree(this.json,e),this.json}_resolveTree(t){t.bufferViews&&(t.bufferViews=t.bufferViews.map(((t,e)=>this._resolveBufferView(t,e)))),t.images&&(t.images=t.images.map(((t,e)=>this._resolveImage(t,e)))),t.samplers&&(t.samplers=t.samplers.map(((t,e)=>this._resolveSampler(t,e)))),t.textures&&(t.textures=t.textures.map(((t,e)=>this._resolveTexture(t,e)))),t.accessors&&(t.accessors=t.accessors.map(((t,e)=>this._resolveAccessor(t,e)))),t.materials&&(t.materials=t.materials.map(((t,e)=>this._resolveMaterial(t,e)))),t.meshes&&(t.meshes=t.meshes.map(((t,e)=>this._resolveMesh(t,e)))),t.nodes&&(t.nodes=t.nodes.map(((t,e)=>this._resolveNode(t,e)))),t.skins&&(t.skins=t.skins.map(((t,e)=>this._resolveSkin(t,e)))),t.scenes&&(t.scenes=t.scenes.map(((t,e)=>this._resolveScene(t,e)))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"===typeof e)return e;const n=this.json[t]&&this.json[t][e];return n||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),n}_resolveScene(t,e){return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map((t=>this.getNode(t))),t}_resolveNode(t,e){return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map((t=>this.getNode(t)))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce(((t,e)=>{const n=this.getMesh(e);return t.id=n.id,t.primitives=t.primitives.concat(n.primitives),t}),{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map((t=>{const e=(t={...t}).attributes;t.attributes={};for(const n in e)t.attributes[n]=this.getAccessor(e[n]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t}))),t}_resolveMaterial(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture={...t.normalTexture},t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture={...t.occlustionTexture},t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture={...t.emmisiveTexture},t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness={...t.pbrMetallicRoughness};const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture={...e.baseColorTexture},e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture={...e.metallicRoughnessTexture},e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){var n,i;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(n=t.componentType,yn[n]),t.components=(i=t.type,mn[i]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:n,byteLength:i}=It(t,t.bufferView),r=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset;let o=e.arrayBuffer.slice(r,r+i);t.bufferView.byteStride&&(o=this._getValueFromInterleavedBuffer(e,r,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new n(o)}return t}_getValueFromInterleavedBuffer(t,e,n,i,r){const o=new Uint8Array(r*i);for(let s=0;s<r;s++){const r=e+s*n;o.set(new Uint8Array(t.arrayBuffer.slice(r,r+i)),s*i)}return o.buffer}_resolveTexture(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.getSampler(t.sampler):Bn,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||"sampler-".concat(e),t.parameters={};for(const n in t){const e=this._enumSamplerParameter(n);void 0!==e&&(t.parameters[e]=t[n])}return t}_enumSamplerParameter(t){return Cn[t]}_resolveImage(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const n=this.images[e];return n&&(t.image=n),t}_resolveBufferView(t,e){const n=t.buffer,i={id:"bufferView-".concat(e),...t,buffer:this.buffers[n]},r=this.buffers[n].arrayBuffer;let o=this.buffers[n].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),i.data=new Uint8Array(r,o,t.byteLength),i}_resolveCamera(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}const Tn=1735152710,Sn=12,Mn=8,In=1313821514,Pn=5130562,Dn=0,Fn=1,Ln=0,On=!0;function Rn(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=new DataView(e),o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(t.getUint8(e+0))).concat(String.fromCharCode(t.getUint8(e+1))).concat(String.fromCharCode(t.getUint8(e+2))).concat(String.fromCharCode(t.getUint8(e+3)))}(r,n+0),s=r.getUint32(n+4,On),a=r.getUint32(n+8,On);switch(Object.assign(t,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:o,version:s,json:{},binChunks:[]}),n+=Sn,t.version){case 1:return function(t,e,n){j(t.header.byteLength>Sn+Mn);const i=e.getUint32(n+0,On),r=e.getUint32(n+4,On);return n+=Mn,j(r===Ln),kn(t,e,n,i),n+=i,n+=Un(t,e,n,t.header.byteLength),n}(t,r,n);case 2:return function(t,e,n,i){return j(t.header.byteLength>Sn+Mn),function(t,e,n,i){for(;n+8<=t.header.byteLength;){const r=e.getUint32(n+0,On),o=e.getUint32(n+4,On);switch(n+=Mn,o){case In:kn(t,e,n,r);break;case Pn:Un(t,e,n,r);break;case Dn:i.strict||kn(t,e,n,r);break;case Fn:i.strict||Un(t,e,n,r)}n+=_t(r,4)}}(t,e,n,i),n+t.header.byteLength}(t,r,n,i={});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}function kn(t,e,n,i){const r=new Uint8Array(e.buffer,n,i),o=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(o),_t(i,4)}function Un(t,e,n,i){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:i,arrayBuffer:e.buffer}),_t(i,4)}async function zn(t,e){let n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;var r,o,s,a;!function(t,e,n,i){i.uri&&(t.baseUri=i.uri);if(e instanceof ArrayBuffer&&!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=new DataView(t),{magic:r=Tn}=n,o=i.getUint32(e,!1);return o===r||o===Tn}(e,n,i)){e=(new TextDecoder).decode(e)}if("string"===typeof e)t.json=At(e);else if(e instanceof ArrayBuffer){const r={};n=Rn(r,e,n,i.glb),gt("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),t._glb=r,t.json=r.json}else gt(!1,"GLTF: must be ArrayBuffer or string");const r=t.json.buffers||[];if(t.buffers=new Array(r.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}const o=t.json.images||[];t.images=new Array(o.length).fill({})}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(new gn).normalize(t,e)}(t,{normalize:null===n||void 0===n||null===(r=n.gltf)||void 0===r?void 0:r.normalize}),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=hn.filter((t=>dn(t.name,e)));for(const o of i){var r;null===(r=o.preprocess)||void 0===r||r.call(o,t,e,n)}}(t,n,i);const l=[];if(null!==n&&void 0!==n&&null!==(o=n.gltf)&&void 0!==o&&o.loadBuffers&&t.json.buffers&&await async function(t,e,n){const i=t.json.buffers||[];for(let s=0;s<i.length;++s){const a=i[s];if(a.uri){var r,o;const{fetch:i}=n;gt(i);const l=mt(a.uri,e),c=await(null===n||void 0===n||null===(r=n.fetch)||void 0===r?void 0:r.call(n,l)),u=await(null===c||void 0===c||null===(o=c.arrayBuffer)||void 0===o?void 0:o.call(c));t.buffers[s]={arrayBuffer:u,byteOffset:0,byteLength:u.byteLength},delete a.uri}else null===t.buffers[s]&&(t.buffers[s]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}(t,n,i),null!==n&&void 0!==n&&null!==(s=n.gltf)&&void 0!==s&&s.loadImages){const e=async function(t,e,n){const i=function(t){const e=new Set,n=t.json.textures||[];for(const i of n)void 0!==i.source&&e.add(i.source);return Array.from(e).sort()}(t),r=t.json.images||[],o=[];for(const s of i)o.push(Gn(t,r[s],s,e,n));return await Promise.all(o)}(t,n,i);l.push(e)}const c=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=hn.filter((t=>dn(t.name,e)));for(const o of i){var r;await(null===(r=o.decode)||void 0===r?void 0:r.call(o,t,e,n))}}(t,n,i);return l.push(c),await Promise.all(l),null!==n&&void 0!==n&&null!==(a=n.gltf)&&void 0!==a&&a.postProcess?function(t,e){return(new En).postProcess(t,e)}(t,n):t}async function Gn(t,e,n,i,r){const{fetch:o,parse:s}=r;let a;if(e.uri&&!e.hasOwnProperty("bufferView")){const t=mt(e.uri,i),n=await o(t);a=await n.arrayBuffer()}if(Number.isFinite(e.bufferView)){const n=yt(t.json,t.buffers,e.bufferView);a=pt(n.buffer,n.byteOffset,n.byteLength)}gt(a,"glTF image has no data");let l=await s(a,[dt,Z],{mimeType:e.mimeType,basis:i.basis||{format:G()}},r);l&&l[0]&&(l={compressed:!0,mipmaps:!1,width:l[0].width,height:l[0].height,data:l[0]}),t.images=t.images||[],t.images[n]=l}const Nn={name:"glTF",id:"gltf",module:"gltf",version:"3.2.13",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;e={...Nn.options,...e},e.gltf={...Nn.options.gltf,...e.gltf};const{byteOffset:i=0}=e;return await zn({},t,i,e,n)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}}},29518:(t,e,n)=>{"use strict";n.d(e,{S:()=>x});var i=n(57370),r=n(7494);const{_parseImageNode:o}=globalThis,s="undefined"!==typeof Image,a="undefined"!==typeof ImageBitmap,l=Boolean(o),c=!!r.jU||l;function u(t){const e=d(t);if(!e)throw new Error("Not an image");return e}function h(t){switch(u(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function d(t){return"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!==typeof Image&&t instanceof Image?"image":t&&"object"===typeof t&&t.data&&t.width&&t.height?"data":null}const f=/^data:image\/svg\+xml/,A=/\.svg((\?|#).*)?$/;function p(t){return t&&(f.test(t)||A.test(t))}function g(t,e){if(p(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function m(t,e,n){const i=function(t,e){if(p(e)){let e=(new TextDecoder).decode(t);try{"function"===typeof unescape&&"function"===typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(n){throw new Error(n.message)}return"data:image/svg+xml;base64,".concat(btoa(e))}return g(t,e)}(t,n),r=self.URL||self.webkitURL,o="string"!==typeof i&&r.createObjectURL(i);try{return await async function(t,e){const n=new Image;if(n.src=t,e.image&&e.image.decode&&n.decode)return await n.decode(),n;return await new Promise(((e,i)=>{try{n.onload=()=>e(n),n.onerror=e=>i(new Error("Could not load image ".concat(t,": ").concat(e)))}catch(r){i(r)}}))}(o||i,e)}finally{o&&r.revokeObjectURL(o)}}const y={};let v=!0;async function _(t,e,n){let i;if(p(n)){i=await m(t,e,n)}else i=g(t,n);const r=e&&e.imagebitmap;return await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(t){for(const e in t||y)return!1;return!0}(e)&&v||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(n){console.warn(n),v=!1}return await createImageBitmap(t)}(i,r)}var b=n(90042);const x={id:"image",module:"images",name:"Images",version:"3.4.15",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],parse:async function(t,e,n){const r=((e=e||{}).image||{}).type||"auto",{url:o}=n||{};let l;switch(function(t){switch(t){case"auto":case"data":return function(){if(a)return"imagebitmap";if(s)return"image";if(c)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return a||s||c;case"imagebitmap":return a;case"image":return s;case"data":return c;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}(r)){case"imagebitmap":l=await _(t,e,o);break;case"image":l=await m(t,e,o);break;case"data":l=await async function(t,e){const{mimeType:n}=(0,b.I)(t)||{},r=globalThis._parseImageNode;return(0,i.h)(r),await r(t,n)}(t);break;default:(0,i.h)(!1)}return"data"===r&&(l=h(l)),l},tests:[t=>Boolean((0,b.I)(new DataView(t)))],options:{image:{type:"auto",decode:!0}}}},90042:(t,e,n)=>{"use strict";function i(t){return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=(r=e,[...r].map((t=>t.charCodeAt(0))));var r;for(let o=0;o<i.length;++o)if(i[o]!==t[o+n])return!1;return!0}(t,"ftyp",4)?0===(96&t[8])?null:function(t){switch((e=t,n=8,i=12,String.fromCharCode(...e.slice(n,i))).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}var e,n,i}(t):null}n.d(e,{I:()=>s});const r=!1,o=!0;function s(t){const e=a(t);return function(t){const e=a(t),n=e.byteLength>=24&&2303741511===e.getUint32(0,r);if(!n)return null;return{mimeType:"image/png",width:e.getUint32(16,r),height:e.getUint32(20,r)}}(e)||function(t){const e=a(t),n=e.byteLength>=3&&65496===e.getUint16(0,r)&&255===e.getUint8(2);if(!n)return null;const{tableMarkers:i,sofMarkers:o}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let n=65504;n<65520;++n)t.add(n);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let s=2;for(;s+9<e.byteLength;){const t=e.getUint16(s,r);if(o.has(t))return{mimeType:"image/jpeg",height:e.getUint16(s+5,r),width:e.getUint16(s+7,r)};if(!i.has(t))return null;s+=2,s+=e.getUint16(s,r)}return null}(e)||function(t){const e=a(t),n=e.byteLength>=10&&1195984440===e.getUint32(0,r);if(!n)return null;return{mimeType:"image/gif",width:e.getUint16(6,o),height:e.getUint16(8,o)}}(e)||function(t){const e=a(t),n=e.byteLength>=14&&16973===e.getUint16(0,r)&&e.getUint32(2,o)===e.byteLength;if(!n)return null;return{mimeType:"image/bmp",width:e.getUint32(18,o),height:e.getUint32(22,o)}}(e)||function(t){const e=new Uint8Array(t instanceof DataView?t.buffer:t),n=i(e);if(!n)return null;return{mimeType:n.mimeType,width:0,height:0}}(e)}function a(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}},12746:(t,e,n)=>{"use strict";n.d(e,{V:()=>o});var i=n(7494);const r={};function o(t){if(void 0===r[t]){const e=i.jU?function(t){switch(t){case"image/avif":case"image/webp":return function(t){try{const e=document.createElement("canvas");return 0===e.toDataURL(t).indexOf("data:".concat(t))}catch{return!1}}(t);default:return!0}}(t):s(t);r[t]=e}return r[t]}function s(t){const e=["image/png","image/jpeg","image/gif"],{_parseImageNode:n,_imageFormatsNode:i=e}=globalThis;return Boolean(n)&&i.includes(t)}},52194:(t,e,n)=>{"use strict";function i(t,e,n){if(n=n||t.byteLength,t.byteLength<n||e.byteLength<n)return!1;const i=new Uint8Array(t),r=new Uint8Array(e);for(let o=0;o<i.length;++o)if(i[o]!==r[o])return!1;return!0}function r(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e.map((t=>t instanceof ArrayBuffer?new Uint8Array(t):t)),r=i.reduce(((t,e)=>t+e.byteLength),0),o=new Uint8Array(r);let s=0;for(const a of i)o.set(a,s),s+=a.byteLength;return o.buffer}function o(t,e,n){const i=void 0!==n?new Uint8Array(t).subarray(e,e+n):new Uint8Array(t).subarray(e);return new Uint8Array(i).buffer}n.d(e,{JY:()=>r,Xq:()=>i,qv:()=>o})},83497:(t,e,n)=>{"use strict";n.d(e,{Pk:()=>r,T_:()=>o});var i=n(57370);function r(t,e){return(0,i.h)(t>=0),(0,i.h)(e>0),t+(e-1)&~(e-1)}function o(t,e,n){let i;if(t instanceof ArrayBuffer)i=new Uint8Array(t);else{const e=t.byteOffset,n=t.byteLength;i=new Uint8Array(t.buffer||t.arrayBuffer,e,n)}return e.set(i,n),n+r(i.byteLength,4)}},57370:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"loader assertion failed.")}n.d(e,{h:()=>i})},7494:(t,e,n)=>{"use strict";n.d(e,{jU:()=>i});"undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof n.g&&n.g,"undefined"!==typeof document&&document;const i=Boolean("object"!==typeof process||"[object process]"!==String(process)||process.browser),r="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);r&&parseFloat(r[1])},27036:(t,e,n)=>{"use strict";function i(t,e,n){if(t.byteLength<=e+n)return"";const i=new DataView(t);let r="";for(let o=0;o<n;o++)r+=String.fromCharCode(i.getUint8(e+o));return r}function r(t){try{return JSON.parse(t)}catch(e){throw new Error('Failed to parse JSON from data starting with "'.concat(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"===typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return i(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer)return i(t,0,e);return""}(t),'"'))}}n.d(e,{R:()=>r})},17834:(t,e,n)=>{"use strict";function i(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function r(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}n.d(e,{XX:()=>r,vB:()=>i})},65192:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var i=n(64649),r=n(92138);const o={id:"request-scheduler",throttleRequests:!0,maxRequests:6};class s{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.Z)(this,"props",void 0),(0,i.Z)(this,"stats",void 0),(0,i.Z)(this,"activeRequestCount",0),(0,i.Z)(this,"requestQueue",[]),(0,i.Z)(this,"requestMap",new Map),(0,i.Z)(this,"deferredUpdate",null),this.props={...o,...t},this.stats=new r.Z({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0;if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);const n={handle:t,priority:0,getPriority:e},i=new Promise((t=>(n.resolve=t,n)));return this.requestQueue.push(n),this.requestMap.set(t,i),this._issueNewRequests(),i}_issueRequest(t){const{handle:e,resolve:n}=t;let i=!1;const r=()=>{i||(i=!0,this.requestMap.delete(e),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:r}):Promise.resolve({done:r})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout((()=>this._issueNewRequestsAsync()),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;const t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(let e=0;e<t;++e){const t=this.requestQueue.shift();t&&this._issueRequest(t)}}}_updateAllRequests(){const t=this.requestQueue;for(let e=0;e<t.length;++e){const n=t[e];this._updateRequest(n)||(t.splice(e,1),this.requestMap.delete(n.handle),e--)}t.sort(((t,e)=>t.priority-e.priority))}_updateRequest(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}},38395:(t,e,n)=>{"use strict";function i(t){let e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let c=0;c<l;c+=3){const t=a[c],l=a[c+1],u=a[c+2];e=t<e?t:e,n=l<n?l:n,i=u<i?u:i,r=t>r?t:r,o=l>o?l:o,s=u>s?u:s}return[[e,n,i],[r,o,s]]}n.d(e,{v:()=>i})},73599:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}n.d(e,{h:()=>i})},89596:(t,e,n)=>{"use strict";n.d(e,{CO:()=>r,hJ:()=>s,jU:()=>o,tq:()=>a});const i={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof n.g&&n.g,document:"undefined"!==typeof document&&document},r=i.global||i.self||i.window||{},o="object"!==typeof process||"[object process]"!==String(process)||process.browser,s="function"===typeof importScripts,a="undefined"!==typeof window&&"undefined"!==typeof window.orientation,l="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);l&&parseFloat(l[1])},34819:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var i=n(69296),r=n(79666);const o=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),s=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),a=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),l=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),c={POSITION:{size:3,value:new Float32Array(s)},NORMAL:{size:3,value:new Float32Array(a)},TEXCOORD_0:{size:2,value:new Float32Array(l)}};class u extends i.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=(0,r.hQ)("cube-geometry")}=t;super({...t,id:e,indices:{size:1,value:new Uint16Array(o)},attributes:{...c,...t.attributes}})}}},69296:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var i=n(79666),r=n(81301);const o={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class s{static get DRAW_MODE(){return o}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=(0,i.hQ)("geometry"),drawMode:n=o.TRIANGLES,attributes:r={},indices:s=null,vertexCount:a=null}=t;this.id=e,this.drawMode=0|n,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=a||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(t){return"Geometry ".concat(this.id," attribute ").concat(t)}_setAttributes(t,e){e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e);for(const n in t){let e=t[n];e=ArrayBuffer.isView(e)?{value:e}:e,(0,r.h)(ArrayBuffer.isView(e.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"POSITION"!==n&&"positions"!==n||e.size||(e.size=3),"indices"===n?((0,r.h)(!this.indices),this.indices=e):this.attributes[n]=e}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(t,e){if(e)return e.value.length;let n=1/0;for(const i in t){const e=t[i],{value:r,size:o,constant:s}=e;!s&&r&&o>=1&&(n=Math.min(n,r.length/o))}return(0,r.h)(Number.isFinite(n)),n}}},94557:(t,e,n)=>{"use strict";n.d(e,{Z:()=>L});var i=n(28007),r=n(37330),o=n(79666),s=n(81301),a=n(97756),l=n(79817),c=n(77462),u=n(33839),h=n(35572);let d=null;function f(t,e){var n;return new t((n=t.BYTES_PER_ELEMENT*e,(!d||d.byteLength<n)&&(d=new ArrayBuffer(n)),d),0,e)}var A=n(93594);class p extends h.Z{get[Symbol.toStringTag](){return"VertexArrayObject"}static isSupported(t){return!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero||((0,i.D0)(t)||"Chrome"===(0,A.Z)())}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new p(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return p.MAX_ATTRIBUTES=p.MAX_ATTRIBUTES||t.getParameter(34921),p.MAX_ATTRIBUTES}static setConstant(t,e,n){switch(n.constructor){case Float32Array:p._setConstantFloatArray(t,e,n);break;case Int32Array:p._setConstantIntArray(t,e,n);break;case Uint32Array:p._setConstantUintArray(t,e,n);break;default:(0,s.h)(!1)}}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.id||e.program&&e.program.id;super(t,Object.assign({},e,{id:n})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=e.isDefaultArray||!1,this.gl2=t,this.initialize(e),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return p.getMaxAttributes(this.gl)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(t)}setProps(t){return this}setElementBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return(0,s.h)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind((()=>{this.gl.bindBuffer(34963,t?t.handle:null)})),this}setBuffer(t,e,n){if(34963===e.target)return this.setElementBuffer(e,n);const{size:r,type:o,stride:a,offset:l,normalized:c,integer:u,divisor:h}=n,{gl:d,gl2:f}=this;return t=Number(t),this.bind((()=>{d.bindBuffer(34962,e.handle),u?((0,s.h)((0,i.D0)(d)),f.vertexAttribIPointer(t,r,o,a,l)):d.vertexAttribPointer(t,r,o,c,a,l),d.enableVertexAttribArray(t),f.vertexAttribDivisor(t,h||0)})),this}enable(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!e&&0===t&&!p.isSupported(this.gl,{constantAttributeZero:!0})||(t=Number(t),this.bind((()=>e?this.gl.enableVertexAttribArray(t):this.gl.disableVertexAttribArray(t)))),this}getConstantBuffer(t,e){const n=this._normalizeConstantArrayValue(e),i=n.byteLength*t,r=n.length*t;let o=!this.buffer;if(this.buffer=this.buffer||new u.Z(this.gl,i),o=o||this.buffer.reallocate(i),o=o||!this._compareConstantArrayValues(n,this.bufferValue),o){const t=f(e.constructor,r);!function(t){let{target:e,source:n,start:i=0,count:r=1}=t;const o=n.length,s=r*o;let a=0;for(let l=i;a<o;a++)e[l++]=n[a];for(;a<s;)a<s-a?(e.copyWithin(i+a,i,i+a),a*=2):(e.copyWithin(i+a,i,i+s-a),a=s)}({target:t,source:n,start:0,count:r}),this.buffer.subData(t),this.bufferValue=e}return this.buffer}_normalizeConstantArrayValue(t){return Array.isArray(t)?new Float32Array(t):t}_compareConstantArrayValues(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}static _setConstantFloatArray(t,e,n){switch(n.length){case 1:t.vertexAttrib1fv(e,n);break;case 2:t.vertexAttrib2fv(e,n);break;case 3:t.vertexAttrib3fv(e,n);break;case 4:t.vertexAttrib4fv(e,n);break;default:(0,s.h)(!1)}}static _setConstantIntArray(t,e,n){switch((0,s.h)((0,i.D0)(t)),n.length){case 1:t.vertexAttribI1iv(e,n);break;case 2:t.vertexAttribI2iv(e,n);break;case 3:t.vertexAttribI3iv(e,n);break;case 4:t.vertexAttribI4iv(e,n);break;default:(0,s.h)(!1)}}static _setConstantUintArray(t,e,n){switch((0,s.h)((0,i.D0)(t)),n.length){case 1:t.vertexAttribI1uiv(e,n);break;case 2:t.vertexAttribI2uiv(e,n);break;case 3:t.vertexAttribI3uiv(e,n);break;case 4:t.vertexAttribI4uiv(e,n);break;default:(0,s.h)(!1)}}_createHandle(){return this.gl.createVertexArray()}_deleteHandle(t){return this.gl2.deleteVertexArray(t),[this.elements]}_bindHandle(t){this.gl2.bindVertexArray(t)}_getParameter(t,e){let{location:n}=e;return(0,s.h)(Number.isFinite(n)),this.bind((()=>34373===t?this.gl.getVertexAttribOffset(n,t):this.gl.getVertexAttrib(n,t)))}}var g=n(69221);const m=/^(.+)__LOCATION_([0-9]+)$/,y=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class v{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.id||e.program&&e.program.id;this.id=n,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new p(t),(0,g.F)(this,"VertexArray","v6.0",y),this.initialize(e),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:t}=this.vertexArrayObject;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}setProps(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(t){return Object.assign(this.attributes,t),this.vertexArrayObject.bind((()=>{for(const e in t){const n=t[e];this._setAttribute(e,n)}this.gl.bindBuffer(34962,null)})),this}setElementBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}setBuffer(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===e.target)return this.setElementBuffer(e,n);const{location:i,accessor:r}=this._resolveLocationAndAccessor(t,e,e.accessor,n);return i>=0&&(this.values[i]=e,this.accessors[i]=r,this.clearDrawParams(),this.vertexArrayObject.setBuffer(i,e,r)),this}setConstant(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{location:i,accessor:r}=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},n));return i>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[i]=e,this.accessors[i]=r,this.clearDrawParams(),this.vertexArrayObject.enable(i,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind((()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new u.Z(this.gl,{accessor:{size:4}});for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++)this.values[t]instanceof u.Z&&(this.gl.disableVertexAttribArray(t),this.gl.bindBuffer(34962,this.buffer.handle),this.gl.vertexAttribPointer(t,1,5126,!1,0,0))})),this}bindBuffers(){return this.vertexArrayObject.bind((()=>{this.elements&&this.setElementBuffer(this.elements);for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++){const e=this.values[t];e instanceof u.Z&&this.setBuffer(t,e)}})),this}bindForDraw(t,e,n){let i;return this.vertexArrayObject.bind((()=>{this._setConstantAttributes(t,e),i=n()})),i}_resolveLocationAndAccessor(t,e,n,r){const o={location:-1,accessor:null},{location:a,name:l}=this._getAttributeIndex(t);if(!Number.isFinite(a)||a<0)return this.unused[t]=e,i.cM.once(3,(()=>"unused value ".concat(t," in ").concat(this.id)))(),o;const u=this._getAttributeInfo(l||a);if(!u)return o;const h=this.accessors[a]||{},d=c.Z.resolve(u.accessor,h,n,r),{size:f,type:A}=d;return(0,s.h)(Number.isFinite(f)&&Number.isFinite(A)),{location:a,accessor:d}}_getAttributeInfo(t){return this.configuration&&this.configuration.getAttributeInfo(t)}_getAttributeIndex(t){const e=Number(t);if(Number.isFinite(e))return{location:e};const n=m.exec(t),i=n?n[1]:t,r=n?Number(n[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(i)+r,name:i}:{location:-1}}_setAttribute(t,e){if(e instanceof u.Z)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof u.Z){const n=e[0],i=e[1];this.setBuffer(t,n,i)}else if(ArrayBuffer.isView(e)||Array.isArray(e)){const n=e;this.setConstant(t,n)}else{if(!(e.buffer instanceof u.Z))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");{const n=e;this.setBuffer(t,n.buffer,n)}}}_setConstantAttributes(t,e){const n=Math.max(0|t,0|e);let i=this.values[0];ArrayBuffer.isView(i)&&this._setConstantAttributeZero(i,n);for(let r=1;r<this.vertexArrayObject.MAX_ATTRIBUTES;r++)i=this.values[r],ArrayBuffer.isView(i)&&this._setConstantAttribute(r,i)}_setConstantAttributeZero(t,e){if(p.isSupported(this.gl,{constantAttributeZero:!0}))return void this._setConstantAttribute(0,t);const n=this.vertexArrayObject.getConstantBuffer(e,t);this.vertexArrayObject.setBuffer(0,n,this.accessors[0])}_setConstantAttribute(t,e){p.setConstant(this.gl,t,e)}_updateDrawParams(){const t={isIndexed:!1,isInstanced:!1,indexCount:1/0,vertexCount:1/0,instanceCount:1/0};for(let e=0;e<this.vertexArrayObject.MAX_ATTRIBUTES;e++)this._updateDrawParamsForLocation(t,e);return this.elements&&(t.elementCount=this.elements.getElementCount(this.elements.accessor),t.isIndexed=!0,t.indexType=this.elementsAccessor.type||this.elements.accessor.type,t.indexOffset=this.elementsAccessor.offset||0),t.indexCount===1/0&&(t.indexCount=0),t.vertexCount===1/0&&(t.vertexCount=0),t.instanceCount===1/0&&(t.instanceCount=0),t}_updateDrawParamsForLocation(t,e){const n=this.values[e],i=this.accessors[e];if(!n)return;const{divisor:r}=i,o=r>0;if(t.isInstanced=t.isInstanced||o,n instanceof u.Z){const e=n;if(o){const n=e.getVertexCount(i);t.instanceCount=Math.min(t.instanceCount,n)}else{const n=e.getVertexCount(i);t.vertexCount=Math.min(t.vertexCount,n)}}}setElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.cM.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}var _=n(54345),b=n(55888),x=n(83951);function w(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{isInteger:n=!1}=e;if(Array.isArray(t)||ArrayBuffer.isView(t))return function(t,e){const{maxElts:n=16,size:i=1}=e;let r="[";for(let s=0;s<t.length&&s<n;++s)s>0&&(r+=",".concat(s%i===0?" ":"")),r+=w(t[s],e);const o=t.length>n?"...":"]";return"".concat(r).concat(o)}(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<1e-16)return n?"0":"0.";if(n)return t.toFixed(0);if(Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);const i=t.toPrecision(2);return i.indexOf(".0")===i.length-2?i.slice(0,-1):i}function C(t,e,n,i){const{gl:r}=t;if(!e)return{[i]:"null","Format ":"N/A"};let o,s,a,l="NOT PROVIDED",c=1,h=0,d=0;if(n&&(l=n.type,c=n.size,l=String(l).replace("Array",""),o=-1!==l.indexOf("nt")),e instanceof u.Z){const t=e,{data:u,changed:f}=t.getDebugData();let A;if(s=f?"*":"",a=u,d=t.byteLength,h=d/u.BYTES_PER_ELEMENT/c,n){const t=n.divisor>0;A="".concat(t?"I ":"P "," ").concat(h," (x").concat(c,"=").concat(d," bytes ").concat((0,b.km)(r,l),")")}else o=!0,A="".concat(d," bytes");return{[i]:"".concat(s).concat(w(a,{size:c,isInteger:o})),"Format ":A}}return a=e,c=e.length,l=String(e.constructor.name).replace("Array",""),o=-1!==l.indexOf("nt"),{[i]:"".concat(w(a,{size:c,isInteger:o})," (constant)"),"Format ":"".concat(c,"x").concat(l," (constant)")}}function B(t,e){const{type:n,size:i}=e,r=(0,x.jG)(n,i);return r?"".concat(t," (").concat(r.name,")"):t}function E(t){let{header:e="Uniforms",program:n,uniforms:i,undefinedOnly:r=!1}=t;(0,s.h)(n);const o=".*Matrix",a=n._uniformSetters,l={},c=Object.keys(a).sort();let u=0;for(const s of c)s.match(".*_.*")||s.match(o)||T({table:l,header:e,uniforms:i,uniformName:s,undefinedOnly:r})&&u++;for(const s of c)s.match(o)&&T({table:l,header:e,uniforms:i,uniformName:s,undefinedOnly:r})&&u++;for(const s of c)l[s]||T({table:l,header:e,uniforms:i,uniformName:s,undefinedOnly:r})&&u++;let h=0;const d={};if(!r)for(const s in i){const t=i[s];l[s]||(h++,d[s]={Type:"NOT USED: ".concat(t),[e]:w(t)})}return{table:l,count:u,unusedTable:d,unusedCount:h}}function T(t){let{table:e,header:n,uniforms:i,uniformName:r,undefinedOnly:o}=t;const s=i[r],a=function(t){return void 0!==t&&null!==t}(s);return(!o||!a)&&(e[r]={[n]:a?w(s):"N/A","Uniform Type":a?s:"NOT PROVIDED"},!0)}function S(t){const{type:e,size:n}=t.accessor,i=(0,x.jG)(e,n);return i?"".concat(i.name," ").concat(t.name):t.name}const M={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function I(t,e){const{attributeMap:n=M}=e||{};return n&&n[t]||t}function P(t,e){let n;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}(0,s.h)(Number.isFinite(e.size),"attribute ".concat(t," needs size"))}const D=()=>{},F={};class L{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{id:n=(0,o.hQ)("model")}=e;(0,s.h)((0,i.UF)(t)),this.id=n,this.gl=t,this.id=e.id||(0,o.hQ)("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||r.Z.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:e=null,vs:n,fs:i,modules:o,defines:a,inject:l,varyings:c,bufferMode:u,transpileToGLSL100:h}=t;this.programProps={program:e,vs:n,fs:i,modules:o,defines:a,inject:l,varyings:c,bufferMode:u,transpileToGLSL100:h},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(t.moduleSettings))),this.drawMode=void 0!==t.drawMode?t.drawMode:4,this.vertexCount=t.vertexCount||0,this.geometryBuffers={},this.isInstanced=t.isInstanced||t.instanced||t.instanceCount>0,this._setModelProps(t),this.geometry={},(0,s.h)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(t){this._setModelProps(t)}delete(){for(const t in this._attributes)this._attributes[t]!==this.attributes[t]&&this._attributes[t].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(t){const{program:e,vs:n,fs:i,modules:r,defines:o,inject:s,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:n,fs:i,modules:r,defines:o,inject:s,varyings:a,bufferMode:l,transpileToGLSL100:c},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(t){return this.drawMode=t,this}setVertexCount(t){return(0,s.h)(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return(0,s.h)(Number.isFinite(t)),this.instanceCount=t,this}setGeometry(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,n){const i={};let r=e.indices;for(const o in e.attributes){const s=e.attributes[o],a=I(o,n);if("indices"===o)r=s;else if(s.constant)i[a]=s.value;else{const e=s.value,n={...s};delete n.value,i[a]=[new u.Z(t,e),n],P(o,n)}}if(r){const e=r.value||r;(0,s.h)(e instanceof Uint16Array||e instanceof Uint32Array,'attribute array for "indices" must be of integer type');const n={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new u.Z(t,{data:e,target:34963}),n]}return i}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,o.nK)(t))return this;const e={};for(const n in t){const i=t[n];e[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(e),this}setUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(this.uniforms,t),this}getModuleUniforms(t){this._checkProgram();const e=this.programManager.getUniforms(this.program);return e?e(t):{}}updateModuleSettings(t){const e=this.getModuleUniforms(t||{});return this.setUniforms(e)}clear(t){return(0,a.Z)(this.program.gl,t),this}draw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._checkProgram();const{moduleSettings:e=null,framebuffer:n,uniforms:r={},attributes:o={},transformFeedback:s=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=t;let c;this.setAttributes(o),this.updateModuleSettings(e),this.setUniforms(r),i.cM.priority>=2&&(c=this._logDrawCallStart(2));const u=this.vertexArray.getDrawParams(),{isIndexed:h=u.isIndexed,indexType:d=u.indexType,indexOffset:f=u.indexOffset,vertexArrayInstanced:A=u.isInstanced}=this.props;A&&!this.isInstanced&&i.cM.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:p,instanceCount:g}=this,{onBeforeRender:m=D,onAfterRender:y=D}=this.props;m(),this.program.setUniforms(this.uniforms);const v=this.program.draw(Object.assign(F,t,{logPriority:c,uniforms:null,framebuffer:n,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:s,isIndexed:h,indexType:d,isInstanced:p,instanceCount:g,offset:h?f:0}));return y(),i.cM.priority>=2&&this._logDrawCallEnd(c,l,n),v}transform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{discard:e=!0,feedbackBuffers:n,unbindModels:i=[]}=t;let{parameters:r}=t;n&&this._setFeedbackBuffers(n),e&&(r=Object.assign({},r,{35977:e})),i.forEach((t=>t.vertexArray.unbindBuffers()));try{this.draw(Object.assign({},t,{parameters:r}))}finally{i.forEach((t=>t.vertexArray.bindBuffers()))}return this}render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i.cM.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}_setModelProps(t){Object.assign(this.props,t),"uniforms"in t&&this.setUniforms(t.uniforms),"pickable"in t&&(this.pickable=t.pickable),"instanceCount"in t&&(this.instanceCount=t.instanceCount),"geometry"in t&&this.setGeometry(t.geometry),"attributes"in t&&this.setAttributes(t.attributes),"_feedbackBuffers"in t&&this._setFeedbackBuffers(t._feedbackBuffers)}_checkProgram(){if(!(this._programDirty||this.programManager.stateHash!==this._programManagerState))return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:e,fs:n,modules:i,inject:r,defines:o,varyings:s,bufferMode:a,transpileToGLSL100:l}=this.programProps;t=this.programManager.get({vs:e,fs:n,modules:i,inject:r,defines:o,varyings:s,bufferMode:a,transpileToGLSL100:l}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}(0,s.h)(t instanceof l.Z,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new v(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const t in this.geometryBuffers){const e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof u.Z&&e.delete()}}_setAnimationProps(t){this.animated&&(0,s.h)(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,o.nK)(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new _.Z(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}_logDrawCallStart(t){const e=t>3?0:1e4;if(!(Date.now()-this.lastLogTime<e))return this.lastLogTime=Date.now(),i.cM.group(2,">>> DRAWING MODEL ".concat(this.id),{collapsed:i.cM.level<=2})(),t}_logDrawCallEnd(t,e,n,r){if(void 0===t)return;const o=function(t){let{vertexArray:e,header:n="Attributes"}=t;if(!e.configuration)return{};const i={};e.elements&&(i.ELEMENT_ARRAY_BUFFER=C(e,e.elements,null,n));const r=e.values;for(const o in r){const t=e._getAttributeInfo(o);if(t){let s="".concat(o,": ").concat(t.name);const a=e.accessors[t.location];a&&(s="".concat(o,": ").concat(B(t.name,a))),i[s]=C(e,r[o],a,n)}}return i}({vertexArray:e,header:"".concat(this.id," attributes"),attributes:this._attributes}),{table:s,unusedTable:a,unusedCount:l}=E({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),{table:c,count:u}=E({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0});u>0&&i.cM.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&i.cM.log("UNUSED UNIFORMS",Object.keys(a))();const h=function(t){const e={},n="Accessors for ".concat(t.id);for(const i of t.attributeInfos)if(i){const t=S(i);e["in ".concat(t)]={[n]:JSON.stringify(i.accessor)}}for(const i of t.varyingInfos)if(i){const t=S(i);e["out ".concat(t)]={[n]:JSON.stringify(i.accessor)}}return e}(this.vertexArray.configuration);i.cM.table(t,o)(),i.cM.table(t,s)(),i.cM.table(t+1,h)(),r&&r.log({logLevel:2,message:"Rendered to ".concat(r.id)}),i.cM.groupEnd(2)()}}},37330:(t,e,n)=>{"use strict";n.d(e,{Z:()=>j});var i=n(5740),r=n(17865);const o={number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},array:{validate:(t,e)=>Array.isArray(t)||ArrayBuffer.isView(t)}};function s(t){let e=a(t);return"object"===e?t?"type"in t?Object.assign({},t,o[t.type]):"value"in t?(e=a(t.value),Object.assign({type:e},t,o[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},o[e])}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}class l{constructor(t){let{name:e,vs:n,fs:i,dependencies:o=[],uniforms:a,getUniforms:l,deprecations:c=[],defines:u={},inject:h={},vertexShader:d,fragmentShader:f}=t;(0,r.Z)("string"===typeof e),this.name=e,this.vs=n||d,this.fs=i||f,this.getModuleUniforms=l,this.dependencies=o,this.deprecations=this._parseDeprecationDefinitions(c),this.defines=u,this.injections=function(t){const e={vs:{},fs:{}};for(const n in t){let i=t[n];"string"===typeof i&&(i={order:0,injection:i}),e[n.slice(0,2)][n]=i}return e}(h),a&&(this.uniforms=function(t){const e={};for(const n in t){const i=s(t[n]);e[n]=i}return e}(a))}getModuleSource(t){let e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:(0,r.Z)(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),"\n").concat(e,"// END MODULE_").concat(this.name,"\n\n")}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach((n=>{n.regex.test(t)&&(n.deprecated?e.deprecated(n.old,n.new)():e.removed(n.old,n.new)())}))}_parseDeprecationDefinitions(t){return t.forEach((t=>{if("function"===t.type)t.regex=new RegExp("\\b".concat(t.old,"\\("));else t.regex=new RegExp("".concat(t.type," ").concat(t.old,";"))})),t}_defaultGetUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={},n=this.uniforms;for(const i in n){const o=n[i];i in t&&!o.private?(o.validate&&(0,r.Z)(o.validate(t[i],o),"".concat(this.name,": invalid ").concat(i)),e[i]=t[i]):e[i]=o.value}return e}}function c(t){return u(d(t))}function u(t){const e={},n={};return h({modules:t,level:0,moduleMap:e,moduleDepth:n}),Object.keys(n).sort(((t,e)=>n[e]-n[t])).map((t=>e[t]))}function h(t){let{modules:e,level:n,moduleMap:i,moduleDepth:r}=t;if(n>=5)throw new Error("Possible loop in shader dependency graph");for(const o of e)i[o.name]=o,(void 0===r[o.name]||r[o.name]<n)&&(r[o.name]=n);for(const o of e)o.dependencies&&h({modules:o.dependencies,level:n+1,moduleMap:i,moduleDepth:r})}function d(t,e){return t.map((t=>(t instanceof l||((0,r.Z)("string"!==typeof t,"Shader module use by name is deprecated. Import shader module '".concat(t,"' and use it directly.")),(0,r.Z)(t.name,"shader module has no name"),(t=new l(t)).dependencies=d(t.dependencies)),t)))}const f=7936,A=7937,p=7938,g=35724,m={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},y={};Object.keys(m).forEach((t=>{y[t]=t}));const v={};function _(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=m[e];if((0,r.Z)(i,e),!function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e="undefined"!==typeof window&&window.navigator||{},n=t.userAgent||e.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(e in v)return v[e];const o=i[0],s=n.behavior||"enable",a="#extension GL_".concat(o," : ").concat(s,"\nvoid main(void) {}"),l=t.createShader(35633);t.shaderSource(l,a),t.compileShader(l);const c=t.getShaderParameter(l,35713);return t.deleteShader(l),v[e]=c,c}function b(t,e){const n=m[e];(0,r.Z)(n,e);const i=function(t){return"undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}(t)&&n[1]||n[0],o="string"===typeof i?Boolean(t.getExtension(i)):i;return(0,r.Z)(!1===o||!0===o),o}function x(t,e){return(e=Array.isArray(e)?e:[e]).every((e=>b(t,e)))}function w(t){const e=function(t){const e=t.getExtension("WEBGL_debug_renderer_info"),n=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||f),i=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||A);return{gpuVendor:function(t,e){return t.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":t.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:t.getParameter(p),shadingLanguageVersion:t.getParameter(g)}}(t);switch(e.gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var C=n(62574);function B(t){return new RegExp("\\b".concat(t,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}const E=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],T=[...E,[B("attribute"),"in $1"],[B("varying"),"out $1"]],S=[...E,[B("varying"),"in $1"]],M=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],I=[...M,[B("in"),"attribute $1"],[B("out"),"varying $1"]],P=[...M,[B("in"),"varying $1"]],D="gl_FragColor",F=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,L=/void\s+main\s*\([^)]*\)\s*\{\n?/;function O(t,e,n){switch(e){case 300:return n?R(t,T):function(t){t=R(t,S);const e=t.match(F);if(e){const n=e[1];t=t.replace(new RegExp("\\b".concat(D,"\\b"),"g"),n)}else{const e="fragmentColor";t=t.replace(L,(t=>"out vec4 ".concat(e,";\n").concat(t))).replace(new RegExp("\\b".concat(D,"\\b"),"g"),e)}return t}(t);case 100:return n?R(t,I):function(t){t=R(t,P);const e=t.match(F);if(e){const n=e[1];t=t.replace(F,"").replace(new RegExp("\\b".concat(n,"\\b"),"g"),D)}return t}(t);default:throw new Error("unknown GLSL version ".concat(e))}}function R(t,e){for(const[n,i]of e)t=t.replace(n,i);return t}const k="\n\n".concat(C.O_,"\n\n"),U={[i.H]:"vertex",[i.Y]:"fragment"},z="precision highp float;\n\n";function G(t,e){let{id:n,source:o,type:s,modules:a,defines:l={},hookFunctions:c=[],inject:u={},transpileToGLSL100:h=!1,prologue:d=!0,log:f}=e;(0,r.Z)("string"===typeof o,"shader source must be a string");const A=s===i.H,p=o.split("\n");let g=100,m="",v=o;0===p[0].indexOf("#version ")?(g=300,m=p[0],v=p.slice(1).join("\n")):m="#version ".concat(g);const b={};a.forEach((t=>{Object.assign(b,t.getDefines())})),Object.assign(b,l);let B=d?"".concat(m,"\n").concat(function(t){let{id:e,source:n,type:i}=t;const r=e&&"string"===typeof e&&-1===n.indexOf("SHADER_NAME");return r?"\n#define SHADER_NAME ".concat(e,"_").concat(U[i],"\n\n"):""}({id:n,source:o,type:s}),"\n").concat(function(t){let{type:e}=t;return"\n#define SHADER_TYPE_".concat(U[e].toUpperCase(),"\n")}({type:s}),"\n").concat(w(t),"\n").concat(function(t,e,n){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return x(t,y.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),x(t,y.GLSL_DERIVATIVES)&&_(t,y.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),x(t,y.GLSL_FRAG_DATA)&&_(t,y.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),x(t,y.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(t),"\n").concat(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=0,n="";for(const i in t){0===e&&(n+="\n// APPLICATION DEFINES\n"),e++;const r=t[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(t[i],"\n"))}0===e&&(n+="\n");return n}(b),"\n").concat(A?"":z,"\n"):"".concat(m,"\n");const E=function(t){const e={vs:{},fs:{}};return t.forEach((t=>{let n;"string"!==typeof t?(n=t,t=n.hook):n={},t=t.trim();const[i,r]=t.split(":"),o=t.replace(/\(.+/,"");e[i][o]=Object.assign(n,{signature:r})})),e}(c),T={},S={},M={};for(const i in u){const t="string"===typeof u[i]?{injection:u[i],order:0}:u[i],e=i.match(/^(v|f)s:(#)?([\w-]+)$/);if(e){const n=e[2],r=e[3];n?"decl"===r?S[i]=[t]:M[i]=[t]:T[i]=[t]}else M[i]=[t]}for(const i of a){f&&i.checkDeprecations(v,f);B+=i.getModuleSource(s,g);const t=i.injections[s];for(const e in t){const n=e.match(/^(v|f)s:#([\w-]+)$/);if(n){const i="decl"===n[2]?S:M;i[e]=i[e]||[],i[e].push(t[e])}else T[e]=T[e]||[],T[e].push(t[e])}}return B+=k,B=(0,C.ZP)(B,s,S),B+=function(t,e){let n="";for(const i in t){const r=t[i];if(n+="void ".concat(r.signature," {\n"),r.header&&(n+="  ".concat(r.header)),e[i]){const t=e[i];t.sort(((t,e)=>t.order-e.order));for(const e of t)n+="  ".concat(e.injection,"\n")}r.footer&&(n+="  ".concat(r.footer)),n+="}\n"}return n}(E[s],T),B+=v,B=(0,C.ZP)(B,s,M),B=O(B,h?100:g,A),B}function N(t){return function(e){const n={};for(const i of t){const t=i.getUniforms(e,n);Object.assign(n,t)}return n}}var Z=n(79817);class j{static getDefaultProgramManager(t){return t.luma=t.luma||{},t.luma.defaultProgramManager=t.luma.defaultProgramManager||new j(t),t.luma.defaultProgramManager}constructor(t){this.gl=t,this._programCache={},this._getUniforms={},this._registeredModules={},this._hookFunctions=[],this._defaultModules=[],this._hashes={},this._hashCounter=0,this.stateHash=0,this._useCounts={}}addDefaultModule(t){this._defaultModules.find((e=>e.name===t.name))||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(t){const e="string"===typeof t?t:t.name;this._defaultModules=this._defaultModules.filter((t=>t.name!==e)),this.stateHash++}addShaderHook(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}get(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{vs:e="",fs:n="",defines:r={},inject:o={},varyings:s=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=t,u=this._getModuleList(t.modules),h=this._getHash(e),d=this._getHash(n),f=u.map((t=>this._getHash(t.name))).sort(),A=s.map((t=>this._getHash(t))),p=Object.keys(r).sort(),g=Object.keys(o).sort(),m=[],y=[];for(const i of p)m.push(this._getHash(i)),m.push(this._getHash(r[i]));for(const i of g)y.push(this._getHash(i)),y.push(this._getHash(o[i]));const v="".concat(h,"/").concat(d,"D").concat(m.join("/"),"M").concat(f.join("/"),"I").concat(y.join("/"),"V").concat(A.join("/"),"H").concat(this.stateHash,"B").concat(a).concat(l?"T":"");if(!this._programCache[v]){const t=function(t,e){const{vs:n,fs:r}=e,o=c(e.modules||[]);return{gl:t,vs:G(t,Object.assign({},e,{source:n,type:i.H,modules:o})),fs:G(t,Object.assign({},e,{source:r,type:i.Y,modules:o})),getUniforms:N(o)}}(this.gl,{vs:e,fs:n,modules:u,inject:o,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[v]=new Z.Z(this.gl,{hash:v,vs:t.vs,fs:t.fs,varyings:s,bufferMode:a}),this._getUniforms[v]=t.getUniforms||(t=>{}),this._useCounts[v]=0}return this._useCounts[v]++,this._programCache[v]}getUniforms(t){return this._getUniforms[t.hash]||null}release(t){const e=t.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}_getModuleList(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=new Array(this._defaultModules.length+t.length),n={};let i=0;for(let r=0,o=this._defaultModules.length;r<o;++r){const t=this._defaultModules[r],o=t.name;e[i++]=t,n[o]=!0}for(let r=0,o=t.length;r<o;++r){const o=t[r],s=o.name;n[s]||(e[i++]=o,n[s]=!0)}return e.length=i,e}}},17225:(t,e,n)=>{"use strict";n.d(e,{Z:()=>S});var i=n(17865);const r="out vec4 transform_output;\nvoid main() {\n  transform_output = vec4(0);\n}",o="#version 300 es\n".concat(r);function s(t,e){e=Array.isArray(e)?e:[e];const n=t.replace(/^\s+/,"").split(/\s+/),[i,r,o]=n;if(!e.includes(i)||!r||!o)return null;return{qualifier:i,type:r,name:o.split(";")[0]}}function a(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{version:e=100,input:n,inputType:s,output:a}=t;if(!n)return 300===e?o:e>300?"#version ".concat(e,"\n").concat(r):"void main() {gl_FragColor = vec4(0);}";const l=function(t,e){switch(e){case"float":return"vec4(".concat(t,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(t,", 0.0, 1.0)");case"vec3":return"vec4(".concat(t,", 1.0)");case"vec4":return t;default:return(0,i.Z)(!1),null}}(n,s);return e>=300?"#version ".concat(e," ").concat(300===e?"es":"","\nin ").concat(s," ").concat(n,";\nout vec4 ").concat(a,";\nvoid main() {\n  ").concat(a," = ").concat(l,";\n}"):"varying ".concat(s," ").concat(n,";\nvoid main() {\n  gl_FragColor = ").concat(l,";\n}")}var l=n(28007),c=n(33839),u=n(54345),h=n(81301);class d{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}setupResources(t){for(const e of this.bindings)this._setupTransformFeedback(e,t)}updateModelProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{varyings:e}=this;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}getDrawOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.bindings[this.currentIndex],{sourceBuffers:n,transformFeedback:i}=e;return{attributes:Object.assign({},n,t.attributes),transformFeedback:i}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t)}getBuffer(t){const{feedbackBuffers:e}=this.bindings[this.currentIndex],n=t?e[t]:null;return n?n instanceof c.Z?n:n.buffer:null}getData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{varyingName:e}=t,n=this.getBuffer(e);return n?n.getData():null}delete(){for(const t in this.resources)this.resources[t].delete()}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t),this.varyings=t.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&(0,h.h)((0,l.D0)(this.gl))}_getFeedbackBuffers(t){const{sourceBuffers:e={}}=t,n={};if(this.bindings[this.currentIndex]&&Object.assign(n,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const i in this.feedbackMap){const t=this.feedbackMap[i];i in e&&(n[t]=i)}Object.assign(n,t.feedbackBuffers);for(const i in n){const t=n[i];if("string"===typeof t){const r=e[t],{byteLength:o,usage:s,accessor:a}=r;n[i]=this._createNewBuffer(i,{byteLength:o,usage:s,accessor:a})}}return n}_setupBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e=null}=t;Object.assign(this.feedbackMap,t.feedbackMap);const n=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:e,feedbackBuffers:n})}_setupTransformFeedback(t,e){let{model:n}=e;const{program:i}=n;t.transformFeedback=new u.Z(this.gl,{program:i,buffers:t.feedbackBuffers})}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:e}=this._swapBuffers(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceBuffers:t,feedbackBuffers:e})}}_updateBinding(t,e){return t?(Object.assign(t.sourceBuffers,e.sourceBuffers),Object.assign(t.feedbackBuffers,e.feedbackBuffers),t.transformFeedback&&t.transformFeedback.setBuffers(t.feedbackBuffers),t):{sourceBuffers:Object.assign({},e.sourceBuffers),feedbackBuffers:Object.assign({},e.feedbackBuffers)}}_swapBuffers(t){if(!this.feedbackMap)return null;const e=Object.assign({},t.sourceBuffers),n=Object.assign({},t.feedbackBuffers);for(const i in this.feedbackMap){const r=this.feedbackMap[i];e[i]=t.feedbackBuffers[r],n[r]=t.sourceBuffers[i],(0,h.h)(n[r]instanceof c.Z)}return{sourceBuffers:e,feedbackBuffers:n}}_createNewBuffer(t,e){const n=new c.Z(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=n,n}_getNextIndex(){return(this.currentIndex+1)%2}}var f=n(56474),A=n(58300),p=n(79078),g=n(17507);function m(t){let e=100;const n=t.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){const t=parseInt(n[1],10);Number.isFinite(t)&&(e=t)}return e}var y=n(62574);const v={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n  return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n  float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n  float xIndex = transform_elementID - (yIndex * texSize[0]);\n  return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n  vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n  vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n  vec2 coord = indices / size + pixelSizeHalf;\n  return coord;\n}\nvec2 transform_getPos(vec2 size) {\n  vec2 texCoord = transform_getTexCoord(size);\n  vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n  return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n  vec2 texCoord = transform_getTexCoord(size);\n  vec4 textureColor = texture2D(texSampler, texCoord);\n  return textureColor;\n}\n",fs:null},_="transform_uSampler_",b="transform_uSize_",x="transform_position";function w(t){let{vs:e,sourceTextureMap:n,targetTextureVarying:r,targetTexture:o}=t;let a=Object.keys(n).length,l=null;const c={};let u=e,d={};if(a>0||r){const t=u.split("\n"),e=t.slice();if(t.forEach(((t,o,u)=>{if(a>0){const r=function(t,e){const n={},r=function(t){return s(t,["attribute","in"])}(t);if(!r)return null;const{type:o,name:a}=r;if(a&&e[a]){const e="// ".concat(t," => Replaced by Transform with a sampler"),{samplerName:r,sizeName:s,uniformDeclerations:l}=function(t){const e="".concat(_).concat(t),n="".concat(b).concat(t),i="  uniform sampler2D ".concat(e,";\n  uniform vec2 ").concat(n,";");return{samplerName:e,sizeName:n,uniformDeclerations:i}}(a),c=function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return(0,i.Z)(!1),null}}(o),u="  ".concat(o," ").concat(a," = transform_getInput(").concat(r,", ").concat(s,").").concat(c,";\n");n[r]=a;return{updatedLine:e,inject:{"vs:#decl":l,"vs:#main-start":u},samplerTextureMap:n}}return null}(t,n);if(r){const{updatedLine:t,inject:n}=r;e[o]=t,d=(0,y.Lm)([d,n]),Object.assign(c,r.samplerTextureMap),a--}}r&&!l&&(l=function(t,e){const n=s(t,["varying","out"]);if(!n)return null;return n.name===e?n.type:null}(t,r))})),r){(0,h.h)(o);const t="".concat(b).concat(r),e={"vs:#decl":"uniform vec2 ".concat(t,";\n"),"vs:#main-start":"     vec2 ".concat(x," = transform_getPos(").concat(t,");\n     gl_Position = vec4(").concat(x,", 0, 1.);\n")};d=(0,y.Lm)([d,e])}u=e.join("\n")}return{vs:u,targetTextureType:l,inject:d,samplerTextureMap:c}}const C={10241:9728,10240:9728,10242:33071,10243:33071};class B{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}updateModelProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._processVertexShader(t);return Object.assign({},t,e)}getDrawOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e,sourceTextures:n,framebuffer:i,targetTexture:r}=this.bindings[this.currentIndex],o=Object.assign({},e,t.attributes),s=Object.assign({},t.uniforms),a=Object.assign({},t.parameters);let l=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const e in this.samplerTextureMap){const t=this.samplerTextureMap[e];s[e]=n[t]}this._setSourceTextureParameters();const t=function(t){let{sourceTextureMap:e,targetTextureVarying:n,targetTexture:i}=t;const r={};let o,s;n&&(({width:o,height:s}=i),r["".concat(b).concat(n)]=[o,s]);for(const a in e)({width:o,height:s}=e[a]),r["".concat(b).concat(a)]=[o,s];return r}({sourceTextureMap:n,targetTextureVarying:this.targetTextureVarying,targetTexture:r});Object.assign(s,t)}return this.hasTargetTexture&&(l=!1,a.viewport=[0,0,i.width,i.height]),{attributes:o,framebuffer:i,uniforms:s,discard:l,parameters:a}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupTextures(t)}getTargetTexture(){const{targetTexture:t}=this.bindings[this.currentIndex];return t}getData(){let{packed:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{framebuffer:e}=this.bindings[this.currentIndex],n=(0,f.z6)(e);if(!t)return n;const r=n.constructor,o=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return(0,i.Z)(!1),null}}(this.targetTextureType),s=new r(n.length*o/4);let a=0;for(let i=0;i<n.length;i+=4)for(let t=0;t<o;t++)s[a++]=n[i+t];return s}getFramebuffer(){return this.bindings[this.currentIndex].framebuffer}delete(){this.ownTexture&&this.ownTexture.delete(),this.elementIDBuffer&&this.elementIDBuffer.delete()}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{_targetTextureVarying:e,_swapTexture:n}=t;this._swapTexture=n,this.targetTextureVarying=e,this.hasTargetTexture=e,this._setupTextures(t)}_createTargetTexture(t){const{sourceTextures:e,textureOrReference:n}=t;if(n instanceof A.Z)return n;const i=e[n];return i?(this._targetRefTexName=n,this._createNewTexture(i)):null}_setupTextures(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e,_sourceTextures:n={},_targetTexture:i}=t,r=this._createTargetTexture({sourceTextures:n,textureOrReference:i});this.hasSourceTextures=this.hasSourceTextures||n&&Object.keys(n).length>0,this._updateBindings({sourceBuffers:e,sourceTextures:n,targetTexture:r}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}_updateElementIDBuffer(t){if("number"!==typeof t||this.elementCount>=t)return;const e=new Float32Array(t);e.forEach(((t,e,n)=>{n[e]=e})),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new c.Z(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){const{sourceTextures:t,targetTexture:e}=this._swapTextures(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceTextures:t,targetTexture:e})}}_updateBinding(t,e){const{sourceBuffers:n,sourceTextures:i,targetTexture:r}=e;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,i),Object.assign(t.sourceBuffers,n),r){t.targetTexture=r;const{width:e,height:n}=r,{framebuffer:i}=t;i?(i.update({attachments:{36064:r},resizeAttachments:!1}),i.resize({width:e,height:n})):t.framebuffer=new p.Z(this.gl,{id:"transform-framebuffer",width:e,height:n,attachments:{36064:r}})}return t}_setSourceTextureParameters(){const t=this.currentIndex,{sourceTextures:e}=this.bindings[t];for(const n in e)e[n].setParameters(C)}_swapTextures(t){if(!this._swapTexture)return null;const e=Object.assign({},t.sourceTextures);e[this._swapTexture]=t.targetTexture;return{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}_createNewTexture(t){const e=(0,g.h)(t,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=e,e}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceTextures:e,targetTexture:n}=this.bindings[this.currentIndex],{vs:i,uniforms:r,targetTextureType:o,inject:s,samplerTextureMap:l}=w({vs:t.vs,sourceTextureMap:e,targetTextureVarying:this.targetTextureVarying,targetTexture:n}),c=(0,y.Lm)([t.inject||{},s]);this.targetTextureType=o,this.samplerTextureMap=l;return{vs:i,fs:t._fs||a({version:m(i),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[v].concat(t.modules||[]):t.modules,uniforms:r,inject:c}}}var E=n(79666),T=n(94557);class S{static isSupported(t){return(0,l.D0)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(e),Object.seal(this)}delete(){const{model:t,bufferTransform:e,textureTransform:n}=this;t&&t.delete(),e&&e.delete(),n&&n.delete()}run(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clearRenderTarget:e=!0}=t,n=this._updateDrawOptions(t);e&&n.framebuffer&&n.framebuffer.clear({color:!0}),this.model.transform(n)}swap(){let t=!1;const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)t=t||n.swap();(0,h.h)(t,"Nothing to swap")}getBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.bufferTransform&&this.bufferTransform.getBuffer(t)}getData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e){const e=n.getData(t);if(e)return e}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"elementCount"in t&&this.model.setVertexCount(t.elementCount);const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)n.update(t)}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{gl:e}=this;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new T.Z(e,Object.assign({},t,{fs:t.fs||a({version:m(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of n)e=i.updateModelProps(e);return e}_buildResourceTransforms(t,e){(function(t){if(!(0,E.nK)(t.feedbackBuffers)||!(0,E.nK)(t.feedbackMap)||t.varyings&&t.varyings.length>0)return!0;return!1})(e)&&(this.bufferTransform=new d(t,e)),function(t){if(!(0,E.nK)(t._sourceTextures)||t._targetTexture||t._targetTextureVarying)return!0;return!1}(e)&&(this.textureTransform=new B(t,e)),(0,h.h)(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of n)e=Object.assign(e,i.getDrawOptions(e));return e}}},92086:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(12308),r=n(70353),o=n(58300),s=n(28007);class a{constructor(t,e){let{attributes:n,material:o,pbrDebug:s,imageBasedLightingEnvironment:a,lights:l,useTangents:c}=e;this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},(0,i.U6)(t,r.h.GLSL_TEXTURE_LOD)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],a&&(this.uniforms.u_DiffuseEnvSampler=a.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=a.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=a.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),s&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(n.NORMAL,"HAS_NORMALS"),this.defineIfPresent(n.TANGENT&&c,"HAS_TANGENTS"),this.defineIfPresent(n.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(a,"USE_IBL"),this.defineIfPresent(l,"USE_LIGHTS"),this.defineIfPresent(s,"PBR_DEBUG"),o&&this.parseMaterial(o)}defineIfPresent(t,e){t&&(this.defines[e]=1)}parseTexture(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const i=t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{},r=t.texture.source.image;let s,a={};r.compressed?(s=r,a={[this.gl.TEXTURE_MIN_FILTER]:r.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):s={data:r};const l=new o.Z(this.gl,{id:t.name||t.id,parameters:{...i,...a},pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1},...s});this.uniforms[e]=l,this.defineIfPresent(n,n),this.generatedTextures.push(l)}parsePbrMetallicRoughness(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:e=1,roughnessFactor:n=1}=t;this.uniforms.u_MetallicRoughnessValues=[e,n]}parseMaterial(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:e=1}=t.normalTexture;this.uniforms.u_NormalScale=e}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:e=1}=t.occlusionTexture;this.uniforms.u_OcclusionStrength=e}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){const{alphaCutoff:e=.5}=t;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=e}else"BLEND"===t.alphaMode&&(s.cM.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}delete(){this.generatedTextures.forEach((t=>t.delete()))}}},28007:(t,e,n)=>{"use strict";n.d(e,{KQ:()=>h,JD:()=>u,s9:()=>tt,JY:()=>Q,w:()=>W,ZS:()=>V,vd:()=>c,yW:()=>et,UF:()=>a,D0:()=>l,cM:()=>i,kL:()=>H,aQ:()=>nt,dR:()=>j,s8:()=>J});const i=new(n(87294).Z)({id:"luma.gl"});function r(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}const o="Invalid WebGLRenderingContext",s="Requires WebGL2";function a(t){return"undefined"!==typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||("undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version)))}function l(t){return"undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function c(t){return l(t)?t:null}function u(t){return r(a(t),o),t}function h(t){return r(l(t),s),t}const d={};function f(t,e){var n;d[t]=!0,void 0!==e&&(n=e,globalThis.console&&globalThis.console.error&&globalThis.console.error(n))}const A=function t(e){const n=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i<this.attribs.length;i++){const e=new t.VertexAttrib(n);this.attribs[i]=e}this.maxAttrib=0};(A.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};const p=function(t){const e=this;this.gl=t,function(t){const e=t.getError;t.getError=function(){let n;do{n=e.apply(t),0!==n&&(d[n]=!0)}while(0!==n);for(n in d)if(d[n])return delete d[n],parseInt(n,10);return 0}}(t);const n=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(t){return t===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:n.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(t){const i=e.currentVertexArrayObject;i.maxAttrib=Math.max(i.maxAttrib,t);return i.attribs[t].enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){const i=e.currentVertexArrayObject;i.maxAttrib=Math.max(i.maxAttrib,t);return i.attribs[t].enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(t,i){switch(t){case 34962:e.currentArrayBuffer=i;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=i}return n.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(t,i){const r=e.currentVertexArrayObject.attribs[t];switch(i){case 34975:return r.buffer;case 34338:return r.enabled;case 34339:return r.size;case 34340:return r.stride;case 34341:return r.type;case 34922:return r.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,i,r,o,s,a){const l=e.currentVertexArrayObject;l.maxAttrib=Math.max(l.maxAttrib,t);const c=l.attribs[t];return c.buffer=e.currentArrayBuffer,c.size=i,c.type=r,c.normalized=o,c.stride=s,c.offset=a,c.recache(),n.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",(()=>{var t;t="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(t),e.reset_()}),!0),this.reset_()};p.prototype.VERTEX_ARRAY_BINDING_OES=34229,p.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let e=0;e<this.vertexArrayObjects.length;++e)this.vertexArrayObjects.isAlive=!1;const t=this.gl;this.maxVertexAttribs=t.getParameter(34921),this.defaultVertexArrayObject=new A(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},p.prototype.createVertexArrayOES=function(){const t=new A(this);return this.vertexArrayObjects.push(t),t},p.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},p.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof A&&t.hasBeenBound&&t.ext===this)},p.prototype.bindVertexArrayOES=function(t){const e=this.gl;if(t&&!t.isAlive)return void f(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");const n=this.original,i=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;const r=this.currentVertexArrayObject;if(i===r)return;i&&r.elementArrayBuffer===i.elementArrayBuffer||n.bindBuffer.call(e,34963,r.elementArrayBuffer);let o=this.currentArrayBuffer;const s=Math.max(i?i.maxAttrib:0,r.maxAttrib);for(let a=0;a<=s;a++){const t=r.attribs[a],s=i?i.attribs[a]:null;if(i&&t.enabled===s.enabled||(t.enabled?n.enableVertexAttribArray.call(e,a):n.disableVertexAttribArray.call(e,a)),t.enabled){let r=!1;i&&t.buffer===s.buffer||(o!==t.buffer&&(n.bindBuffer.call(e,34962,t.buffer),o=t.buffer),r=!0),(r||t.cached!==s.cached)&&n.vertexAttribPointer.call(e,a,t.size,t.type,t.normalized,t.stride,t.offset)}}this.currentArrayBuffer!==o&&n.bindBuffer.call(e,34962,this.currentArrayBuffer)};const g="OES_element_index",m="WEBGL_draw_buffers",y="WEBGL_debug_renderer_info",v=t=>l(t)?void 0:0,_={3074:t=>l(t)?void 0:36064,35723:t=>l(t)?void 0:4352,35977:v,32937:v,36795:(t,e)=>{const n=l(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?e(n.GPU_DISJOINT_EXT):0},37445:(t,e)=>{const n=t.getExtension(y);return e(n&&n.UNMASKED_VENDOR_WEBGL||7936)},37446:(t,e)=>{const n=t.getExtension(y);return e(n&&n.UNMASKED_RENDERER_WEBGL||7937)},34047:(t,e)=>{const n=t.luma.extensions.EXT_texture_filter_anisotropic;return n?e(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:v,35071:v,37447:v,36063:(t,e)=>{if(!l(t)){const n=t.getExtension(m);return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:v,35374:v,35377:v,34852:t=>{if(!l(t)){const e=t.getExtension(m);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension(g)?2147483647:65535,33001:t=>t.getExtension(g)?16777216:65535,33e3:t=>16777216,37157:v,35373:v,35657:v,36183:v,37137:v,34045:v,35978:v,35979:v,35968:v,35376:v,35375:v,35659:v,37154:v,35371:v,35658:v,35076:v,35077:v,35380:v};const b="ANGLE_instanced_arrays";const x={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{r(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[b]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){r(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{r(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{r(!1)},deleteQuery:()=>{r(!1)},beginQuery:()=>{r(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},w={readBuffer:(t,e,n)=>{l(t)&&e(n)},getVertexAttrib:(t,e,n,i)=>{const{webgl2:r,ext:o}=function(t,e){return{webgl2:l(t),ext:t.getExtension(e)}}(t,b);let s;switch(i){case 35069:s=!!r&&void 0;break;case 35070:s=r||o?void 0:0}return void 0!==s?s:e(n,i)},getProgramParameter:(t,e,n,i)=>{if(!l(t))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(n,i)},getInternalformatParameter:(t,e,n,i,r)=>l(t)||32937!==r?t.getInternalformatParameter(n,i,r):new Int32Array([0]),getTexParameter(t,e,n,i){if(34046===i){const{extensions:e}=t.luma,n=e.EXT_texture_filter_anisotropic;i=n&&n.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(n,i)},getParameter:function(t,e,n){const i=_[n],r="function"===typeof i?i(t,e,n):i;return void 0!==r?r:e(n)},hint:(t,e,n,i)=>e(n,i)};function C(t,e){let{extension:n,target:i,target2:o}=e;const s=x[n];r(s);const{meta:a={}}=s,{suffix:l=""}=a,c=t.getExtension(n);for(const r of Object.keys(s)){const e="".concat(r).concat(l);let n=null;"meta"===r||"function"===typeof t[r]||(c&&"function"===typeof c[e]?n=function(){return c[e](...arguments)}:"function"===typeof s[r]&&(n=s[r].bind(i))),n&&(i[r]=n,o[r]=n)}}globalThis.polyfillContext=function(t){t.luma=t.luma||{};const{luma:e}=t;return e.polyfilled||(!function(t){if("function"===typeof t.createVertexArray)return;const e=t.getSupportedExtensions;t.getSupportedExtensions=function(){const t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};const n=t.getExtension;t.getExtension=function(e){return n.call(this,e)||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new p(this)),this.__OESVertexArrayObject))}}(t),function(t){t.luma.extensions={};const e=t.getSupportedExtensions()||[];for(const n of e)t.luma[n]=t.getExtension(n)}(t),function(t,e){for(const n of Object.getOwnPropertyNames(e))"overrides"!==n&&C(t,{extension:n,target:t.luma,target2:t})}(t,x),function(t,e){let{target:n,target2:i}=e;Object.keys(w).forEach((e=>{if("function"===typeof w[e]){const r=t[e]?t[e].bind(t):()=>{},o=w[e].bind(null,t,r);n[e]=o,i[e]=o}}))}(t,{target:e,target2:t}),e.polyfilled=!0),t};const B={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},E=(t,e,n)=>e?t.enable(n):t.disable(n),T=(t,e,n)=>t.hint(n,e),S=(t,e,n)=>t.pixelStorei(n,e);function M(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const I={3042:E,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:E,2885:(t,e)=>t.cullFace(e),2929:E,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:E,35723:T,36006:(t,e)=>{const n=l(t)?36009:36160;return t.bindFramebuffer(n,e)},2886:(t,e)=>t.frontFace(e),33170:T,2849:(t,e)=>t.lineWidth(e),32823:E,32824:"polygonOffset",10752:"polygonOffset",35977:E,32938:"sampleCoverage",32939:"sampleCoverage",3089:E,3088:(t,e)=>t.scissor(...e),2960:E,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),3333:S,3317:S,37440:S,37441:S,37443:S,3330:S,3332:S,3331:S,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:S,32878:S,3316:S,3315:S,32877:S,framebuffer:(t,e)=>{const n=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,n)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{e=M(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=M(e)&&2===e.length?[...e,...e]:e,t.blendFuncSeparate(...e)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=M(e)?e:[e,e];const[n,i]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=M(e)&&3===e.length?[...e,...e]:e;const[n,i,r,o,s,a]=e;t.stencilFuncSeparate(1028,n,i,r),t.stencilFuncSeparate(1029,o,s,a)},stencilOp:(t,e)=>{e=M(e)&&3===e.length?[...e,...e]:e;const[n,i,r,o,s,a]=e;t.stencilOpSeparate(1028,n,i,r),t.stencilOpSeparate(1029,o,s,a)},viewport:(t,e)=>t.viewport(...e)};function P(t,e,n){return void 0!==e[t]?e[t]:n[t]}const D={blendEquation:(t,e,n)=>t.blendEquationSeparate(P(32777,e,n),P(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(P(32969,e,n),P(32968,e,n),P(32971,e,n),P(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(P(32824,e,n),P(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(P(32938,e,n),P(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,P(2962,e,n),P(2967,e,n),P(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,P(34816,e,n),P(36003,e,n),P(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,P(2964,e,n),P(2965,e,n),P(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,P(34817,e,n),P(34818,e,n),P(34819,e,n))},F={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,n)=>t({[e]:n}),hint:(t,e,n)=>t({[e]:n}),bindFramebuffer:(t,e,n)=>{switch(e){case 36160:return t({36006:n,36010:n});case 36009:return t({36006:n});case 36008:return t({36010:n});default:return null}},blendColor:(t,e,n,i,r)=>t({32773:new Float32Array([e,n,i,r])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,n)=>t({32777:e,34877:n}),blendFunc:(t,e,n)=>t({32969:e,32968:n,32971:e,32970:n}),blendFuncSeparate:(t,e,n,i,r)=>t({32969:e,32968:n,32971:i,32970:r}),clearColor:(t,e,n,i,r)=>t({3106:new Float32Array([e,n,i,r])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,n,i,r)=>t({3107:[e,n,i,r]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,n)=>t({2928:new Float32Array([e,n])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,n)=>t({32824:e,10752:n}),sampleCoverage:(t,e,n)=>t({32938:e,32939:n}),scissor:(t,e,n,i,r)=>t({3088:new Int32Array([e,n,i,r])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,n)=>t({[1028===e?2968:36005]:n}),stencilFunc:(t,e,n,i)=>t({2962:e,2967:n,2963:i,34816:e,36003:n,36004:i}),stencilFuncSeparate:(t,e,n,i,r)=>t({[1028===e?2962:34816]:n,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(t,e,n,i)=>t({2964:e,2965:n,2966:i,34817:e,34818:n,34819:i}),stencilOpSeparate:(t,e,n,i,r)=>t({[1028===e?2964:34817]:n,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(t,e,n,i,r)=>t({2978:[e,n,i,r]})},L=(t,e)=>t.isEnabled(e),O={3042:L,2884:L,2929:L,3024:L,32823:L,32926:L,32928:L,3089:L,2960:L,35977:L};function R(t){for(const e in t)return!1;return!0}function k(t,e){if(t===e)return!0;const n=Array.isArray(t)||ArrayBuffer.isView(t),i=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&i&&t.length===e.length){for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}return!1}function U(t,e){const n=t[e].bind(t);t[e]=function(){const e=arguments.length<=0?void 0:arguments[0];return e in t.state.cache&&t.state.enable?t.state.cache[e]:n(...arguments)},Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function z(t,e,n){const i=t[e].bind(t);t[e]=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];const{valueChanged:s,oldValue:a}=n(t.state._updateCache,...r);return s&&i(...r),a},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}class G{constructor(t){let{copyState:e=!1,log:n=(()=>{})}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=e?V(t):Object.assign({},B),this.log=n,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(){this.stateStack.push({})}pop(){r(this.stateStack.length>0);const t=this.stateStack[this.stateStack.length-1];j(this.gl,t),this.stateStack.pop()}_updateCache(t){let e,n=!1;const i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const o in t){r(void 0!==o);const s=t[o],a=this.cache[o];k(s,a)||(n=!0,e=a,i&&!(o in i)&&(i[o]=a),this.cache[o]=s)}return{valueChanged:n,oldValue:e}}}function N(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{enable:n=!0,copyState:i}=e;if(r(void 0!==i),!t.state){const{polyfillContext:e}=globalThis;e&&e(t),t.state=new G(t,{copyState:i}),function(t){const e=t.useProgram.bind(t);t.useProgram=function(n){t.state.program!==n&&(e(n),t.state.program=n)}}(t);for(const n in F){z(t,n,F[n])}U(t,"getParameter"),U(t,"isEnabled")}return t.state.enable=n,t}function Z(t){r(t.state),t.state.pop()}function j(t,e){if(r(a(t),"setParameters requires a WebGL context"),R(e))return;const n={};for(const r in e){const i=Number(r),o=I[r];o&&("string"===typeof o?n[o]=!0:o(t,e[r],i))}const i=t.state&&t.state.cache;if(i)for(const r in n){(0,D[r])(t,e,i)}}function V(t,e){if("number"===typeof(e=e||B)){const n=e,i=O[n];return i?i(t,n):t.getParameter(n)}const n=Array.isArray(e)?e:Object.keys(e),i={};for(const r of n){const e=O[r];i[r]=e?e(t,Number(r)):t.getParameter(Number(r))}return i}function H(t){j(t,B)}function J(t,e,n){if(R(e))return n(t);const{nocatch:i=!0}=e;let r;if(function(t){t.state||N(t,{copyState:!1}),t.state.push()}(t),j(t,e),i)r=n(t),Z(t);else try{r=n(t)}finally{Z(t)}return r}function W(t){const{luma:e}=t;if(t.canvas&&e){const n=e.canvasSizeInfo,i="clientWidth"in n?n.clientWidth:t.canvas.clientWidth;return i?t.drawingBufferWidth/i:1}return 1}function Q(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(t,e,n,i,r){const o=K(t[0],e,n);let s=q(t[1],e,i,r),a=K(t[0]+1,e,n);const l=a===n-1?a:a-1;let c;a=q(t[1]+1,e,i,r),r?(a=0===a?a:a+1,c=s,s=a):c=a===i-1?a:a-1;return{x:o,y:s,width:Math.max(l-o+1,1),height:Math.max(c-s+1,1)}}(e,W(t),t.drawingBufferWidth,t.drawingBufferHeight,n)}function K(t,e,n){return Math.min(Math.round(t*e),n-1)}function q(t,e,n,i){return i?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const X=(0,n(11515).Z)(),Y=X&&"undefined"!==typeof document,$={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function tt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(X,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},$,t);const{width:e,height:n}=t;function o(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}let s;t.onError=o;const{canvas:a}=t,c=function(t){let e,{canvas:n,width:i=800,height:r=600,onError:o}=t;if("string"===typeof n){Y&&"complete"===document.readyState||o("createGLContext called on canvas '".concat(n,"' before page was loaded")),e=document.getElementById(n)}else n?e=n:(e=document.createElement("canvas"),e.id="lumagl-canvas",e.style.width=Number.isFinite(i)?"".concat(i,"px"):"100%",e.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",document.body.insertBefore(e,document.body.firstChild));return e}({canvas:a,width:e,height:n,onError:o});return s=function(t,e){const{onError:n}=e;let i=null;const r=t=>i=t.statusMessage||i;t.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:o=!0,webgl2:s=!0}=e;let a=null;s&&(a=a||t.getContext("webgl2",e),a=a||t.getContext("experimental-webgl2",e));o&&(a=a||t.getContext("webgl",e),a=a||t.getContext("experimental-webgl",e));if(t.removeEventListener("webglcontextcreationerror",r,!1),!a)return n("Failed to create ".concat(s&&!o?"WebGL2":"WebGL"," context: ").concat(i||"Unknown error"));e.onContextLost&&t.addEventListener("webglcontextlost",e.onContextLost,!1);e.onContextRestored&&t.addEventListener("webglcontextrestored",e.onContextRestored,!1);return a}(c,t),s?(s=et(s,t),function(t){const e=l(t)?"WebGL2":"WebGL1",n=function(t){const e=t.getParameter(7936),n=t.getParameter(7937),i=t.getExtension("WEBGL_debug_renderer_info"),r=i&&t.getParameter(i.UNMASKED_VENDOR_WEBGL||7936),o=i&&t.getParameter(i.UNMASKED_RENDERER_WEBGL||7937);return{vendor:r||e,renderer:o||n,vendorMasked:e,rendererMasked:n,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t),r=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",o=t.debug?" debug":"";i.info(1,"".concat(e).concat(o," context ").concat(r))()}(s),s):null}function et(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||t._instrumented)return t;t._version=t._version||function(t){if("undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext)return 2;return 1}(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{},e=Object.assign({},$,e);const{manageState:n,debug:r}=e;return n&&N(t,{copyState:!1,log:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return i.log(1,...e)()}}),X&&r&&(globalThis.makeDebugContext?(t=globalThis.makeDebugContext(t,e),i.level=Math.max(i.level,1)):i.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function nt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.canvas){return void function(t,e,n){let r="width"in n?n.width:t.canvas.clientWidth,o="height"in n?n.height:t.canvas.clientHeight;r&&o||(i.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,r=t.canvas.width||1,o=t.canvas.height||1);t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};const s=t.luma.canvasSizeInfo;if(s.clientWidth!==r||s.clientHeight!==o||s.devicePixelRatio!==e){let n=e;const s=Math.floor(r*n),a=Math.floor(o*n);t.canvas.width=s,t.canvas.height=a,t.drawingBufferWidth===s&&t.drawingBufferHeight===a||(i.warn("Device pixel ratio clamped")(),n=Math.min(t.drawingBufferWidth/r,t.drawingBufferHeight/o),t.canvas.width=Math.floor(r*n),t.canvas.height=Math.floor(o*n)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:r,clientHeight:o,devicePixelRatio:e})}}(t,function(t){const e="undefined"===typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}(e.useDevicePixels),e)}const n=t.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in e&&"height"in e&&n.resize(e.width,e.height)}},5740:(t,e,n)=>{"use strict";n.d(e,{H:()=>i,Y:()=>r});const i="vs",r="fs"},62574:(t,e,n)=>{"use strict";n.d(e,{O_:()=>s,Lm:()=>h,ZP:()=>u});var i=n(5740),r=n(17865);const o={[i.H]:"#ifdef MODULE_LOGDEPTH\n  logdepth_adjustPosition(gl_Position);\n#endif\n",[i.Y]:"#ifdef MODULE_MATERIAL\n  gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n  gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n  gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n  gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n  gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n  logdepth_setFragDepth();\n#endif\n"},s="__LUMA_INJECT_DECLARATIONS__",a=/void\s+main\s*\([^)]*\)\s*\{\n?/,l=/}\n?[^{}]*$/,c=[];function u(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const u=e===i.H;for(const i in n){const e=n[i];e.sort(((t,e)=>t.order-e.order)),c.length=e.length;for(let t=0,n=e.length;t<n;++t)c[t]=e[t].injection;const r="".concat(c.join("\n"),"\n");switch(i){case"vs:#decl":u&&(t=t.replace(s,r));break;case"vs:#main-start":u&&(t=t.replace(a,(t=>t+r)));break;case"vs:#main-end":u&&(t=t.replace(l,(t=>r+t)));break;case"fs:#decl":u||(t=t.replace(s,r));break;case"fs:#main-start":u||(t=t.replace(a,(t=>t+r)));break;case"fs:#main-end":u||(t=t.replace(l,(t=>r+t)));break;default:t=t.replace(i,(t=>t+r))}}return t=t.replace(s,""),r&&(t=t.replace(/\}\s*$/,(t=>t+o[e]))),t}function h(t){const e={};return(0,r.Z)(Array.isArray(t)&&t.length>1),t.forEach((t=>{for(const n in t)e[n]=e[n]?"".concat(e[n],"\n").concat(t[n]):t[n]})),e}},45986:(t,e,n)=>{"use strict";n.d(e,{H:()=>s});const i="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n  vec3 color;\n  vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n  return pointLight.attenuation.x\n       + pointLight.attenuation.y * distance\n       + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",r={lightSources:{}};function o(){let{color:t=[0,0,0],intensity:e=1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.map((t=>t*e/255))}const s={name:"lights",vs:i,fs:i,getUniforms:function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;if("lightSources"in e){const{ambientLight:t,pointLights:n,directionalLights:i}=e.lightSources||{};return t||n&&n.length>0||i&&i.length>0?Object.assign({},function(t){let{ambientLight:e,pointLights:n=[],directionalLights:i=[]}=t;const r={};return r["lighting_uAmbientLight.color"]=e?o(e):[0,0,0],n.forEach(((t,e)=>{r["lighting_uPointLight[".concat(e,"].color")]=o(t),r["lighting_uPointLight[".concat(e,"].position")]=t.position,r["lighting_uPointLight[".concat(e,"].attenuation")]=t.attenuation||[1,0,0]})),r.lighting_uPointLightCount=n.length,i.forEach(((t,e)=>{r["lighting_uDirectionalLight[".concat(e,"].color")]=o(t),r["lighting_uDirectionalLight[".concat(e,"].direction")]=t.direction})),r.lighting_uDirectionalLightCount=i.length,r}({ambientLight:t,pointLights:n,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){const n={pointLights:[],directionalLights:[]};for(const t of e.lights||[])switch(t.type){case"ambient":n.ambientLight=t;break;case"directional":n.directionalLights.push(t);break;case"point":n.pointLights.push(t)}return t({lightSources:n})}return{}},defines:{MAX_LIGHTS:3}}},78032:(t,e,n)=>{"use strict";n.d(e,{b:()=>i});const i={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n  vec4 pos = u_ModelMatrix * position;\n  pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n  vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n  vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n  vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n  pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n  pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n  pbr_vUV = uv;\n#else\n  pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n  #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n  #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n  float NdotL;\n  float NdotV;\n  float NdotH;\n  float LdotH;\n  float VdotH;\n  float perceptualRoughness;\n  float metalness;\n  vec3 reflectance0;\n  vec3 reflectance90;\n  float alphaRoughness;\n  vec3 diffuseColor;\n  vec3 specularColor;\n  vec3 n;\n  vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n  vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n  vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n  vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n  return vec4(linOut,srgbIn.w);;\n#else\n  return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n  vec3 pos_dx = dFdx(pbr_vPosition);\n  vec3 pos_dy = dFdy(pbr_vPosition);\n  vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n  vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n  vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n  vec3 ng = normalize(pbr_vNormal);\n#else\n  vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n  t = normalize(t - ng * dot(ng, t));\n  vec3 b = normalize(cross(ng, t));\n  mat3 tbn = mat3(t, b, ng);\n#else\n  mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n  vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n  n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n  vec3 n = normalize(tbn[2].xyz);\n#endif\n\n  return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n  float mipCount = 9.0;\n  float lod = (pbrInputs.perceptualRoughness * mipCount);\n  vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n    vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n  vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n  vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n  vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n  vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n  vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n  diffuse *= u_ScaleIBLAmbient.x;\n  specular *= u_ScaleIBLAmbient.y;\n\n  return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n  return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n  return pbrInputs.reflectance0 +\n    (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n    pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n  float NdotL = pbrInputs.NdotL;\n  float NdotV = pbrInputs.NdotV;\n  float r = pbrInputs.alphaRoughness;\n\n  float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n  float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n  return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n  float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n  float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n  return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n  pbrInputs.NdotL = 1.0;\n  pbrInputs.NdotH = 0.0;\n  pbrInputs.LdotH = 0.0;\n  pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n  vec3 n = pbrInputs.n;\n  vec3 v = pbrInputs.v;\n  vec3 l = normalize(lightDirection);\n  vec3 h = normalize(l+v);\n\n  pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n  pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n  pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n  pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n  vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n  PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n  vec3 F = specularReflection(pbrInputs);\n  float G = geometricOcclusion(pbrInputs);\n  float D = microfacetDistribution(pbrInputs);\n  vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n  vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n  return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n  vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n  vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n  if (baseColor.a < u_AlphaCutoff) {\n    discard;\n  }\n#endif\n\n  vec3 color = vec3(0, 0, 0);\n\n  if(pbr_uUnlit){\n    color.rgb = baseColor.rgb;\n  }\n  else{\n\n\n    float perceptualRoughness = u_MetallicRoughnessValues.y;\n    float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n    vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n    perceptualRoughness = mrSample.g * perceptualRoughness;\n    metallic = mrSample.b * metallic;\n#endif\n    perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n    metallic = clamp(metallic, 0.0, 1.0);\n\n    float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n    vec3 f0 = vec3(0.04);\n    vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n    diffuseColor *= 1.0 - metallic;\n    vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n    float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n    float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n    vec3 specularEnvironmentR0 = specularColor.rgb;\n    vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n    vec3 n = getNormal();\n    vec3 v = normalize(u_Camera - pbr_vPosition);\n\n    float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n    vec3 reflection = -normalize(reflect(v, n));\n\n    PBRInfo pbrInputs = PBRInfo(\n      0.0,\n      NdotV,\n      0.0,\n      0.0,\n      0.0,\n      perceptualRoughness,\n      metallic,\n      specularEnvironmentR0,\n      specularEnvironmentR90,\n      alphaRoughness,\n      diffuseColor,\n      specularColor,\n      n,\n      v\n    );\n\n#ifdef USE_LIGHTS\n    PBRInfo_setAmbientLight(pbrInputs);\n    color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n    SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n      if (i < lighting_uDirectionalLightCount) {\n        PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n        color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n      }\n    }\n    SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n      if (i < lighting_uPointLightCount) {\n        PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n        float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n        color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n      }\n    }\n#endif\n#ifdef USE_IBL\n    color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n    float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n    color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n    vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n    color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n    color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n    color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n    color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n  }\n\n  return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[n(45986).H]}},54976:(t,e,n)=>{"use strict";n.d(e,{N:()=>a,s:()=>l});var i=n(45986);const r="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3  lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n    vec3 halfway_direction = normalize(light_direction + view_direction);\n    float lambertian = dot(light_direction, normal_worldspace);\n    float specular = 0.0;\n    if (lambertian > 0.0) {\n      float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n      specular = pow(specular_angle, lighting_uShininess);\n    }\n    lambertian = max(lambertian, 0.0);\n    return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n  vec3 lightColor = surfaceColor;\n\n  if (lighting_uEnabled) {\n    vec3 view_direction = normalize(cameraPosition - position_worldspace);\n    lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n    for (int i = 0; i < MAX_LIGHTS; i++) {\n      if (i >= lighting_uPointLightCount) {\n        break;\n      }\n      PointLight pointLight = lighting_uPointLight[i];\n      vec3 light_position_worldspace = pointLight.position;\n      vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n      lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n    }\n\n    for (int i = 0; i < MAX_LIGHTS; i++) {\n      if (i >= lighting_uDirectionalLightCount) {\n        break;\n      }\n      DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n      lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n    }\n  }\n  return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n  vec3 lightColor = vec3(0, 0, 0);\n  vec3 surfaceColor = vec3(0, 0, 0);\n\n  if (lighting_uEnabled) {\n    vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n    for (int i = 0; i < MAX_LIGHTS; i++) {\n      if (i >= lighting_uPointLightCount) {\n        break;\n      }\n      PointLight pointLight = lighting_uPointLight[i];\n      vec3 light_position_worldspace = pointLight.position;\n      vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n      lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n    }\n\n    for (int i = 0; i < MAX_LIGHTS; i++) {\n      if (i >= lighting_uDirectionalLightCount) {\n        break;\n      }\n      DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n      lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n    }\n  }\n  return lightColor;\n}\n",o={};function s(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;if(!("material"in t))return{};const{material:e}=t;return e?function(t){const{ambient:e=.35,diffuse:n=.6,shininess:i=32,specularColor:r=[30,30,30]}=t;return{lighting_uAmbient:e,lighting_uDiffuse:n,lighting_uShininess:i,lighting_uSpecularColor:r.map((t=>t/255))}}(e):{lighting_uEnabled:!1}}const a={name:"gouraud-lighting",dependencies:[i.H],vs:r,defines:{LIGHTING_VERTEX:1},getUniforms:s},l={name:"phong-lighting",dependencies:[i.H],fs:r,defines:{LIGHTING_FRAGMENT:1},getUniforms:s}},17865:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}n.d(e,{Z:()=>i})},77462:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var i=n(75946),r=n(81301),o=n(80182);const s={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},a={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}};class l{static getBytesPerElement(t){return(0,i.vN)(t.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(t){(0,r.h)(t.size);return(0,i.vN)(t.type||5126).BYTES_PER_ELEMENT*t.size}static resolve(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new l(...[s,...e])}constructor(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach((t=>this._assign(t))),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return l.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return l.getBytesPerVertex(this)}_assign(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=(0,o.k)("Accessor",t,a),void 0!==t.type&&(this.type=t.type,5124!==t.type&&5125!==t.type||(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&("boolean"===typeof t.index?this.index=t.index?1:0:this.index=t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}}},33839:(t,e,n)=>{"use strict";n.d(e,{Z:()=>d});var i=n(35572),r=n(77462),o=n(75946),s=n(28007),a=n(81301),l=n(80182);const c={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},u={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:c},h={removedProps:c};class d extends i.Z{get[Symbol.toStringTag](){return"Buffer"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=e.target||(this.gl.webgl2?36662:34962),this.initialize(e),Object.seal(this)}getElementCount(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/r.Z.getBytesPerElement(t))}getVertexCount(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/r.Z.getBytesPerVertex(t))}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=(0,l.k)("Buffer",t,u),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}setProps(t){return"accessor"in(t=(0,l.k)("Buffer",t,h))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new r.Z(t),this}reallocate(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}setData(t){return this.initialize(t)}subData(t){ArrayBuffer.isView(t)&&(t={data:t});const{data:e,offset:n=0,srcOffset:i=0}=t,r=t.byteLength||t.length;(0,a.h)(e);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==i||void 0!==r?((0,s.KQ)(this.gl),this.gl.bufferSubData(this.target,n,e,i,r)):this.gl.bufferSubData(o,n,e),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(e),this}copyData(t){let{sourceBuffer:e,readOffset:n=0,writeOffset:i=0,size:r}=t;const{gl:o}=this;return(0,s.KQ)(o),o.bindBuffer(36662,e.handle),o.bindBuffer(36663,this.handle),o.copyBufferSubData(36662,36663,n,i,r),o.bindBuffer(36662,null),o.bindBuffer(36663,null),this.debugData=null,this}getData(){let{dstData:t=null,srcByteOffset:e=0,dstOffset:n=0,length:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.KQ)(this.gl);const r=(0,o.vN)(this.accessor.type||5126,{clamped:!1}),l=this._getAvailableElementCount(e),c=n;let u,h;t?(h=t.length,u=h-c):(u=Math.min(l,i||l),h=c+u);const d=Math.min(l,u);return i=i||d,(0,a.h)(i<=d),t=t||new r(h),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,t,n,i),this.gl.bindBuffer(36662,null),t}bind(){let{target:t=this.target,index:e=this.accessor&&this.accessor.index,offset:n=0,size:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 35345===t||35982===t?void 0!==i?this.gl.bindBufferRange(t,e,this.handle,n,i):((0,a.h)(0===n),this.gl.bindBufferBase(t,e,this.handle)):this.gl.bindBuffer(t,this.handle),this}unbind(){let{target:t=this.target,index:e=this.accessor&&this.accessor.index}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 35345===t||35982===t?this.gl.bindBufferBase(t,e,null):this.gl.bindBuffer(t,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.byteLength+e;(0,a.h)(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();const i=this._getTarget();this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,this.usage),this.gl.bufferSubData(i,e,t),this.gl.bindBuffer(i,null),this.debugData=t.slice(0,10),this.bytesUsed=n,this._trackAllocatedMemory(n);const s=(0,o.O)(t);return(0,a.h)(s),this.setAccessor(new r.Z(this.accessor,{type:s})),this}_setByteLength(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;(0,a.h)(t>=0),this._trackDeallocatedMemory();let n=t;0===t&&(n=new Float32Array(0));const i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,e),this.gl.bindBuffer(i,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(t){const e=t/(0,o.vN)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new r.Z(this.accessor,{type:(0,o.O)(t)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(t){this.gl.bindBuffer(this.target,this.handle);const e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}get type(){return s.cM.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return s.cM.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return s.cM.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return s.cM.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new r.Z(this.accessor,t),this}}},97756:(t,e,n)=>{"use strict";n.d(e,{$:()=>A,Z:()=>f});var i=n(28007),r=n(81301);const o=256,s=1024,a=16384,l=6144,c=6145,u=6146,h=34041,d="clear: bad arguments";function f(t){let{framebuffer:e=null,color:n=null,depth:l=null,stencil:c=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const u={};e&&(u.framebuffer=e);let h=0;n&&(h|=a,!0!==n&&(u.clearColor=n)),l&&(h|=o,!0!==l&&(u.clearDepth=l)),c&&(h|=s,!0!==l&&(u.clearStencil=l)),(0,r.h)(0!==h,d),(0,i.s8)(t,u,(()=>{t.clear(h)}))}function A(t){let{framebuffer:e=null,buffer:n=l,drawBuffer:o=0,value:s=[0,0,0,0]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.KQ)(t),(0,i.s8)(t,{framebuffer:e},(()=>{switch(n){case l:switch(s.constructor){case Int32Array:t.clearBufferiv(n,o,s);break;case Uint32Array:t.clearBufferuiv(n,o,s);break;case Float32Array:default:t.clearBufferfv(n,o,s)}break;case c:t.clearBufferfv(c,0,[s]);break;case u:t.clearBufferiv(u,0,[s]);break;case h:const[e,i]=s;t.clearBufferfi(h,0,e,i);break;default:(0,r.h)(!1,d)}}))}},56474:(t,e,n)=>{"use strict";n.d(e,{Km:()=>f,Lv:()=>A,z6:()=>h,Jb:()=>d});var i=n(33839),r=n(79078),o=n(51055),s=n(28007),a=n(75946),l=n(81301);function c(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return(0,l.h)(!1),0}}var u=n(17507);function h(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{sourceX:n=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:o=36064,target:s=null,sourceWidth:u,sourceHeight:h,sourceType:d}=e;const{framebuffer:f,deleteFramebuffer:A}=p(t);(0,l.h)(f);const{gl:g,handle:m,attachments:y}=f;u=u||f.width,h=h||f.height,36064===o&&null===m&&(o=1028),(0,l.h)(y[o]),d=d||y[o].type,s=function(t,e,n,i,r){if(t)return t;e=e||5121;const o=(0,a.vN)(e,{clamped:!1}),s=c(n);return new o(i*r*s)}(s,d,r,u,h),d=d||(0,a.O)(s);const v=g.bindFramebuffer(36160,m);return g.readPixels(n,i,u,h,r,d,s),g.bindFramebuffer(36160,v||null),A&&f.delete(),s}function d(t,e){let{sourceX:n=0,sourceY:r=0,sourceFormat:o=6408,target:a=null,targetByteOffset:u=0,sourceWidth:h,sourceHeight:d,sourceType:f}=e;const{framebuffer:A,deleteFramebuffer:g}=p(t);(0,l.h)(A),h=h||A.width,d=d||A.height;const m=(0,s.KQ)(A.gl);if(f=f||(a?a.type:5121),!a){const t=c(o),e=function(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return(0,l.h)(!1),0}}(f),n=u+h*d*t*e;a=new i.Z(m,{byteLength:n,accessor:{type:f,size:t}})}return a.bind({target:35051}),(0,s.s8)(m,{framebuffer:A},(()=>{m.readPixels(n,r,h,d,o,f,u)})),a.unbind({target:35051}),g&&A.delete(),a}function f(t){let{sourceAttachment:e=36064,targetMaxHeight:n=Number.MAX_SAFE_INTEGER}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=h(t,{sourceAttachment:e}),{width:r,height:o}=t;for(;o>n;)({data:i,width:r,height:o}=(0,a.KS)({data:i,width:r,height:o}));(0,a.c$)({data:i,width:r,height:o});const s=document.createElement("canvas");s.width=r,s.height=o;const l=s.getContext("2d"),c=l.createImageData(r,o);return c.data.set(i),l.putImageData(c,0,0),s.toDataURL()}function A(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{sourceX:i=0,sourceY:r=0,targetMipmaplevel:a=0,targetInternalFormat:c=6408}=n;let{targetX:u,targetY:h,targetZ:d,width:f,height:A}=n;const{framebuffer:g,deleteFramebuffer:m}=p(t);(0,l.h)(g);const{gl:y,handle:v}=g,_="undefined"!==typeof u||"undefined"!==typeof h||"undefined"!==typeof d;u=u||0,h=h||0,d=d||0;const b=y.bindFramebuffer(36160,v);(0,l.h)(e);let x=null;if(e instanceof o.Z&&(x=e,f=Number.isFinite(f)?f:x.width,A=Number.isFinite(A)?A:x.height,x.bind(0),e=x.target),_)switch(e){case 3553:case 34067:y.copyTexSubImage2D(e,a,u,h,i,r,f,A);break;case 35866:case 32879:(0,s.KQ)(y).copyTexSubImage3D(e,a,u,h,d,i,r,f,A)}else y.copyTexImage2D(e,a,c,i,r,f,A,0);return x&&x.unbind(),y.bindFramebuffer(36160,b||null),m&&g.delete(),x}function p(t){return t instanceof r.Z?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:(0,u.Y)(t),deleteFramebuffer:!0}}},79078:(t,e,n)=>{"use strict";n.d(e,{Z:()=>f});var i=n(28007),r=n(35572),o=n(58300),s=n(38332),a=n(97756),l=n(56474),c=n(12308),u=n(55888),h=n(81301);const d="Multiple render targets not supported";class f extends r.Z{get[Symbol.toStringTag](){return"Framebuffer"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{colorBufferFloat:n,colorBufferHalfFloat:i}=e;let r=!0;return n&&(r=Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")||t.getExtension("OES_texture_float"))),i&&(r=r&&Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("EXT_color_buffer_half_float"))),r}static getDefaultFramebuffer(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new f(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}get MAX_COLOR_ATTACHMENTS(){const t=(0,i.KQ)(this.gl);return t.getParameter(t.MAX_COLOR_ATTACHMENTS)}get MAX_DRAW_BUFFERS(){const t=(0,i.KQ)(this.gl);return t.getParameter(t.MAX_DRAW_BUFFERS)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.width=null,this.height=null,this.attachments={},this.readBuffer=36064,this.drawBuffers=[36064],this.ownResources=[],this.initialize(e),Object.seal(this)}get color(){return this.attachments[36064]||null}get texture(){return this.attachments[36064]||null}get depth(){return this.attachments[36096]||this.attachments[33306]||null}get stencil(){return this.attachments[36128]||this.attachments[33306]||null}initialize(t){let{width:e=1,height:n=1,attachments:i=null,color:r=!0,depth:o=!0,stencil:s=!1,check:a=!0,readBuffer:l,drawBuffers:c}=t;if((0,h.h)(e>=0&&n>=0,"Width and height need to be integers"),this.width=e,this.height=n,i)for(const u in i){const t=i[u];(Array.isArray(t)?t[0]:t).resize({width:e,height:n})}else i=this._createDefaultAttachments(r,o,s,e,n);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const t of this.ownResources)t.delete();return super.delete(),this}update(t){let{attachments:e={},readBuffer:n,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:o=!0}=t;this.attach(e,{clearAttachments:r,resizeAttachments:o});const{gl:s}=this,a=s.bindFramebuffer(36160,this.handle);return n&&this._setReadBuffer(n),i&&this._setDrawBuffers(i),s.bindFramebuffer(36160,a||null),this}resize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{width:e,height:n}=t;if(null===this.handle)return(0,h.h)(void 0===e&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===e&&(e=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),e!==this.width&&n!==this.height&&i.cM.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(e,"x").concat(n))();for(const i in this.attachments)this.attachments[i].resize({width:e,height:n});return this.width=e,this.height=n,this}attach(t){let{clearAttachments:e=!1,resizeAttachments:n=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i={};e&&Object.keys(this.attachments).forEach((t=>{i[t]=null})),Object.assign(i,t);const r=this.gl.bindFramebuffer(36160,this.handle);for(const o in i){(0,h.h)(void 0!==o,"Misspelled framebuffer binding point?");const t=Number(o),e=i[t];let r=e;if(r)if(r instanceof s.Z)this._attachRenderbuffer({attachment:t,renderbuffer:r});else if(Array.isArray(e)){const[n,i=0,o=0]=e;r=n,this._attachTexture({attachment:t,texture:n,layer:i,level:o})}else this._attachTexture({attachment:t,texture:r,layer:0,level:0});else this._unattach(t);n&&r&&r.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,r||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter((t=>!this.attachments[t])).forEach((t=>{delete this.attachments[t]}))}checkStatus(){const{gl:t}=this,e=this.getStatus();if(36053!==e)throw new Error(function(t){return(f.STATUS||{})[t]||"Framebuffer error ".concat(t)}(e));return this}getStatus(){const{gl:t}=this,e=t.bindFramebuffer(36160,this.handle),n=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),n}clear(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:e,depth:n,stencil:i,drawBuffers:r=[]}=t,o=this.gl.bindFramebuffer(36160,this.handle);return(e||n||i)&&(0,a.Z)(this.gl,{color:e,depth:n,stencil:i}),r.forEach(((t,e)=>{(0,a.$)(this.gl,{drawBuffer:e,value:t})})),this.gl.bindFramebuffer(36160,o||null),this}readPixels(){return i.cM.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(){return i.cM.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(){return i.cM.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(){return i.cM.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(){return i.cM.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(){return i.cM.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate(t){let{attachments:e=[],x:n=0,y:r=0,width:o,height:s}=t;const a=(0,i.KQ)(this.gl),l=a.bindFramebuffer(36008,this.handle);return 0===n&&0===r&&void 0===o&&void 0===s?a.invalidateFramebuffer(36008,e):a.invalidateFramebuffer(36008,e,n,r,o,s),a.bindFramebuffer(36008,l),this}getAttachmentParameter(t,e,n){let i=this._getAttachmentParameterFallback(e);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=(0,u.km)(this.gl,i)),i}getAttachmentParameters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[];const i={};for(const r of n){i[e?(0,u.km)(this.gl,r):r]=this.getAttachmentParameter(t,r,e)}return i}getParameters(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Object.keys(this.attachments),n={};for(const i of e){const e=Number(i);n[t?(0,u.km)(this.gl,e):e]=this.getAttachmentParameters(e,t)}return n}show(){return"undefined"!==typeof window&&window.open((0,l.Km)(this),"luma-debug-texture"),this}log(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t>i.cM.level||"undefined"===typeof window)return this;e=e||"Framebuffer ".concat(this.id);const n=(0,l.Km)(this,{targetMaxHeight:100});return i.cM.image({logLevel:t,message:e,image:n},e)(),this}bind(){let{target:t=36160}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindFramebuffer(t,this.handle),this}unbind(){let{target:t=36160}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindFramebuffer(t,null),this}_createDefaultAttachments(t,e,n,i,r){let a=null;return t&&(a=a||{},a[36064]=new o.Z(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(a[36064])),e&&n?(a=a||{},a[33306]=new s.Z(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}),this.ownResources.push(a[33306])):e?(a=a||{},a[36096]=new s.Z(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:r}),this.ownResources.push(a[36096])):n&&(0,h.h)(!1),a}_unattach(t){const e=this.attachments[t];e&&(e instanceof s.Z?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}_attachRenderbuffer(t){let{attachment:e=36064,renderbuffer:n}=t;const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,n.handle),this.attachments[e]=n}_attachTexture(t){let{attachment:e=36064,texture:n,layer:r,level:o}=t;const{gl:s}=this;switch(s.bindTexture(n.target,n.handle),n.target){case 35866:case 32879:(0,i.KQ)(s).framebufferTextureLayer(36160,e,n.target,o,r);break;case 34067:const t=function(t){return t<34069?t+34069:t}(r);s.framebufferTexture2D(36160,e,t,n.handle,o);break;case 3553:s.framebufferTexture2D(36160,e,3553,n.handle,o);break;default:(0,h.h)(!1,"Illegal texture type")}s.bindTexture(n.target,null),this.attachments[e]=n}_setReadBuffer(t){const e=(0,i.vd)(this.gl);e?e.readBuffer(t):(0,h.h)(36064===t||1029===t,d),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,n=(0,i.KQ)(e);if(n)n.drawBuffers(t);else{const n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):(0,h.h)(1===t.length&&(36064===t[0]||1029===t[0]),d)}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=(0,c.N$)(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(t){return this.gl.bindFramebuffer(36160,t)}}f.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},79817:(t,e,n)=>{"use strict";n.d(e,{Z:()=>Z});var i=n(35572),r=n(51055),o=n(79078),s=n(28007),a=n(38332),l=n(81301);const c={5126:w.bind(null,"uniform1fv",p,1,C),35664:w.bind(null,"uniform2fv",p,2,C),35665:w.bind(null,"uniform3fv",p,3,C),35666:w.bind(null,"uniform4fv",p,4,C),5124:w.bind(null,"uniform1iv",g,1,C),35667:w.bind(null,"uniform2iv",g,2,C),35668:w.bind(null,"uniform3iv",g,3,C),35669:w.bind(null,"uniform4iv",g,4,C),35670:w.bind(null,"uniform1iv",g,1,C),35671:w.bind(null,"uniform2iv",g,2,C),35672:w.bind(null,"uniform3iv",g,3,C),35673:w.bind(null,"uniform4iv",g,4,C),35674:w.bind(null,"uniformMatrix2fv",p,4,B),35675:w.bind(null,"uniformMatrix3fv",p,9,B),35676:w.bind(null,"uniformMatrix4fv",p,16,B),35678:x,35680:x,5125:w.bind(null,"uniform1uiv",m,1,C),36294:w.bind(null,"uniform2uiv",m,2,C),36295:w.bind(null,"uniform3uiv",m,3,C),36296:w.bind(null,"uniform4uiv",m,4,C),35685:w.bind(null,"uniformMatrix2x3fv",p,6,B),35686:w.bind(null,"uniformMatrix2x4fv",p,8,B),35687:w.bind(null,"uniformMatrix3x2fv",p,6,B),35688:w.bind(null,"uniformMatrix3x4fv",p,12,B),35689:w.bind(null,"uniformMatrix4x2fv",p,8,B),35690:w.bind(null,"uniformMatrix4x3fv",p,12,B),35678:x,35680:x,35679:x,35682:x,36289:x,36292:x,36293:x,36298:x,36299:x,36300:x,36303:x,36306:x,36307:x,36308:x,36311:x},u={},h={},d={},f=[0];function A(t,e,n,i){1===e&&"boolean"===typeof t&&(t=t?1:0),Number.isFinite(t)&&(f[0]=t,t=f);const r=t.length;if(r%e&&s.cM.warn("Uniform size should be multiples of ".concat(e),t)(),t instanceof n)return t;let o=i[r];o||(o=new n(r),i[r]=o);for(let s=0;s<r;s++)o[s]=t[s];return o}function p(t,e){return A(t,e,Float32Array,u)}function g(t,e){return A(t,e,Int32Array,h)}function m(t,e){return A(t,e,Uint32Array,d)}function y(t,e,n){const i=c[n.type];if(!i)throw new Error("Unknown GLSL uniform type ".concat(n.type));return i().bind(null,t,e)}function v(t){if("]"!==t[t.length-1])return{name:t,length:1,isArray:!1};const e=t.match(/([^[]*)(\[[0-9]+\])?/);if(!e||e.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(t));return{name:e[1],length:e[2]||1,isArray:Boolean(e[2])}}function _(t){return Array.isArray(t)||ArrayBuffer.isView(t)?function(t){if(0===t.length)return!1;const e=Math.min(t.length,16);for(let n=0;n<e;++n)if(!Number.isFinite(t[n]))return!1;return!0}(t):!!isFinite(t)||(!0===t||!1===t||(t instanceof r.Z||(t instanceof a.Z||t instanceof o.Z&&Boolean(t.texture))))}function b(t,e,n){if(Array.isArray(n)||ArrayBuffer.isView(n))if(t[e]){const i=t[e];for(let t=0,e=n.length;t<e;++t)i[t]=n[t]}else t[e]=n.slice();else t[e]=n}function x(){let t=null;return(e,n,i)=>{const r=t!==i;return r&&(e.uniform1i(n,i),t=i),r}}function w(t,e,n,i){let r=null,o=null;return(s,a,c)=>{const u=e(c,n),h=u.length;let d=!1;if(null===r)r=new Float32Array(h),o=h,d=!0;else{(0,l.h)(o===h,"Uniform length cannot change.");for(let t=0;t<h;++t)if(u[t]!==r[t]){d=!0;break}}return d&&(i(s,t,a,u),r.set(u)),d}}function C(t,e,n,i){t[e](n,i)}function B(t,e,n,i){t[e](n,!1,i)}function E(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed";const n=t.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:e}const T=35632,S=35633;function M(t,e,n,i){const r=t.split(/\r?\n/),o={},s={},a=i||E(e)||"(unnamed)",l="".concat(function(t){switch(t){case T:return"fragment";case S:return"vertex";default:return"unknown type"}}(n)," shader ").concat(a);for(let u=0;u<r.length;u++){const e=r[u];if(e.length<=1)continue;const n=e.split(":"),i=n[0],a=parseInt(n[2],10);if(isNaN(a))throw new Error("GLSL compilation error in ".concat(l,": ").concat(t));"WARNING"!==i?o[a]=e:s[a]=e}const c=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ";const i=t.split(/\r?\n/),r=String(i.length+e-1).length;return i.map(((t,i)=>{const o=String(i+e),s=o.length;return P(o,r-s)+n+t}))}(e);return{shaderName:l,errors:I(o,c),warnings:I(s,c)}}function I(t,e){let n="";for(let i=0;i<e.length;i++){const r=e[i];if((t[i+3]||t[i+2]||t[i+1])&&(n+="".concat(r,"\n"),t[i+1])){const e=t[i+1],r=e.split(":",3),o=r[0],s=parseInt(r[1],10)||0,a=e.substring(r.join(":").length+1).trim();n+=P("^^^ ".concat(o,": ").concat(a,"\n\n"),s)}}return n}function P(t,e){let n="";for(let i=0;i<e;++i)n+=" ";return"".concat(n).concat(t)}var D=n(79666);class F extends i.Z{get[Symbol.toStringTag](){return"Shader"}static getTypeName(t){switch(t){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return(0,l.h)(!1),"unknown"}}constructor(t,e){(0,s.JD)(t),(0,l.h)("string"===typeof e.source,"Shader: GLSL source code must be a JavaScript string");super(t,{id:E(e.source,null)||e.id||(0,D.hQ)("unnamed ".concat(F.getTypeName(e.shaderType)))}),this.shaderType=e.shaderType,this.source=e.source,this.initialize(e)}initialize(t){let{source:e}=t;const n=E(e,null);n&&(this.id=(0,D.hQ)(n)),this._compile(e)}getParameter(t){return this.gl.getShaderParameter(this.handle,t)}toString(){return"".concat(F.getTypeName(this.shaderType),":").concat(this.id)}getName(){return E(this.source)||"unnamed-shader"}getSource(){return this.gl.getShaderSource(this.handle)}getTranslatedSource(){const t=this.gl.getExtension("WEBGL_debug_shaders");return t?t.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL_debug_shaders not implemented"}_compile(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.source;t.startsWith("#version ")||(t="#version 100\n".concat(t)),this.source=t,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle);if(!this.getParameter(35713)){const t=this.gl.getShaderInfoLog(this.handle),{shaderName:e,errors:n,warnings:i}=M(t,this.source,this.shaderType,this.id);throw s.cM.error("GLSL compilation errors in ".concat(e,"\n").concat(n))(),s.cM.warn("GLSL compilation warnings in ".concat(e,"\n").concat(i))(),new Error("GLSL compilation errors in ".concat(e))}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class L extends F{get[Symbol.toStringTag](){return"VertexShader"}constructor(t,e){"string"===typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class O extends F{get[Symbol.toStringTag](){return"FragmentShader"}constructor(t,e){"string"===typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}var R=n(77462),k=n(83951);class U{constructor(t){this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}getAttributeInfo(t){const e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}getAttributeLocation(t){const e=this.getAttributeInfo(t);return e?e.location:-1}getAttributeAccessor(t){const e=this.getAttributeInfo(t);return e?e.accessor:null}getVaryingInfo(t){const e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}getVaryingIndex(t){const e=this.getVaryingInfo();return e?e.location:-1}getVaryingAccessor(t){const e=this.getVaryingInfo();return e?e.accessor:null}_readAttributesFromProgram(t){const{gl:e}=t,n=e.getProgramParameter(t.handle,35721);for(let i=0;i<n;i++){const{name:n,type:r,size:o}=e.getActiveAttrib(t.handle,i),s=e.getAttribLocation(t.handle,n);s>=0&&this._addAttribute(s,n,r,o)}this.attributeInfos.sort(((t,e)=>t.location-e.location))}_readVaryingsFromProgram(t){const{gl:e}=t;if(!(0,s.D0)(e))return;const n=e.getProgramParameter(t.handle,35971);for(let i=0;i<n;i++){const{name:n,type:r,size:o}=e.getTransformFeedbackVarying(t.handle,i);this._addVarying(i,n,r,o)}this.varyingInfos.sort(((t,e)=>t.location-e.location))}_addAttribute(t,e,n,i){const{type:r,components:o}=(0,k.hJ)(n),s={type:r,size:i*o};this._inferProperties(t,e,s);const a={location:t,name:e,accessor:new R.Z(s)};this.attributeInfos.push(a),this.attributeInfosByLocation[t]=a,this.attributeInfosByName[a.name]=a}_inferProperties(t,e,n){/instance/i.test(e)&&(n.divisor=1)}_addVarying(t,e,n,i){const{type:r,components:o}=(0,k.hJ)(n),s={location:t,name:e,accessor:new R.Z({type:r,size:i*o})};this.varyingInfos.push(s),this.varyingInfosByName[s.name]=s}}var z=n(55888);const G=35981,N=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class Z extends i.Z{get[Symbol.toStringTag](){return"Program"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.stubRemovedMethods("Program","v6.0",N),this._isCached=!1,this.initialize(e),Object.seal(this),this._setId(e.id)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{hash:e,vs:n,fs:i,varyings:r,bufferMode:o=G}=t;return this.hash=e||"",this.vs="string"===typeof n?new L(this.gl,{id:"".concat(t.id,"-vs"),source:n}):n,this.fs="string"===typeof i?new O(this.gl,{id:"".concat(t.id,"-fs"),source:i}):i,(0,l.h)(this.vs instanceof L),(0,l.h)(this.fs instanceof O),this.uniforms={},this._textureUniforms={},r&&r.length>0&&((0,s.KQ)(this.gl),this.varyings=r,this.gl2.transformFeedbackVaryings(this.handle,r,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new U(this),this.setProps(t)}delete(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:super.delete(t)}setProps(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}draw(t){let{logPriority:e,drawMode:n=4,vertexCount:i,offset:r=0,start:o,end:a,isIndexed:c=!1,indexType:u=5123,instanceCount:h=0,isInstanced:d=h>0,vertexArray:f=null,transformFeedback:A,framebuffer:p,parameters:g={},uniforms:m,samplers:y}=t;if((m||y)&&(s.cM.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(m||{})),s.cM.priority>=e){const t=p?p.id:"default",r="mode=".concat((0,z.km)(this.gl,n)," verts=").concat(i," ")+"instances=".concat(h," indexType=").concat((0,z.km)(this.gl,u)," ")+"isInstanced=".concat(d," isIndexed=").concat(c," ")+"Framebuffer=".concat(t);s.cM.log(e,r)()}return(0,l.h)(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===h)&&(f.bindForDraw(i,h,(()=>{if(void 0!==p&&(g=Object.assign({},g,{framebuffer:p})),A){const t=(0,k.$Z)(n);A.begin(t)}this._bindTextures(),(0,s.s8)(this.gl,g,(()=>{c&&d?this.gl2.drawElementsInstanced(n,i,u,r,h):c&&(0,s.D0)(this.gl)&&!isNaN(o)&&!isNaN(a)?this.gl2.drawRangeElements(n,o,a,i,u,r):c?this.gl.drawElements(n,i,u,r):d?this.gl2.drawArraysInstanced(n,r,i,h):this.gl.drawArrays(n,r,i)})),A&&A.end()})),!0)}setUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s.cM.priority>=2&&function(t,e,n){for(const i in t){const r=t[i];if((!n||Boolean(n[i]))&&!_(r))throw e=e?"".concat(e," "):"",console.error("".concat(e," Bad uniform ").concat(i),r),new Error("".concat(e," Bad uniform ").concat(i))}}(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const e in t){const n=t[e],i=this._uniformSetters[e];if(i){let t=n,s=!1;if(t instanceof o.Z&&(t=t.texture),t instanceof r.Z)if(s=this.uniforms[e]!==n,s){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);const n=t,{textureIndex:r}=i;n.bind(r),t=r,this._textureUniforms[e]=n}else t=i.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(i(t)||s)&&b(this.uniforms,e,n)}}return this}_areTexturesRenderable(){let t=!0;for(const e in this._textureUniforms){const n=this._textureUniforms[e];n.update(),t=t&&n.loaded}return t}_bindTextures(){for(const t in this._textureUniforms){const e=this._uniformSetters[t].textureIndex;this._textureUniforms[t].bind(e)}}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(t){const e=this.gl.getAttachedShaders(t),n={};for(const i of e){switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new L({handle:i});break;case 35632:n.fs=new O({handle:i})}}return n}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=(0,D.hQ)(t)}}_getName(){let t=this.vs.getName()||this.fs.getName();return t=t.replace(/shader/i,""),t=t?"".concat(t,"-program"):"program",t}_compileAndLink(){const{gl:t}=this;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),s.cM.time(4,"linkProgram for ".concat(this._getName()))(),t.linkProgram(this.handle),s.cM.timeEnd(4,"linkProgram for ".concat(this._getName()))(),t.debug||s.cM.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error("Error linking: ".concat(t.getProgramInfoLog(this.handle)));t.validateProgram(this.handle);if(!t.getProgramParameter(this.handle,35715))throw new Error("Error validating: ".concat(t.getProgramInfoLog(this.handle)))}}_readUniformLocationsFromLinkedProgram(){const{gl:t}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let e=0;e<this._uniformCount;e++){const n=this.gl.getActiveUniform(this.handle,e),{name:i}=v(n.name);let r=t.getUniformLocation(this.handle,i);if(this._uniformSetters[i]=y(t,r,n),n.size>1)for(let e=0;e<n.size;e++)r=t.getUniformLocation(this.handle,"".concat(i,"[").concat(e,"]")),this._uniformSetters["".concat(i,"[").concat(e,"]")]=y(t,r,n)}this._textureIndexCounter=0}getActiveUniforms(t,e){return this.gl2.getActiveUniforms(this.handle,t,e)}getUniformBlockIndex(t){return this.gl2.getUniformBlockIndex(this.handle,t)}getActiveUniformBlockParameter(t,e){return this.gl2.getActiveUniformBlockParameter(this.handle,t,e)}uniformBlockBinding(t,e){this.gl2.uniformBlockBinding(this.handle,t,e)}}},38332:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var i=n(35572);const r="EXT_color_buffer_float",o={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:r,bpp:2},33327:{gl2:r,bpp:4},34842:{gl2:r,bpp:8},33326:{gl2:r,bpp:4},33328:{gl2:r,bpp:8},34836:{gl2:r,bpp:16},35898:{gl2:r,bpp:4}};var s=n(28007),a=n(81301);class l extends i.Z{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(t){let{format:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null};return!e||function(t,e,n){const i=n[e];if(!i)return!1;const r=(0,s.D0)(t)&&i.gl2||i.gl1;return"string"===typeof r?t.getExtension(r):r}(t,e,o)}static getSamplesForFormat(t,e){let{format:n}=e;return t.getInternalformatParameter(36161,n,32937)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.initialize(e),Object.seal(this)}initialize(t){let{format:e,width:n=1,height:i=1,samples:r=0}=t;return(0,a.h)(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&(0,s.D0)(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,n,i):this.gl.renderbufferStorage(36161,e,n,i),this.format=e,this.width=n,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*o[this.format].bpp),this}resize(t){let{width:e,height:n}=t;return e!==this.width||n!==this.height?this.initialize({width:e,height:n,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(t){this.gl.bindRenderbuffer(36161,t)}_syncHandle(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(t){this.gl.bindRenderbuffer(36161,this.handle);return this.gl.getRenderbufferParameter(36161,t)}}},35572:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var i=n(28007),r=n(48546),o=n(55888),s=n(81301),a=n(79666),l=n(69221);const c="Resource subclass must define virtual methods";class u{get[Symbol.toStringTag](){return"Resource"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.JD)(t);const{id:n,userData:r={}}=e;this.gl=t,this.gl2=t,this.id=n||(0,a.hQ)(this[Symbol.toStringTag]),this.userData=r,this._bound=!1,this._handle=e.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}get handle(){return this._handle}delete(){let{deleteChildren:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,e&&t&&e.filter(Boolean).forEach((t=>t.delete())),this}bind(){let t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!==typeof e?(this._bindHandle(e),this):(this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t)}unbind(){this.bind(null)}getParameter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=(0,o.sF)(this.gl,t),(0,s.h)(t);const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=(0,i.D0)(this.gl);if(!((!("webgl2"in n)||t)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){const e=n.webgl1,i="webgl2"in n?n.webgl2:n.webgl1;return t?i:e}}return this._getParameter(t,e)}getParameters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{parameters:e,keys:n}=t,r=this.constructor.PARAMETERS||{},s=(0,i.D0)(this.gl),a={},l=e||Object.keys(r);for(const i of l){const e=r[i];if(e&&(!("webgl2"in e)||s)&&(!("extension"in e)||this.gl.getExtension(e.extension))){const r=n?(0,o.km)(this.gl,i):i;a[r]=this.getParameter(i,t),n&&"GLenum"===e.type&&(a[r]=(0,o.km)(this.gl,a[r]))}}return a}setParameter(t,e){t=(0,o.sF)(this.gl,t),(0,s.h)(t);const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=(0,i.D0)(this.gl);if(!((!("webgl2"in n)||t)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(e=(0,o.sF)(e))}return this._setParameter(t,e),this}setParameters(t){for(const e in t)this.setParameter(e,t[e]);return this}stubRemovedMethods(t,e,n){return(0,l.F)(this,t,e,n)}initialize(t){}_createHandle(){throw new Error(c)}_deleteHandle(){throw new Error(c)}_bindHandle(t){throw new Error(c)}_getOptsFromHandle(){throw new Error(c)}_getParameter(t,e){throw new Error(c)}_setParameter(t,e){throw new Error(c)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const t=this[Symbol.toStringTag],e=r.lR.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get("".concat(t,"s Created")).incrementCount(),e.get("".concat(t,"s Active")).incrementCount()}_removeStats(){const t=this[Symbol.toStringTag];r.lR.get("Resource Counts").get("".concat(t,"s Active")).decrementCount()}_trackAllocatedMemory(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag];this._trackAllocatedMemoryForContext(t,e),this._trackAllocatedMemoryForContext(t,e,this.gl.canvas&&this.gl.canvas.id),this.byteLength=t}_trackAllocatedMemoryForContext(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const i=r.lR.get("Memory Usage".concat(n));i.get("GPU Memory").addCount(t),i.get("".concat(e," Memory")).addCount(t)}_trackDeallocatedMemory(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag];this._trackDeallocatedMemoryForContext(t),this._trackDeallocatedMemoryForContext(t,this.gl.canvas&&this.gl.canvas.id),this.byteLength=0}_trackDeallocatedMemoryForContext(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=r.lR.get("Memory Usage".concat(e));n.get("GPU Memory").subtractCount(this.byteLength),n.get("".concat(t," Memory")).subtractCount(this.byteLength)}}},58300:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(28007),r=n(51055),o=n(81301);let s="";class a extends r.Z{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(t,e){return r.Z.isSupported(t,e)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,r;(0,i.JD)(t),(e instanceof Promise||"string"===typeof e)&&(e={data:e}),"string"===typeof e.data&&(e=Object.assign({},e,{data:(n=e.data,(0,o.h)("string"===typeof n),n=s+n,new Promise(((t,e)=>{try{const i=new Image;i.onload=()=>t(i),i.onerror=()=>e(new Error("Could not load image ".concat(n,"."))),i.crossOrigin=r&&r.crossOrigin||"anonymous",i.src=n}catch(i){e(i)}})))})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}},29094:(t,e,n)=>{"use strict";n.d(e,{C:()=>o,KR:()=>l,ae:()=>r,br:()=>a,pH:()=>s});var i=n(28007);const r={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},o={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},s={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1};function a(t,e){const n=r[e];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;const o=(0,i.D0)(t)&&n.gl2||n.gl1;return"string"===typeof o?t.getExtension(o):o}function l(t,e){const n=r[e];switch(n&&n.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}},51055:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var i=n(28007),r=n(35572),o=n(33839),s=n(29094),a=n(81301),l=n(79666);const c=[9729,9728],u=globalThis.WebGLBuffer||function(){};class h extends r.Z{get[Symbol.toStringTag](){return"Texture"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{format:n,linearFiltering:i}=e;let r=!0;return n&&(r=r&&(0,s.br)(t,n),r=r&&(!i||(0,s.KR)(t,n))),r}constructor(t,e){const{id:n=(0,l.hQ)("texture"),handle:i,target:r}=e;super(t,{id:n,handle:i}),this.target=r,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.data;if(e instanceof Promise)return e.then((e=>this.initialize(Object.assign({},t,{pixels:e,data:e})))),this;const n="undefined"!==typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(n&&e.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,e.addEventListener("loadeddata",(()=>this.initialize(t))),this;const{pixels:r=null,format:o=6408,border:s=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:u}=t;e||(e=r);let{width:h,height:d,dataFormat:f,type:A,compressed:p=!1,mipmaps:g=!0}=t;const{depth:m=0}=t;return({width:h,height:d,compressed:p,dataFormat:f,type:A}=this._deduceParameters({format:o,type:A,dataFormat:f,compressed:p,data:e,width:h,height:d})),this.width=h,this.height=d,this.depth=m,this.format=o,this.type=A,this.dataFormat=f,this.border=s,this.textureUnit=u,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),g&&this._isNPOT()&&(i.cM.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),g=!1,this._updateForNPOT(l)),this.mipmaps=g,this.setImageData({data:e,width:h,height:d,depth:m,format:o,type:A,dataFormat:f,border:s,mipmaps:g,parameters:c,compressed:p}),g&&this.generateMipmap(),this.setParameters(l),a&&(this.data=e),n&&(this._video={video:e,parameters:l,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){if(this._video){const{video:t,parameters:e,lastTime:n}=this._video;if(n===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:e}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}resize(t){let{height:e,width:n,mipmaps:i=!1}=t;return n!==this.width||e!==this.height?this.initialize({width:n,height:e,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}generateMipmap(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(i.cM.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),(0,i.s8)(this.gl,t,(()=>{this.gl.generateMipmap(this.target)})),this.gl.bindTexture(this.target,null),this)}setImageData(t){this._trackDeallocatedMemory("Texture");const{target:e=this.target,pixels:n=null,level:r=0,format:o=this.format,border:l=this.border,offset:c=0,parameters:u={}}=t;let{data:h=null,type:d=this.type,width:f=this.width,height:A=this.height,dataFormat:p=this.dataFormat,compressed:g=!1}=t;h||(h=n),({type:d,dataFormat:p,compressed:g,width:f,height:A}=this._deduceParameters({format:o,type:d,dataFormat:p,compressed:g,data:h,width:f,height:A}));const{gl:m}=this;m.bindTexture(this.target,this.handle);let y,v=null;({data:h,dataType:v}=this._getDataType({data:h,compressed:g}));let _=0;if((0,i.s8)(this.gl,u,(()=>{switch(v){case"null":m.texImage2D(e,r,o,f,A,l,p,d,h);break;case"typed-array":m.texImage2D(e,r,o,f,A,l,p,d,h,c);break;case"buffer":y=(0,i.KQ)(m),y.bindBuffer(35052,h.handle||h),y.texImage2D(e,r,o,f,A,l,p,d,c),y.bindBuffer(35052,null);break;case"browser-object":(0,i.D0)(m)?m.texImage2D(e,r,o,f,A,l,p,d,h):m.texImage2D(e,r,o,p,d,h);break;case"compressed":for(const[t,n]of h.entries())m.compressedTexImage2D(e,t,n.format,n.width,n.height,l,n.data),_+=n.levelSize;break;default:(0,a.h)(!1,"Unknown image data type")}})),"compressed"===v)this._trackAllocatedMemory(_,"Texture");else if(h&&h.byteLength)this._trackAllocatedMemory(h.byteLength,"Texture");else{const t=s.C[this.dataFormat]||4,e=s.pH[this.type]||1;this._trackAllocatedMemory(this.width*this.height*t*e,"Texture")}return this.loaded=!0,this}setSubImageData(t){let{target:e=this.target,pixels:n=null,data:r=null,x:s=0,y:l=0,width:c=this.width,height:h=this.height,level:d=0,format:f=this.format,type:A=this.type,dataFormat:p=this.dataFormat,compressed:g=!1,offset:m=0,border:y=this.border,parameters:v={}}=t;if(({type:A,dataFormat:p,compressed:g,width:c,height:h}=this._deduceParameters({format:f,type:A,dataFormat:p,compressed:g,data:r,width:c,height:h})),(0,a.h)(0===this.depth,"texSubImage not supported for 3D textures"),r||(r=n),r&&r.data){const t=r;r=t.data,c=t.shape[0],h=t.shape[1]}r instanceof o.Z&&(r=r.handle),this.gl.bindTexture(this.target,this.handle),(0,i.s8)(this.gl,v,(()=>{if(g)this.gl.compressedTexSubImage2D(e,d,s,l,c,h,f,r);else if(null===r)this.gl.texSubImage2D(e,d,s,l,c,h,p,A,null);else if(ArrayBuffer.isView(r))this.gl.texSubImage2D(e,d,s,l,c,h,p,A,r,m);else if(r instanceof u){const t=(0,i.KQ)(this.gl);t.bindBuffer(35052,r),t.texSubImage2D(e,d,s,l,c,h,p,A,m),t.bindBuffer(35052,null)}else if((0,i.D0)(this.gl)){(0,i.KQ)(this.gl).texSubImage2D(e,d,s,l,c,h,p,A,r)}else this.gl.texSubImage2D(e,d,s,l,p,A,r)})),this.gl.bindTexture(this.target,null)}copyFramebuffer(){return i.cM.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}unbind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}_getDataType(t){let{data:e,compressed:n=!1}=t;return n?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof o.Z?{data:e.handle,dataType:"buffer"}:e instanceof u?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(t){const{format:e,data:n}=t;let{width:i,height:r,dataFormat:o,type:a,compressed:l}=t;const c=s.ae[e];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:i,height:r}=this._deduceImageSize(n,i,r)),{dataFormat:o,type:a,compressed:l,width:i,height:r,format:e,data:n}}_deduceImageSize(t,e,n){let i;return i="undefined"!==typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!==typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:n}:{width:e>=0?e:1,height:n>=0?n:1},(0,a.h)(i,"Could not deduced texture size"),(0,a.h)(void 0===e||i.width===e,"Deduced texture width does not match supplied width"),(0,a.h)(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}_setParameter(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:(0,a.h)(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(0,i.D0)(this.gl)&&(!(!this.width||!this.height)&&(!(0,l.wt)(this.width)||!(0,l.wt)(this.height)))}_updateForNPOT(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(t,e){if(this._isNPOT())switch(t){case 10241:-1===c.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}},54345:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var i=n(28007),r=n(35572),o=n(33839),s=n(79666);class a extends r.Z{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(t){return(0,i.D0)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.KQ)(t),super(t,e),this.initialize(e),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,(0,s.nK)(this.buffers)||this.bind((()=>this._unbindBuffers())),this.setProps(t),this}setProps(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}setBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind((()=>{for(const e in t)this.setBuffer(e,t[e])})),this}setBuffer(t,e){const n=this._getVaryingIndex(t),{buffer:r,byteSize:o,byteOffset:s}=this._getBufferParams(e);return n<0?(this.unused[t]=r,i.cM.warn("".concat(this.id," unused varying buffer ").concat(t))(),this):(this.buffers[n]=e,this.bindOnUse||this._bindBuffer(n,r,s,o),this)}begin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(t){let e,n,i;return t instanceof o.Z===!1?(i=t.buffer,n=t.byteSize,e=t.byteOffset):i=t,void 0===e&&void 0===n||(e=e||0,n=n||i.byteLength-e),{buffer:i,byteOffset:e,byteSize:n}}_getVaryingInfo(t){return this.configuration&&this.configuration.getVaryingInfo(t)}_getVaryingIndex(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;const e=Number(t);return Number.isFinite(e)?e:-1}_bindBuffers(){if(this.bindOnUse)for(const t in this.buffers){const{buffer:e,byteSize:n,byteOffset:i}=this._getBufferParams(this.buffers[t]);this._bindBuffer(t,e,i,n)}}_unbindBuffers(){if(this.bindOnUse)for(const t in this.buffers)this._bindBuffer(t,null)}_bindBuffer(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;const r=e&&e.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,t,r,n,i):this.gl.bindBufferBase(35982,t,r),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(t){this.gl.bindTransformFeedback(36386,this.handle)}}},12308:(t,e,n)=>{"use strict";n.d(e,{N$:()=>c,U6:()=>a,ag:()=>l});var i=n(70353),r=n(28007),o=n(81301);const s=2;function a(t,e){return l(t,e)}function l(t,e){return(e=Array.isArray(e)?e:[e]).every((e=>u(t,e)))}function c(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in i.Z)void 0===t.luma.caps[e]&&(t.luma.caps[e]=u(t,e));return t.luma.caps}function u(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){const n=i.Z[e];let s;(0,o.h)(n,e);const a=(0,r.D0)(t)&&n[1]||n[0];if("function"===typeof a)s=a(t);else if(Array.isArray(a)){s=!0;for(const e of a)s=s&&Boolean(t.getExtension(e))}else"string"===typeof a?s=Boolean(t.getExtension(a)):"boolean"===typeof a?s=a:(0,o.h)(!1);return s}(t,e)),t.luma.caps[e]||r.cM.log(s,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}},70353:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s,h:()=>o});var i=n(79078),r=n(58300);const o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};const s={[o.WEBGL2]:[!1,!0],[o.VERTEX_ARRAY_OBJECT]:["OES_vertex_array_object",!0],[o.TIMER_QUERY]:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],[o.INSTANCED_RENDERING]:["ANGLE_instanced_arrays",!0],[o.MULTIPLE_RENDER_TARGETS]:["WEBGL_draw_buffers",!0],[o.ELEMENT_INDEX_UINT32]:["OES_element_index_uint",!0],[o.BLEND_EQUATION_MINMAX]:["EXT_blend_minmax",!0],[o.FLOAT_BLEND]:["EXT_float_blend"],[o.COLOR_ENCODING_SRGB]:["EXT_sRGB",!0],[o.TEXTURE_DEPTH]:["WEBGL_depth_texture",!0],[o.TEXTURE_FLOAT]:["OES_texture_float",!0],[o.TEXTURE_HALF_FLOAT]:["OES_texture_half_float",!0],[o.TEXTURE_FILTER_LINEAR_FLOAT]:["OES_texture_float_linear"],[o.TEXTURE_FILTER_LINEAR_HALF_FLOAT]:["OES_texture_half_float_linear"],[o.TEXTURE_FILTER_ANISOTROPIC]:["EXT_texture_filter_anisotropic"],[o.COLOR_ATTACHMENT_RGBA32F]:[function(t){const e=new r.Z(t,{format:6408,type:5126,dataFormat:6408}),n=new i.Z(t,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),o=n.getStatus();return e.delete(),n.delete(),36053===o},"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_FLOAT]:[!1,"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_HALF_FLOAT]:["EXT_color_buffer_half_float"],[o.GLSL_FRAG_DATA]:["WEBGL_draw_buffers",!0],[o.GLSL_FRAG_DEPTH]:["EXT_frag_depth",!0],[o.GLSL_DERIVATIVES]:["OES_standard_derivatives",!0],[o.GLSL_TEXTURE_LOD]:["EXT_shader_texture_lod",!0]}},48546:(t,e,n)=>{"use strict";n.d(e,{lR:()=>a});var i=n(28007),r=n(92138),o=n(11515);const s="8.5.21";const a=new class{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new r.Z({id:t})),this.stats.get(t)}};if(globalThis.luma&&globalThis.luma.VERSION!==s)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(s));globalThis.luma||((0,o.Z)()&&i.cM.log(1,"luma.gl ".concat(s," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:s,version:s,log:i.cM,stats:a,globals:{modules:{},nodeIO:{}}});globalThis.luma},81301:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}n.d(e,{h:()=>i})},80182:(t,e,n)=>{"use strict";n.d(e,{k:()=>r});var i=n(28007);function r(t,e,n){const{removedProps:r={},deprecatedProps:o={},replacedProps:s={}}=n;for(const l in r)if(l in e){const e=r[l]?"".concat(t,".").concat(r[l]):"N/A";i.cM.removed("".concat(t,".").concat(l),e)()}for(const l in o)if(l in e){const e=o[l];i.cM.deprecated("".concat(t,".").concat(l),"".concat(t,".").concat(e))()}let a=null;for(const l in s)if(l in e){const n=s[l];i.cM.deprecated("".concat(t,".").concat(l),"".concat(t,".").concat(n))(),a=a||Object.assign({},e),a[n]=e[l],delete a[l]}return a||e}},69221:(t,e,n)=>{"use strict";n.d(e,{F:()=>r});var i=n(28007);function r(t,e,n,r){const o="See luma.gl ".concat(n," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),s=Object.getPrototypeOf(t);r.forEach((t=>{s.methodName||(s[t]=()=>{throw i.cM.removed("Calling removed method ".concat(e,".").concat(t,": "),o)(),new Error(t)})}))}},79666:(t,e,n)=>{"use strict";n.d(e,{hQ:()=>o,nK:()=>a,wt:()=>s});var i=n(81301);const r={};function o(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";r[t]=r[t]||1;const e=r[t]++;return"".concat(t,"-").concat(e)}function s(t){return(0,i.h)("number"===typeof t,"Input must be a number"),t&&0===(t&t-1)}function a(t){let e=!0;for(const n in t){e=!1;break}return e}},83951:(t,e,n)=>{"use strict";n.d(e,{$Z:()=>v,hJ:()=>_,jG:()=>b});var i=n(81301);const r=5120,o=5121,s=5122,a=5123,l=0,c=1,u=2,h=3,d=4,f=5,A=6,p=5126,g=5124,m=5125,y={[p]:[p,1,"float"],35664:[p,2,"vec2"],35665:[p,3,"vec3"],35666:[p,4,"vec4"],[g]:[g,1,"int"],35667:[g,2,"ivec2"],35668:[g,3,"ivec3"],35669:[g,4,"ivec4"],[m]:[m,1,"uint"],36294:[m,2,"uvec2"],36295:[m,3,"uvec3"],36296:[m,4,"uvec4"],35670:[p,1,"bool"],35671:[p,2,"bvec2"],35672:[p,3,"bvec3"],35673:[p,4,"bvec4"],35674:[p,8,"mat2"],35685:[p,8,"mat2x3"],35686:[p,8,"mat2x4"],35675:[p,12,"mat3"],35687:[p,12,"mat3x2"],35688:[p,12,"mat3x4"],35676:[p,16,"mat4"],35689:[p,16,"mat4x2"],35690:[p,16,"mat4x3"]};function v(t){switch(t){case l:return l;case c:case h:case u:return c;case d:case f:case A:return d;default:return(0,i.h)(!1),0}}function _(t){const e=y[t];if(!e)return null;const[n,i]=e;return{type:n,components:i}}function b(t,e){switch(t){case r:case o:case s:case a:t=p}for(const n in y){const[i,r,o]=y[n];if(i===t&&r===e)return{glType:n,name:o}}return null}},55888:(t,e,n)=>{"use strict";n.d(e,{km:()=>o,sF:()=>r});var i=n(81301);function r(t,e){if("string"!==typeof e)return e;const n=Number(e);if(!isNaN(n))return n;const r=t[e=e.replace(/^.*\./,"")];return(0,i.h)(void 0!==r,"Accessing undefined constant GL.".concat(e)),r}function o(t,e){e=Number(e);for(const n in t)if(t[n]===e)return"GL.".concat(n);return String(e)}},17507:(t,e,n)=>{"use strict";n.d(e,{h:()=>f,Y:()=>A});var i=n(58300),r=n(28007),o=n(51055);const s=[34069,34070,34071,34072,34073,34074];class a extends o.Z{get[Symbol.toStringTag](){return"TextureCube"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,r.JD)(t),super(t,Object.assign({},e,{target:34067})),this.initialize(e),Object.seal(this)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{mipmaps:e=!0,parameters:n={}}=t;return this.opts=t,this.setCubeMapImageData(t).then((()=>{this.loaded=!0,e&&this.generateMipmap(t),this.setParameters(n)})),this}subImage(t){let{face:e,data:n,x:i=0,y:r=0,mipmapLevel:o=0}=t;return this._subImage({target:e,data:n,x:i,y:r,mipmapLevel:o})}async setCubeMapImageData(t){let{width:e,height:n,pixels:i,data:o,border:a=0,format:l=6408,type:c=5121}=t;const{gl:u}=this,h=i||o,d=await Promise.all(s.map((t=>{const e=h[t];return Promise.all(Array.isArray(e)?e:[e])})));this.bind(),s.forEach(((t,i)=>{d[i].length>1&&!1!==this.opts.mipmaps&&r.cM.warn("".concat(this.id," has mipmap and multiple LODs."))(),d[i].forEach(((i,r)=>{e&&n?u.texImage2D(t,r,l,e,n,a,l,c,i):u.texImage2D(t,r,l,l,c,i)}))})),this.unbind()}setImageDataForFace(t){const{face:e,width:n,height:i,pixels:r,data:o,border:s=0,format:a=6408,type:l=5121}=t,{gl:c}=this,u=r||o;return this.bind(),u instanceof Promise?u.then((n=>this.setImageDataForFace(Object.assign({},t,{face:e,data:n,pixels:n})))):this.width||this.height?c.texImage2D(e,0,a,n,i,s,a,l,u):c.texImage2D(e,0,a,a,l,u),this}}a.FACES=s;var l=n(29094),c=n(33839);class u extends o.Z{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(t){return(0,r.D0)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,r.KQ)(t),e=Object.assign({depth:1},e,{target:32879,unpackFlipY:!1}),super(t,e),this.initialize(e),Object.seal(this)}setImageData(t){let{level:e=0,dataFormat:n=6408,width:i,height:o,depth:s=1,border:a=0,format:u,type:h=5121,offset:d=0,data:f,parameters:A={}}=t;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),(0,r.s8)(this.gl,A,(()=>{ArrayBuffer.isView(f)&&this.gl.texImage3D(this.target,e,n,i,o,s,a,u,h,f),f instanceof c.Z&&(this.gl.bindBuffer(35052,f.handle),this.gl.texImage3D(this.target,e,n,i,o,s,a,u,h,d))})),f&&f.byteLength)this._trackAllocatedMemory(f.byteLength,"Texture");else{const t=l.C[this.dataFormat]||4,e=l.pH[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*t*e,"Texture")}return this.loaded=!0,this}}var h=n(79078),d=n(81301);function f(t,e){(0,d.h)(t instanceof i.Z||t instanceof a||t instanceof u);const n=t.constructor,{gl:r,width:o,height:s,format:l,type:c,dataFormat:h,border:f,mipmaps:A}=t;return new n(r,Object.assign({width:o,height:s,format:l,type:c,dataFormat:h,border:f,mipmaps:A},e))}function A(t,e){const{gl:n,width:i,height:r,id:o}=t;return new h.Z(n,Object.assign({},e,{id:"framebuffer-for-".concat(o),width:i,height:r,attachments:{36064:t}}))}},75946:(t,e,n)=>{"use strict";n.d(e,{KS:()=>a,O:()=>r,c$:()=>s,vN:()=>o});const i="Failed to deduce GL constant from typed array";function r(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(i)}}function o(t){let{clamped:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function s(t){let{data:e,width:n,height:i,bytesPerPixel:r=4,temp:o}=t;const s=n*r;o=o||new Uint8Array(s);for(let a=0;a<i/2;++a){const t=a*s,n=(i-a-1)*s;o.set(e.subarray(t,t+s)),e.copyWithin(t,n,n+s),e.set(o,n)}}function a(t){let{data:e,width:n,height:i}=t;const r=Math.round(n/2),o=Math.round(i/2),s=new Uint8Array(r*o*4);for(let a=0;a<o;a++)for(let t=0;t<r;t++)for(let i=0;i<4;i++)s[4*(a*r+t)+i]=e[4*(2*a*n+2*t)+i];return{data:s,width:r,height:o}}},80097:(t,e,n)=>{var i=n(47131);function r(t){return{type:"Feature",geometry:i.tileToGeoJSON(t),properties:{}}}function o(t,e){var n,r,o=t.coordinates,a=e.max_zoom,h={},d=[];if("Point"===t.type)return[i.pointToTile(o[0],o[1],a)];if("MultiPoint"===t.type)for(n=0;n<o.length;n++)h[u((r=i.pointToTile(o[n][0],o[n][1],a))[0],r[1],r[2])]=!0;else if("LineString"===t.type)l(h,o,a);else if("MultiLineString"===t.type)for(n=0;n<o.length;n++)l(h,o[n],a);else if("Polygon"===t.type)s(h,d,o,a);else{if("MultiPolygon"!==t.type)throw new Error("Geometry type not implemented");for(n=0;n<o.length;n++)s(h,d,o[n],a)}if(e.min_zoom!==a){var f=d.length;for(c(h,d),n=0;n<f;n++){var A=d[n];h[u(A[0],A[1],A[2])]=!0}return function(t,e,n){for(var i=[],r=n.max_zoom;r>n.min_zoom;r--){for(var o={},s=[],a=0;a<e.length;a++){var l=e[a];if(l[0]%2===0&&l[1]%2===0){var c=u(l[0]+1,l[1],r),h=u(l[0],l[1]+1,r),d=u(l[0]+1,l[1]+1,r);if(t[c]&&t[h]&&t[d]){t[u(l[0],l[1],l[2])]=!1,t[c]=!1,t[h]=!1,t[d]=!1;var f=[l[0]/2,l[1]/2,r-1];r-1===n.min_zoom?i.push(f):(o[u(l[0]/2,l[1]/2,r-1)]=!0,s.push(f))}}}for(a=0;a<e.length;a++)t[u((l=e[a])[0],l[1],l[2])]&&i.push(l);t=o,e=s}return i}(h,d,e)}return c(h,d),d}function s(t,e,n,i){for(var r=[],o=0;o<n.length;o++){var s=[];l(t,n[o],i,s);for(var c=0,h=s.length,d=h-1;c<h;d=c++){var f=(c+1)%h,A=s[c][1];(A>s[d][1]||A>s[f][1])&&(A<s[d][1]||A<s[f][1])&&A!==s[f][1]&&r.push(s[c])}}for(r.sort(a),o=0;o<r.length;o+=2){A=r[o][1];for(var p=r[o][0]+1;p<r[o+1][0];p++){t[u(p,A,i)]||e.push([p,A,i])}}}function a(t,e){return t[1]-e[1]||t[0]-e[0]}function l(t,e,n,r){for(var o,s,a=0;a<e.length-1;a++){var l=i.pointToTileFraction(e[a][0],e[a][1],n),c=i.pointToTileFraction(e[a+1][0],e[a+1][1],n),h=l[0],d=l[1],f=c[0]-h,A=c[1]-d;if(0!==A||0!==f){var p=f>0?1:-1,g=A>0?1:-1,m=Math.floor(h),y=Math.floor(d),v=0===f?1/0:Math.abs(((f>0?1:0)+m-h)/f),_=0===A?1/0:Math.abs(((A>0?1:0)+y-d)/A),b=Math.abs(p/f),x=Math.abs(g/A);for(m===o&&y===s||(t[u(m,y,n)]=!0,r&&y!==s&&r.push([m,y]),o=m,s=y);v<1||_<1;)v<_?(v+=b,m+=p):(_+=x,y+=g),t[u(m,y,n)]=!0,r&&y!==s&&r.push([m,y]),o=m,s=y}}r&&y===r[0][1]&&r.pop()}function c(t,e){for(var n=Object.keys(t),i=0;i<n.length;i++)e.push(h(+n[i]))}function u(t,e,n){return 32*(2*(1<<n)*e+t)+n}function h(t){var e=t%32,n=2*(1<<e),i=(t-e)/32,r=i%n;return[r,(i-r)/n%n,e]}},97833:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var i=n(47410);class r extends(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array)){clone(){return(new this.constructor).copy(this)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:(0,i.kJ)(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(i.vc)}formatString(t){let e="";for(let n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+(0,i.Bw)(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!(0,i.fS)(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,n){if(void 0===n)return this.lerp(this,t,e);for(let i=0;i<this.ELEMENTS;++i){const r=t[i];this[i]=r+n*(e[i]-r)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}add(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)for(let t=0;t<this.ELEMENTS;++t)this[t]+=i[t];return this.check()}subtract(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)for(let t=0;t<this.ELEMENTS;++t)this[t]-=i[t];return this.check()}scale(t){if("number"===typeof t)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(i.vc.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}get elements(){return this}}},53209:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var i=n(97833),r=n(69801),o=n(47410);class s extends i.Z{toString(){let t="[";if(o.vc.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=" ".concat(this[e])}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,n){return this[e*this.RANK+t]=(0,r.u5)(n),this}getColumn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0);const n=t*this.RANK;for(let i=0;i<this.RANK;++i)e[i]=this[n+i];return e}setColumn(t,e){const n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=e[i];return this}}},95282:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var i=n(97833),r=n(69801),o=n(45903);class s extends i.Z{get x(){return this[0]}set x(t){this[0]=(0,r.u5)(t)}get y(){return this[1]}set y(t){this[1]=(0,r.u5)(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let n=0;n<this.ELEMENTS;++n){const i=this[n]-t[n];e+=i*i}return(0,r.u5)(e)}dot(t){let e=0;for(let n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return(0,r.u5)(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)for(let t=0;t<this.ELEMENTS;++t)this[t]*=i[t];return this.check()}divide(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const i of e)for(let t=0;t<this.ELEMENTS;++t)this[t]/=i[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return(0,o.Z)(t>=0&&t<this.ELEMENTS,"index is out of range"),(0,r.u5)(this[t])}setComponent(t,e){return(0,o.Z)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}},73518:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var i,r=n(53209),o=n(69801),s=n(63986),a=n(24645),l=n(77548),c=n(99007);!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"}(i||(i={}));const u=Object.freeze([1,0,0,0,1,0,0,0,1]);class h extends r.Z{static get IDENTITY(){return function(){f||(f=new h,Object.freeze(f));return f}()}static get ZERO(){return function(){d||(d=new h([0,0,0,0,0,0,0,0,0]),Object.freeze(d));return d}()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return i}constructor(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):n.length>0?this.copy([t,...n]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(u)}fromObject(t){return this.check()}fromQuaternion(t){return a.en(this,t),this.check()}set(t,e,n,i,r,o,s,a,l){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this[4]=r,this[5]=o,this[6]=s,this[7]=a,this[8]=l,this.check()}setRowMajor(t,e,n,i,r,o,s,a,l){return this[0]=t,this[1]=i,this[2]=s,this[3]=e,this[4]=r,this[5]=a,this[6]=n,this[7]=o,this[8]=l,this.check()}determinant(){return a.GH(this)}transpose(){return a.p4(this,this),this.check()}invert(){return a.U_(this,this),this.check()}multiplyLeft(t){return a.Jp(this,t,this),this.check()}multiplyRight(t){return a.Jp(this,this,t),this.check()}rotate(t){return a.U1(this,this,t),this.check()}scale(t){return Array.isArray(t)?a.bA(this,this,t):a.bA(this,this,[t,t]),this.check()}translate(t){return a.Iu(this,this,t),this.check()}transform(t,e){let n;switch(t.length){case 2:n=l.kK(e||[-0,-0],t,this);break;case 3:n=c.kK(e||[-0,-0,-0],t,this);break;case 4:n=(0,s._x)(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,o.IL)(n,t.length),n}transformVector(t,e){return this.transform(t,e)}transformVector2(t,e){return this.transform(t,e)}transformVector3(t,e){return this.transform(t,e)}}let d,f},12987:(t,e,n)=>{"use strict";n.d(e,{Z:()=>g});var i,r=n(53209),o=n(69801),s=n(63986),a=n(83367),l=n(77548),c=n(99007),u=n(62220);!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"}(i||(i={}));const h=45*Math.PI/180,d=1,f=.1,A=500,p=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class g extends r.Z{static get IDENTITY(){return function(){y||(y=new g,Object.freeze(y));return y}()}static get ZERO(){return function(){m||(m=new g([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(m));return m}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return i}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,n,i,r,o,s,a,l,c,u,h,d,f,A,p){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this[4]=r,this[5]=o,this[6]=s,this[7]=a,this[8]=l,this[9]=c,this[10]=u,this[11]=h,this[12]=d,this[13]=f,this[14]=A,this[15]=p,this.check()}setRowMajor(t,e,n,i,r,o,s,a,l,c,u,h,d,f,A,p){return this[0]=t,this[1]=r,this[2]=l,this[3]=d,this[4]=e,this[5]=o,this[6]=c,this[7]=f,this[8]=n,this[9]=s,this[10]=u,this[11]=A,this[12]=i,this[13]=a,this[14]=h,this[15]=p,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(p)}fromObject(t){return this.check()}fromQuaternion(t){return a.en(this,t),this.check()}frustum(t){const{left:e,right:n,bottom:i,top:r,near:o=f,far:s=A}=t;return s===1/0?function(t,e,n,i,r,o){const s=2*o/(n-e),a=2*o/(r-i),l=(n+e)/(n-e),c=(r+i)/(r-i),u=-1,h=-1,d=-2*o;t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=l,t[9]=c,t[10]=u,t[11]=h,t[12]=0,t[13]=0,t[14]=d,t[15]=0}(this,e,n,i,r,o):a.oy(this,e,n,i,r,o,s),this.check()}lookAt(t){const{eye:e,center:n=[0,0,0],up:i=[0,1,0]}=t;return a.zB(this,e,n,i),this.check()}ortho(t){const{left:e,right:n,bottom:i,top:r,near:o=f,far:s=A}=t;return a.M5(this,e,n,i,r,o,s),this.check()}orthographic(t){const{fovy:e=h,aspect:n=d,focalDistance:i=1,near:r=f,far:o=A}=t;v(e);const s=e/2,a=i*Math.tan(s),l=a*n;return this.ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:o})}perspective(t){const{fovy:e=45*Math.PI/180,aspect:n=1,near:i=.1,far:r=500}=t;return v(e),a.G3(this,e,n,i,r),this.check()}determinant(){return a.GH(this)}getScale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const n=this.getScale(e),i=1/n[0],r=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*r,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*r,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const n=this.getScale(e),i=1/n[0],r=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*r,t[2]=this[2]*o,t[3]=this[4]*i,t[4]=this[5]*r,t[5]=this[6]*o,t[6]=this[8]*i,t[7]=this[9]*r,t[8]=this[10]*o,t}transpose(){return a.p4(this,this),this.check()}invert(){return a.U_(this,this),this.check()}multiplyLeft(t){return a.Jp(this,t,this),this.check()}multiplyRight(t){return a.Jp(this,this,t),this.check()}rotateX(t){return a.lM(this,this,t),this.check()}rotateY(t){return a.uD(this,this,t),this.check()}rotateZ(t){return a.jI(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return a.U1(this,this,t,e),this.check()}scale(t){return a.bA(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return a.Iu(this,this,t),this.check()}transform(t,e){return 4===t.length?(e=u.fF(e||[-0,-0,-0,-0],t,this),(0,o.IL)(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:n}=t;let i;switch(n){case 2:i=l.fF(e||[-0,-0],t,this);break;case 3:i=c.fF(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,o.IL)(i,t.length),i}transformAsVector(t,e){let n;switch(t.length){case 2:n=(0,s.pb)(e||[-0,-0],t,this);break;case 3:n=(0,s.pL)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,o.IL)(n,t.length),n}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,n){return this.identity().translate([t,e,n])}}let m,y;function v(t){if(t>2*Math.PI)throw Error("expected radians")}},34980:(t,e,n)=>{"use strict";n.d(e,{Z:()=>S});var i=n(97833),r=n(69801),o=n(95282),s=n(47410),a=n(99007),l=n(63986);let c;class u extends o.Z{static get ZERO(){return c||(c=new u(0,0,0,0),Object.freeze(c)),c}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;super(-0,-0,-0,-0),(0,s.kJ)(t)&&1===arguments.length?this.copy(t):(s.vc.debug&&((0,r.u5)(t),(0,r.u5)(e),(0,r.u5)(n),(0,r.u5)(i)),this[0]=t,this[1]=e,this[2]=n,this[3]=i)}set(t,e,n,i){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return s.vc.debug&&((0,r.u5)(t.x),(0,r.u5)(t.y),(0,r.u5)(t.z),(0,r.u5)(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=(0,r.u5)(t)}get w(){return this[3]}set w(t){this[3]=(0,r.u5)(t)}transform(t){return a.fF(this,this,t),this.check()}transformByMatrix3(t){return(0,l._x)(this,this,t),this.check()}transformByMatrix2(t){return(0,l.G7)(this,this,t),this.check()}transformByQuaternion(t){return a.VC(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}}var h=n(60285),d=n(24645),f=n(62220);function A(){var t=new h.WT(4);return h.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function p(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function g(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=n[0],l=n[1],c=n[2],u=n[3];return t[0]=i*u+s*a+r*c-o*l,t[1]=r*u+s*l+o*a-i*c,t[2]=o*u+s*c+i*l-r*a,t[3]=s*u-i*a-r*l-o*c,t}function m(t,e,n,i){var r,o,s,a,l,c=e[0],u=e[1],d=e[2],f=e[3],A=n[0],p=n[1],g=n[2],m=n[3];return(o=c*A+u*p+d*g+f*m)<0&&(o=-o,A=-A,p=-p,g=-g,m=-m),1-o>h.Ib?(r=Math.acos(o),s=Math.sin(r),a=Math.sin((1-i)*r)/s,l=Math.sin(i*r)/s):(a=1-i,l=i),t[0]=a*c+l*A,t[1]=a*u+l*p,t[2]=a*d+l*g,t[3]=a*f+l*m,t}function y(t,e){var n,i=e[0]+e[4]+e[8];if(i>0)n=Math.sqrt(i+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var o=(r+1)%3,s=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*o+o]-e[3*s+s]+1),t[r]=.5*n,n=.5/n,t[3]=(e[3*o+s]-e[3*s+o])*n,t[o]=(e[3*o+r]+e[3*r+o])*n,t[s]=(e[3*s+r]+e[3*r+s])*n}return t}f.d9,f.al,f.JG,f.t8;var v=f.IH,_=f.bA,b=f.AK,x=f.t7,w=f.kE,C=f.we,B=f.Fv,E=(f.I6,f.fS,function(){var t=a.Ue(),e=a.al(1,0,0),n=a.al(0,1,0);return function(i,r,o){var s=a.AK(r,o);return s<-.999999?(a.kC(t,e,r),a.Zh(t)<1e-6&&a.kC(t,n,r),a.Fv(t,t),p(i,t,Math.PI),i):s>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(a.kC(t,r,o),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+s,B(i,i))}}());(function(){var t=A(),e=A()})(),function(){var t=d.Ue()}();const T=[0,0,0,1];class S extends i.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?this.copy(t):this.set(t,e,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,n,i){return this[0]=t,this[1]=e,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return y(this,t),this.check()}fromAxisRotation(t,e){return p(this,t,e),this.check()}identity(){var t;return(t=this)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=(0,r.u5)(t)}get y(){return this[1]}set y(t){this[1]=(0,r.u5)(t)}get z(){return this[2]}set z(t){this[2]=(0,r.u5)(t)}get w(){return this[3]}set w(t){this[3]=(0,r.u5)(t)}len(){return w(this)}lengthSquared(){return C(this)}dot(t){return b(this,t)}rotationTo(t,e){return E(this,t,e),this.check()}add(t){return v(this,this,t),this.check()}calculateW(){return function(t,e){var n=e[0],i=e[1],r=e[2];t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r))}(this,this),this.check()}conjugate(){var t,e;return e=this,(t=this)[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],this.check()}invert(){return function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=n*n+i*i+r*r+o*o,a=s?1/s:0;t[0]=-n*a,t[1]=-i*a,t[2]=-r*a,t[3]=o*a}(this,this),this.check()}lerp(t,e,n){return void 0===n?this.lerp(this,t,e):(x(this,t,e,n),this.check())}multiplyRight(t){return g(this,this,t),this.check()}multiplyLeft(t){return g(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+s*a,t[1]=r*l+o*a,t[2]=o*l-r*a,t[3]=s*l-i*a}(this,this,t),this.check()}rotateY(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l-o*a,t[1]=r*l+s*a,t[2]=o*l+i*a,t[3]=s*l-r*a}(this,this,t),this.check()}rotateZ(t){return function(t,e,n){n*=.5;var i=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);t[0]=i*l+r*a,t[1]=r*l-i*a,t[2]=o*l+s*a,t[3]=s*l-o*a}(this,this,t),this.check()}scale(t){return _(this,this,t),this.check()}slerp(t,e,n){let i,r,o;switch(arguments.length){case 1:({start:i=T,target:r,ratio:o}=t);break;case 2:i=this,r=t,o=e;break;default:i=t,r=e,o=n}return m(this,i,r,o),this.check()}transformVector4(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new u;return f.VC(e,t,this),(0,r.IL)(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}}},431:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var i=n(95282),r=n(47410),o=n(69801),s=n(99007),a=n(63986);const l=[0,0,0];let c;class u extends i.Z{static get ZERO(){return c||(c=new u(0,0,0),Object.freeze(c)),c}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;super(-0,-0,-0),1===arguments.length&&(0,r.kJ)(t)?this.copy(t):(r.vc.debug&&((0,o.u5)(t),(0,o.u5)(e),(0,o.u5)(n)),this[0]=t,this[1]=e,this[2]=n)}set(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return r.vc.debug&&((0,o.u5)(t.x),(0,o.u5)(t.y),(0,o.u5)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=(0,o.u5)(t)}angle(t){return s.EU(this,t)}cross(t){return s.kC(this,this,t),this.check()}rotateX(t){let{radians:e,origin:n=l}=t;return s.lM(this,this,n,e),this.check()}rotateY(t){let{radians:e,origin:n=l}=t;return s.uD(this,this,n,e),this.check()}rotateZ(t){let{radians:e,origin:n=l}=t;return s.jI(this,this,n,e),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return s.fF(this,this,t),this.check()}transformAsVector(t){return(0,a.pL)(this,this,t),this.check()}transformByMatrix3(t){return s.kK(this,this,t),this.check()}transformByMatrix2(t){return(0,a.eQ)(this,this,t),this.check()}transformByQuaternion(t){return s.VC(this,this,t),this.check()}}},45903:(t,e,n)=>{"use strict";function i(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}n.d(e,{Z:()=>i})},47410:(t,e,n)=>{"use strict";n.d(e,{Bw:()=>s,RW:()=>u,Ux:()=>c,Yr:()=>l,fS:()=>f,kJ:()=>a,t7:()=>d,uZ:()=>h,vc:()=>o});const i=1/Math.PI*180,r=1/180*Math.PI,o={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function s(t){let{precision:e=o.precision}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=function(t){return Math.round(t/o.EPSILON)*o.EPSILON}(t),"".concat(parseFloat(t.toPrecision(e)))}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function l(t){return function(t,e){return A(t,(t=>t*r),e)}(t)}function c(t){return u(t)}function u(t,e){return A(t,(t=>t*i),e)}function h(t,e,n){return A(t,(t=>Math.max(e,Math.min(n,t))))}function d(t,e,n){return a(t)?t.map(((t,i)=>d(t,e[i],n))):n*e+(1-n)*t}function f(t,e,n){const i=o.EPSILON;n&&(o.EPSILON=n);try{if(t===e)return!0;if(a(t)&&a(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(!f(t[n],e[n]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):"number"===typeof t&&"number"===typeof e&&Math.abs(t-e)<=o.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{o.EPSILON=i}}function A(t,e,n){if(a(t)){const i=t;n=n||function(t){return t.clone?t.clone():new Array(t.length)}(i);for(let r=0;r<n.length&&r<i.length;++r)n[r]=e(t[r],r,n);return n}return e(t)}},63986:(t,e,n)=>{"use strict";function i(t,e,n){const i=e[0],r=e[1],o=n[3]*i+n[7]*r||1;return t[0]=(n[0]*i+n[4]*r)/o,t[1]=(n[1]*i+n[5]*r)/o,t}function r(t,e,n){const i=e[0],r=e[1],o=e[2],s=n[3]*i+n[7]*r+n[11]*o||1;return t[0]=(n[0]*i+n[4]*r+n[8]*o)/s,t[1]=(n[1]*i+n[5]*r+n[9]*o)/s,t[2]=(n[2]*i+n[6]*r+n[10]*o)/s,t}function o(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t[2]=e[2],t}function s(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t[2]=e[2],t[3]=e[3],t}function a(t,e,n){const i=e[0],r=e[1],o=e[2];return t[0]=n[0]*i+n[3]*r+n[6]*o,t[1]=n[1]*i+n[4]*r+n[7]*o,t[2]=n[2]*i+n[5]*r+n[8]*o,t[3]=e[3],t}n.d(e,{G7:()=>s,_x:()=>a,eQ:()=>o,pL:()=>r,pb:()=>i})},84802:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});const i={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:2*Math.PI}},69801:(t,e,n)=>{"use strict";n.d(e,{IL:()=>o,u5:()=>r});var i=n(47410);function r(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function o(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(i.vc.debug&&!function(t,e){if(t.length!==e)return!1;for(let n=0;n<t.length;++n)if(!Number.isFinite(t[n]))return!1;return!0}(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}},89019:(t,e,n)=>{"use strict";n.d(e,{Xx:()=>u,KM:()=>A,Mh:()=>Z,F7:()=>F,JO:()=>U,du:()=>at});const i=-1,r=0,o=1;var s=n(64649),a=n(431);const l=new a.Z,c=new a.Z;class u{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=arguments.length>2?arguments[2]:void 0;(0,s.Z)(this,"center",void 0),(0,s.Z)(this,"halfDiagonal",void 0),(0,s.Z)(this,"minimum",void 0),(0,s.Z)(this,"maximum",void 0),n=n||l.copy(t).add(e).scale(.5),this.center=new a.Z(n),this.halfDiagonal=new a.Z(e).subtract(this.center),this.minimum=new a.Z(t),this.maximum=new a.Z(e)}clone(){return new u(this.minimum,this.maximum,this.center)}equals(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){const{halfDiagonal:e}=this,n=c.from(t.normal),s=e.x*Math.abs(n.x)+e.y*Math.abs(n.y)+e.z*Math.abs(n.z),a=this.center.dot(n)+t.distance;return a-s>0?o:a+s<0?i:r}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=l.from(t).subtract(this.center),{halfDiagonal:n}=this;let i,r=0;return i=Math.abs(e.x)-n.x,i>0&&(r+=i*i),i=Math.abs(e.y)-n.y,i>0&&(r+=i*i),i=Math.abs(e.z)-n.z,i>0&&(r+=i*i),r}}var h=n(83367);const d=new a.Z,f=new a.Z;class A{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,s.Z)(this,"center",void 0),(0,s.Z)(this,"radius",void 0),this.radius=-0,this.center=new a.Z,this.fromCenterRadius(t,e)}fromCenterRadius(t,e){return this.center.from(t),this.radius=e,this}fromCornerPoints(t,e){return e=d.from(e),this.center=(new a.Z).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new A(this.center,this.radius)}union(t){const e=this.center,n=this.radius,i=t.center,r=t.radius,o=d.copy(i).subtract(e),s=o.magnitude();if(n>=s+r)return this.clone();if(r>=s+n)return t.clone();const a=.5*(n+s+r);return f.copy(o).scale((-n+a)/s).add(e),this.center.copy(f),this.radius=a,this}expand(t){const e=d.from(t).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}transform(t){this.center.transform(t);const e=h.Q$(d,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}distanceSquaredTo(t){const e=this.distanceTo(t);return e*e}distanceTo(t){const e=d.from(t).subtract(this.center);return Math.max(0,e.len()-this.radius)}intersectPlane(t){const e=this.center,n=this.radius,s=t.normal.dot(e)+t.distance;return s<-n?i:s<n?r:o}}var p=n(73518),g=n(34980);const m=new a.Z,y=new a.Z,v=new a.Z,_=new a.Z,b=new a.Z,x=new a.Z,w=new a.Z,C=0,B=1,E=2,T=3,S=4,M=5,I=6,P=7,D=8;class F{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];(0,s.Z)(this,"center",void 0),(0,s.Z)(this,"halfAxes",void 0),this.center=(new a.Z).from(t),this.halfAxes=new p.Z(e)}get halfSize(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new a.Z(t).len(),new a.Z(e).len(),new a.Z(n).len()]}get quaternion(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new a.Z(t).normalize(),r=new a.Z(e).normalize(),o=new a.Z(n).normalize();return(new g.Z).fromMatrix3(new p.Z([...i,...r,...o]))}fromCenterHalfSizeQuaternion(t,e,n){const i=new g.Z(n),r=(new p.Z).fromQuaternion(i);return r[0]=r[0]*e[0],r[1]=r[1]*e[0],r[2]=r[2]*e[0],r[3]=r[3]*e[1],r[4]=r[4]*e[1],r[5]=r[5]*e[1],r[6]=r[6]*e[2],r[7]=r[7]*e[2],r[8]=r[8]*e[2],this.center=(new a.Z).from(t),this.halfAxes=r,this}clone(){return new F(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new A;const e=this.halfAxes,n=e.getColumn(0,v),i=e.getColumn(1,_),r=e.getColumn(2,b),o=m.copy(n).add(i).add(r);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){const e=this.center,n=t.normal,s=this.halfAxes,a=n.x,l=n.y,c=n.z,u=Math.abs(a*s[C]+l*s[B]+c*s[E])+Math.abs(a*s[T]+l*s[S]+c*s[M])+Math.abs(a*s[I]+l*s[P]+c*s[D]),h=n.dot(e)+t.distance;return h<=-u?i:h>=u?o:r}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=y.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,v),r=n.getColumn(1,_),o=n.getColumn(2,b),s=i.magnitude(),a=r.magnitude(),l=o.magnitude();i.normalize(),r.normalize(),o.normalize();let c,u=0;return c=Math.abs(e.dot(i))-s,c>0&&(u+=c*c),c=Math.abs(e.dot(r))-a,c>0&&(u+=c*c),c=Math.abs(e.dot(o))-l,c>0&&(u+=c*c),u}computePlaneDistances(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;const o=this.center,s=this.halfAxes,a=s.getColumn(0,v),l=s.getColumn(1,_),c=s.getColumn(2,b),u=x.copy(a).add(l).add(c).add(o),h=w.copy(u).subtract(t);let d=e.dot(h);return i=Math.min(d,i),r=Math.max(d,r),u.copy(o).add(a).add(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),u.copy(o).add(a).subtract(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),u.copy(o).add(a).subtract(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).subtract(a).add(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).subtract(a).add(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).subtract(a).subtract(l).add(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).subtract(a).subtract(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),i=Math.min(d,i),r=Math.max(d,r),n[0]=i,n[1]=r,n}transform(t){this.center.transformAsPoint(t);const e=this.halfAxes.getColumn(0,v);e.transformAsPoint(t);const n=this.halfAxes.getColumn(1,_);n.transformAsPoint(t);const i=this.halfAxes.getColumn(2,b);return i.transformAsPoint(t),this.halfAxes=new p.Z([...e,...n,...i]),this}getTransform(){throw new Error("not implemented")}}var L=n(45903),O=n(47410);const R=new a.Z,k=new a.Z;class U{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,s.Z)(this,"normal",void 0),(0,s.Z)(this,"distance",void 0),this.normal=new a.Z,this.distance=-0,this.fromNormalDistance(t,e)}fromNormalDistance(t,e){return(0,L.Z)(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}fromPointNormal(t,e){t=R.from(t),this.normal.from(e).normalize();const n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,e,n,i){return this.normal.set(t,e,n),(0,L.Z)((0,O.fS)(this.normal.len(),1)),this.distance=i,this}clone(){return new U(this.normal,this.distance)}equals(t){return(0,O.fS)(this.distance,t.distance)&&(0,O.fS)(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){const e=k.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,e)}projectPointOntoPlane(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];t=R.from(t);const n=this.getPointDistance(t),i=k.copy(this.normal).scale(n);return t.subtract(i).to(e)}}const z=[new a.Z([1,0,0]),new a.Z([0,1,0]),new a.Z([0,0,1])],G=new a.Z,N=new a.Z;new U(new a.Z(1,0,0),0);class Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,s.Z)(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*z.length;const e=t.center,n=t.radius;let i=0;for(const r of z){let t=this.planes[i],o=this.planes[i+1];t||(t=this.planes[i]=new U),o||(o=this.planes[i+1]=new U);const s=G.copy(r).scale(-n).add(e);r.dot(s);t.fromPointNormal(s,r);const a=G.copy(r).scale(n).add(e),l=N.copy(r).negate();l.dot(a);o.fromPointNormal(a,l),i+=2}return this}computeVisibility(t){let e=o;for(const n of this.planes){switch(t.intersectPlane(n)){case i:return i;case r:e=r}}return e}computeVisibilityWithPlaneMask(t,e){if((0,L.Z)(Number.isFinite(e),"parentPlaneMask is required."),e===Z.MASK_OUTSIDE||e===Z.MASK_INSIDE)return e;let n=Z.MASK_INSIDE;const o=this.planes;for(let s=0;s<this.planes.length;++s){const a=s<31?1<<s:0;if(s<31&&0===(e&a))continue;const l=o[s],c=t.intersectPlane(l);if(c===i)return Z.MASK_OUTSIDE;c===r&&(n|=a)}return n}}(0,s.Z)(Z,"MASK_OUTSIDE",4294967295),(0,s.Z)(Z,"MASK_INSIDE",0),(0,s.Z)(Z,"MASK_INDETERMINATE",2147483647);new a.Z,new a.Z,new a.Z,new a.Z,new a.Z;new a.Z,new a.Z,new a.Z,new a.Z,new a.Z,new a.Z,new a.Z,new a.Z,new a.Z,new a.Z,new a.Z,new a.Z,Math.PI;var j=n(84802);const V=new p.Z,H=new p.Z,J=new p.Z,W=new p.Z,Q=new p.Z;function K(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=j.Z.EPSILON20;let i=0,r=0;const o=H,s=J;o.identity(),s.copy(t);const a=n*function(t){let e=0;for(let n=0;n<9;++n){const i=t[n];e+=i*i}return Math.sqrt(e)}(s);for(;r<10&&Y(s)>a;)$(s,W),Q.copy(W).transpose(),s.multiplyRight(W),s.multiplyLeft(Q),o.multiplyRight(W),++i>2&&(++r,i=0);return e.unitary=o.toTarget(e.unitary),e.diagonal=s.toTarget(e.diagonal),e}const q=[1,0,0],X=[2,2,1];function Y(t){let e=0;for(let n=0;n<3;++n){const i=t[V.getElementIndex(X[n],q[n])];e+=2*i*i}return Math.sqrt(e)}function $(t,e){const n=j.Z.EPSILON15;let i=0,r=1;for(let c=0;c<3;++c){const e=Math.abs(t[V.getElementIndex(X[c],q[c])]);e>i&&(r=c,i=e)}const o=q[r],s=X[r];let a=1,l=0;if(Math.abs(t[V.getElementIndex(s,o)])>n){const e=(t[V.getElementIndex(s,s)]-t[V.getElementIndex(o,o)])/2/t[V.getElementIndex(s,o)];let n;n=e<0?-1/(-e+Math.sqrt(1+e*e)):1/(e+Math.sqrt(1+e*e)),a=1/Math.sqrt(1+n*n),l=n*a}return p.Z.IDENTITY.to(e),e[V.getElementIndex(o,o)]=e[V.getElementIndex(s,s)]=a,e[V.getElementIndex(s,o)]=l,e[V.getElementIndex(o,s)]=-l,e}const tt=new a.Z,et=new a.Z,nt=new a.Z,it=new a.Z,rt=new a.Z,ot=new p.Z,st={diagonal:new p.Z,unitary:new p.Z};function at(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new F;if(!t||0===t.length)return e.halfAxes=new p.Z([0,0,0,0,0,0,0,0,0]),e.center=new a.Z,e;const n=t.length,i=new a.Z(0,0,0);for(const a of t)i.add(a);const r=1/n;i.multiplyByScalar(r);let o=0,s=0,l=0,c=0,u=0,h=0;for(const a of t){const t=tt.copy(a).subtract(i);o+=t.x*t.x,s+=t.x*t.y,l+=t.x*t.z,c+=t.y*t.y,u+=t.y*t.z,h+=t.z*t.z}o*=r,s*=r,l*=r,c*=r,u*=r,h*=r;const d=ot;d[0]=o,d[1]=s,d[2]=l,d[3]=s,d[4]=c,d[5]=u,d[6]=l,d[7]=u,d[8]=h;const{unitary:f}=K(d,st),A=e.halfAxes.copy(f);let g=A.getColumn(0,nt),m=A.getColumn(1,it),y=A.getColumn(2,rt),v=-Number.MAX_VALUE,_=-Number.MAX_VALUE,b=-Number.MAX_VALUE,x=Number.MAX_VALUE,w=Number.MAX_VALUE,C=Number.MAX_VALUE;for(const a of t)tt.copy(a),v=Math.max(tt.dot(g),v),_=Math.max(tt.dot(m),_),b=Math.max(tt.dot(y),b),x=Math.min(tt.dot(g),x),w=Math.min(tt.dot(m),w),C=Math.min(tt.dot(y),C);g=g.multiplyByScalar(.5*(x+v)),m=m.multiplyByScalar(.5*(w+_)),y=y.multiplyByScalar(.5*(C+b)),e.center.copy(g).add(m).add(y);const B=et.set(v-x,_-w,b-C).multiplyByScalar(.5),E=new p.Z([B[0],0,0,0,B[1],0,0,0,B[2]]);return e.halfAxes.multiplyRight(E),e}},23595:(t,e,n)=>{"use strict";n.d(e,{wG:()=>i,WZ:()=>G,GU:()=>W,dj:()=>R,ct:()=>J,OT:()=>s,ap:()=>o,Ny:()=>r});const i={CLOCKWISE:1,COUNTER_CLOCKWISE:-1};function r(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Math.sign(o(t,e))}(t,n);return i!==e&&(function(t,e){const{start:n=0,end:i=t.length,size:r=2}=e,o=(i-n)/r,s=Math.floor(o/2);for(let a=0;a<s;++a){const e=n+a*r,i=n+(o-1-a)*r;for(let n=0;n<r;++n){const r=t[e+n];t[e+n]=t[i+n],t[i+n]=r}}}(t,n),!0)}function o(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{start:n=0,end:i=t.length}=e,r=e.size||2;let o=0;for(let s=n,a=i-r;s<i;s+=r)o+=(t[s]-t[a])*(t[s+1]+t[a+1]),a=s;return o/2}function s(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,i=arguments.length>3?arguments[3]:void 0;const r=e&&e.length,o=r?e[0]*n:t.length;let s=a(t,0,o,n,!0,i&&i[0]);const u=[];if(!s||s.next===s.prev)return u;let h,d,f,g,m,v,_;if(r&&(s=function(t,e,n,i,r){const o=[];let s,c,u,h,d;for(s=0,c=e.length;s<c;s++)u=e[s]*i,h=s<c-1?e[s+1]*i:t.length,d=a(t,u,h,i,!1,r&&r[s+1]),d===d.next&&(d.steiner=!0),o.push(y(d));for(o.sort(A),s=0;s<o.length;s++)p(o[s],n),n=l(n,n.next);return n}(t,e,s,n,i)),t.length>80*n){g=d=t[0],m=f=t[1];for(let e=n;e<o;e+=n)v=t[e],_=t[e+1],v<g&&(g=v),_<m&&(m=_),v>d&&(d=v),_>f&&(f=_);h=Math.max(d-g,f-m),h=0!==h?1/h:0}return c(s,u,n,g,m,h),u}function a(t,e,n,i,r,s){let a,l;if(void 0===s&&(s=o(t,{start:e,end:n,size:i})),r===s<0)for(a=e;a<n;a+=i)l=S(a,t[a],t[a+1],l);else for(a=n-i;a>=e;a-=i)l=S(a,t[a],t[a+1],l);return l&&x(l,l.next)&&(M(l),l=l.next),l}function l(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!x(i,i.next)&&0!==b(i.prev,i,i.next))i=i.next;else{if(M(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function c(t,e,n,i,r,o,s){if(!t)return;!s&&o&&function(t,e,n,i){let r=t;do{null===r.z&&(r.z=m(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,o,s,a,l,c=1;do{for(r=t,t=null,l=null,i=0;r;){for(i++,s=r,o=0,n=0;n<c&&(o++,s=s.nextZ,s);n++);for(a=c;o>0||a>0&&s;)0!==o&&(0===a||!s||r.z<=s.z)?(e=r,r=r.nextZ,o--):(e=s,s=s.nextZ,a--),l?l.nextZ=e:t=e,e.prevZ=l,l=e;r=s}l.nextZ=null,c*=2}while(i>1)}(r)}(t,i,r,o);let a,A,p=t;for(;t.prev!==t.next;)if(a=t.prev,A=t.next,o?h(t,i,r,o):u(t))e.push(a.i/n),e.push(t.i/n),e.push(A.i/n),M(t),t=A.next,p=A.next;else if((t=A)===p){s?1===s?c(t=d(l(t),e,n),e,n,i,r,o,2):2===s&&f(t,e,n,i,r,o):c(l(t),e,n,i,r,o,1);break}}function u(t){const e=t.prev,n=t,i=t.next;if(b(e,n,i)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(v(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&b(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function h(t,e,n,i){const r=t.prev,o=t,s=t.next;if(b(r,o,s)>=0)return!1;const a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,l=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,c=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,u=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,h=m(a,l,e,n,i),d=m(c,u,e,n,i);let f=t.prevZ,A=t.nextZ;for(;f&&f.z>=h&&A&&A.z<=d;){if(f!==t.prev&&f!==t.next&&v(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,A!==t.prev&&A!==t.next&&v(r.x,r.y,o.x,o.y,s.x,s.y,A.x,A.y)&&b(A.prev,A,A.next)>=0)return!1;A=A.nextZ}for(;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&v(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;A&&A.z<=d;){if(A!==t.prev&&A!==t.next&&v(r.x,r.y,o.x,o.y,s.x,s.y,A.x,A.y)&&b(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function d(t,e,n){let i=t;do{const r=i.prev,o=i.next.next;!x(r,o)&&w(r,i,i.next,o)&&E(r,o)&&E(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),M(i),M(i.next),i=t=o),i=i.next}while(i!==t);return l(i)}function f(t,e,n,i,r,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&_(s,t)){let a=T(s,t);return s=l(s,s.next),a=l(a,a.next),c(s,e,n,i,r,o),void c(a,e,n,i,r,o)}t=t.next}s=s.next}while(s!==t)}function A(t,e){return t.x-e.x}function p(t,e){if(e=function(t,e){let n=e;const i=t.x,r=t.y;let o,s=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const t=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=i&&t>s){if(s=t,t===i){if(r===n.y)return n;if(r===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!o)return null;if(i===s)return o;const a=o,l=o.x,c=o.y;let u,h=1/0;n=o;do{i>=n.x&&n.x>=l&&i!==n.x&&v(r<c?i:s,r,l,c,r<c?s:i,r,n.x,n.y)&&(u=Math.abs(r-n.y)/(i-n.x),E(n,t)&&(u<h||u===h&&(n.x>o.x||n.x===o.x&&g(o,n)))&&(o=n,h=u)),n=n.next}while(n!==a);return o}(t,e),e){const n=T(e,t);l(e,e.next),l(n,n.next)}}function g(t,e){return b(t.prev,t,e.prev)<0&&b(e.next,t,t.next)<0}function m(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function y(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function v(t,e,n,i,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(i-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(r-s)*(i-a)>=0}function _(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&w(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(E(t,e)&&E(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(b(t.prev,t,e.prev)||b(t,e.prev,e))||x(t,e)&&b(t.prev,t,t.next)>0&&b(e.prev,e,e.next)>0)}function b(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function x(t,e){return t.x===e.x&&t.y===e.y}function w(t,e,n,i){const r=B(b(t,e,n)),o=B(b(t,e,i)),s=B(b(n,i,t)),a=B(b(n,i,e));return r!==o&&s!==a||(!(0!==r||!C(t,n,e))||(!(0!==o||!C(t,i,e))||(!(0!==s||!C(n,t,i))||!(0!==a||!C(n,e,i)))))}function C(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function B(t){return t>0?1:t<0?-1:0}function E(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function T(t,e){const n=new I(t.i,t.x,t.y),i=new I(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function S(t,e,n,i){const r=new I(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function M(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function I(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function P(t,e,n,i){let r,o,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(8&n)r=(i[3]-t[1])/(e[1]-t[1]),o=3;else if(4&n)r=(i[1]-t[1])/(e[1]-t[1]),o=1;else if(2&n)r=(i[2]-t[0])/(e[0]-t[0]),o=2;else{if(!(1&n))return null;r=(i[0]-t[0])/(e[0]-t[0]),o=0}for(let a=0;a<t.length;a++)s[a]=(1&o)===a?i[o]:r*(e[a]-t[a])+t[a];return s}function D(t,e){let n=0;return t[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}function F(t,e){const n=e.length,i=t.length;if(i>0){let r=!0;for(let o=0;o<n;o++)if(t[i-n+o]!==e[o]){r=!1;break}if(r)return!1}for(let r=0;r<n;r++)t[i+r]=e[r];return!0}function L(t,e){const n=e.length;for(let i=0;i<n;i++)t[i]=e[i]}function O(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const o=i+e*n;for(let s=0;s<n;s++)r[s]=t[o+s];return r}function R(t,e){const{size:n=2,broken:i=!1,gridResolution:r=10,gridOffset:o=[0,0],startIndex:s=0,endIndex:a=t.length}=e||{},l=(a-s)/n;let c=[];const u=[c],h=O(t,0,n,s);let d,f;const A=Z(h,r,o,[]),p=[];F(c,h);for(let g=1;g<l;g++){for(d=O(t,g,n,s,d),f=D(d,A);f;){P(h,d,f,A,p);const t=D(p,A);t&&(P(h,p,t,A,p),f=t),F(c,p),L(h,p),j(A,r,f),i&&c.length>n&&(c=[],u.push(c),F(c,h)),f=D(d,A)}F(c,d),L(h,d)}return i?u:u[0]}const k=0,U=1;function z(t,e){for(let n=0;n<e.length;n++)t.push(e[n]);return t}function G(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0;if(!t.length)return[];const{size:i=2,gridResolution:r=10,gridOffset:o=[0,0],edgeTypes:s=!1}=n||{},a=[],l=[{pos:t,types:s?new Array(t.length/i).fill(U):null,holes:e||[]}],c=[[],[]];let u=[];for(;l.length;){const{pos:t,types:e,holes:n}=l.shift();V(t,i,n[0]||t.length,c),u=Z(c[0],r,o,u);const h=D(c[1],u);if(h){let r=N(t,e,i,0,n[0]||t.length,u,h);const o={pos:r[0].pos,types:r[0].types,holes:[]},a={pos:r[1].pos,types:r[1].types,holes:[]};l.push(o,a);for(let l=0;l<n.length;l++)r=N(t,e,i,n[l],n[l+1]||t.length,u,h),r[0]&&(o.holes.push(o.pos.length),o.pos=z(o.pos,r[0].pos),s&&(o.types=z(o.types,r[0].types))),r[1]&&(a.holes.push(a.pos.length),a.pos=z(a.pos,r[1].pos),s&&(a.types=z(a.types,r[1].types)))}else{const i={positions:t};s&&(i.edgeTypes=e),n.length&&(i.holeIndices=n),a.push(i)}}return a}function N(t,e,n,i,r,o,s){const a=(r-i)/n,l=[],c=[],u=[],h=[],d=[];let f,A,p;const g=O(t,a-1,n,i);let m=Math.sign(8&s?g[1]-o[3]:g[0]-o[2]),y=e&&e[a-1],v=0,_=0;for(let b=0;b<a;b++)f=O(t,b,n,i,f),A=Math.sign(8&s?f[1]-o[3]:f[0]-o[2]),p=e&&e[i/n+b],A&&m&&m!==A&&(P(g,f,s,o,d),F(l,d)&&u.push(y),F(c,d)&&h.push(y)),A<=0?(F(l,f)&&u.push(p),v-=A):u.length&&(u[u.length-1]=k),A>=0?(F(c,f)&&h.push(p),_+=A):h.length&&(h[h.length-1]=k),L(g,f),m=A,y=p;return[v?{pos:l,types:e&&u}:null,_?{pos:c,types:e&&h}:null]}function Z(t,e,n,i){const r=Math.floor((t[0]-n[0])/e)*e+n[0],o=Math.floor((t[1]-n[1])/e)*e+n[1];return i[0]=r,i[1]=o,i[2]=r+e,i[3]=o+e,i}function j(t,e,n){8&n?(t[1]+=e,t[3]+=e):4&n?(t[1]-=e,t[3]-=e):2&n?(t[0]+=e,t[2]+=e):1&n&&(t[0]-=e,t[2]-=e)}function V(t,e,n,i){let r=1/0,o=-1/0,s=1/0,a=-1/0;for(let l=0;l<n;l+=e){const e=t[l],n=t[l+1];r=e<r?e:r,o=e>o?e:o,s=n<s?n:s,a=n>a?n:a}return i[0][0]=r,i[0][1]=s,i[1][0]=o,i[1][1]=a,i}const H=85.051129;function J(t,e){const{size:n=2,startIndex:i=0,endIndex:r=t.length,normalize:o=!0}=e||{},s=t.slice(i,r);q(s,n,0,r-i);const a=R(s,{size:n,broken:!0,gridResolution:360,gridOffset:[-180,-180]});if(o)for(const l of a)X(l,n);return a}function W(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0;const{size:i=2,normalize:r=!0,edgeTypes:o=!1}=n||{};e=e||[];const s=[],a=[];let l=0,c=0;for(let h=0;h<=e.length;h++){const r=e[h]||t.length,o=c,u=Q(t,i,l,r);for(let e=u;e<r;e++)s[c++]=t[e];for(let e=l;e<u;e++)s[c++]=t[e];q(s,i,o,c),K(s,i,o,c,null===n||void 0===n?void 0:n.maxLatitude),l=r,a[h]=c}a.pop();const u=G(s,a,{size:i,gridResolution:360,gridOffset:[-180,-180],edgeTypes:o});if(r)for(const h of u)X(h.positions,i);return u}function Q(t,e,n,i){let r=-1,o=-1;for(let s=n+1;s<i;s+=e){const e=Math.abs(t[s]);e>r&&(r=e,o=s-1)}return o}function K(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:H;const o=t[n],s=t[i-e];if(Math.abs(o-s)>180){const i=O(t,0,e,n);i[0]+=360*Math.round((s-o)/360),F(t,i),i[1]=Math.sign(i[1])*r,F(t,i),i[0]=o,F(t,i)}}function q(t,e,n,i){let r,o=t[0];for(let s=n;s<i;s+=e){r=t[s];const e=r-o;(e>180||e<-180)&&(r-=360*Math.round(e/360)),t[s]=o=r}}function X(t,e){let n;const i=t.length/e;for(let o=0;o<i&&(n=t[o*e],(n+180)%360===0);o++);const r=360*-Math.round(n/360);if(0!==r)for(let o=0;o<i;o++)t[o*e]+=r}},75818:(t,e,n)=>{"use strict";n.d(e,{DW:()=>z,eG:()=>S,Lu:()=>P,Xg:()=>O,if:()=>H,sj:()=>D,zX:()=>k,ro:()=>T,up:()=>J,Bf:()=>B,wl:()=>I,lf:()=>M,w5:()=>w,QA:()=>N,CT:()=>L,NC:()=>E,es:()=>C,aW:()=>F});var i=n(64649),r=n(62220);function o(t,e){const n=(0,r.fF)([],e,t);return(0,r.bA)(n,n,1/n[3]),n}function s(t,e){const n=t%e;return n<0?e+n:n}function a(t,e,n){return t<e?e:t>n?n:t}const l=Math.log2||function(t){return Math.log(t)*Math.LOG2E};var c=n(83367),u=n(77548),h=n(99007);function d(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const f=Math.PI,A=f/4,p=f/180,g=180/f,m=512,y=4003e4,v=85.051129,_=1.5;function b(t){return Math.pow(2,t)}function x(t){return l(t)}function w(t){const[e,n]=t;d(Number.isFinite(e)),d(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");const i=n*p;return[m*(e*p+f)/(2*f),m*(f+Math.log(Math.tan(A+.5*i)))/(2*f)]}function C(t){const[e,n]=t,i=e/m*(2*f)-f,r=2*(Math.atan(Math.exp(n/m*(2*f)-f))-A);return[i*g,r*g]}function B(t){const{latitude:e}=t;d(Number.isFinite(e));const n=Math.cos(e*p);return x(y*n)-9}function E(t){const e=Math.cos(t*p);return m/y/e}function T(t){const{latitude:e,longitude:n,highPrecision:i=!1}=t;d(Number.isFinite(e)&&Number.isFinite(n));const r=m,o=Math.cos(e*p),s=r/360,a=s/o,l=r/y/o,c={unitsPerMeter:[l,l,l],metersPerUnit:[1/l,1/l,1/l],unitsPerDegree:[s,a,l],degreesPerUnit:[1/s,1/a,1/l]};if(i){const t=p*Math.tan(e*p)/o,n=s*t/2,i=r/y*t,u=i/a*l;c.unitsPerDegree2=[0,n,i],c.unitsPerMeter2=[u,0,u]}return c}function S(t,e){const[n,i,r]=t,[o,s,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=T({longitude:n,latitude:i,highPrecision:!0}),u=w(t);u[0]+=o*(l[0]+c[0]*s),u[1]+=s*(l[1]+c[1]*s);const h=C(u),d=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],d]:h}function M(t){const{height:e,pitch:n,bearing:i,altitude:r,scale:o,center:s}=t,a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];c.Iu(a,a,[0,0,-r]),c.lM(a,a,-n*p),c.jI(a,a,i*p);const l=o/e;return c.bA(a,a,[l,l,l]),s&&c.Iu(a,a,h.tk([],s)),a}function I(t){const{width:e,height:n,altitude:i,pitch:r=0,offset:o,center:s,scale:l,nearZMultiplier:c=1,farZMultiplier:u=1}=t;let{fovy:h=P(_)}=t;void 0!==i&&(h=P(i));const d=h*p,f=r*p,A=D(h);let g=A;s&&(g+=s[2]*l/Math.cos(f)/n);const m=d*(.5+(o?o[1]:0)/n),y=Math.sin(m)*g/Math.sin(a(Math.PI/2-f-m,.01,Math.PI-.01)),v=Math.sin(f)*y+g,b=10*g;return{fov:d,aspect:e/n,focalDistance:A,near:c,far:Math.min(v*u,b)}}function P(t){return 2*Math.atan(.5/t)*g}function D(t){return.5/Math.tan(.5*t*p)}function F(t,e){const[n,i,r=0]=t;return d(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)),o(e,[n,i,r,1])}function L(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const[i,r,s]=t;if(d(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s)){return o(e,[i,r,s,1])}const a=o(e,[i,r,0,1]),l=o(e,[i,r,1,1]),c=a[2],h=l[2],f=c===h?0:((n||0)-c)/(h-c);return u.t7([],a,l,f)}function O(t){const{width:e,height:n,bounds:i,minExtent:r=0,maxZoom:o=24,offset:s=[0,0]}=t,[[c,u],[h,f]]=i,A=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if("number"===typeof t)return{top:t,bottom:t,left:t,right:t};return d(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t}(t.padding),p=w([c,a(f,-v,v)]),g=w([h,a(u,-v,v)]),m=[Math.max(Math.abs(g[0]-p[0]),r),Math.max(Math.abs(g[1]-p[1]),r)],y=[e-A.left-A.right-2*Math.abs(s[0]),n-A.top-A.bottom-2*Math.abs(s[1])];d(y[0]>0&&y[1]>0);const _=y[0]/m[0],b=y[1]/m[1],x=(A.right-A.left)/2/_,B=(A.top-A.bottom)/2/b,E=C([(g[0]+p[0])/2+x,(g[1]+p[1])/2+B]),T=Math.min(o,l(Math.abs(Math.min(_,b))));return d(Number.isFinite(T)),{longitude:E[0],latitude:E[1],zoom:T}}const R=Math.PI/180;function k(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const{width:n,height:i,unproject:r}=t,o={targetZ:e},s=r([0,i],o),a=r([n,i],o);let l,c;return(t.fovy?.5*t.fovy*R:Math.atan(.5/t.altitude))>(90-t.pitch)*R-.01?(l=U(t,0,e),c=U(t,n,e)):(l=r([0,0],o),c=r([n,0],o)),[s,a,c,l]}function U(t,e,n){const{pixelUnprojectionMatrix:i}=t,r=o(i,[e,0,1,1]),s=o(i,[e,t.height,1,1]),a=(n*t.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2]),l=C(u.t7([],r,s,a));return l.push(n),l}class z{constructor(){var t=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1};(0,i.Z)(this,"latitude",void 0),(0,i.Z)(this,"longitude",void 0),(0,i.Z)(this,"zoom",void 0),(0,i.Z)(this,"pitch",void 0),(0,i.Z)(this,"bearing",void 0),(0,i.Z)(this,"altitude",void 0),(0,i.Z)(this,"fovy",void 0),(0,i.Z)(this,"meterOffset",void 0),(0,i.Z)(this,"center",void 0),(0,i.Z)(this,"width",void 0),(0,i.Z)(this,"height",void 0),(0,i.Z)(this,"scale",void 0),(0,i.Z)(this,"distanceScales",void 0),(0,i.Z)(this,"viewMatrix",void 0),(0,i.Z)(this,"projectionMatrix",void 0),(0,i.Z)(this,"viewProjectionMatrix",void 0),(0,i.Z)(this,"pixelProjectionMatrix",void 0),(0,i.Z)(this,"pixelUnprojectionMatrix",void 0),(0,i.Z)(this,"equals",(t=>t instanceof z&&(t.width===this.width&&t.height===this.height&&c.fS(t.projectionMatrix,this.projectionMatrix)&&c.fS(t.viewMatrix,this.viewMatrix)))),(0,i.Z)(this,"project",(function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{topLeft:i=!0}=n,r=F(t.projectPosition(e),t.pixelProjectionMatrix),[o,s]=r,a=i?s:t.height-s;return 2===e.length?[o,a]:[o,a,r[2]]})),(0,i.Z)(this,"unproject",(function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{topLeft:i=!0,targetZ:r}=n,[o,s,a]=e,l=i?s:t.height-s,c=r&&r*t.distanceScales.unitsPerMeter[2],u=L([o,l,a],t.pixelUnprojectionMatrix,c),[h,d,f]=t.unprojectPosition(u);return Number.isFinite(a)?[h,d,f]:Number.isFinite(r)?[h,d,r]:[h,d]})),(0,i.Z)(this,"projectPosition",(t=>{const[e,n]=w(t);return[e,n,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]})),(0,i.Z)(this,"unprojectPosition",(t=>{const[e,n]=C(t);return[e,n,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}));let{width:n,height:r,altitude:o=null,fovy:s=null}=e;const{latitude:a=0,longitude:l=0,zoom:u=0,pitch:d=0,bearing:f=0,position:A=null,nearZMultiplier:p=.02,farZMultiplier:g=1.01}=e;n=n||1,r=r||1,null===s&&null===o?(o=_,s=P(o)):null===s?s=P(o):null===o&&(o=D(s));const m=b(u);o=Math.max(.75,o);const y=T({longitude:l,latitude:a}),v=w([l,a]);v.push(0),A&&h.IH(v,v,h.dC([],A,y.unitsPerMeter)),this.projectionMatrix=function(t){const{fov:e,aspect:n,near:i,far:r}=I(t);return c.G3([],e,n,i,r)}({width:n,height:r,scale:m,center:v,pitch:d,fovy:s,nearZMultiplier:p,farZMultiplier:g}),this.viewMatrix=M({height:r,scale:m,center:v,pitch:d,bearing:f,altitude:o}),this.width=n,this.height=r,this.scale=m,this.latitude=a,this.longitude=l,this.zoom=u,this.pitch=d,this.bearing=f,this.altitude=o,this.fovy=s,this.center=v,this.meterOffset=A||[0,0,0],this.distanceScales=y,this._initMatrices(),Object.freeze(this)}_initMatrices(){const{width:t,height:e,projectionMatrix:n,viewMatrix:i}=this,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];c.Jp(r,r,n),c.Jp(r,r,i),this.viewProjectionMatrix=r;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];c.bA(o,o,[t/2,-e/2,1]),c.Iu(o,o,[1,-1,0]),c.Jp(o,o,r);const s=c.U_([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!s)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=s}projectFlat(t){return w(t)}unprojectFlat(t){return C(t)}getMapCenterByLngLatPosition(t){let{lngLat:e,pos:n}=t;const i=L(n,this.pixelUnprojectionMatrix),r=w(e),o=u.IH([],r,u.tk([],i));return C(u.IH([],this.center,o))}fitBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{width:n,height:i}=this,{longitude:r,latitude:o,zoom:s}=O(Object.assign({width:n,height:i,bounds:t},e));return new z({width:n,height:i,longitude:r,latitude:o,zoom:s})}getBounds(t){const e=this.getBoundingRegion(t),n=Math.min(...e.map((t=>t[0]))),i=Math.max(...e.map((t=>t[0])));return[[n,Math.min(...e.map((t=>t[1])))],[i,Math.max(...e.map((t=>t[1])))]]}getBoundingRegion(){return k(this,(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).z||0)}getLocationAtPoint(t){let{lngLat:e,pos:n}=t;return this.getMapCenterByLngLatPosition({lngLat:e,pos:n})}}const G=512;function N(t){const{width:e,height:n,pitch:i=0}=t;let{longitude:r,latitude:o,zoom:a,bearing:c=0}=t;(r<-180||r>180)&&(r=s(r+180,360)-180),(c<-180||c>180)&&(c=s(c+180,360)-180);const u=l(n/G);if(a<=u)a=u,o=0;else{const t=n/2/Math.pow(2,a),e=C([0,t])[1];if(o<e)o=e;else{const e=C([0,G-t])[1];o>e&&(o=e)}}return{width:e,height:n,longitude:r,latitude:o,zoom:a,pitch:i,bearing:c}}const Z=.01,j=["longitude","latitude","zoom"],V={curve:1.414,speed:1.2};function H(t,e,n,i){const{startZoom:r,startCenterXY:o,uDelta:s,w0:a,u1:l,S:c,rho:h,rho2:d,r0:f}=W(t,e,i);if(l<Z){const i={};for(const r of j){const o=t[r],s=e[r];i[r]=(A=n)*s+(1-A)*o}return i}var A;const p=n*c,g=Math.cosh(f)/Math.cosh(f+h*p),m=a*((Math.cosh(f)*Math.tanh(f+h*p)-Math.sinh(f))/d)/l,y=r+x(1/g),v=u.bA([],s,m);u.IH(v,v,o);const _=C(v);return{longitude:_[0],latitude:_[1],zoom:y}}function J(t,e,n){const i={...V,...n},{screenSpeed:r,speed:o,maxDuration:s}=i,{S:a,rho:l}=W(t,e,i),c=1e3*a;let u;return u=Number.isFinite(r)?c/(r/l):c/o,Number.isFinite(s)&&u>s?0:u}function W(t,e,n){const i=(n=Object.assign({},V,n)).curve,r=t.zoom,o=[t.longitude,t.latitude],s=b(r),a=e.zoom,l=[e.longitude,e.latitude],c=b(a-r),h=w(o),d=w(l),f=u.lu([],d,h),A=Math.max(t.width,t.height),p=A/c,g=u.kE(f)*s,m=Math.max(g,Z),y=i*i,v=(p*p-A*A+y*y*m*m)/(2*A*y*m),_=(p*p-A*A-y*y*m*m)/(2*p*y*m),x=Math.log(Math.sqrt(v*v+1)-v),C=Math.log(Math.sqrt(_*_+1)-_);return{startZoom:r,startCenterXY:h,uDelta:f,w0:A,u1:g,S:(C-x)/i,rho:i,rho2:y,r0:x,r1:C}}},93594:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var i=n(11515),r=n(33568);const o=globalThis;function s(t){if(!t&&!(0,i.Z)())return"Node";if((0,r.Z)(t))return"Electron";const e="undefined"!==typeof navigator?navigator:{},n=t||e.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";const s=-1!==n.indexOf("MSIE "),a=-1!==n.indexOf("Trident/");return s||a?"IE":o.chrome?"Chrome":o.safari?"Safari":o.mozInnerScreenX?"Firefox":"Unknown"}},11515:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var i=n(33568);function r(){return!("object"===typeof process&&"[object process]"===String(process)&&!process.browser)||(0,i.Z)()}},33568:(t,e,n)=>{"use strict";function i(t){if("undefined"!==typeof window&&"object"===typeof window.process&&"renderer"===window.process.type)return!0;if("undefined"!==typeof process&&"object"===typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"===typeof navigator&&"string"===typeof navigator.userAgent&&navigator.userAgent,n=t||e;return!!(n&&n.indexOf("Electron")>=0)}n.d(e,{Z:()=>i})},87294:(t,e,n)=>{"use strict";n.d(e,{Z:()=>_});var i=n(64649),r=n(11515);const o="undefined"!==typeof __VERSION__?__VERSION__:"untranspiled source";(0,r.Z)();class s{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";(0,i.Z)(this,"storage",void 0),(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"config",void 0),this.storage=function(t){try{const e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch(e){return null}}(n),this.id=t,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function a(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const r=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>i&&(n=Math.min(n,i/t.width));const o=t.width*n,s=t.height*n,a=["font-size:1px;","padding:".concat(Math.floor(s/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(s,"px;"),"background:url(".concat(r,");"),"background-size:".concat(o,"px ").concat(s,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}let l;function c(t){return"string"===typeof t?l[t.toUpperCase()]||l.WHITE:t}function u(t,e){if(!t)throw new Error(e||"Assertion failed")}!function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(l||(l={}));const h={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof n.g&&n.g,document:"undefined"!==typeof document&&document,process:"object"===typeof process&&process},d=(globalThis,h.window||h.self||h.global),f=h.process||{};console;function A(){let t;var e,n;if(r.Z&&"performance"in d)t=null===d||void 0===d||null===(e=d.performance)||void 0===e||null===(n=e.now)||void 0===n?void 0:n.call(e);else if("hrtime"in f){var i;const e=null===f||void 0===f||null===(i=f.hrtime)||void 0===i?void 0:i.call(f);t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}const p={debug:r.Z&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},g={enabled:!0,level:0};function m(){}const y={},v={once:!0};class _{constructor(){let{id:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"VERSION",o),(0,i.Z)(this,"_startTs",A()),(0,i.Z)(this,"_deltaTs",A()),(0,i.Z)(this,"_storage",void 0),(0,i.Z)(this,"userData",{}),(0,i.Z)(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new s("__probe-".concat(this.id,"__"),g),this.timeStamp("".concat(this.id," started")),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n);for(const r of i)"function"===typeof t[r]&&(e.find((t=>r===t))||(t[r]=t[r].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((A()-this._startTs).toPrecision(10))}getDelta(){return Number((A()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.setConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){u(t,e)}warn(t){return this._getLogFunction(0,t,p.warn,arguments,v)}error(t){return this._getLogFunction(0,t,p.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,p.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,p.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return this._getLogFunction(t,e,p.debug||p.info,arguments,v)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||m,n&&[n],{tag:w(e)}):m}image(t){let{logLevel:e,priority:n,image:i,message:o="",scale:s=1}=t;return this._shouldLog(e||n)?r.Z?function(t){let{image:e,message:n="",scale:i=1}=t;if("string"===typeof e){const t=new Image;return t.onload=()=>{const e=a(t,n,i);console.log(...e)},t.src=e,m}const r=e.nodeName||"";if("img"===r.toLowerCase())return console.log(...a(e,n,i)),m;if("canvas"===r.toLowerCase()){const t=new Image;return t.onload=()=>console.log(...a(t,n,i)),t.src=e.toDataURL(),m}return m}({image:i,message:o,scale:s}):function(t){let{image:e,message:n="",scale:i=1}=t;return console.warn("removed"),m}({image:i,message:o,scale:s}):m}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||m)}group(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const i=x({logLevel:t,message:e,opts:n}),{collapsed:r}=n;return i.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||m)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=b(t)}_getLogFunction(t,e,n,i,o){if(this._shouldLog(t)){o=x({logLevel:t,message:e,args:i,opts:o}),u(n=n||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=A();const s=o.tag||o.message;if(o.once){if(y[s])return m;y[s]=A()}return e=function(t,e,n){if("string"===typeof e){const a=n.time?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const n=Math.max(e-t.length,0);return"".concat(" ".repeat(n)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(n.total)):"";e=n.time?"".concat(t,": ").concat(a,"  ").concat(e):"".concat(t,": ").concat(e),i=e,o=n.color,s=n.background,r.Z||"string"!==typeof i||(o&&(o=c(o),i="\x1b[".concat(o,"m").concat(i,"\x1b[39m")),s&&(o=c(s),i="\x1b[".concat(s+10,"m").concat(i,"\x1b[49m"))),e=i}var i,o,s;return e}(this.id,o.message,o),n.bind(console,e,...o.args)}return m}}function b(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return u(Number.isFinite(e)&&e>=0),e}function x(t){const{logLevel:e,message:n}=t;t.logLevel=b(e);const i=t.args?Array.from(t.args):[];for(;i.length&&i.shift()!==n;);switch(typeof e){case"string":case"function":void 0!==n&&i.unshift(n),t.message=e;break;case"object":Object.assign(t,e)}"function"===typeof t.message&&(t.message=t.message());const r=typeof t.message;return u("string"===r||"object"===r),Object.assign(t,{args:i},t.opts)}function w(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}(0,i.Z)(_,"VERSION",o)},92138:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var i=n(64649);function r(){let t;if("undefined"!==typeof window&&window.performance)t=window.performance.now();else if("undefined"!==typeof process&&process.hrtime){const e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}class o{constructor(t,e){(0,i.Z)(this,"name",void 0),(0,i.Z)(this,"type",void 0),(0,i.Z)(this,"sampleSize",1),(0,i.Z)(this,"time",void 0),(0,i.Z)(this,"count",void 0),(0,i.Z)(this,"samples",void 0),(0,i.Z)(this,"lastTiming",void 0),(0,i.Z)(this,"lastSampleTime",void 0),(0,i.Z)(this,"lastSampleCount",void 0),(0,i.Z)(this,"_count",0),(0,i.Z)(this,"_time",0),(0,i.Z)(this,"_samples",0),(0,i.Z)(this,"_startTime",0),(0,i.Z)(this,"_timerPending",!1),this.name=t,this.type=e,this.reset()}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=r(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(r()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class s{constructor(t){(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t in this.stats)this.stats[t].reset();return this}forEach(t){for(const e in this.stats)t(this.stats[e])}getTable(){const t={};return this.forEach((e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}_initializeStats(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>this._getOrCreate(t)))}_getOrCreate(t){if(!t||!t.name)return null;const{name:e,type:n}=t;return this.stats[e]||(this.stats[e]=t instanceof o?t:new o(e,n)),this.stats[e]}}},34286:(t,e,n)=>{var i,r;!function(){var o={Burg:{2:["#ffc6c4","#672044"],3:["#ffc6c4","#cc607d","#672044"],4:["#ffc6c4","#e38191","#ad466c","#672044"],5:["#ffc6c4","#ee919b","#cc607d","#9e3963","#672044"],6:["#ffc6c4","#f29ca3","#da7489","#b95073","#93345d","#672044"],7:["#ffc6c4","#f4a3a8","#e38191","#cc607d","#ad466c","#8b3058","#672044"],tags:["quantitative"]},BurgYl:{2:["#fbe6c5","#70284a"],3:["#fbe6c5","#dc7176","#70284a"],4:["#fbe6c5","#ee8a82","#c8586c","#70284a"],5:["#fbe6c5","#f2a28a","#dc7176","#b24b65","#70284a"],6:["#fbe6c5","#f4b191","#e7807d","#d06270","#a44360","#70284a"],7:["#fbe6c5","#f5ba98","#ee8a82","#dc7176","#c8586c","#9c3f5d","#70284a"],tags:["quantitative"]},RedOr:{2:["#f6d2a9","#b13f64"],3:["#f6d2a9","#ea8171","#b13f64"],4:["#f6d2a9","#f19c7c","#dd686c","#b13f64"],5:["#f6d2a9","#f3aa84","#ea8171","#d55d6a","#b13f64"],6:["#f6d2a9","#f4b28a","#ef9177","#e3726d","#cf5669","#b13f64"],7:["#f6d2a9","#f5b78e","#f19c7c","#ea8171","#dd686c","#ca5268","#b13f64"],tags:["quantitative"]},OrYel:{2:["#ecda9a","#ee4d5a"],3:["#ecda9a","#f7945d","#ee4d5a"],4:["#ecda9a","#f3ad6a","#f97b57","#ee4d5a"],5:["#ecda9a","#f1b973","#f7945d","#f86f56","#ee4d5a"],6:["#ecda9a","#f0c079","#f5a363","#f98558","#f76856","#ee4d5a"],7:["#ecda9a","#efc47e","#f3ad6a","#f7945d","#f97b57","#f66356","#ee4d5a"],tags:["quantitative"]},Peach:{2:["#fde0c5","#eb4a40"],3:["#fde0c5","#f59e72","#eb4a40"],4:["#fde0c5","#f8b58b","#f2855d","#eb4a40"],5:["#fde0c5","#f9c098","#f59e72","#f17854","#eb4a40"],6:["#fde0c5","#fac7a1","#f7ac80","#f38f65","#f0704f","#eb4a40"],7:["#fde0c5","#facba6","#f8b58b","#f59e72","#f2855d","#ef6a4c","#eb4a40"],tags:["quantitative"]},PinkYl:{2:["#fef6b5","#e15383"],3:["#fef6b5","#ffa679","#e15383"],4:["#fef6b5","#ffc285","#fa8a76","#e15383"],5:["#fef6b5","#ffd08e","#ffa679","#f67b77","#e15383"],6:["#fef6b5","#ffd795","#ffb77f","#fd9576","#f37378","#e15383"],7:["#fef6b5","#ffdd9a","#ffc285","#ffa679","#fa8a76","#f16d7a","#e15383"],tags:["quantitative"]},Mint:{2:["#e4f1e1","#0d585f"],3:["#e4f1e1","#63a6a0","#0d585f"],4:["#e4f1e1","#89c0b6","#448c8a","#0d585f"],5:["#E4F1E1","#9CCDC1","#63A6A0","#337F7F","#0D585F"],6:["#e4f1e1","#abd4c7","#7ab5ad","#509693","#2c7778","#0d585f"],7:["#e4f1e1","#b4d9cc","#89c0b6","#63a6a0","#448c8a","#287274","#0d585f"],tags:["quantitative"]},BluGrn:{2:["#c4e6c3","#1d4f60"],3:["#c4e6c3","#4da284","#1d4f60"],4:["#c4e6c3","#6dbc90","#36877a","#1d4f60"],5:["#c4e6c3","#80c799","#4da284","#2d7974","#1d4f60"],6:["#c4e6c3","#8dce9f","#5fb28b","#3e927e","#297071","#1d4f60"],7:["#c4e6c3","#96d2a4","#6dbc90","#4da284","#36877a","#266b6e","#1d4f60"],tags:["quantitative"]},DarkMint:{2:["#d2fbd4","#123f5a"],3:["#d2fbd4","#559c9e","#123f5a"],4:["#d2fbd4","#7bbcb0","#3a7c89","#123f5a"],5:["#d2fbd4","#8eccb9","#559c9e","#2b6c7f","#123f5a"],6:["#d2fbd4","#9cd5be","#6cafa9","#458892","#266377","#123f5a"],7:["#d2fbd4","#a5dbc2","#7bbcb0","#559c9e","#3a7c89","#235d72","#123f5a"],tags:["quantitative"]},Emrld:{2:["#d3f2a3","#074050"],3:["#d3f2a3","#4c9b82","#074050"],4:["#d3f2a3","#6cc08b","#217a79","#074050"],5:["#d3f2a3","#82d091","#4c9b82","#19696f","#074050"],6:["#d3f2a3","#8fda94","#60b187","#35877d","#145f69","#074050"],7:["#d3f2a3","#97e196","#6cc08b","#4c9b82","#217a79","#105965","#074050"],tags:["quantitative"]},ag_GrnYl:{2:["#245668","#EDEF5D"],3:["#245668","#39AB7E","#EDEF5D"],4:["#245668","#0D8F81","#6EC574","#EDEF5D"],5:["#245668","#04817E","#39AB7E","#8BD16D","#EDEF5D"],6:["#245668","#09787C","#1D9A81","#58BB79","#9DD869","#EDEF5D"],7:["#245668","#0F7279","#0D8F81","#39AB7E","#6EC574","#A9DC67","#EDEF5D"],tags:["aggregation"]},BluYl:{2:["#f7feae","#045275"],3:["#f7feae","#46aea0","#045275"],4:["#f7feae","#7ccba2","#089099","#045275"],5:["#f7feae","#9bd8a4","#46aea0","#058092","#045275"],6:["#f7feae","#ace1a4","#68bfa1","#2a9c9c","#02778e","#045275"],7:["#f7feae","#b7e6a5","#7ccba2","#46aea0","#089099","#00718b","#045275"],tags:["quantitative"]},Teal:{2:["#d1eeea","#2a5674"],3:["#d1eeea","#68abb8","#2a5674"],4:["#d1eeea","#85c4c9","#4f90a6","#2a5674"],5:["#d1eeea","#96d0d1","#68abb8","#45829b","#2a5674"],6:["#d1eeea","#a1d7d6","#79bbc3","#599bae","#3f7994","#2a5674"],7:["#d1eeea","#a8dbd9","#85c4c9","#68abb8","#4f90a6","#3b738f","#2a5674"],tags:["quantitative"]},TealGrn:{2:["#b0f2bc","#257d98"],3:["#b0f2bc","#4cc8a3","#257d98"],4:["#b0f2bc","#67dba5","#38b2a3","#257d98"],5:["#b0f2bc","#77e2a8","#4cc8a3","#31a6a2","#257d98"],6:["#b0f2bc","#82e6aa","#5bd4a4","#3fbba3","#2e9ea1","#257d98"],7:["#b0f2bc","#89e8ac","#67dba5","#4cc8a3","#38b2a3","#2c98a0","#257d98"],tags:["quantitative"]},Purp:{2:["#f3e0f7","#63589f"],3:["#f3e0f7","#b998dd","#63589f"],4:["#f3e0f7","#d1afe8","#9f82ce","#63589f"],5:["#f3e0f7","#dbbaed","#b998dd","#9178c4","#63589f"],6:["#f3e0f7","#e0c2ef","#c8a5e4","#aa8bd4","#8871be","#63589f"],7:["#f3e0f7","#e4c7f1","#d1afe8","#b998dd","#9f82ce","#826dba","#63589f"],tags:["quantitative"]},PurpOr:{2:["#f9ddda","#573b88"],3:["#f9ddda","#ce78b3","#573b88"],4:["#f9ddda","#e597b9","#ad5fad","#573b88"],5:["#f9ddda","#eda8bd","#ce78b3","#9955a8","#573b88"],6:["#f9ddda","#f0b2c1","#dd8ab6","#bb69b0","#8c4fa4","#573b88"],7:["#f9ddda","#f2b9c4","#e597b9","#ce78b3","#ad5fad","#834ba0","#573b88"],tags:["quantitative"]},Sunset:{2:["#f3e79b","#5c53a5"],3:["#f3e79b","#eb7f86","#5c53a5"],4:["#f3e79b","#f8a07e","#ce6693","#5c53a5"],5:["#f3e79b","#fab27f","#eb7f86","#b95e9a","#5c53a5"],6:["#f3e79b","#fabc82","#f59280","#dc6f8e","#ab5b9e","#5c53a5"],7:["#f3e79b","#fac484","#f8a07e","#eb7f86","#ce6693","#a059a0","#5c53a5"],tags:["quantitative"]},Magenta:{2:["#f3cbd3","#6c2167"],3:["#f3cbd3","#ca699d","#6c2167"],4:["#f3cbd3","#dd88ac","#b14d8e","#6c2167"],5:["#f3cbd3","#e498b4","#ca699d","#a24186","#6c2167"],6:["#f3cbd3","#e7a2b9","#d67ba5","#bc5894","#983a81","#6c2167"],7:["#f3cbd3","#eaa9bd","#dd88ac","#ca699d","#b14d8e","#91357d","#6c2167"],tags:["quantitative"]},SunsetDark:{2:["#fcde9c","#7c1d6f"],3:["#fcde9c","#e34f6f","#7c1d6f"],4:["#fcde9c","#f0746e","#dc3977","#7c1d6f"],5:["#fcde9c","#f58670","#e34f6f","#d72d7c","#7c1d6f"],6:["#fcde9c","#f89872","#ec666d","#df4273","#c5287b","#7c1d6f"],7:["#fcde9c","#faa476","#f0746e","#e34f6f","#dc3977","#b9257a","#7c1d6f"],tags:["quantitative"]},ag_Sunset:{2:["#4b2991","#edd9a3"],3:["#4b2991","#ea4f88","#edd9a3"],4:["#4b2991","#c0369d","#fa7876","#edd9a3"],5:["#4b2991","#a52fa2","#ea4f88","#fa9074","#edd9a3"],6:["#4b2991","#932da3","#d43f96","#f7667c","#f89f77","#edd9a3"],7:["#4b2991","#872ca2","#c0369d","#ea4f88","#fa7876","#f6a97a","#edd9a3"],tags:["aggregation"]},BrwnYl:{2:["#ede5cf","#541f3f"],3:["#ede5cf","#c1766f","#541f3f"],4:["#ede5cf","#d39c83","#a65461","#541f3f"],5:["#ede5cf","#daaf91","#c1766f","#95455a","#541f3f"],6:["#ede5cf","#ddba9b","#cd8c7a","#b26166","#8a3c56","#541f3f"],7:["#ede5cf","#e0c2a2","#d39c83","#c1766f","#a65461","#813753","#541f3f"],tags:["quantitative"]},ArmyRose:{2:["#929b4f","#db8195"],3:["#a3ad62","#fdfbe4","#df91a3"],4:["#929b4f","#d9dbaf","#f3d1ca","#db8195"],5:["#879043","#c1c68c","#fdfbe4","#ebb4b8","#d8758b"],6:["#7f883b","#b0b874","#e3e4be","#f6ddd1","#e4a0ac","#d66d85"],7:["#798234","#a3ad62","#d0d3a2","#fdfbe4","#f0c6c3","#df91a3","#d46780"],tags:["diverging"]},Fall:{2:["#3d5941","#ca562c"],3:["#3d5941","#f6edbd","#ca562c"],4:["#3d5941","#b5b991","#edbb8a","#ca562c"],5:["#3d5941","#96a07c","#f6edbd","#e6a272","#ca562c"],6:["#3d5941","#839170","#cecea2","#f1cf9e","#e19464","#ca562c"],7:["#3d5941","#778868","#b5b991","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},Geyser:{2:["#008080","#ca562c"],3:["#008080","#f6edbd","#ca562c"],4:["#008080","#b4c8a8","#edbb8a","#ca562c"],5:["#008080","#92b69e","#f6edbd","#e6a272","#ca562c"],6:["#008080","#7eab98","#ced7b1","#f1cf9e","#e19464","#ca562c"],7:["#008080","#70a494","#b4c8a8","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},Temps:{2:["#009392","#cf597e"],3:["#009392","#e9e29c","#cf597e"],4:["#009392","#9ccb86","#eeb479","#cf597e"],5:["#009392","#71be83","#e9e29c","#ed9c72","#cf597e"],6:["#009392","#52b684","#bcd48c","#edc783","#eb8d71","#cf597e"],7:["#009392","#39b185","#9ccb86","#e9e29c","#eeb479","#e88471","#cf597e"],tags:["diverging"]},TealRose:{2:["#009392","#d0587e"],3:["#009392","#f1eac8","#d0587e"],4:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],5:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],6:["#009392","#72aaa1","#b1c7b3","#e5b9ad","#d98994","#d0587e"],7:["#009392","#72aaa1","#b1c7b3","#f1eac8","#e5b9ad","#d98994","#d0587e"],tags:["diverging"]},Tropic:{2:["#009B9E","#C75DAB"],3:["#009B9E","#F1F1F1","#C75DAB"],4:["#009B9E","#A7D3D4","#E4C1D9","#C75DAB"],5:["#009B9E","#7CC5C6","#F1F1F1","#DDA9CD","#C75DAB"],6:["#009B9E","#5DBCBE","#C6DFDF","#E9D4E2","#D99BC6","#C75DAB"],7:["#009B9E","#42B7B9","#A7D3D4","#F1F1F1","#E4C1D9","#D691C1","#C75DAB"],tags:["diverging"]},Earth:{2:["#A16928","#2887a1"],3:["#A16928","#edeac2","#2887a1"],4:["#A16928","#d6bd8d","#b5c8b8","#2887a1"],5:["#A16928","#caa873","#edeac2","#98b7b2","#2887a1"],6:["#A16928","#c29b64","#e0cfa2","#cbd5bc","#85adaf","#2887a1"],7:["#A16928","#bd925a","#d6bd8d","#edeac2","#b5c8b8","#79a7ac","#2887a1"],tags:["diverging"]},Antique:{2:["#855C75","#D9AF6B","#7C7C7C"],3:["#855C75","#D9AF6B","#AF6458","#7C7C7C"],4:["#855C75","#D9AF6B","#AF6458","#736F4C","#7C7C7C"],5:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#7C7C7C"],6:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#7C7C7C"],7:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#7C7C7C"],8:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#7C7C7C"],9:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#7C7C7C"],10:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#7C7C7C"],11:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#467378","#7C7C7C"],tags:["qualitative"]},Bold:{2:["#7F3C8D","#11A579","#A5AA99"],3:["#7F3C8D","#11A579","#3969AC","#A5AA99"],4:["#7F3C8D","#11A579","#3969AC","#F2B701","#A5AA99"],5:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#A5AA99"],6:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#A5AA99"],7:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#A5AA99"],8:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#A5AA99"],9:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#A5AA99"],10:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#A5AA99"],11:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#4b4b8f","#A5AA99"],tags:["qualitative"]},Pastel:{2:["#66C5CC","#F6CF71","#B3B3B3"],3:["#66C5CC","#F6CF71","#F89C74","#B3B3B3"],4:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#B3B3B3"],5:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#B3B3B3"],6:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#B3B3B3"],7:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#B3B3B3"],8:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#B3B3B3"],9:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B3B3B3"],10:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#B3B3B3"],11:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#D3B484","#B3B3B3"],tags:["qualitative"]},Prism:{2:["#5F4690","#1D6996","#666666"],3:["#5F4690","#1D6996","#38A6A5","#666666"],4:["#5F4690","#1D6996","#38A6A5","#0F8554","#666666"],5:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#666666"],6:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#666666"],7:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#666666"],8:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#666666"],9:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#666666"],10:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#666666"],11:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#994E95","#666666"],tags:["qualitative"]},Safe:{2:["#88CCEE","#CC6677","#888888"],3:["#88CCEE","#CC6677","#DDCC77","#888888"],4:["#88CCEE","#CC6677","#DDCC77","#117733","#888888"],5:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#888888"],6:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#888888"],7:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#888888"],8:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#888888"],9:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#888888"],10:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#888888"],11:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#6699CC","#888888"],tags:["qualitative","colorblind"]},Vivid:{2:["#E58606","#5D69B1","#A5AA99"],3:["#E58606","#5D69B1","#52BCA3","#A5AA99"],4:["#E58606","#5D69B1","#52BCA3","#99C945","#A5AA99"],5:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#A5AA99"],6:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#A5AA99"],7:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#A5AA99"],8:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#A5AA99"],9:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#A5AA99"],10:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#A5AA99"],11:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#CC3A8E","#A5AA99"],tags:["qualitative"]}},s={Blues:{tags:["quantitative"]},BrBG:{tags:["diverging"]},Greys:{tags:["quantitative"]},PiYG:{tags:["diverging"]},PRGn:{tags:["diverging"]},Purples:{tags:["quantitative"]},RdYlGn:{tags:["diverging"]},Spectral:{tags:["diverging"]},YlOrBr:{tags:["quantitative"]},YlGn:{tags:["quantitative"]},YlGnBu:{tags:["quantitative"]},YlOrRd:{tags:["quantitative"]}},a=n(88809);for(var l in a){var c=a[l],u={};for(var h in c)u[h]=c[h];l in s&&(u.tags=s[l].tags),o["cb_"+l]=u}void 0===(r="function"===typeof(i=o)?i.call(e,n,e,t):i)||(t.exports=r)}()},79354:(t,e,n)=>{t.exports=n(34286)},5320:(t,e,n)=>{var i,r;void 0===(r="function"===typeof(i={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}})?i.call(e,n,e,t):i)||(t.exports=r)},88809:(t,e,n)=>{t.exports=n(5320)},25880:t=>{"use strict";function e(t,e,i){i=i||2;var o,s,a,l,h,d,A,p=e&&e.length,g=p?e[0]*i:t.length,m=n(t,0,g,i,!0),y=[];if(!m||m.next===m.prev)return y;if(p&&(m=function(t,e,i,r){var o,s,a,l=[];for(o=0,s=e.length;o<s;o++)(a=n(t,e[o]*r,o<s-1?e[o+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),l.push(f(a));for(l.sort(c),o=0;o<l.length;o++)i=u(l[o],i);return i}(t,e,m,i)),t.length>80*i){o=a=t[0],s=l=t[1];for(var v=i;v<g;v+=i)(h=t[v])<o&&(o=h),(d=t[v+1])<s&&(s=d),h>a&&(a=h),d>l&&(l=d);A=0!==(A=Math.max(a-o,l-s))?32767/A:0}return r(m,y,i,o,s,A,0),y}function n(t,e,n,i,r){var o,s;if(r===E(t,e,n,i)>0)for(o=e;o<n;o+=i)s=w(o,t[o],t[o+1],s);else for(o=n-i;o>=e;o-=i)s=w(o,t[o],t[o+1],s);return s&&m(s,s.next)&&(C(s),s=s.next),s}function i(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!m(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(C(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function r(t,e,n,c,u,h,f){if(t){!f&&h&&function(t,e,n,i){var r=t;do{0===r.z&&(r.z=d(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,o,s,a,l,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e<c&&(a++,i=i.nextZ);e++);for(l=c;a>0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,c*=2}while(s>1)}(r)}(t,c,u,h);for(var A,p,g=t;t.prev!==t.next;)if(A=t.prev,p=t.next,h?s(t,c,u,h):o(t))e.push(A.i/n|0),e.push(t.i/n|0),e.push(p.i/n|0),C(t),t=p.next,g=p.next;else if((t=p)===g){f?1===f?r(t=a(i(t),e,n),e,n,c,u,h,2):2===f&&l(t,e,n,c,u,h):r(i(t),e,n,c,u,h,1);break}}}function o(t){var e=t.prev,n=t,i=t.next;if(g(e,n,i)>=0)return!1;for(var r=e.x,o=n.x,s=i.x,a=e.y,l=n.y,c=i.y,u=r<o?r<s?r:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,d=r>o?r>s?r:s:o>s?o:s,f=a>l?a>c?a:c:l>c?l:c,p=i.next;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=h&&p.y<=f&&A(r,a,o,l,s,c,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function s(t,e,n,i){var r=t.prev,o=t,s=t.next;if(g(r,o,s)>=0)return!1;for(var a=r.x,l=o.x,c=s.x,u=r.y,h=o.y,f=s.y,p=a<l?a<c?a:c:l<c?l:c,m=u<h?u<f?u:f:h<f?h:f,y=a>l?a>c?a:c:l>c?l:c,v=u>h?u>f?u:f:h>f?h:f,_=d(p,m,e,n,i),b=d(y,v,e,n,i),x=t.prevZ,w=t.nextZ;x&&x.z>=_&&w&&w.z<=b;){if(x.x>=p&&x.x<=y&&x.y>=m&&x.y<=v&&x!==r&&x!==s&&A(a,u,l,h,c,f,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,w.x>=p&&w.x<=y&&w.y>=m&&w.y<=v&&w!==r&&w!==s&&A(a,u,l,h,c,f,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;x&&x.z>=_;){if(x.x>=p&&x.x<=y&&x.y>=m&&x.y<=v&&x!==r&&x!==s&&A(a,u,l,h,c,f,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;w&&w.z<=b;){if(w.x>=p&&w.x<=y&&w.y>=m&&w.y<=v&&w!==r&&w!==s&&A(a,u,l,h,c,f,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function a(t,e,n){var r=t;do{var o=r.prev,s=r.next.next;!m(o,s)&&y(o,r,r.next,s)&&b(o,s)&&b(s,o)&&(e.push(o.i/n|0),e.push(r.i/n|0),e.push(s.i/n|0),C(r),C(r.next),r=t=s),r=r.next}while(r!==t);return i(r)}function l(t,e,n,o,s,a){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&p(l,c)){var u=x(l,c);return l=i(l,l.next),u=i(u,u.next),r(l,e,n,o,s,a,0),void r(u,e,n,o,s,a,0)}c=c.next}l=l.next}while(l!==t)}function c(t,e){return t.x-e.x}function u(t,e){var n=function(t,e){var n,i=e,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>s&&(s=a,n=i.x<i.next.x?i:i.next,a===r))return n}i=i.next}while(i!==e);if(!n)return null;var l,c=n,u=n.x,d=n.y,f=1/0;i=n;do{r>=i.x&&i.x>=u&&r!==i.x&&A(o<d?r:s,o,u,d,o<d?s:r,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(r-i.x),b(i,t)&&(l<f||l===f&&(i.x>n.x||i.x===n.x&&h(n,i)))&&(n=i,f=l)),i=i.next}while(i!==c);return n}(t,e);if(!n)return e;var r=x(n,t);return i(r,r.next),i(n,n.next)}function h(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function A(t,e,n,i,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(i-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function p(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&y(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||m(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,n,i){var r=_(g(t,e,n)),o=_(g(t,e,i)),s=_(g(n,i,t)),a=_(g(n,i,e));return r!==o&&s!==a||(!(0!==r||!v(t,n,e))||(!(0!==o||!v(t,i,e))||(!(0!==s||!v(n,t,i))||!(0!==a||!v(n,e,i)))))}function v(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function _(t){return t>0?1:t<0?-1:0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function x(t,e){var n=new B(t.i,t.x,t.y),i=new B(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function w(t,e,n,i){var r=new B(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function C(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function B(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function E(t,e,n,i){for(var r=0,o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}t.exports=e,t.exports.default=e,e.deviation=function(t,e,n,i){var r=e&&e.length,o=r?e[0]*n:t.length,s=Math.abs(E(t,0,o,n));if(r)for(var a=0,l=e.length;a<l;a++){var c=e[a]*n,u=a<l-1?e[a+1]*n:t.length;s-=Math.abs(E(t,c,u,n))}var h=0;for(a=0;a<i.length;a+=3){var d=i[a]*n,f=i[a+1]*n,A=i[a+2]*n;h+=Math.abs((t[d]-t[A])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[A+1]-t[d+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},e.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[r][o][s]);r>0&&(i+=t[r-1].length,n.holes.push(i))}return n}},61521:(t,e,n)=>{const i=n(42103),r={"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"|":function(t,e){return t|e},"^":function(t,e){return t^e},"&":function(t,e){return t&e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<<e},">>":function(t,e){return t>>e},">>>":function(t,e){return t>>>e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e}},o={"-":function(t){return-t},"+":function(t){return+t},"~":function(t){return~t},"!":function(t){return!t}};function s(t,e){return t.map((function(t){return u(t,e)}))}async function a(t,e){return await Promise.all(t.map((t=>h(t,e))))}function l(t,e){const n=u(t.object,e);return t.computed?[n,n[u(t.property,e)]]:[n,n[t.property.name]]}async function c(t,e){const n=await h(t.object,e);return t.computed?[n,n[await h(t.property,e)]]:[n,n[t.property.name]]}function u(t,e){switch(t.type){case"ArrayExpression":return s(t.elements,e);case"BinaryExpression":return r[t.operator](u(t.left,e),u(t.right,e));case"CallExpression":let n,i,a;if("MemberExpression"===t.callee.type?(a=l(t.callee,e),n=a[0],i=a[1]):i=u(t.callee,e),"function"!==typeof i)return;return i.apply(n,s(t.arguments,e));case"ConditionalExpression":return u(t.test,e)?u(t.consequent,e):u(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":return"||"===t.operator?u(t.left,e)||u(t.right,e):"&&"===t.operator?u(t.left,e)&&u(t.right,e):r[t.operator](u(t.left,e),u(t.right,e));case"MemberExpression":return l(t,e)[1];case"ThisExpression":return e;case"UnaryExpression":return o[t.operator](u(t.argument,e));default:return}}async function h(t,e){switch(t.type){case"ArrayExpression":return await a(t.elements,e);case"BinaryExpression":{const[n,i]=await Promise.all([h(t.left,e),h(t.right,e)]);return r[t.operator](n,i)}case"CallExpression":let n,i,s;if("MemberExpression"===t.callee.type?(s=await c(t.callee,e),n=s[0],i=s[1]):i=await h(t.callee,e),"function"!==typeof i)return;return await i.apply(n,await a(t.arguments,e));case"ConditionalExpression":return await h(t.test,e)?await h(t.consequent,e):await h(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":{if("||"===t.operator)return await h(t.left,e)||await h(t.right,e);if("&&"===t.operator)return await h(t.left,e)&&await h(t.right,e);const[n,i]=await Promise.all([h(t.left,e),h(t.right,e)]);return r[t.operator](n,i)}case"MemberExpression":return(await c(t,e))[1];case"ThisExpression":return e;case"UnaryExpression":return o[t.operator](await h(t.argument,e));default:return}}t.exports={parse:i,eval:u,evalAsync:h,compile:function(t){return u.bind(null,i(t))},compileAsync:function(t){return h.bind(null,i(t))}}},83652:(t,e,n)=>{"use strict";const i=n(65699),r=n(62847),o=n(59925);t.exports={XMLParser:r,XMLValidator:i,XMLBuilder:o}},12284:(t,e)=>{"use strict";const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+n+"]["+(n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",r=new RegExp("^"+i+"$");e.isExist=function(t){return"undefined"!==typeof t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,n){if(e){const i=Object.keys(e),r=i.length;for(let o=0;o<r;o++)t[i[o]]="strict"===n?[e[i[o]]]:e[i[o]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.isName=function(t){const e=r.exec(t);return!(null===e||"undefined"===typeof e)},e.getAllMatches=function(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const o=i.length;for(let t=0;t<o;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n},e.nameRegexp=i},65699:(t,e,n)=>{"use strict";const i=n(12284),r={allowBooleanAttributes:!1,unpairedTags:[]};function o(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function s(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return A("InvalidXml","XML declaration allowed only at the start of the document.",g(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function a(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=Object.assign({},r,e);const n=[];let l=!1,c=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let r=0;r<t.length;r++)if("<"===t[r]&&"?"===t[r+1]){if(r+=2,r=s(t,r),r.err)return r}else{if("<"!==t[r]){if(o(t[r]))continue;return A("InvalidChar","char '"+t[r]+"' is not expected.",g(t,r))}{let p=r;if(r++,"!"===t[r]){r=a(t,r);continue}{let m=!1;"/"===t[r]&&(m=!0,r++);let y="";for(;r<t.length&&">"!==t[r]&&" "!==t[r]&&"\t"!==t[r]&&"\n"!==t[r]&&"\r"!==t[r];r++)y+=t[r];if(y=y.trim(),"/"===y[y.length-1]&&(y=y.substring(0,y.length-1),r--),h=y,!i.isName(h)){let e;return e=0===y.trim().length?"Invalid space after '<'.":"Tag '"+y+"' is an invalid name.",A("InvalidTag",e,g(t,r))}const v=u(t,r);if(!1===v)return A("InvalidAttr","Attributes for '"+y+"' have open quote.",g(t,r));let _=v.value;if(r=v.index,"/"===_[_.length-1]){const n=r-_.length;_=_.substring(0,_.length-1);const i=d(_,e);if(!0!==i)return A(i.err.code,i.err.msg,g(t,n+i.err.line));l=!0}else if(m){if(!v.tagClosed)return A("InvalidTag","Closing tag '"+y+"' doesn't have proper closing.",g(t,r));if(_.trim().length>0)return A("InvalidTag","Closing tag '"+y+"' can't have attributes or invalid starting.",g(t,p));{const e=n.pop();if(y!==e.tagName){let n=g(t,e.tagStartPos);return A("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+y+"'.",g(t,p))}0==n.length&&(c=!0)}}else{const i=d(_,e);if(!0!==i)return A(i.err.code,i.err.msg,g(t,r-_.length+i.err.line));if(!0===c)return A("InvalidXml","Multiple possible root nodes found.",g(t,r));-1!==e.unpairedTags.indexOf(y)||n.push({tagName:y,tagStartPos:p}),l=!0}for(r++;r<t.length;r++)if("<"===t[r]){if("!"===t[r+1]){r++,r=a(t,r);continue}if("?"!==t[r+1])break;if(r=s(t,++r),r.err)return r}else if("&"===t[r]){const e=f(t,r);if(-1==e)return A("InvalidChar","char '&' is not expected.",g(t,r));r=e}else if(!0===c&&!o(t[r]))return A("InvalidXml","Extra text at the end",g(t,r));"<"===t[r]&&r--}}}var h;return l?1==n.length?A("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",g(t,n[0].tagStartPos)):!(n.length>0)||A("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):A("InvalidXml","Start tag expected.",1)};const l='"',c="'";function u(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if(t[e]===l||t[e]===c)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){r=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:r}}const h=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function d(t,e){const n=i.getAllMatches(t,h),r={};for(let i=0;i<n.length;i++){if(0===n[i][1].length)return A("InvalidAttr","Attribute '"+n[i][2]+"' has no space in starting.",m(n[i]));if(void 0!==n[i][3]&&void 0===n[i][4])return A("InvalidAttr","Attribute '"+n[i][2]+"' is without value.",m(n[i]));if(void 0===n[i][3]&&!e.allowBooleanAttributes)return A("InvalidAttr","boolean attribute '"+n[i][2]+"' is not allowed.",m(n[i]));const t=n[i][2];if(!p(t))return A("InvalidAttr","Attribute '"+t+"' is an invalid name.",m(n[i]));if(r.hasOwnProperty(t))return A("InvalidAttr","Attribute '"+t+"' is repeated.",m(n[i]));r[t]=1}return!0}function f(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function A(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function p(t){return i.isName(t)}function g(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function m(t){return t.startIndex+t[1].length}},59925:(t,e,n)=>{"use strict";const i=n(63156),r={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:"  ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function o(t){this.options=Object.assign({},r,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=l),this.processTextOrObjNode=s,this.options.format?(this.indentate=a,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function s(t,e,n){const i=this.j2x(t,n+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}function a(t){return this.options.indentBy.repeat(t)}function l(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}o.prototype.build=function(t){return this.options.preserveOrder?i(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},o.prototype.j2x=function(t,e){let n="",i="";for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r))if("undefined"===typeof t[r])this.isAttribute(r)&&(i+="");else if(null===t[r])this.isAttribute(r)?i+="":"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if(t[r]instanceof Date)i+=this.buildTextValNode(t[r],r,"",e);else if("object"!==typeof t[r]){const o=this.isAttribute(r);if(o)n+=this.buildAttrPairStr(o,""+t[r]);else if(r===this.options.textNodeName){let e=this.options.tagValueProcessor(r,""+t[r]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextValNode(t[r],r,"",e)}else if(Array.isArray(t[r])){const n=t[r].length;let o="";for(let s=0;s<n;s++){const n=t[r][s];"undefined"===typeof n||(null===n?"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar:"object"===typeof n?this.options.oneListGroup?o+=this.j2x(n,e+1).val:o+=this.processTextOrObjNode(n,r,e):o+=this.buildTextValNode(n,r,"",e))}this.options.oneListGroup&&(o=this.buildObjectNode(o,r,"",e)),i+=o}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const e=Object.keys(t[r]),i=e.length;for(let o=0;o<i;o++)n+=this.buildAttrPairStr(e[o],""+t[r][e[o]])}else i+=this.processTextOrObjNode(t[r],r,e);return{attrStr:n,val:i}},o.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},o.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let r="</"+e+this.tagEndChar,o="";return"?"===e[0]&&(o="?",r=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===o.length?this.indentate(i)+"\x3c!--".concat(t,"--\x3e")+this.newLine:this.indentate(i)+"<"+e+n+o+this.tagEndChar+t+this.indentate(i)+r:this.indentate(i)+"<"+e+n+o+">"+t+r}},o.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":"></".concat(t),e},o.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+"<![CDATA[".concat(t,"]]>")+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+"\x3c!--".concat(t,"--\x3e")+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(e,t);return r=this.replaceEntitiesValue(r),""===r?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+r+"</"+e+this.tagEndChar}},o.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t},t.exports=o},63156:t=>{function e(t,s,a,l){let c="",u=!1;for(let h=0;h<t.length;h++){const d=t[h],f=n(d);if(void 0===f)continue;let A="";if(A=0===a.length?f:"".concat(a,".").concat(f),f===s.textNodeName){let t=d[f];r(A,s)||(t=s.tagValueProcessor(f,t),t=o(t,s)),u&&(c+=l),c+=t,u=!1;continue}if(f===s.cdataPropName){u&&(c+=l),c+="<![CDATA[".concat(d[f][0][s.textNodeName],"]]>"),u=!1;continue}if(f===s.commentPropName){c+=l+"\x3c!--".concat(d[f][0][s.textNodeName],"--\x3e"),u=!0;continue}if("?"===f[0]){const t=i(d[":@"],s),e="?xml"===f?"":l;let n=d[f][0][s.textNodeName];n=0!==n.length?" "+n:"",c+=e+"<".concat(f).concat(n).concat(t,"?>"),u=!0;continue}let p=l;""!==p&&(p+=s.indentBy);const g=i(d[":@"],s),m=l+"<".concat(f).concat(g),y=e(d[f],s,A,p);-1!==s.unpairedTags.indexOf(f)?s.suppressUnpairedNode?c+=m+">":c+=m+"/>":y&&0!==y.length||!s.suppressEmptyNode?y&&y.endsWith(">")?c+=m+">".concat(y).concat(l,"</").concat(f,">"):(c+=m+">",y&&""!==l&&(y.includes("/>")||y.includes("</"))?c+=l+s.indentBy+y+l:c+=y,c+="</".concat(f,">")):c+=m+"/>",u=!0}return c}function n(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function i(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){if(!t.hasOwnProperty(i))continue;let r=e.attributeValueProcessor(i,t[i]);r=o(r,e),!0===r&&e.suppressBooleanAttributes?n+=" ".concat(i.substr(e.attributeNamePrefix.length)):n+=" ".concat(i.substr(e.attributeNamePrefix.length),'="').concat(r,'"')}return n}function r(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function o(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}t.exports=function(t,n){let i="";return n.format&&n.indentBy.length>0&&(i="\n"),e(t,n,"",i)}},13371:(t,e,n)=>{const i=n(12284);function r(t,e){let n="";for(;e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)n+=t[e];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const i=t[e++];let r="";for(;e<t.length&&t[e]!==i;e++)r+=t[e];return[n,r,e]}function o(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function s(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function a(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function l(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function c(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function u(t){if(i.isName(t))return t;throw new Error("Invalid entity name ".concat(t))}t.exports=function(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,h=!1,d=!1,f="";for(;e<t.length;e++)if("<"!==t[e]||d)if(">"===t[e]){if(d?"-"===t[e-1]&&"-"===t[e-2]&&(d=!1,i--):i--,0===i)break}else"["===t[e]?h=!0:f+=t[e];else{if(h&&s(t,e))e+=7,[entityName,val,e]=r(t,e+1),-1===val.indexOf("&")&&(n[u(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val:val});else if(h&&a(t,e))e+=8;else if(h&&l(t,e))e+=8;else if(h&&c(t,e))e+=9;else{if(!o)throw new Error("Invalid DOCTYPE");d=!0}i++,f=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}},1962:(t,e)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}};e.buildOptions=function(t){return Object.assign({},n,t)},e.defaultOptions=n},84053:(t,e,n)=>{"use strict";const i=n(12284),r=n(41949),o=n(13371),s=n(99967);function a(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function l(t,e,n,i,r,o,s){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){s||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,r,o);if(null===i||void 0===i)return t;if(typeof i!==typeof t||i!==t)return i;if(this.options.trimValues)return _(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?_(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function c(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const u=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function h(t,e,n){if(!this.options.ignoreAttributes&&"string"===typeof t){const n=i.getAllMatches(t,u),r=n.length,o={};for(let t=0;t<r;t++){const i=this.resolveNameSpace(n[t][1]);let r=n[t][4],s=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(s=this.options.transformAttributeName(s)),"__proto__"===s&&(s="#__proto__"),void 0!==r){this.options.trimValues&&(r=r.trim()),r=this.replaceEntitiesValue(r);const t=this.options.attributeValueProcessor(i,r,e);o[s]=null===t||void 0===t?r:typeof t!==typeof r||t!==r?t:_(r,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[s]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=o,t}return o}}const d=function(t){t=t.replace(/\r\n?/g,"\n");const e=new r("!xml");let n=e,i="",s="";for(let a=0;a<t.length;a++){if("<"===t[a])if("/"===t[a+1]){const e=m(t,">",a,"Closing Tag is not closed.");let r=t.substring(a+2,e).trim();if(this.options.removeNSPrefix){const t=r.indexOf(":");-1!==t&&(r=r.substr(t+1))}this.options.transformTagName&&(r=this.options.transformTagName(r)),n&&(i=this.saveTextToParentTag(i,n,s));const o=s.substring(s.lastIndexOf(".")+1);if(r&&-1!==this.options.unpairedTags.indexOf(r))throw new Error("Unpaired tag can not be used as closing tag: </".concat(r,">"));let l=0;o&&-1!==this.options.unpairedTags.indexOf(o)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),i="",a=e}else if("?"===t[a+1]){let e=y(t,a,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new r(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s,e.tagName)),this.addChild(n,t,s)}a=e.closeIndex+1}else if("!--"===t.substr(a+1,3)){const e=m(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){const r=t.substring(a+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:r}])}a=e}else if("!D"===t.substr(a+1,2)){const e=o(t,a);this.docTypeEntities=e.entities,a=e.i}else if("!["===t.substr(a+1,2)){const e=m(t,"]]>",a,"CDATA is not closed.")-2,r=t.substring(a+9,e);i=this.saveTextToParentTag(i,n,s);let o=this.parseTextData(r,n.tagname,s,!0,!1,!0,!0);void 0==o&&(o=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:r}]):n.add(this.options.textNodeName,o),a=e+2}else{let o=y(t,a,this.options.removeNSPrefix),l=o.tagName;const c=o.rawTagName;let u=o.tagExp,h=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1));const f=n;if(f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),l!==e.tagname&&(s+=s?"."+l:l),this.isItStopNode(this.options.stopNodes,s,l)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)a=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(l))a=o.closeIndex;else{const n=this.readStopNodeData(t,c,d+1);if(!n)throw new Error("Unexpected end of ".concat(c));a=n.i,e=n.tagContent}const i=new r(l);l!==u&&h&&(i[":@"]=this.buildAttributesMap(u,s,l)),e&&(e=this.parseTextData(e,l,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,s)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),s=s.substr(0,s.length-1),u=l):u=u.substr(0,u.length-1),this.options.transformTagName&&(l=this.options.transformTagName(l));const t=new r(l);l!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,l)),this.addChild(n,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new r(l);this.tagsNodeStack.push(n),l!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,l)),this.addChild(n,t,s),n=t}i="",a=d}}else i+=t[a]}return e.child};function f(t,e,n){const i=this.options.updateTag(e.tagname,n,e[":@"]);!1===i||("string"===typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e))}const A=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function p(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function g(t,e,n){const i="*."+n;for(const r in t){const n=t[r];if(i===n||e===n)return!0}return!1}function m(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function y(t,e,n){const i=function(t,e){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let o=e;o<t.length;o++){let e=t[o];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:o};if(t[o+1]===i[1])return{data:r,index:o}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!i)return;let r=i.data;const o=i.index,s=r.search(/\s/);let a=r,l=!0;-1!==s&&(a=r.substring(0,s),r=r.substring(s+1).trimStart());const c=a;if(n){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),l=a!==i.data.substr(t+1))}return{tagName:a,tagExp:r,closeIndex:o,attrExpPresent:l,rawTagName:c}}function v(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const o=m(t,">",n,"".concat(e," is not closed"));if(t.substring(n+2,o).trim()===e&&(r--,0===r))return{tagContent:t.substring(i,n),i:o};n=o}else if("?"===t[n+1]){n=m(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=m(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=m(t,"]]>",n,"StopNode is not closed.")-2}else{const i=y(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&r++,n=i.closeIndex}}}function _(t,e,n){if(e&&"string"===typeof t){const e=t.trim();return"true"===e||"false"!==e&&s(t,n)}return i.isExist(t)?t:""}t.exports=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xa2"},pound:{regex:/&(pound|#163);/g,val:"\xa3"},yen:{regex:/&(yen|#165);/g,val:"\xa5"},euro:{regex:/&(euro|#8364);/g,val:"\u20ac"},copyright:{regex:/&(copy|#169);/g,val:"\xa9"},reg:{regex:/&(reg|#174);/g,val:"\xae"},inr:{regex:/&(inr|#8377);/g,val:"\u20b9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,16))}},this.addExternalEntities=a,this.parseXml=d,this.parseTextData=l,this.resolveNameSpace=c,this.buildAttributesMap=h,this.isItStopNode=g,this.replaceEntitiesValue=A,this.readStopNodeData=v,this.saveTextToParentTag=p,this.addChild=f}}},62847:(t,e,n)=>{const{buildOptions:i}=n(1962),r=n(84053),{prettify:o}=n(59830),s=n(65699);t.exports=class{constructor(t){this.externalEntities={},this.options=i(t)}parse(t,e){if("string"===typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=s.validate(t,e);if(!0!==n)throw Error("".concat(n.err.msg,":").concat(n.err.line,":").concat(n.err.col))}const n=new r(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:o(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}}},59830:(t,e)=>{"use strict";function n(t,e,s){let a;const l={};for(let c=0;c<t.length;c++){const u=t[c],h=i(u);let d="";if(d=void 0===s?h:s+"."+h,h===e.textNodeName)void 0===a?a=u[h]:a+=""+u[h];else{if(void 0===h)continue;if(u[h]){let t=n(u[h],e,d);const i=o(t,e);u[":@"]?r(t,u[":@"],d,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==l[h]&&l.hasOwnProperty(h)?(Array.isArray(l[h])||(l[h]=[l[h]]),l[h].push(t)):e.isArray(h,d,i)?l[h]=[t]:l[h]=t}}}return"string"===typeof a?a.length>0&&(l[e.textNodeName]=a):void 0!==a&&(l[e.textNodeName]=a),l}function i(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const t=e[n];if(":@"!==t)return t}}function r(t,e,n,i){if(e){const r=Object.keys(e),o=r.length;for(let s=0;s<o;s++){const o=r[s];i.isArray(o,n+"."+o,!0,!0)?t[o]=[e[o]]:t[o]=e[o]}}}function o(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!==typeof t[n]&&0!==t[n])}e.prettify=function(t,e){return n(t,e)}},41949:t=>{"use strict";t.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}},60285:(t,e,n)=>{"use strict";n.d(e,{Ib:()=>i,WT:()=>r});var i=1e-6,r="undefined"!==typeof Float32Array?Float32Array:Array;Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},24645:(t,e,n)=>{"use strict";n.d(e,{GH:()=>a,Iu:()=>c,Jp:()=>l,U1:()=>u,U_:()=>s,Ue:()=>r,bA:()=>h,en:()=>d,p4:()=>o});var i=n(60285);function r(){var t=new i.WT(9);return i.WT!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function o(t,e){if(t===e){var n=e[1],i=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=i,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function s(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*s-a*c,d=-u*o+a*l,f=c*o-s*l,A=n*h+i*d+r*f;return A?(A=1/A,t[0]=h*A,t[1]=(-u*i+r*c)*A,t[2]=(a*i-r*s)*A,t[3]=d*A,t[4]=(u*n-r*l)*A,t[5]=(-a*n+r*o)*A,t[6]=f*A,t[7]=(-c*n+i*l)*A,t[8]=(s*n-i*o)*A,t):null}function a(t){var e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*(c*o-s*l)+n*(-c*r+s*a)+i*(l*r-o*a)}function l(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=n[0],f=n[1],A=n[2],p=n[3],g=n[4],m=n[5],y=n[6],v=n[7],_=n[8];return t[0]=d*i+f*s+A*c,t[1]=d*r+f*a+A*u,t[2]=d*o+f*l+A*h,t[3]=p*i+g*s+m*c,t[4]=p*r+g*a+m*u,t[5]=p*o+g*l+m*h,t[6]=y*i+v*s+_*c,t[7]=y*r+v*a+_*u,t[8]=y*o+v*l+_*h,t}function c(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=n[0],f=n[1];return t[0]=i,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=d*i+f*s+c,t[7]=d*r+f*a+u,t[8]=d*o+f*l+h,t}function u(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=Math.sin(n),f=Math.cos(n);return t[0]=f*i+d*s,t[1]=f*r+d*a,t[2]=f*o+d*l,t[3]=f*s-d*i,t[4]=f*a-d*r,t[5]=f*l-d*o,t[6]=c,t[7]=u,t[8]=h,t}function h(t,e,n){var i=n[0],r=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function d(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=n+n,a=i+i,l=r+r,c=n*s,u=i*s,h=i*a,d=r*s,f=r*a,A=r*l,p=o*s,g=o*a,m=o*l;return t[0]=1-h-A,t[3]=u-m,t[6]=d+g,t[1]=u+m,t[4]=1-c-A,t[7]=f-p,t[2]=d-g,t[5]=f+p,t[8]=1-c-h,t}},83367:(t,e,n)=>{"use strict";n.d(e,{G3:()=>m,GH:()=>s,Iu:()=>l,Jp:()=>a,M5:()=>y,Q$:()=>A,U1:()=>u,U_:()=>o,bA:()=>c,en:()=>p,fS:()=>_,jI:()=>f,lM:()=>h,oy:()=>g,p4:()=>r,uD:()=>d,zB:()=>v});var i=n(60285);function r(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[11]=e[14],t[12]=r,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function o(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],A=e[12],p=e[13],g=e[14],m=e[15],y=n*a-i*s,v=n*l-r*s,_=n*c-o*s,b=i*l-r*a,x=i*c-o*a,w=r*c-o*l,C=u*p-h*A,B=u*g-d*A,E=u*m-f*A,T=h*g-d*p,S=h*m-f*p,M=d*m-f*g,I=y*M-v*S+_*T+b*E-x*B+w*C;return I?(I=1/I,t[0]=(a*M-l*S+c*T)*I,t[1]=(r*S-i*M-o*T)*I,t[2]=(p*w-g*x+m*b)*I,t[3]=(d*x-h*w-f*b)*I,t[4]=(l*E-s*M-c*B)*I,t[5]=(n*M-r*E+o*B)*I,t[6]=(g*_-A*w-m*v)*I,t[7]=(u*w-d*_+f*v)*I,t[8]=(s*S-a*E+c*C)*I,t[9]=(i*E-n*S-o*C)*I,t[10]=(A*x-p*_+m*y)*I,t[11]=(h*_-u*x-f*y)*I,t[12]=(a*B-s*T-l*C)*I,t[13]=(n*T-i*B+r*C)*I,t[14]=(p*v-A*b-g*y)*I,t[15]=(u*b-h*v+d*y)*I,t):null}function s(t){var e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],f=t[12],A=t[13],p=t[14],g=t[15];return(e*s-n*o)*(h*g-d*p)-(e*a-i*o)*(u*g-d*A)+(e*l-r*o)*(u*p-h*A)+(n*a-i*s)*(c*g-d*f)-(n*l-r*s)*(c*p-h*f)+(i*l-r*a)*(c*A-u*f)}function a(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],A=e[11],p=e[12],g=e[13],m=e[14],y=e[15],v=n[0],_=n[1],b=n[2],x=n[3];return t[0]=v*i+_*a+b*h+x*p,t[1]=v*r+_*l+b*d+x*g,t[2]=v*o+_*c+b*f+x*m,t[3]=v*s+_*u+b*A+x*y,v=n[4],_=n[5],b=n[6],x=n[7],t[4]=v*i+_*a+b*h+x*p,t[5]=v*r+_*l+b*d+x*g,t[6]=v*o+_*c+b*f+x*m,t[7]=v*s+_*u+b*A+x*y,v=n[8],_=n[9],b=n[10],x=n[11],t[8]=v*i+_*a+b*h+x*p,t[9]=v*r+_*l+b*d+x*g,t[10]=v*o+_*c+b*f+x*m,t[11]=v*s+_*u+b*A+x*y,v=n[12],_=n[13],b=n[14],x=n[15],t[12]=v*i+_*a+b*h+x*p,t[13]=v*r+_*l+b*d+x*g,t[14]=v*o+_*c+b*f+x*m,t[15]=v*s+_*u+b*A+x*y,t}function l(t,e,n){var i,r,o,s,a,l,c,u,h,d,f,A,p=n[0],g=n[1],m=n[2];return e===t?(t[12]=e[0]*p+e[4]*g+e[8]*m+e[12],t[13]=e[1]*p+e[5]*g+e[9]*m+e[13],t[14]=e[2]*p+e[6]*g+e[10]*m+e[14],t[15]=e[3]*p+e[7]*g+e[11]*m+e[15]):(i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],A=e[11],t[0]=i,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=f,t[11]=A,t[12]=i*p+a*g+h*m+e[12],t[13]=r*p+l*g+d*m+e[13],t[14]=o*p+c*g+f*m+e[14],t[15]=s*p+u*g+A*m+e[15]),t}function c(t,e,n){var i=n[0],r=n[1],o=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function u(t,e,n,r){var o,s,a,l,c,u,h,d,f,A,p,g,m,y,v,_,b,x,w,C,B,E,T,S,M=r[0],I=r[1],P=r[2],D=Math.hypot(M,I,P);return D<i.Ib?null:(M*=D=1/D,I*=D,P*=D,o=Math.sin(n),a=1-(s=Math.cos(n)),l=e[0],c=e[1],u=e[2],h=e[3],d=e[4],f=e[5],A=e[6],p=e[7],g=e[8],m=e[9],y=e[10],v=e[11],_=M*M*a+s,b=I*M*a+P*o,x=P*M*a-I*o,w=M*I*a-P*o,C=I*I*a+s,B=P*I*a+M*o,E=M*P*a+I*o,T=I*P*a-M*o,S=P*P*a+s,t[0]=l*_+d*b+g*x,t[1]=c*_+f*b+m*x,t[2]=u*_+A*b+y*x,t[3]=h*_+p*b+v*x,t[4]=l*w+d*C+g*B,t[5]=c*w+f*C+m*B,t[6]=u*w+A*C+y*B,t[7]=h*w+p*C+v*B,t[8]=l*E+d*T+g*S,t[9]=c*E+f*T+m*S,t[10]=u*E+A*T+y*S,t[11]=h*E+p*T+v*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function h(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*i,t[5]=s*r+u*i,t[6]=a*r+h*i,t[7]=l*r+d*i,t[8]=c*r-o*i,t[9]=u*r-s*i,t[10]=h*r-a*i,t[11]=d*r-l*i,t}function d(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[0],s=e[1],a=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r-c*i,t[1]=s*r-u*i,t[2]=a*r-h*i,t[3]=l*r-d*i,t[8]=o*i+c*r,t[9]=s*i+u*r,t[10]=a*i+h*r,t[11]=l*i+d*r,t}function f(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+c*i,t[1]=s*r+u*i,t[2]=a*r+h*i,t[3]=l*r+d*i,t[4]=c*r-o*i,t[5]=u*r-s*i,t[6]=h*r-a*i,t[7]=d*r-l*i,t}function A(t,e){var n=e[0],i=e[1],r=e[2],o=e[4],s=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return t[0]=Math.hypot(n,i,r),t[1]=Math.hypot(o,s,a),t[2]=Math.hypot(l,c,u),t}function p(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=n+n,a=i+i,l=r+r,c=n*s,u=i*s,h=i*a,d=r*s,f=r*a,A=r*l,p=o*s,g=o*a,m=o*l;return t[0]=1-h-A,t[1]=u+m,t[2]=d-g,t[3]=0,t[4]=u-m,t[5]=1-c-A,t[6]=f+p,t[7]=0,t[8]=d+g,t[9]=f-p,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function g(t,e,n,i,r,o,s){var a=1/(n-e),l=1/(r-i),c=1/(o-s);return t[0]=2*o*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(n+e)*a,t[9]=(r+i)*l,t[10]=(s+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*c,t[15]=0,t}var m=function(t,e,n,i,r){var o,s=1/Math.tan(e/2);return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(o=1/(i-r),t[10]=(r+i)*o,t[14]=2*r*i*o):(t[10]=-1,t[14]=-2*i),t};var y=function(t,e,n,i,r,o,s){var a=1/(e-n),l=1/(i-r),c=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*a,t[13]=(r+i)*l,t[14]=(s+o)*c,t[15]=1,t};function v(t,e,n,r){var o,s,a,l,c,u,h,d,f,A,p=e[0],g=e[1],m=e[2],y=r[0],v=r[1],_=r[2],b=n[0],x=n[1],w=n[2];return Math.abs(p-b)<i.Ib&&Math.abs(g-x)<i.Ib&&Math.abs(m-w)<i.Ib?function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(t):(h=p-b,d=g-x,f=m-w,o=v*(f*=A=1/Math.hypot(h,d,f))-_*(d*=A),s=_*(h*=A)-y*f,a=y*d-v*h,(A=Math.hypot(o,s,a))?(o*=A=1/A,s*=A,a*=A):(o=0,s=0,a=0),l=d*a-f*s,c=f*o-h*a,u=h*s-d*o,(A=Math.hypot(l,c,u))?(l*=A=1/A,c*=A,u*=A):(l=0,c=0,u=0),t[0]=o,t[1]=l,t[2]=h,t[3]=0,t[4]=s,t[5]=c,t[6]=d,t[7]=0,t[8]=a,t[9]=u,t[10]=f,t[11]=0,t[12]=-(o*p+s*g+a*m),t[13]=-(l*p+c*g+u*m),t[14]=-(h*p+d*g+f*m),t[15]=1,t)}function _(t,e){var n=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],A=t[11],p=t[12],g=t[13],m=t[14],y=t[15],v=e[0],_=e[1],b=e[2],x=e[3],w=e[4],C=e[5],B=e[6],E=e[7],T=e[8],S=e[9],M=e[10],I=e[11],P=e[12],D=e[13],F=e[14],L=e[15];return Math.abs(n-v)<=i.Ib*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-_)<=i.Ib*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(o-b)<=i.Ib*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(s-x)<=i.Ib*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(a-w)<=i.Ib*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(l-C)<=i.Ib*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(c-B)<=i.Ib*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(u-E)<=i.Ib*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-T)<=i.Ib*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-S)<=i.Ib*Math.max(1,Math.abs(d),Math.abs(S))&&Math.abs(f-M)<=i.Ib*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(A-I)<=i.Ib*Math.max(1,Math.abs(A),Math.abs(I))&&Math.abs(p-P)<=i.Ib*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-D)<=i.Ib*Math.max(1,Math.abs(g),Math.abs(D))&&Math.abs(m-F)<=i.Ib*Math.max(1,Math.abs(m),Math.abs(F))&&Math.abs(y-L)<=i.Ib*Math.max(1,Math.abs(y),Math.abs(L))}},77548:(t,e,n)=>{"use strict";n.d(e,{IH:()=>r,bA:()=>o,c:()=>c,fF:()=>d,iu:()=>u,kE:()=>s,kK:()=>h,lu:()=>f,t7:()=>l,tk:()=>a});var i=n(60285);function r(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function o(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function s(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function a(t,e){return t[0]=-e[0],t[1]=-e[1],t}function l(t,e,n,i){var r=e[0],o=e[1];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t}function c(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t}function u(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t}function h(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t}function d(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t}var f=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};!function(){var t=function(){var t=new i.WT(2);return i.WT!=Float32Array&&(t[0]=0,t[1]=0),t}()}()},99007:(t,e,n)=>{"use strict";n.d(e,{AK:()=>u,EU:()=>v,Fv:()=>c,IH:()=>a,Ue:()=>r,VC:()=>p,Zh:()=>x,al:()=>s,dC:()=>b,fF:()=>f,jI:()=>y,kC:()=>h,kE:()=>o,kK:()=>A,lM:()=>g,lu:()=>_,t7:()=>d,tk:()=>l,uD:()=>m,x9:()=>w});var i=n(60285);function r(){var t=new i.WT(3);return i.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=t[0],n=t[1],i=t[2];return Math.hypot(e,n,i)}function s(t,e,n){var r=new i.WT(3);return r[0]=t,r[1]=e,r[2]=n,r}function a(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function l(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function c(t,e){var n=e[0],i=e[1],r=e[2],o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function u(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function h(t,e,n){var i=e[0],r=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=r*l-o*a,t[1]=o*s-i*l,t[2]=i*a-r*s,t}function d(t,e,n,i){var r=e[0],o=e[1],s=e[2];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t[2]=s+i*(n[2]-s),t}function f(t,e,n){var i=e[0],r=e[1],o=e[2],s=n[3]*i+n[7]*r+n[11]*o+n[15];return s=s||1,t[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/s,t[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/s,t[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/s,t}function A(t,e,n){var i=e[0],r=e[1],o=e[2];return t[0]=i*n[0]+r*n[3]+o*n[6],t[1]=i*n[1]+r*n[4]+o*n[7],t[2]=i*n[2]+r*n[5]+o*n[8],t}function p(t,e,n){var i=n[0],r=n[1],o=n[2],s=n[3],a=e[0],l=e[1],c=e[2],u=r*c-o*l,h=o*a-i*c,d=i*l-r*a,f=r*d-o*h,A=o*u-i*d,p=i*h-r*u,g=2*s;return u*=g,h*=g,d*=g,f*=2,A*=2,p*=2,t[0]=a+u+f,t[1]=l+h+A,t[2]=c+d+p,t}function g(t,e,n,i){var r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[0],o[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),o[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function m(t,e,n,i){var r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),o[1]=r[1],o[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function y(t,e,n,i){var r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),o[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),o[2]=r[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function v(t,e){var n=t[0],i=t[1],r=t[2],o=e[0],s=e[1],a=e[2],l=Math.sqrt(n*n+i*i+r*r)*Math.sqrt(o*o+s*s+a*a),c=l&&u(t,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}var _=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},b=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t},x=o,w=function(t){var e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i};!function(){var t=r()}()},62220:(t,e,n)=>{"use strict";n.d(e,{AK:()=>f,Fv:()=>d,I6:()=>m,IH:()=>l,JG:()=>s,VC:()=>g,al:()=>o,bA:()=>c,d9:()=>r,fF:()=>p,fS:()=>y,kE:()=>u,t7:()=>A,t8:()=>a,we:()=>h});var i=n(60285);function r(t){var e=new i.WT(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,n,r){var o=new i.WT(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function l(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function c(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function u(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.hypot(e,n,i,r)}function h(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r}function d(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=n*n+i*i+r*r+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=n*s,t[1]=i*s,t[2]=r*s,t[3]=o*s,t}function f(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function A(t,e,n,i){var r=e[0],o=e[1],s=e[2],a=e[3];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t[2]=s+i*(n[2]-s),t[3]=a+i*(n[3]-a),t}function p(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*o+n[12]*s,t[1]=n[1]*i+n[5]*r+n[9]*o+n[13]*s,t[2]=n[2]*i+n[6]*r+n[10]*o+n[14]*s,t[3]=n[3]*i+n[7]*r+n[11]*o+n[15]*s,t}function g(t,e,n){var i=e[0],r=e[1],o=e[2],s=n[0],a=n[1],l=n[2],c=n[3],u=c*i+a*o-l*r,h=c*r+l*i-s*o,d=c*o+s*r-a*i,f=-s*i-a*r-l*o;return t[0]=u*c+f*-s+h*-l-d*-a,t[1]=h*c+f*-a+d*-s-u*-l,t[2]=d*c+f*-l+u*-a-h*-s,t[3]=e[3],t}function m(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function y(t,e){var n=t[0],r=t[1],o=t[2],s=t[3],a=e[0],l=e[1],c=e[2],u=e[3];return Math.abs(n-a)<=i.Ib*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-l)<=i.Ib*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-c)<=i.Ib*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(s-u)<=i.Ib*Math.max(1,Math.abs(s),Math.abs(u))}!function(){var t=function(){var t=new i.WT(4);return i.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}()},73356:(t,e,n)=>{"use strict";n.d(e,{AI:()=>O,Cx:()=>R,Ji:()=>j,Lg:()=>U,OK:()=>N,U7:()=>V,VP:()=>k,b3:()=>G,jV:()=>z,kU:()=>Z,v8:()=>L});var i=function(t){var e,n="undefined"!==typeof(t=t||{})?t:{},i={};for(e in n)n.hasOwnProperty(e)&&(i[e]=n[e]);var r,o=[],s="";document.currentScript&&(s=document.currentScript.src),s=0!==s.indexOf("blob:")?s.substr(0,s.lastIndexOf("/")+1):"",r=function(t,e,n){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){if(200==i.status||0==i.status&&i.response)e(i.response);else{var r=K(t);r?e(r.buffer):n()}},i.onerror=n,i.send(null)};var a=n.print||console.log.bind(console),l=n.printErr||console.warn.bind(console);for(e in i)i.hasOwnProperty(e)&&(n[e]=i[e]);i=null,n.arguments&&(o=n.arguments);var c=0,u=function(){return c};var h=!1;function d(t){var e,i=n["_"+t];return e="Cannot call unknown function "+t+", make sure it is exported",i||lt("Assertion failed: "+e),i}function f(t,e,n,i,r){var o={string:function(t){var e=0;if(null!==t&&void 0!==t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,i){if(!(i>0))return 0;for(var r=n,o=n+i-1,s=0;s<t.length;++s){var a=t.charCodeAt(s);if(a>=55296&&a<=57343)a=65536+((1023&a)<<10)|1023&t.charCodeAt(++s);if(a<=127){if(n>=o)break;e[n++]=a}else if(a<=2047){if(n+1>=o)break;e[n++]=192|a>>6,e[n++]=128|63&a}else if(a<=65535){if(n+2>=o)break;e[n++]=224|a>>12,e[n++]=128|a>>6&63,e[n++]=128|63&a}else{if(n+3>=o)break;e[n++]=240|a>>18,e[n++]=128|a>>12&63,e[n++]=128|a>>6&63,e[n++]=128|63&a}}e[n]=0})(t,y,e,n)})(t,e=tt(n),n)}return e},array:function(t){var e=tt(t.length);return function(t,e){m.set(t,e)}(t,e),e}};var s=d(t),a=[],l=0;if(i)for(var c=0;c<i.length;c++){var u=o[n[c]];u?(0===l&&(l=nt()),a[c]=u(i[c])):a[c]=i[c]}var h=s.apply(null,a);return h=function(t){return"string"===e?p(t):"boolean"===e?Boolean(t):t}(h),0!==l&&et(l),h}var A="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;function p(t,e){return t?function(t,e,n){for(var i=e+n,r=e;t[r]&&!(r>=i);)++r;if(r-e>16&&t.subarray&&A)return A.decode(t.subarray(e,r));for(var o="";e<r;){var s=t[e++];if(128&s){var a=63&t[e++];if(192!=(224&s)){var l=63&t[e++];if((s=224==(240&s)?(15&s)<<12|a<<6|l:(7&s)<<18|a<<12|l<<6|63&t[e++])<65536)o+=String.fromCharCode(s);else{var c=s-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}(y,t,e):""}var g,m,y,v,_,b,x;"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");function w(t,e){return t%e>0&&(t+=e-t%e),t}function C(t){g=t,n.HEAP8=m=new Int8Array(t),n.HEAP16=v=new Int16Array(t),n.HEAP32=_=new Int32Array(t),n.HEAPU8=y=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=b=new Float32Array(t),n.HEAPF64=x=new Float64Array(t)}var B=n.TOTAL_MEMORY||33554432;function E(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var i=e.func;"number"===typeof i?void 0===e.arg?n.dynCall_v(i):n.dynCall_vi(i,e.arg):i(void 0===e.arg?null:e.arg)}else e()}}B=(g=n.buffer?n.buffer:new ArrayBuffer(B)).byteLength,C(g),_[6004]=5266928;var T=[],S=[],M=[],I=[];var P=Math.abs,D=Math.ceil,F=Math.floor,L=Math.min,O=0,R=null,k=null;n.preloadedImages={},n.preloadedAudios={};var U,z,G=null,N="data:application/octet-stream;base64,";function Z(t){return String.prototype.startsWith?t.startsWith(N):0===t.indexOf(N)}G="data:application/octet-stream;base64,AAAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAABAAAAAMAAAAGAAAABQAAAAIAAAAAAAAAAgAAAAMAAAABAAAABAAAAAYAAAAAAAAABQAAAAMAAAAGAAAABAAAAAUAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAABAAAABQAAAAIAAAAAAAAAAQAAAAMAAAAGAAAABAAAAAYAAAAAAAAABQAAAAIAAAABAAAABAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAgAAAAMAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABgAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAABgAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAAAAAACAAAAAwAAAAQAAAAFAAAABgAAAAAAAAABAAAAAwAAAAQAAAAFAAAABgAAAAAAAAABAAAAAgAAAAQAAAAFAAAABgAAAAAAAAABAAAAAgAAAAMAAAAFAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAAAAAAABgAAAAAAAAADAAAAAgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAUAAAAEAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAEAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAUAAAACAAAABAAAAAMAAAAIAAAAAQAAAAcAAAAGAAAACQAAAAAAAAADAAAAAgAAAAIAAAAGAAAACgAAAAsAAAAAAAAAAQAAAAUAAAADAAAADQAAAAEAAAAHAAAABAAAAAwAAAAAAAAABAAAAH8AAAAPAAAACAAAAAMAAAAAAAAADAAAAAUAAAACAAAAEgAAAAoAAAAIAAAAAAAAABAAAAAGAAAADgAAAAsAAAARAAAAAQAAAAkAAAACAAAABwAAABUAAAAJAAAAEwAAAAMAAAANAAAAAQAAAAgAAAAFAAAAFgAAABAAAAAEAAAAAAAAAA8AAAAJAAAAEwAAAA4AAAAUAAAAAQAAAAcAAAAGAAAACgAAAAsAAAAYAAAAFwAAAAUAAAACAAAAEgAAAAsAAAARAAAAFwAAABkAAAACAAAABgAAAAoAAAAMAAAAHAAAAA0AAAAaAAAABAAAAA8AAAADAAAADQAAABoAAAAVAAAAHQAAAAMAAAAMAAAABwAAAA4AAAB/AAAAEQAAABsAAAAJAAAAFAAAAAYAAAAPAAAAFgAAABwAAAAfAAAABAAAAAgAAAAMAAAAEAAAABIAAAAhAAAAHgAAAAgAAAAFAAAAFgAAABEAAAALAAAADgAAAAYAAAAjAAAAGQAAABsAAAASAAAAGAAAAB4AAAAgAAAABQAAAAoAAAAQAAAAEwAAACIAAAAUAAAAJAAAAAcAAAAVAAAACQAAABQAAAAOAAAAEwAAAAkAAAAoAAAAGwAAACQAAAAVAAAAJgAAABMAAAAiAAAADQAAAB0AAAAHAAAAFgAAABAAAAApAAAAIQAAAA8AAAAIAAAAHwAAABcAAAAYAAAACwAAAAoAAAAnAAAAJQAAABkAAAAYAAAAfwAAACAAAAAlAAAACgAAABcAAAASAAAAGQAAABcAAAARAAAACwAAAC0AAAAnAAAAIwAAABoAAAAqAAAAHQAAACsAAAAMAAAAHAAAAA0AAAAbAAAAKAAAACMAAAAuAAAADgAAABQAAAARAAAAHAAAAB8AAAAqAAAALAAAAAwAAAAPAAAAGgAAAB0AAAArAAAAJgAAAC8AAAANAAAAGgAAABUAAAAeAAAAIAAAADAAAAAyAAAAEAAAABIAAAAhAAAAHwAAACkAAAAsAAAANQAAAA8AAAAWAAAAHAAAACAAAAAeAAAAGAAAABIAAAA0AAAAMgAAACUAAAAhAAAAHgAAADEAAAAwAAAAFgAAABAAAAApAAAAIgAAABMAAAAmAAAAFQAAADYAAAAkAAAAMwAAACMAAAAuAAAALQAAADgAAAARAAAAGwAAABkAAAAkAAAAFAAAACIAAAATAAAANwAAACgAAAA2AAAAJQAAACcAAAA0AAAAOQAAABgAAAAXAAAAIAAAACYAAAB/AAAAIgAAADMAAAAdAAAALwAAABUAAAAnAAAAJQAAABkAAAAXAAAAOwAAADkAAAAtAAAAKAAAABsAAAAkAAAAFAAAADwAAAAuAAAANwAAACkAAAAxAAAANQAAAD0AAAAWAAAAIQAAAB8AAAAqAAAAOgAAACsAAAA+AAAAHAAAACwAAAAaAAAAKwAAAD4AAAAvAAAAQAAAABoAAAAqAAAAHQAAACwAAAA1AAAAOgAAAEEAAAAcAAAAHwAAACoAAAAtAAAAJwAAACMAAAAZAAAAPwAAADsAAAA4AAAALgAAADwAAAA4AAAARAAAABsAAAAoAAAAIwAAAC8AAAAmAAAAKwAAAB0AAABFAAAAMwAAAEAAAAAwAAAAMQAAAB4AAAAhAAAAQwAAAEIAAAAyAAAAMQAAAH8AAAA9AAAAQgAAACEAAAAwAAAAKQAAADIAAAAwAAAAIAAAAB4AAABGAAAAQwAAADQAAAAzAAAARQAAADYAAABHAAAAJgAAAC8AAAAiAAAANAAAADkAAABGAAAASgAAACAAAAAlAAAAMgAAADUAAAA9AAAAQQAAAEsAAAAfAAAAKQAAACwAAAA2AAAARwAAADcAAABJAAAAIgAAADMAAAAkAAAANwAAACgAAAA2AAAAJAAAAEgAAAA8AAAASQAAADgAAABEAAAAPwAAAE0AAAAjAAAALgAAAC0AAAA5AAAAOwAAAEoAAABOAAAAJQAAACcAAAA0AAAAOgAAAH8AAAA+AAAATAAAACwAAABBAAAAKgAAADsAAAA/AAAATgAAAE8AAAAnAAAALQAAADkAAAA8AAAASAAAAEQAAABQAAAAKAAAADcAAAAuAAAAPQAAADUAAAAxAAAAKQAAAFEAAABLAAAAQgAAAD4AAAArAAAAOgAAACoAAABSAAAAQAAAAEwAAAA/AAAAfwAAADgAAAAtAAAATwAAADsAAABNAAAAQAAAAC8AAAA+AAAAKwAAAFQAAABFAAAAUgAAAEEAAAA6AAAANQAAACwAAABWAAAATAAAAEsAAABCAAAAQwAAAFEAAABVAAAAMQAAADAAAAA9AAAAQwAAAEIAAAAyAAAAMAAAAFcAAABVAAAARgAAAEQAAAA4AAAAPAAAAC4AAABaAAAATQAAAFAAAABFAAAAMwAAAEAAAAAvAAAAWQAAAEcAAABUAAAARgAAAEMAAAA0AAAAMgAAAFMAAABXAAAASgAAAEcAAABZAAAASQAAAFsAAAAzAAAARQAAADYAAABIAAAAfwAAAEkAAAA3AAAAUAAAADwAAABYAAAASQAAAFsAAABIAAAAWAAAADYAAABHAAAANwAAAEoAAABOAAAAUwAAAFwAAAA0AAAAOQAAAEYAAABLAAAAQQAAAD0AAAA1AAAAXgAAAFYAAABRAAAATAAAAFYAAABSAAAAYAAAADoAAABBAAAAPgAAAE0AAAA/AAAARAAAADgAAABdAAAATwAAAFoAAABOAAAASgAAADsAAAA5AAAAXwAAAFwAAABPAAAATwAAAE4AAAA/AAAAOwAAAF0AAABfAAAATQAAAFAAAABEAAAASAAAADwAAABjAAAAWgAAAFgAAABRAAAAVQAAAF4AAABlAAAAPQAAAEIAAABLAAAAUgAAAGAAAABUAAAAYgAAAD4AAABMAAAAQAAAAFMAAAB/AAAASgAAAEYAAABkAAAAVwAAAFwAAABUAAAARQAAAFIAAABAAAAAYQAAAFkAAABiAAAAVQAAAFcAAABlAAAAZgAAAEIAAABDAAAAUQAAAFYAAABMAAAASwAAAEEAAABoAAAAYAAAAF4AAABXAAAAUwAAAGYAAABkAAAAQwAAAEYAAABVAAAAWAAAAEgAAABbAAAASQAAAGMAAABQAAAAaQAAAFkAAABhAAAAWwAAAGcAAABFAAAAVAAAAEcAAABaAAAATQAAAFAAAABEAAAAagAAAF0AAABjAAAAWwAAAEkAAABZAAAARwAAAGkAAABYAAAAZwAAAFwAAABTAAAATgAAAEoAAABsAAAAZAAAAF8AAABdAAAATwAAAFoAAABNAAAAbQAAAF8AAABqAAAAXgAAAFYAAABRAAAASwAAAGsAAABoAAAAZQAAAF8AAABcAAAATwAAAE4AAABtAAAAbAAAAF0AAABgAAAAaAAAAGIAAABuAAAATAAAAFYAAABSAAAAYQAAAH8AAABiAAAAVAAAAGcAAABZAAAAbwAAAGIAAABuAAAAYQAAAG8AAABSAAAAYAAAAFQAAABjAAAAUAAAAGkAAABYAAAAagAAAFoAAABxAAAAZAAAAGYAAABTAAAAVwAAAGwAAAByAAAAXAAAAGUAAABmAAAAawAAAHAAAABRAAAAVQAAAF4AAABmAAAAZQAAAFcAAABVAAAAcgAAAHAAAABkAAAAZwAAAFsAAABhAAAAWQAAAHQAAABpAAAAbwAAAGgAAABrAAAAbgAAAHMAAABWAAAAXgAAAGAAAABpAAAAWAAAAGcAAABbAAAAcQAAAGMAAAB0AAAAagAAAF0AAABjAAAAWgAAAHUAAABtAAAAcQAAAGsAAAB/AAAAZQAAAF4AAABzAAAAaAAAAHAAAABsAAAAZAAAAF8AAABcAAAAdgAAAHIAAABtAAAAbQAAAGwAAABdAAAAXwAAAHUAAAB2AAAAagAAAG4AAABiAAAAaAAAAGAAAAB3AAAAbwAAAHMAAABvAAAAYQAAAG4AAABiAAAAdAAAAGcAAAB3AAAAcAAAAGsAAABmAAAAZQAAAHgAAABzAAAAcgAAAHEAAABjAAAAdAAAAGkAAAB1AAAAagAAAHkAAAByAAAAcAAAAGQAAABmAAAAdgAAAHgAAABsAAAAcwAAAG4AAABrAAAAaAAAAHgAAAB3AAAAcAAAAHQAAABnAAAAdwAAAG8AAABxAAAAaQAAAHkAAAB1AAAAfwAAAG0AAAB2AAAAcQAAAHkAAABqAAAAdgAAAHgAAABsAAAAcgAAAHUAAAB5AAAAbQAAAHcAAABvAAAAcwAAAG4AAAB5AAAAdAAAAHgAAAB4AAAAcwAAAHIAAABwAAAAeQAAAHcAAAB2AAAAeQAAAHQAAAB4AAAAdwAAAHUAAABxAAAAdgAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAQAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAADAAAABQAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAgAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAABQAAAAUAAAAAAAAAAAAAAP////8BAAAAAAAAAAMAAAAEAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAQAAAP//////////AQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAIAAAAAAAAAAAAAAAEAAAACAAAABgAAAAQAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAoAAAACAAAAAAAAAAAAAAABAAAAAQAAAAUAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAAAAAAAAAAAAAEAAAADAAAABwAAAAYAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAJAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAAAAAAAAAAAAQAAAAQAAAAIAAAACgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAAAAAAAAAAABAAAACwAAAA8AAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAgAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAAAAAAAAAAABAAAADAAAABAAAAAMAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAEAAAAKAAAAEwAAAAgAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAgAAAAAAAAAAAAAAAQAAAA0AAAARAAAADQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAAAAAAAAAAAAAEAAAAOAAAAEgAAAA8AAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAAAAAABAAAA//////////8TAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABIAAAAAAAAAGAAAAAAAAAAhAAAAAAAAAB4AAAAAAAAAIAAAAAMAAAAxAAAAAQAAADAAAAADAAAAMgAAAAMAAAAIAAAAAAAAAAUAAAAFAAAACgAAAAUAAAAWAAAAAAAAABAAAAAAAAAAEgAAAAAAAAApAAAAAQAAACEAAAAAAAAAHgAAAAAAAAAEAAAAAAAAAAAAAAAFAAAAAgAAAAUAAAAPAAAAAQAAAAgAAAAAAAAABQAAAAUAAAAfAAAAAQAAABYAAAAAAAAAEAAAAAAAAAACAAAAAAAAAAYAAAAAAAAADgAAAAAAAAAKAAAAAAAAAAsAAAAAAAAAEQAAAAMAAAAYAAAAAQAAABcAAAADAAAAGQAAAAMAAAAAAAAAAAAAAAEAAAAFAAAACQAAAAUAAAAFAAAAAAAAAAIAAAAAAAAABgAAAAAAAAASAAAAAQAAAAoAAAAAAAAACwAAAAAAAAAEAAAAAQAAAAMAAAAFAAAABwAAAAUAAAAIAAAAAQAAAAAAAAAAAAAAAQAAAAUAAAAQAAAAAQAAAAUAAAAAAAAAAgAAAAAAAAAHAAAAAAAAABUAAAAAAAAAJgAAAAAAAAAJAAAAAAAAABMAAAAAAAAAIgAAAAMAAAAOAAAAAQAAABQAAAADAAAAJAAAAAMAAAADAAAAAAAAAA0AAAAFAAAAHQAAAAUAAAABAAAAAAAAAAcAAAAAAAAAFQAAAAAAAAAGAAAAAQAAAAkAAAAAAAAAEwAAAAAAAAAEAAAAAgAAAAwAAAAFAAAAGgAAAAUAAAAAAAAAAQAAAAMAAAAAAAAADQAAAAUAAAACAAAAAQAAAAEAAAAAAAAABwAAAAAAAAAaAAAAAAAAACoAAAAAAAAAOgAAAAAAAAAdAAAAAAAAACsAAAAAAAAAPgAAAAMAAAAmAAAAAQAAAC8AAAADAAAAQAAAAAMAAAAMAAAAAAAAABwAAAAFAAAALAAAAAUAAAANAAAAAAAAABoAAAAAAAAAKgAAAAAAAAAVAAAAAQAAAB0AAAAAAAAAKwAAAAAAAAAEAAAAAwAAAA8AAAAFAAAAHwAAAAUAAAADAAAAAQAAAAwAAAAAAAAAHAAAAAUAAAAHAAAAAQAAAA0AAAAAAAAAGgAAAAAAAAAfAAAAAAAAACkAAAAAAAAAMQAAAAAAAAAsAAAAAAAAADUAAAAAAAAAPQAAAAMAAAA6AAAAAQAAAEEAAAADAAAASwAAAAMAAAAPAAAAAAAAABYAAAAFAAAAIQAAAAUAAAAcAAAAAAAAAB8AAAAAAAAAKQAAAAAAAAAqAAAAAQAAACwAAAAAAAAANQAAAAAAAAAEAAAABAAAAAgAAAAFAAAAEAAAAAUAAAAMAAAAAQAAAA8AAAAAAAAAFgAAAAUAAAAaAAAAAQAAABwAAAAAAAAAHwAAAAAAAAAyAAAAAAAAADAAAAAAAAAAMQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAIQAAAAMAAAAYAAAAAwAAABIAAAADAAAAEAAAAAMAAABGAAAAAAAAAEMAAAAAAAAAQgAAAAMAAAA0AAAAAwAAADIAAAAAAAAAMAAAAAAAAAAlAAAAAwAAACAAAAAAAAAAHgAAAAMAAABTAAAAAAAAAFcAAAADAAAAVQAAAAMAAABKAAAAAwAAAEYAAAAAAAAAQwAAAAAAAAA5AAAAAQAAADQAAAADAAAAMgAAAAAAAAAZAAAAAAAAABcAAAAAAAAAGAAAAAMAAAARAAAAAAAAAAsAAAADAAAACgAAAAMAAAAOAAAAAwAAAAYAAAADAAAAAgAAAAMAAAAtAAAAAAAAACcAAAAAAAAAJQAAAAMAAAAjAAAAAwAAABkAAAAAAAAAFwAAAAAAAAAbAAAAAwAAABEAAAAAAAAACwAAAAMAAAA/AAAAAAAAADsAAAADAAAAOQAAAAMAAAA4AAAAAwAAAC0AAAAAAAAAJwAAAAAAAAAuAAAAAwAAACMAAAADAAAAGQAAAAAAAAAkAAAAAAAAABQAAAAAAAAADgAAAAMAAAAiAAAAAAAAABMAAAADAAAACQAAAAMAAAAmAAAAAwAAABUAAAADAAAABwAAAAMAAAA3AAAAAAAAACgAAAAAAAAAGwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAFAAAAAAAAAAzAAAAAwAAACIAAAAAAAAAEwAAAAMAAABIAAAAAAAAADwAAAADAAAALgAAAAMAAABJAAAAAwAAADcAAAAAAAAAKAAAAAAAAABHAAAAAwAAADYAAAADAAAAJAAAAAAAAABAAAAAAAAAAC8AAAAAAAAAJgAAAAMAAAA+AAAAAAAAACsAAAADAAAAHQAAAAMAAAA6AAAAAwAAACoAAAADAAAAGgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAMwAAAAMAAABSAAAAAwAAAEAAAAAAAAAALwAAAAAAAABMAAAAAwAAAD4AAAAAAAAAKwAAAAMAAABhAAAAAAAAAFkAAAADAAAARwAAAAMAAABiAAAAAwAAAFQAAAAAAAAARQAAAAAAAABgAAAAAwAAAFIAAAADAAAAQAAAAAAAAABLAAAAAAAAAEEAAAAAAAAAOgAAAAMAAAA9AAAAAAAAADUAAAADAAAALAAAAAMAAAAxAAAAAwAAACkAAAADAAAAHwAAAAMAAABeAAAAAAAAAFYAAAAAAAAATAAAAAMAAABRAAAAAwAAAEsAAAAAAAAAQQAAAAAAAABCAAAAAwAAAD0AAAAAAAAANQAAAAMAAABrAAAAAAAAAGgAAAADAAAAYAAAAAMAAABlAAAAAwAAAF4AAAAAAAAAVgAAAAAAAABVAAAAAwAAAFEAAAADAAAASwAAAAAAAAA5AAAAAAAAADsAAAAAAAAAPwAAAAMAAABKAAAAAAAAAE4AAAADAAAATwAAAAMAAABTAAAAAwAAAFwAAAADAAAAXwAAAAMAAAAlAAAAAAAAACcAAAADAAAALQAAAAMAAAA0AAAAAAAAADkAAAAAAAAAOwAAAAAAAABGAAAAAwAAAEoAAAAAAAAATgAAAAMAAAAYAAAAAAAAABcAAAADAAAAGQAAAAMAAAAgAAAAAwAAACUAAAAAAAAAJwAAAAMAAAAyAAAAAwAAADQAAAAAAAAAOQAAAAAAAAAuAAAAAAAAADwAAAAAAAAASAAAAAMAAAA4AAAAAAAAAEQAAAADAAAAUAAAAAMAAAA/AAAAAwAAAE0AAAADAAAAWgAAAAMAAAAbAAAAAAAAACgAAAADAAAANwAAAAMAAAAjAAAAAAAAAC4AAAAAAAAAPAAAAAAAAAAtAAAAAwAAADgAAAAAAAAARAAAAAMAAAAOAAAAAAAAABQAAAADAAAAJAAAAAMAAAARAAAAAwAAABsAAAAAAAAAKAAAAAMAAAAZAAAAAwAAACMAAAAAAAAALgAAAAAAAABHAAAAAAAAAFkAAAAAAAAAYQAAAAMAAABJAAAAAAAAAFsAAAADAAAAZwAAAAMAAABIAAAAAwAAAFgAAAADAAAAaQAAAAMAAAAzAAAAAAAAAEUAAAADAAAAVAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAWQAAAAAAAAA3AAAAAwAAAEkAAAAAAAAAWwAAAAMAAAAmAAAAAAAAAC8AAAADAAAAQAAAAAMAAAAiAAAAAwAAADMAAAAAAAAARQAAAAMAAAAkAAAAAwAAADYAAAAAAAAARwAAAAAAAABgAAAAAAAAAGgAAAAAAAAAawAAAAMAAABiAAAAAAAAAG4AAAADAAAAcwAAAAMAAABhAAAAAwAAAG8AAAADAAAAdwAAAAMAAABMAAAAAAAAAFYAAAADAAAAXgAAAAMAAABSAAAAAAAAAGAAAAAAAAAAaAAAAAAAAABUAAAAAwAAAGIAAAAAAAAAbgAAAAMAAAA6AAAAAAAAAEEAAAADAAAASwAAAAMAAAA+AAAAAwAAAEwAAAAAAAAAVgAAAAMAAABAAAAAAwAAAFIAAAAAAAAAYAAAAAAAAABVAAAAAAAAAFcAAAAAAAAAUwAAAAMAAABlAAAAAAAAAGYAAAADAAAAZAAAAAMAAABrAAAAAwAAAHAAAAADAAAAcgAAAAMAAABCAAAAAAAAAEMAAAADAAAARgAAAAMAAABRAAAAAAAAAFUAAAAAAAAAVwAAAAAAAABeAAAAAwAAAGUAAAAAAAAAZgAAAAMAAAAxAAAAAAAAADAAAAADAAAAMgAAAAMAAAA9AAAAAwAAAEIAAAAAAAAAQwAAAAMAAABLAAAAAwAAAFEAAAAAAAAAVQAAAAAAAABfAAAAAAAAAFwAAAAAAAAAUwAAAAAAAABPAAAAAAAAAE4AAAAAAAAASgAAAAMAAAA/AAAAAQAAADsAAAADAAAAOQAAAAMAAABtAAAAAAAAAGwAAAAAAAAAZAAAAAUAAABdAAAAAQAAAF8AAAAAAAAAXAAAAAAAAABNAAAAAQAAAE8AAAAAAAAATgAAAAAAAAB1AAAABAAAAHYAAAAFAAAAcgAAAAUAAABqAAAAAQAAAG0AAAAAAAAAbAAAAAAAAABaAAAAAQAAAF0AAAABAAAAXwAAAAAAAABaAAAAAAAAAE0AAAAAAAAAPwAAAAAAAABQAAAAAAAAAEQAAAAAAAAAOAAAAAMAAABIAAAAAQAAADwAAAADAAAALgAAAAMAAABqAAAAAAAAAF0AAAAAAAAATwAAAAUAAABjAAAAAQAAAFoAAAAAAAAATQAAAAAAAABYAAAAAQAAAFAAAAAAAAAARAAAAAAAAAB1AAAAAwAAAG0AAAAFAAAAXwAAAAUAAABxAAAAAQAAAGoAAAAAAAAAXQAAAAAAAABpAAAAAQAAAGMAAAABAAAAWgAAAAAAAABpAAAAAAAAAFgAAAAAAAAASAAAAAAAAABnAAAAAAAAAFsAAAAAAAAASQAAAAMAAABhAAAAAQAAAFkAAAADAAAARwAAAAMAAABxAAAAAAAAAGMAAAAAAAAAUAAAAAUAAAB0AAAAAQAAAGkAAAAAAAAAWAAAAAAAAABvAAAAAQAAAGcAAAAAAAAAWwAAAAAAAAB1AAAAAgAAAGoAAAAFAAAAWgAAAAUAAAB5AAAAAQAAAHEAAAAAAAAAYwAAAAAAAAB3AAAAAQAAAHQAAAABAAAAaQAAAAAAAAB3AAAAAAAAAG8AAAAAAAAAYQAAAAAAAABzAAAAAAAAAG4AAAAAAAAAYgAAAAMAAABrAAAAAQAAAGgAAAADAAAAYAAAAAMAAAB5AAAAAAAAAHQAAAAAAAAAZwAAAAUAAAB4AAAAAQAAAHcAAAAAAAAAbwAAAAAAAABwAAAAAQAAAHMAAAAAAAAAbgAAAAAAAAB1AAAAAQAAAHEAAAAFAAAAaQAAAAUAAAB2AAAAAQAAAHkAAAAAAAAAdAAAAAAAAAByAAAAAQAAAHgAAAABAAAAdwAAAAAAAAByAAAAAAAAAHAAAAAAAAAAawAAAAAAAABkAAAAAAAAAGYAAAAAAAAAZQAAAAMAAABTAAAAAQAAAFcAAAADAAAAVQAAAAMAAAB2AAAAAAAAAHgAAAAAAAAAcwAAAAUAAABsAAAAAQAAAHIAAAAAAAAAcAAAAAAAAABcAAAAAQAAAGQAAAAAAAAAZgAAAAAAAAB1AAAAAAAAAHkAAAAFAAAAdwAAAAUAAABtAAAAAQAAAHYAAAAAAAAAeAAAAAAAAABfAAAAAQAAAGwAAAABAAAAcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAB+ogX28rbpPxqumpJv+fM/165tC4ns9D+XaEnTqUsEQFrOtNlC4PA/3U+0XG6P9b9TdUUBxTTjP4PUp8ex1ty/B1rD/EN43z+lcDi6LLrZP/a45NWEHMY/oJ5ijLDZ+j/xw3rjxWPjP2B8A46ioQdAotff3wla2z+FMSpA1jj+v6b5Y1mtPbS/cIu8K0F457/2esiyJpDNv98k5Ts2NeA/pvljWa09tD88ClUJ60MDQPZ6yLImkM0/4ONKxa0UBcD2uOTVhBzGv5G7JRxGave/8cN648Vj47+HCwtkjAXIv6LX398JWtu/qyheaCAL9D9TdUUBxTTjv4gyTxslhwVAB1rD/EN4378EH/28teoFwH6iBfbytum/F6ztFYdK/r/Xrm0Liez0vwcS6wNGWeO/Ws602ULg8L9TCtRLiLT8P8pi5RexJsw/BlIKPVwR5T95Wyu0/QjnP5PjoT7YYcu/mBhKZ6zrwj8wRYS7NebuP3qW6geh+Ls/SLrixebL3r+pcyymN9XrPwmkNHp7xec/GWNMZVAA17+82s+x2BLiPwn2ytbJ9ek/LgEH1sMS1j8yp/2LhTfeP+SnWwtQBbu/d38gkp5X7z8ytsuHaADGPzUYObdf1+m/7IauECWhwz+cjSACjzniP76Z+wUhN9K/1+GEKzup67+/GYr/04baPw6idWOvsuc/ZedTWsRa5b/EJQOuRzi0v/OncYhHPes/h49PixY53j+i8wWfC03Nvw2idWOvsue/ZedTWsRa5T/EJQOuRzi0P/KncYhHPeu/iY9PixY53r+i8wWfC03NP9anWwtQBbs/d38gkp5X778ytsuHaADGvzUYObdf1+k/74auECWhw7+cjSACjzniv8CZ+wUhN9I/1uGEKzup6z+/GYr/04bavwmkNHp7xee/F2NMZVAA1z+82s+x2BLivwr2ytbJ9em/KwEH1sMS1r8yp/2LhTfev81i5RexJsy/BlIKPVwR5b95Wyu0/Qjnv5DjoT7YYcs/nBhKZ6zrwr8wRYS7Nebuv3OW6geh+Lu/SLrixebL3j+pcyymN9Xrv8rHIFfWehZAMBwUdlo0DECTUc17EOb2PxpVB1SWChdAzjbhb9pTDUDQhmdvECX5P9FlMKCC9+g/IIAzjELgE0DajDngMv8GQFhWDmDPjNs/y1guLh96EkAxPi8k7DIEQJCc4URlhRhA3eLKKLwkEECqpNAyTBD/P6xpjXcDiwVAFtl//cQm4z+Ibt3XKiYTQM7mCLUb3QdAoM1t8yVv7D8aLZv2Nk8UQEAJPV5nQwxAtSsfTCoE9z9TPjXLXIIWQBVanC5W9AtAYM3d7Adm9j++5mQz1FoWQBUThyaVBghAwH5muQsV7T89Q1qv82MUQJoWGOfNuBdAzrkClkmwDkDQjKq77t37Py+g0dtitsE/ZwAMTwVPEUBojepluNwBQGYbtuW+t9w/HNWIJs6MEkDTNuQUSlgEQKxktPP5TcQ/ixbLB8JjEUCwuWjXMQYCQAS/R09FkRdAowpiZjhhDkB7LmlczD/7P01iQmhhsAVAnrtTwDy84z/Z6jfQ2TgTQChOCXMnWwpAhrW3daoz8z/HYJvVPI4VQLT3ik5FcA5Angi7LOZd+z+NNVzDy5gXQBXdvVTFUA1AYNMgOeYe+T8+qHXGCwkXQKQTOKwa5AJA8gFVoEMW0T+FwzJyttIRQAEAAAD/////BwAAAP////8xAAAA/////1cBAAD/////YQkAAP////+nQQAA/////5HLAQD/////95AMAP/////B9lcAAAAAAAAAAAAAAAAAAgAAAP////8OAAAA/////2IAAAD/////rgIAAP/////CEgAA/////06DAAD/////IpcDAP/////uIRkA/////4LtrwAAAAAAAAAAAAAAAAAAAAAAAgAAAP//////////AQAAAAMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////wIAAAD//////////wEAAAAAAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA/////////////////////wEAAAD///////////////8CAAAA////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD///////////////////////////////8CAAAA////////////////AQAAAP////////////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAAAQAAAP//////////AgAAAP//////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAAEAAAD//////////wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAgAAAAAAAAACAAAAAQAAAAEAAAACAAAAAgAAAAAAAAAFAAAABQAAAAAAAAACAAAAAgAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAABAAAAAgAAAAIAAAACAAAAAAAAAAUAAAAGAAAAAAAAAAIAAAACAAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAAAAAAAAgAAAAEAAAADAAAAAgAAAAIAAAAAAAAABQAAAAcAAAAAAAAAAgAAAAIAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAACAAAAAQAAAAQAAAACAAAAAgAAAAAAAAAFAAAACAAAAAAAAAACAAAAAgAAAAMAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAACAAAAAAAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAUAAAAJAAAAAAAAAAIAAAACAAAAAwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAIAAAACAAAAAAAAAAMAAAAOAAAAAgAAAAAAAAACAAAAAwAAAAAAAAAAAAAAAgAAAAIAAAADAAAABgAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAgAAAAIAAAAAAAAAAwAAAAoAAAACAAAAAAAAAAIAAAADAAAAAQAAAAAAAAACAAAAAgAAAAMAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAgAAAAAAAAADAAAACwAAAAIAAAAAAAAAAgAAAAMAAAACAAAAAAAAAAIAAAACAAAAAwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAACAAAAAAAAAAMAAAAMAAAAAgAAAAAAAAACAAAAAwAAAAMAAAAAAAAAAgAAAAIAAAADAAAACQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAIAAAAAAAAAAwAAAA0AAAACAAAAAAAAAAIAAAADAAAABAAAAAAAAAACAAAAAgAAAAMAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAgAAAAAAAAADAAAABgAAAAIAAAAAAAAAAgAAAAMAAAAPAAAAAAAAAAIAAAACAAAAAwAAAAsAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAIAAAACAAAAAAAAAAMAAAAHAAAAAgAAAAAAAAACAAAAAwAAABAAAAAAAAAAAgAAAAIAAAADAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAIAAAAAAAAAAwAAAAgAAAACAAAAAAAAAAIAAAADAAAAEQAAAAAAAAACAAAAAgAAAAMAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAACAAAAAgAAAAAAAAADAAAACQAAAAIAAAAAAAAAAgAAAAMAAAASAAAAAAAAAAIAAAACAAAAAwAAAA4AAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAACAAAAAAAAAAMAAAAFAAAAAgAAAAAAAAACAAAAAwAAABMAAAAAAAAAAgAAAAIAAAADAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAgAAAAAAAAACAAAAAQAAABMAAAACAAAAAgAAAAAAAAAFAAAACgAAAAAAAAACAAAAAgAAAAMAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABEAAAACAAAAAAAAAAIAAAABAAAADwAAAAIAAAACAAAAAAAAAAUAAAALAAAAAAAAAAIAAAACAAAAAwAAABEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAIAAAAAAAAAAgAAAAEAAAAQAAAAAgAAAAIAAAAAAAAABQAAAAwAAAAAAAAAAgAAAAIAAAADAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAACAAAAAQAAABEAAAACAAAAAgAAAAAAAAAFAAAADQAAAAAAAAACAAAAAgAAAAMAAAATAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAACAAAAAAAAAAIAAAABAAAAEgAAAAIAAAACAAAAAAAAAAUAAAAOAAAAAAAAAAIAAAACAAAAAwAAAAIAAAABAAAAAAAAAAEAAAACAAAAAAAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAEAAAAAAAAAAgAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAgAAAAAAAAABAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAFAAAAAAAAAAEAAAAAAAAAAAAAAMuhRbbsNlBBYqHW9OmHIkF9XBuqnS31QAK37uYhNMhAOSo3UUupm0DC+6pc6JxvQHV9eseEEEJAzURsCyqlFEB8BQ4NMJjnPyy3tBoS97o/xawXQznRjj89J2K2CZxhP6vX43RIIDQ/S8isgygEBz+LvFHQkmzaPjFFFO7wMq4+AADMLkTtjkIAAOgkJqxhQgAAU7B0MjRCAADwpBcVB0IAAACYP2HaQQAAAIn/Ja5BzczM4Eg6gUHNzMxMU7BTQTMzMzNfgCZBAAAAAEi3+UAAAAAAwGPNQDMzMzMzy6BAmpmZmZkxc0AzMzMzM/NFQDMzMzMzMxlAzczMzMzM7D+ygXSx2U6RQKimJOvQKnpA23hmONTHY0A/AGcxyudNQNb3K647mzZA+S56rrwWIUAm4kUQ+9UJQKre9hGzh/M/BLvoy9WG3T+LmqMf8VHGP2m3nYNV37A/gbFHcyeCmT+cBPWBckiDP61tZACjKW0/q2RbYVUYVj8uDypVyLNAP6jGS5cA5zBBwcqhBdCNGUEGEhQ/JVEDQT6WPnRbNO1AB/AWSJgT1kDfUWNCNLDAQNk+5C33OqlAchWL34QSk0DKvtDIrNV8QNF0G3kFzGVASSeWhBl6UED+/0mNGuk4QGjA/dm/1CJALPLPMql6DEDSHoDrwpP1P2jouzWST+A/egAAAAAAAABKAwAAAAAAAPoWAAAAAAAAyqAAAAAAAAB6ZQQAAAAAAErGHgAAAAAA+mvXAAAAAADK8+MFAAAAAHqqOykAAAAASqmhIAEAAAD6oGvkBwAAAMpm8T43AAAAes+ZuIIBAABKrDQMkwoAAPq1cFUFSgAAyvkUViUGAgAAAAAAAwAAAAYAAAACAAAABQAAAAEAAAAEAAAAAAAAAAAAAAAFAAAAAwAAAAEAAAAGAAAABAAAAAIAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAA/////wAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAP////8AAAAAAAAAAAEAAAABAAAAAAAAAAAAAAD/////AAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAAAAAABAAEAAAEBAAAAAAABAAAAAQAAAAEAAQAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAHAAAABwAAAAEAAAACAAAABAAAAAMAAAAAAAAAAAAAAAcAAAADAAAAAQAAAAIAAAAFAAAABAAAAAAAAAAAAAAAYWxnb3MuYwBfcG9seWZpbGxJbnRlcm5hbABhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0dlb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9HZW9Cb3VuZGFyeQBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGgzVG9Mb2NhbElqawBiYXNlQ2VsbCAhPSBvcmlnaW5CYXNlQ2VsbAAhKG9yaWdpbk9uUGVudCAmJiBpbmRleE9uUGVudCkAcGVudGFnb25Sb3RhdGlvbnMgPj0gMABkaXJlY3Rpb25Sb3RhdGlvbnMgPj0gMABiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvSDMAIV9pc0Jhc2VDZWxsUGVudGFnb24oYmFzZUNlbGwpAGJhc2VDZWxsUm90YXRpb25zID49IDAAd2l0aGluUGVudGFnb25Sb3RhdGlvbnMgPj0gMABncmFwaC0+YnVja2V0cyAhPSBOVUxMAHZlcnRleEdyYXBoLmMAaW5pdFZlcnRleEdyYXBoAG5vZGUgIT0gTlVMTABhZGRWZXJ0ZXhOb2Rl";function j(t){return t}function V(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function H(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function J(){return m.length}function W(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(m),$(e),C(e),1}catch(n){}}var Q="function"===typeof atob?atob:function(t){var e,n,i,r,o,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",c=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=a.indexOf(t.charAt(c++))<<2|(r=a.indexOf(t.charAt(c++)))>>4,n=(15&r)<<4|(o=a.indexOf(t.charAt(c++)))>>2,i=(3&o)<<6|(s=a.indexOf(t.charAt(c++))),l+=String.fromCharCode(e),64!==o&&(l+=String.fromCharCode(n)),64!==s&&(l+=String.fromCharCode(i))}while(c<t.length);return l};function K(t){if(Z(t))return function(t){try{for(var e=Q(t),n=new Uint8Array(e.length),i=0;i<e.length;++i)n[i]=e.charCodeAt(i);return n}catch(r){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(N.length))}var q,X,Y=function(t,e,n){var i=new t.Int8Array(n),r=new t.Int32Array(n),o=(new t.Uint8Array(n),new t.Float32Array(n),new t.Float64Array(n)),s=0|e.p,a=t.Math.floor,l=t.Math.abs,c=t.Math.sqrt,u=t.Math.pow,h=t.Math.cos,d=t.Math.sin,f=t.Math.tan,A=t.Math.acos,p=t.Math.asin,g=t.Math.atan,m=t.Math.atan2,y=t.Math.ceil,v=t.Math.imul,_=t.Math.min,b=t.Math.clz32,x=e.b,w=e.c,C=e.d,B=e.e,E=e.f,T=e.g,S=e.h,M=e.i,I=24048;function P(t,e,n,i){var r,o;0|D(t|=0,e|=0,n|=0,i|=0,0)&&(Me(0|i,0,(o=1+(0|v(3*n|0,n+1|0))|0)<<3),(r=0|ve(o,4))&&(F(t,e,n,i,r,o,0),ye(r)))}function D(t,e,n,i,o){t|=0,e|=0,n|=0,o|=0;var s,a=0,l=0,c=0,u=0,h=0,d=0,f=0,A=0;if(s=I,I=I+16|0,A=s,r[(a=i|=0)>>2]=t,r[a+4>>2]=e,(a=0!=(0|o))&&(r[o>>2]=0),0|Lt(t,e))return I=s,0|(A=1);r[A>>2]=0;t:do{if((0|n)>=1)if(a)for(h=0,d=1,f=1,l=0,a=t;;){if(!(l|h)){if(0==(0|(a=0|L(a,e,4,A)))&0==(0|(e=0|w()))){a=2;break t}if(0|Lt(a,e)){a=1;break t}}if(0==(0|(a=0|L(a,e,0|r[16+(h<<2)>>2],A)))&0==(0|(e=0|w()))){a=2;break t}if(r[(t=i+(f<<3)|0)>>2]=a,r[t+4>>2]=e,r[o+(f<<2)>>2]=d,t=(0|(l=l+1|0))==(0|d),u=6==(0|(c=h+1|0)),0|Lt(a,e)){a=1;break t}if((0|(d=d+(u&t&1)|0))>(0|n)){a=0;break}h=t?u?0:c:h,f=f+1|0,l=t?0:l}else for(h=0,d=1,f=1,l=0,a=t;;){if(!(l|h)){if(0==(0|(a=0|L(a,e,4,A)))&0==(0|(e=0|w()))){a=2;break t}if(0|Lt(a,e)){a=1;break t}}if(0==(0|(a=0|L(a,e,0|r[16+(h<<2)>>2],A)))&0==(0|(e=0|w()))){a=2;break t}if(r[(t=i+(f<<3)|0)>>2]=a,r[t+4>>2]=e,t=(0|(l=l+1|0))==(0|d),u=6==(0|(c=h+1|0)),0|Lt(a,e)){a=1;break t}if((0|(d=d+(u&t&1)|0))>(0|n)){a=0;break}h=t?u?0:c:h,f=f+1|0,l=t?0:l}else a=0}while(0);return I=s,0|(A=a)}function F(t,e,n,i,o,s,a){n|=0,i|=0,o|=0,s|=0,a|=0;var l,c,u=0,h=0,d=0,f=0,A=0;if(c=I,I=I+16|0,l=c,0==(0|(t|=0))&0==(0|(e|=0)))I=c;else{if(u=0|we(0|t,0|e,0|s,((0|s)<0)<<31>>31),w(),!(0==(0|(A=0|r[(f=h=i+(u<<3)|0)>>2]))&0==(0|(f=0|r[f+4>>2]))|(d=(0|A)==(0|t)&(0|f)==(0|e))))do{d=(0|(f=0|r[(A=h=i+((u=(u+1|0)%(0|s)|0)<<3)|0)>>2]))==(0|t)&(0|(A=0|r[A+4>>2]))==(0|e)}while(!(0==(0|f)&0==(0|A)|d));u=o+(u<<2)|0,d&&(0|r[u>>2])<=(0|a)||(r[(A=h)>>2]=t,r[A+4>>2]=e,r[u>>2]=a,(0|a)>=(0|n)||(A=a+1|0,r[l>>2]=0,F(f=0|L(t,e,2,l),0|w(),n,i,o,s,A),r[l>>2]=0,F(f=0|L(t,e,3,l),0|w(),n,i,o,s,A),r[l>>2]=0,F(f=0|L(t,e,1,l),0|w(),n,i,o,s,A),r[l>>2]=0,F(f=0|L(t,e,5,l),0|w(),n,i,o,s,A),r[l>>2]=0,F(f=0|L(t,e,4,l),0|w(),n,i,o,s,A),r[l>>2]=0,F(f=0|L(t,e,6,l),0|w(),n,i,o,s,A))),I=c}}function L(t,e,n,i){t|=0,e|=0,n|=0;var o,s,a=0,l=0,c=0,u=0,h=0,d=0,f=0;if((0|r[(i|=0)>>2])>0){a=0;do{n=0|lt(n),a=a+1|0}while((0|a)<(0|r[i>>2]))}o=0|Ce(0|t,0|e,45),w(),s=127&o,l=0|Ot(t,e),a=0|Ce(0|t,0|e,52),w(),a&=15;t:do{if(a)for(;;){if(d=0|Ce(0|t,0|e,0|(h=3*(15-a|0)|0)),w(),d&=7,f=0==(0|Gt(a)),a=a+-1|0,u=0|Be(7,0,0|h),e&=~w(),t=(h=0|Be(0|r[(f?464:48)+(28*d|0)+(n<<2)>>2],0,0|h))|t&~u,e|=0|w(),!(n=0|r[(f?672:256)+(28*d|0)+(n<<2)>>2])){n=0;break t}if(!a){c=6;break}}else c=6}while(0);6==(0|c)&&(t|=d=0|Be(0|(f=0|r[880+(28*s|0)+(n<<2)>>2]),0,45),e=w()|-1040385&e,n=0|r[4304+(28*s|0)+(n<<2)>>2],127==(127&f)&&(f=0|Be(0|r[880+(28*s|0)+20>>2],0,45),e=w()|-1040385&e,n=0|r[4304+(28*s|0)+20>>2],t=0|kt(f|t,e),e=0|w(),r[i>>2]=1+(0|r[i>>2]))),c=0|Ce(0|t,0|e,45),w(),c&=127;t:do{if(0|R(c)){e:do{if(1==(0|Ot(t,e))){if((0|s)!=(0|c)){if(0|G(c,0|r[7728+(28*s|0)>>2])){t=0|zt(t,e),l=1,e=0|w();break}t=0|kt(t,e),l=1,e=0|w();break}switch(0|l){case 5:t=0|zt(t,e),e=0|w(),r[i>>2]=5+(0|r[i>>2]),l=0;break e;case 3:t=0|kt(t,e),e=0|w(),r[i>>2]=1+(0|r[i>>2]),l=0;break e;default:return f=0,x(0|(d=0)),0|f}}else l=0}while(0);if((0|n)>0){a=0;do{t=0|Rt(t,e),e=0|w(),a=a+1|0}while((0|a)!=(0|n))}if((0|s)!=(0|c)){if(!(0|k(c))){if(0!=(0|l)|5!=(0|Ot(t,e)))break;r[i>>2]=1+(0|r[i>>2]);break}switch(127&o){case 8:case 118:break t}3!=(0|Ot(t,e))&&(r[i>>2]=1+(0|r[i>>2]))}}else if((0|n)>0){a=0;do{t=0|kt(t,e),e=0|w(),a=a+1|0}while((0|a)!=(0|n))}}while(0);return r[i>>2]=((0|r[i>>2])+n|0)%6|0,f=t,x(0|(d=e)),0|f}function O(t,e,n,i,s,a){e|=0,n|=0,i|=0,s|=0,a|=0;var l,c,u,h,d,f,A,p,g,m=0,y=0,v=0,_=0,b=0,x=0,C=0,B=0,E=0,T=0,S=0,M=0,P=0,D=0;if(g=I,I=I+48|0,f=g+32|0,A=g+16|0,p=g,(0|(m=0|r[(t|=0)>>2]))<=0)return I=g,0|(M=0);l=t+4|0,c=f+8|0,u=A+8|0,h=p+8|0,d=((0|e)<0)<<31>>31,S=0;t:for(;;){E=(y=0|r[l>>2])+(S<<4)|0,r[f>>2]=r[E>>2],r[f+4>>2]=r[E+4>>2],r[f+8>>2]=r[E+8>>2],r[f+12>>2]=r[E+12>>2],(0|S)==(m+-1|0)?(r[A>>2]=r[y>>2],r[A+4>>2]=r[y+4>>2],r[A+8>>2]=r[y+8>>2],r[A+12>>2]=r[y+12>>2]):(E=y+(S+1<<4)|0,r[A>>2]=r[E>>2],r[A+4>>2]=r[E+4>>2],r[A+8>>2]=r[E+8>>2],r[A+12>>2]=r[E+12>>2]),E=0|J(f,A,n);e:do{if((0|E)>0){T=+(0|E),B=0;n:for(;;){D=+(E-B|0),P=+(0|B),o[p>>3]=+o[f>>3]*D/T+ +o[A>>3]*P/T,o[h>>3]=+o[c>>3]*D/T+ +o[u>>3]*P/T,y=0|we(0|(x=0|Nt(p,n)),0|(C=0|w()),0|e,0|d),w(),_=0|r[(v=m=a+(y<<3)|0)>>2],v=0|r[v+4>>2];i:do{if(0==(0|_)&0==(0|v))M=14;else for(b=0;;){if((0|b)>(0|e)){m=1;break i}if((0|_)==(0|x)&(0|v)==(0|C)){m=7;break i}if(0==(0|(_=0|r[(v=m=a+((y=(y+1|0)%(0|e)|0)<<3)|0)>>2]))&0==(0|(v=0|r[v+4>>2]))){M=14;break}b=b+1|0}}while(0);switch(14==(0|M)&&(M=0,0==(0|x)&0==(0|C)?m=7:(r[m>>2]=x,r[m+4>>2]=C,m=0|r[i>>2],r[(b=s+(m<<3)|0)>>2]=x,r[b+4>>2]=C,r[i>>2]=m+1,m=0)),7&m){case 7:case 0:break;default:break n}if((0|E)<=(0|(B=B+1|0))){M=8;break e}}if(0|m){m=-1,M=20;break t}}else M=8}while(0);if(8==(0|M)&&(M=0),(0|(S=S+1|0))>=(0|(m=0|r[t>>2]))){m=0,M=20;break}}return 20==(0|M)?(I=g,0|m):0}function R(t){return 0|r[7728+(28*(t|=0)|0)+16>>2]}function k(t){return 4==(0|(t|=0))|117==(0|t)}function U(t){return 0|r[11152+(216*(0|r[(t|=0)>>2])|0)+(72*(0|r[t+4>>2])|0)+(24*(0|r[t+8>>2])|0)+(r[t+12>>2]<<3)>>2]}function z(t){return 0|r[11152+(216*(0|r[(t|=0)>>2])|0)+(72*(0|r[t+4>>2])|0)+(24*(0|r[t+8>>2])|0)+(r[t+12>>2]<<3)+4>>2]}function G(t,e){return e|=0,(0|r[7728+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|r[7728+(28*t|0)+24>>2])==(0|e))}function N(t,e){return 0|r[880+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function Z(t,e){return e|=0,(0|r[880+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|r[880+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|r[880+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|r[880+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|r[880+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|r[880+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|r[880+(28*t|0)+24>>2])==(0|e)?6:7)}function j(t){return+o[(t|=0)+16>>3]<+o[t+24>>3]|0}function V(t,e){t|=0;var n,i,r=0;return(r=+o[(e|=0)>>3])>=+o[t+8>>3]&&r<=+o[t>>3]?(n=+o[t+16>>3],r=+o[t+24>>3],e=(i=+o[e+8>>3])>=r,t=i<=n&1,n<r?e&&(t=1):e||(t=0),0|(e=0!=(0|t))):0|(e=0)}function H(t,e){t|=0,e|=0;var n,i,s,a,c,u,h=0,d=0;a=I,I=I+288|0,n=a+264|0,i=a+96|0,d=(h=s=a)+96|0;do{r[h>>2]=0,h=h+4|0}while((0|h)<(0|d));return Jt(e,s),Vt(d=0|r[(h=s)>>2],h=0|r[h+4>>2],n),Ht(d,h,i),c=+St(n,i+8|0),o[n>>3]=+o[t>>3],o[(h=n+8|0)>>3]=+o[t+16>>3],o[i>>3]=+o[t+8>>3],o[(d=i+8|0)>>3]=+o[t+24>>3],u=+St(n,i),d=~~+y(+u*u/+Ee(+ +l(+(+o[h>>3]-+o[d>>3])/(+o[n>>3]-+o[i>>3])),3)/(c*(2.59807621135*c)*.8)),I=a,0|(0==(0|d)?1:d)}function J(t,e,n){t|=0,e|=0,n|=0;var i,o,s,a,l,c=0,u=0;a=I,I=I+288|0,i=a+264|0,o=a+96|0,u=(c=s=a)+96|0;do{r[c>>2]=0,c=c+4|0}while((0|c)<(0|u));return Jt(n,s),Vt(c=0|r[(u=s)>>2],u=0|r[u+4>>2],i),Ht(c,u,o),l=+St(i,o+8|0),u=~~+y(+ +St(t,e)/(2*l)),I=a,0|(0==(0|u)?1:u)}function W(t,e,n,i){e|=0,n|=0,i|=0,r[(t|=0)>>2]=e,r[t+4>>2]=n,r[t+8>>2]=i}function Q(t,e){t|=0;var n,i,s,a,c=0,u=0,h=0,d=0,f=0,A=0,p=0;r[(a=(e|=0)+8|0)>>2]=0,i=+o[t>>3],d=+l(+i),s=+o[t+8>>3],d+=.5*(f=+l(+s)/.8660254037844386),d-=+(0|(c=~~d)),f-=+(0|(t=~~f));do{if(d<.5){if(d<.3333333333333333){if(r[e>>2]=c,f<.5*(d+1)){r[e+4>>2]=t;break}t=t+1|0,r[e+4>>2]=t;break}if(t=(1&!(f<(p=1-d)))+t|0,r[e+4>>2]=t,p<=f&f<2*d){c=c+1|0,r[e>>2]=c;break}r[e>>2]=c;break}if(!(d<.6666666666666666)){if(c=c+1|0,r[e>>2]=c,f<.5*d){r[e+4>>2]=t;break}t=t+1|0,r[e+4>>2]=t;break}if(f<1-d){if(r[e+4>>2]=t,2*d-1<f){r[e>>2]=c;break}}else t=t+1|0,r[e+4>>2]=t;c=c+1|0,r[e>>2]=c}while(0);do{if(i<0){if(1&t){c=~~(+(0|c)-(2*(+((A=0|_e(0|c,((0|c)<0)<<31>>31,0|(A=(t+1|0)/2|0),((0|A)<0)<<31>>31))>>>0)+4294967296*+(0|w()))+1)),r[e>>2]=c;break}c=~~(+(0|c)-2*(+((A=0|_e(0|c,((0|c)<0)<<31>>31,0|(A=(0|t)/2|0),((0|A)<0)<<31>>31))>>>0)+4294967296*+(0|w()))),r[e>>2]=c;break}}while(0);A=e+4|0,s<0&&(c=c-((1|t<<1)/2|0)|0,r[e>>2]=c,t=0-t|0,r[A>>2]=t),u=t-c|0,(0|c)<0?(h=0-c|0,r[A>>2]=u,r[a>>2]=h,r[e>>2]=0,t=u,c=0):h=0,(0|t)<0&&(c=c-t|0,r[e>>2]=c,h=h-t|0,r[a>>2]=h,r[A>>2]=0,t=0),n=c-h|0,u=t-h|0,(0|h)<0&&(r[e>>2]=n,r[A>>2]=u,r[a>>2]=0,t=u,c=n,h=0),(0|(u=(0|h)<(0|(u=(0|t)<(0|c)?t:c))?h:u))<=0||(r[e>>2]=c-u,r[A>>2]=t-u,r[a>>2]=h-u)}function K(t){var e,n=0,i=0,o=0,s=0,a=0;n=0|r[(t|=0)>>2],i=0|r[(e=t+4|0)>>2],(0|n)<0&&(i=i-n|0,r[e>>2]=i,r[(a=t+8|0)>>2]=(0|r[a>>2])-n,r[t>>2]=0,n=0),(0|i)<0?(n=n-i|0,r[t>>2]=n,s=(0|r[(a=t+8|0)>>2])-i|0,r[a>>2]=s,r[e>>2]=0,i=0):(a=s=t+8|0,s=0|r[s>>2]),(0|s)<0&&(n=n-s|0,r[t>>2]=n,i=i-s|0,r[e>>2]=i,r[a>>2]=0,s=0),(0|(o=(0|s)<(0|(o=(0|i)<(0|n)?i:n))?s:o))<=0||(r[t>>2]=n-o,r[e>>2]=i-o,r[a>>2]=s-o)}function q(t,e){e|=0;var n,i;i=0|r[(t|=0)+8>>2],n=+((0|r[t+4>>2])-i|0),o[e>>3]=+((0|r[t>>2])-i|0)-.5*n,o[e+8>>3]=.8660254037844386*n}function X(t,e,n){t|=0,e|=0,r[(n|=0)>>2]=(0|r[e>>2])+(0|r[t>>2]),r[n+4>>2]=(0|r[e+4>>2])+(0|r[t+4>>2]),r[n+8>>2]=(0|r[e+8>>2])+(0|r[t+8>>2])}function Y(t,e,n){t|=0,e|=0,r[(n|=0)>>2]=(0|r[t>>2])-(0|r[e>>2]),r[n+4>>2]=(0|r[t+4>>2])-(0|r[e+4>>2]),r[n+8>>2]=(0|r[t+8>>2])-(0|r[e+8>>2])}function $(t,e){e|=0;var n,i=0;i=0|v(0|r[(t|=0)>>2],e),r[t>>2]=i,n=0|v(0|r[(i=t+4|0)>>2],e),r[i>>2]=n,e=0|v(0|r[(t=t+8|0)>>2],e),r[t>>2]=e}function tt(t){var e,n,i=0,o=0,s=0,a=0,l=0;l=(0|(n=0|r[(t|=0)>>2]))<0,t=(t=(o=(0|(a=((e=(0|(s=(0|r[t+4>>2])-(l?n:0)|0))<0)?0-s|0:0)+((0|r[t+8>>2])-(l?n:0))|0))<0)?0:a)-((s=(0|(o=(0|t)<(0|(o=(0|(i=(e?0:s)-(o?a:0)|0))<(0|(a=(l?0:n)-(e?s:0)-(o?a:0)|0))?i:a))?t:o))>0)?o:0)|0,i=i-(s?o:0)|0;t:do{switch(a-(s?o:0)|0){case 0:switch(0|i){case 0:return 0|(l=0==(0|t)?0:1==(0|t)?1:7);case 1:return 0|(l=0==(0|t)?2:1==(0|t)?3:7);default:break t}case 1:switch(0|i){case 0:return 0|(l=0==(0|t)?4:1==(0|t)?5:7);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(l=7)}function et(t){var e,n,i=0,o=0,s=0,a=0,l=0;o=0|r[(e=(t|=0)+8|0)>>2],s=0|ge(+((3*(i=(0|r[t>>2])-o|0)|0)-(o=(0|r[(n=t+4|0)>>2])-o|0)|0)/7),r[t>>2]=s,i=0|ge(+((o<<1)+i|0)/7),r[n>>2]=i,r[e>>2]=0,o=i-s|0,(0|s)<0?(l=0-s|0,r[n>>2]=o,r[e>>2]=l,r[t>>2]=0,i=o,s=0,o=l):o=0,(0|i)<0&&(s=s-i|0,r[t>>2]=s,o=o-i|0,r[e>>2]=o,r[n>>2]=0,i=0),l=s-o|0,a=i-o|0,(0|o)<0?(r[t>>2]=l,r[n>>2]=a,r[e>>2]=0,i=a,a=l,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|i)<(0|a)?i:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=i-s,r[e>>2]=o-s)}function nt(t){var e,n,i=0,o=0,s=0,a=0,l=0;o=0|r[(e=(t|=0)+8|0)>>2],s=0|ge(+(((i=(0|r[t>>2])-o|0)<<1)+(o=(0|r[(n=t+4|0)>>2])-o|0)|0)/7),r[t>>2]=s,i=0|ge(+((3*o|0)-i|0)/7),r[n>>2]=i,r[e>>2]=0,o=i-s|0,(0|s)<0?(l=0-s|0,r[n>>2]=o,r[e>>2]=l,r[t>>2]=0,i=o,s=0,o=l):o=0,(0|i)<0&&(s=s-i|0,r[t>>2]=s,o=o-i|0,r[e>>2]=o,r[n>>2]=0,i=0),l=s-o|0,a=i-o|0,(0|o)<0?(r[t>>2]=l,r[n>>2]=a,r[e>>2]=0,i=a,a=l,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|i)<(0|a)?i:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=i-s,r[e>>2]=o-s)}function it(t){var e,n,i,o=0,s=0,a=0,l=0;o=0|r[(t|=0)>>2],s=0|r[(n=t+4|0)>>2],a=0|r[(i=t+8|0)>>2],l=s+(3*o|0)|0,r[t>>2]=l,s=a+(3*s|0)|0,r[n>>2]=s,o=(3*a|0)+o|0,r[i>>2]=o,a=s-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=a,r[i>>2]=o,r[t>>2]=0,s=a,a=0):a=l,(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=l-s,r[i>>2]=o-s)}function rt(t){var e,n,i,o=0,s=0,a=0,l=0;l=0|r[(t|=0)>>2],a=(3*(o=0|r[(n=t+4|0)>>2])|0)+l|0,l=(s=0|r[(i=t+8|0)>>2])+(3*l|0)|0,r[t>>2]=l,r[n>>2]=a,o=(3*s|0)+o|0,r[i>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=s,r[i>>2]=o,r[t>>2]=0,l=0):s=a,(0|s)<0&&(l=l-s|0,r[t>>2]=l,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=l-o|0,a=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=a,r[i>>2]=0,l=e,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|a)<(0|l)?a:l))?o:s))<=0||(r[t>>2]=l-s,r[n>>2]=a-s,r[i>>2]=o-s)}function ot(t,e){t|=0;var n,i,o,s=0,a=0,l=0;((e|=0)+-1|0)>>>0>=6||(l=(0|r[15472+(12*e|0)>>2])+(0|r[t>>2])|0,r[t>>2]=l,o=t+4|0,a=(0|r[15472+(12*e|0)+4>>2])+(0|r[o>>2])|0,r[o>>2]=a,i=t+8|0,e=(0|r[15472+(12*e|0)+8>>2])+(0|r[i>>2])|0,r[i>>2]=e,s=a-l|0,(0|l)<0?(e=e-l|0,r[o>>2]=s,r[i>>2]=e,r[t>>2]=0,a=0):(s=a,a=l),(0|s)<0&&(a=a-s|0,r[t>>2]=a,e=e-s|0,r[i>>2]=e,r[o>>2]=0,s=0),n=a-e|0,l=s-e|0,(0|e)<0?(r[t>>2]=n,r[o>>2]=l,r[i>>2]=0,a=n,e=0):l=s,(0|(s=(0|e)<(0|(s=(0|l)<(0|a)?l:a))?e:s))<=0||(r[t>>2]=a-s,r[o>>2]=l-s,r[i>>2]=e-s))}function st(t){var e,n,i,o=0,s=0,a=0,l=0;l=0|r[(t|=0)>>2],a=(o=0|r[(n=t+4|0)>>2])+l|0,l=(s=0|r[(i=t+8|0)>>2])+l|0,r[t>>2]=l,r[n>>2]=a,o=s+o|0,r[i>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=s,r[i>>2]=o,r[t>>2]=0,a=0):(s=a,a=l),(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=l-s,r[i>>2]=o-s)}function at(t){var e,n,i,o=0,s=0,a=0,l=0;o=0|r[(t|=0)>>2],a=0|r[(n=t+4|0)>>2],s=0|r[(i=t+8|0)>>2],l=a+o|0,r[t>>2]=l,a=s+a|0,r[n>>2]=a,o=s+o|0,r[i>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=s,r[i>>2]=o,r[t>>2]=0,a=0):(s=a,a=l),(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=l-s,r[i>>2]=o-s)}function lt(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function ct(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function ut(t){var e,n,i,o=0,s=0,a=0,l=0;o=0|r[(t|=0)>>2],s=0|r[(n=t+4|0)>>2],a=0|r[(i=t+8|0)>>2],l=s+(o<<1)|0,r[t>>2]=l,s=a+(s<<1)|0,r[n>>2]=s,o=(a<<1)+o|0,r[i>>2]=o,a=s-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=a,r[i>>2]=o,r[t>>2]=0,s=a,a=0):a=l,(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[n>>2]=l-s,r[i>>2]=o-s)}function ht(t){var e,n,i,o=0,s=0,a=0,l=0;l=0|r[(t|=0)>>2],a=((o=0|r[(n=t+4|0)>>2])<<1)+l|0,l=(s=0|r[(i=t+8|0)>>2])+(l<<1)|0,r[t>>2]=l,r[n>>2]=a,o=(s<<1)+o|0,r[i>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[n>>2]=s,r[i>>2]=o,r[t>>2]=0,l=0):s=a,(0|s)<0&&(l=l-s|0,r[t>>2]=l,o=o-s|0,r[i>>2]=o,r[n>>2]=0,s=0),e=l-o|0,a=s-o|0,(0|o)<0?(r[t>>2]=e,r[n>>2]=a,r[i>>2]=0,l=e,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|a)<(0|l)?a:l))?o:s))<=0||(r[t>>2]=l-s,r[n>>2]=a-s,r[i>>2]=o-s)}function dt(t,e){e|=0;var n,i,o,s=0,a=0,l=0;return o=(0|(i=(0|r[(t|=0)>>2])-(0|r[e>>2])|0))<0,n=(0|(a=(0|r[t+4>>2])-(0|r[e+4>>2])-(o?i:0)|0))<0,e=(e=(t=(0|(l=(o?0-i|0:0)+(0|r[t+8>>2])-(0|r[e+8>>2])+(n?0-a|0:0)|0))<0)?0:l)-((a=(0|(t=(0|e)<(0|(t=(0|(s=(n?0:a)-(t?l:0)|0))<(0|(l=(o?0:i)-(n?a:0)-(t?l:0)|0))?s:l))?e:t))>0)?t:0)|0,s=s-(a?t:0)|0,0|((0|(t=(0|(t=l-(a?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(s=(0|s)>-1?s:0-s|0))>(0|(e=(0|e)>-1?e:0-e|0))?s:e))?t:e)}function ft(t,e){e|=0;var n;n=0|r[(t|=0)+8>>2],r[e>>2]=(0|r[t>>2])-n,r[e+4>>2]=(0|r[t+4>>2])-n}function At(t,e){e|=0;var n,i,o,s=0,a=0,l=0;a=0|r[(t|=0)>>2],r[e>>2]=a,t=0|r[t+4>>2],r[(i=e+4|0)>>2]=t,r[(o=e+8|0)>>2]=0,s=t-a|0,(0|a)<0?(t=0-a|0,r[i>>2]=s,r[o>>2]=t,r[e>>2]=0,a=0):(s=t,t=0),(0|s)<0&&(a=a-s|0,r[e>>2]=a,t=t-s|0,r[o>>2]=t,r[i>>2]=0,s=0),n=a-t|0,l=s-t|0,(0|t)<0?(r[e>>2]=n,r[i>>2]=l,r[o>>2]=0,s=l,l=n,t=0):l=a,(0|(a=(0|t)<(0|(a=(0|s)<(0|l)?s:l))?t:a))<=0||(r[e>>2]=l-a,r[i>>2]=s-a,r[o>>2]=t-a)}function pt(t){var e,n,i,o;n=(o=0|r[(e=(t|=0)+8|0)>>2])-(0|r[t>>2])|0,r[t>>2]=n,t=(0|r[(i=t+4|0)>>2])-o|0,r[i>>2]=t,r[e>>2]=0-(t+n)}function gt(t){var e,n,i=0,o=0,s=0,a=0,l=0;i=0-(o=0|r[(t|=0)>>2])|0,r[t>>2]=i,r[(e=t+8|0)>>2]=0,a=(s=0|r[(n=t+4|0)>>2])+o|0,(0|o)>0?(r[n>>2]=a,r[e>>2]=o,r[t>>2]=0,i=0,s=a):o=0,(0|s)<0?(l=i-s|0,r[t>>2]=l,o=o-s|0,r[e>>2]=o,r[n>>2]=0,a=l-o|0,i=0-o|0,(0|o)<0?(r[t>>2]=a,r[n>>2]=i,r[e>>2]=0,s=i,o=0):(s=0,a=l)):a=i,(0|(i=(0|o)<(0|(i=(0|s)<(0|a)?s:a))?o:i))<=0||(r[t>>2]=a-i,r[n>>2]=s-i,r[e>>2]=o-i)}function mt(t,e,n,i){e|=0,n|=0,i|=0;var s,a=0,l=0,c=0,u=0;if(s=I,I=I+32|0,function(t,e){t|=0,e|=0;var n=0,i=0,r=0;n=+o[t>>3],i=+h(+n),n=+d(+n),o[e+16>>3]=n,n=+o[t+8>>3],r=i*+h(+n),o[e>>3]=r,n=i*+d(+n),o[e+8>>3]=n}(t|=0,l=s),r[n>>2]=0,a=+le(15888,l),(c=+le(15912,l))<a&&(r[n>>2]=1,a=c),(c=+le(15936,l))<a&&(r[n>>2]=2,a=c),(c=+le(15960,l))<a&&(r[n>>2]=3,a=c),(c=+le(15984,l))<a&&(r[n>>2]=4,a=c),(c=+le(16008,l))<a&&(r[n>>2]=5,a=c),(c=+le(16032,l))<a&&(r[n>>2]=6,a=c),(c=+le(16056,l))<a&&(r[n>>2]=7,a=c),(c=+le(16080,l))<a&&(r[n>>2]=8,a=c),(c=+le(16104,l))<a&&(r[n>>2]=9,a=c),(c=+le(16128,l))<a&&(r[n>>2]=10,a=c),(c=+le(16152,l))<a&&(r[n>>2]=11,a=c),(c=+le(16176,l))<a&&(r[n>>2]=12,a=c),(c=+le(16200,l))<a&&(r[n>>2]=13,a=c),(c=+le(16224,l))<a&&(r[n>>2]=14,a=c),(c=+le(16248,l))<a&&(r[n>>2]=15,a=c),(c=+le(16272,l))<a&&(r[n>>2]=16,a=c),(c=+le(16296,l))<a&&(r[n>>2]=17,a=c),(c=+le(16320,l))<a&&(r[n>>2]=18,a=c),(c=+le(16344,l))<a&&(r[n>>2]=19,a=c),(c=+A(+(1-.5*a)))<1e-16)return r[i>>2]=0,r[i+4>>2]=0,r[i+8>>2]=0,r[i+12>>2]=0,void(I=s);if(n=0|r[n>>2],a=+Et((a=+o[16368+(24*n|0)>>3])-+Et(+function(t,e){t|=0,e|=0;var n=0,i=0,r=0,s=0,a=0;return s=+o[e>>3],i=+h(+s),r=+o[e+8>>3]-+o[t+8>>3],a=i*+d(+r),n=+o[t>>3],+ +m(+a,+(+d(+s)*+h(+n)-+h(+r)*(i*+d(+n))))}(15568+(n<<4)|0,t))),u=0|Gt(e)?+Et(a+-.3334731722518321):a,a=+f(+c)/.381966011250105,(0|e)>0){l=0;do{a*=2.6457513110645907,l=l+1|0}while((0|l)!=(0|e))}c=+h(+u)*a,o[i>>3]=c,u=+d(+u)*a,o[i+8>>3]=u,I=s}function yt(t,e,n,i,s){e|=0,n|=0,i|=0,s|=0;var a=0,u=0;if(a=+function(t){t|=0;var e=0,n=0;return n=+o[t>>3],e=+o[t+8>>3],+ +c(+(n*n+e*e))}(t|=0),a<1e-16)return e=15568+(e<<4)|0,r[s>>2]=r[e>>2],r[s+4>>2]=r[e+4>>2],r[s+8>>2]=r[e+8>>2],void(r[s+12>>2]=r[e+12>>2]);if(u=+m(+ +o[t+8>>3],+ +o[t>>3]),(0|n)>0){t=0;do{a/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}i?(a/=3,n=0==(0|Gt(n)),a=+g(.381966011250105*(n?a:a/2.6457513110645907))):(a=+g(.381966011250105*a),0|Gt(n)&&(u=+Et(u+.3334731722518321))),function(t,e,n,i){t|=0,e=+e,n=+n,i|=0;var s=0,a=0,c=0,u=0;if(n<1e-16)return r[i>>2]=r[t>>2],r[i+4>>2]=r[t+4>>2],r[i+8>>2]=r[t+8>>2],void(r[i+12>>2]=r[t+12>>2]);a=e<0?e+6.283185307179586:e,a=e>=6.283185307179586?a+-6.283185307179586:a;do{if(!(a<1e-16)){if(s=+l(+(a+-3.141592653589793))<1e-16,e=+o[t>>3],s){e-=n,o[i>>3]=e,s=i;break}if(c=+h(+n),n=+d(+n),e=c*+d(+e)+ +h(+a)*(n*+h(+e)),e=+p(+((e=e>1?1:e)<-1?-1:e)),o[i>>3]=e,+l(+(e+-1.5707963267948966))<1e-16)return o[i>>3]=1.5707963267948966,void(o[i+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return o[i>>3]=-1.5707963267948966,void(o[i+8>>3]=0);if(u=+h(+e),a=n*+d(+a)/u,n=+o[t>>3],e=(c-+d(+e)*+d(+n))/+h(+n)/u,c=a>1?1:a,e=e>1?1:e,(e=+o[t+8>>3]+ +m(+(c<-1?-1:c),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(o[i+8>>3]=e)}e=+o[t>>3]+n,o[i>>3]=e,s=i}while(0);if(+l(+(e+-1.5707963267948966))<1e-16)return o[s>>3]=1.5707963267948966,void(o[i+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return o[s>>3]=-1.5707963267948966,void(o[i+8>>3]=0);if(e=+o[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);o[i+8>>3]=e}(15568+(e<<4)|0,+Et(+o[16368+(24*e|0)>>3]-u),a,s)}function vt(t,e,n){e|=0,n|=0;var i,o;i=I,I=I+16|0,q((t|=0)+4|0,o=i),yt(o,0|r[t>>2],e,0,n),I=i}function _t(t,e,n,i,s){t|=0,e|=0,n|=0,i|=0,s|=0;var a,l,c,u,h,d,f,A,p,g,m,y,v,_,b,x,w,B,E,T,S,M,P=0,D=0,F=0,L=0,O=0,R=0;if(M=I,I=I+272|0,L=M+240|0,E=M,T=M+224|0,S=M+208|0,m=M+176|0,y=M+160|0,v=M+192|0,_=M+144|0,b=M+128|0,x=M+112|0,w=M+96|0,B=M+80|0,r[(P=M+256|0)>>2]=e,r[L>>2]=r[t>>2],r[L+4>>2]=r[t+4>>2],r[L+8>>2]=r[t+8>>2],r[L+12>>2]=r[t+12>>2],bt(L,P,E),r[s>>2]=0,(0|(L=i+n+(5==(0|i)&1)|0))<=(0|n))I=M;else{l=T+4|0,c=m+4|0,u=n+5|0,h=16848+((a=0|r[P>>2])<<2)|0,d=16928+(a<<2)|0,f=b+8|0,A=x+8|0,p=w+8|0,g=S+4|0,F=n;t:for(;;){D=E+((0|F)%5<<4)|0,r[S>>2]=r[D>>2],r[S+4>>2]=r[D+4>>2],r[S+8>>2]=r[D+8>>2],r[S+12>>2]=r[D+12>>2];do{}while(2==(0|xt(S,a,0,1)));if((0|F)>(0|n)&0!=(0|Gt(e))){if(r[m>>2]=r[S>>2],r[m+4>>2]=r[S+4>>2],r[m+8>>2]=r[S+8>>2],r[m+12>>2]=r[S+12>>2],q(l,y),i=0|r[m>>2],P=0|r[17008+(80*i|0)+(r[T>>2]<<2)>>2],r[m>>2]=r[18608+(80*i|0)+(20*P|0)>>2],(0|(D=0|r[18608+(80*i|0)+(20*P|0)+16>>2]))>0){t=0;do{st(c),t=t+1|0}while((0|t)<(0|D))}switch(D=18608+(80*i|0)+(20*P|0)+4|0,r[v>>2]=r[D>>2],r[v+4>>2]=r[D+4>>2],r[v+8>>2]=r[D+8>>2],$(v,3*(0|r[h>>2])|0),X(c,v,c),K(c),q(c,_),O=+(0|r[d>>2]),o[b>>3]=3*O,o[f>>3]=0,R=-1.5*O,o[x>>3]=R,o[A>>3]=2.598076211353316*O,o[w>>3]=R,o[p>>3]=-2.598076211353316*O,0|r[17008+(80*(0|r[m>>2])|0)+(r[S>>2]<<2)>>2]){case 1:t=x,i=b;break;case 3:t=w,i=x;break;case 2:t=b,i=w;break;default:t=12;break t}se(y,_,i,t,B),yt(B,0|r[m>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2])}if((0|F)<(0|u)&&(q(g,m),yt(m,0|r[S>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2])),r[T>>2]=r[S>>2],r[T+4>>2]=r[S+4>>2],r[T+8>>2]=r[S+8>>2],r[T+12>>2]=r[S+12>>2],(0|(F=F+1|0))>=(0|L)){t=3;break}}3!=(0|t)?12==(0|t)&&C(22474,22521,581,22531):I=M}}function bt(t,e,n){t|=0,e|=0,n|=0;var i,o=0,s=0,a=0,l=0,c=0;i=I,I=I+128|0,s=i,l=20208,c=(a=o=i+64|0)+60|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));l=20272,c=(a=s)+60|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));o=(c=0==(0|Gt(0|r[e>>2])))?o:s,ut(s=t+4|0),ht(s),0|Gt(0|r[e>>2])&&(rt(s),r[e>>2]=1+(0|r[e>>2])),r[n>>2]=r[t>>2],X(s,o,e=n+4|0),K(e),r[n+16>>2]=r[t>>2],X(s,o+12|0,e=n+20|0),K(e),r[n+32>>2]=r[t>>2],X(s,o+24|0,e=n+36|0),K(e),r[n+48>>2]=r[t>>2],X(s,o+36|0,e=n+52|0),K(e),r[n+64>>2]=r[t>>2],X(s,o+48|0,n=n+68|0),K(n),I=i}function xt(t,e,n,i){n|=0,i|=0;var o,s,a,l,c,u,h=0,d=0,f=0,A=0,p=0;if(u=I,I=I+32|0,c=u+12|0,s=u,p=(t|=0)+4|0,A=0|r[16928+((e|=0)<<2)>>2],A=(l=0!=(0|i))?3*A|0:A,h=0|r[p>>2],o=0|r[(a=t+8|0)>>2],l){if((0|(h=o+h+(i=0|r[(d=t+12|0)>>2])|0))==(0|A))return I=u,0|(p=1);f=d}else h=o+h+(i=0|r[(f=t+12|0)>>2])|0;if((0|h)<=(0|A))return I=u,0|(p=0);do{if((0|i)>0){if(i=0|r[t>>2],(0|o)>0){d=18608+(80*i|0)+60|0,i=t;break}i=18608+(80*i|0)+40|0,n?(W(c,A,0,0),Y(p,c,s),at(s),X(s,c,p),d=i,i=t):(d=i,i=t)}else d=18608+(80*(0|r[t>>2])|0)+20|0,i=t}while(0);if(r[i>>2]=r[d>>2],(0|r[(h=d+16|0)>>2])>0){i=0;do{st(p),i=i+1|0}while((0|i)<(0|r[h>>2]))}return t=d+4|0,r[c>>2]=r[t>>2],r[c+4>>2]=r[t+4>>2],r[c+8>>2]=r[t+8>>2],e=0|r[16848+(e<<2)>>2],$(c,l?3*e|0:e),X(p,c,p),K(p),i=l&&((0|r[a>>2])+(0|r[p>>2])+(0|r[f>>2])|0)==(0|A)?1:2,I=u,0|(p=i)}function wt(t,e){t|=0,e|=0;var n=0;do{n=0|xt(t,e,0,1)}while(2==(0|n));return 0|n}function Ct(t,e,n,i,s){t|=0,e|=0,n|=0,i|=0,s|=0;var a,l,c,u,h,d,f,A,p,g,m,y,v,_,b,x,w,B,E=0,T=0,S=0,M=0,P=0;if(B=I,I=I+240|0,_=B+208|0,b=B,x=B+192|0,w=B+176|0,p=B+160|0,g=B+144|0,m=B+128|0,y=B+112|0,v=B+96|0,r[(E=B+224|0)>>2]=e,r[_>>2]=r[t>>2],r[_+4>>2]=r[t+4>>2],r[_+8>>2]=r[t+8>>2],r[_+12>>2]=r[t+12>>2],Bt(_,E,b),r[s>>2]=0,(0|(A=i+n+(6==(0|i)&1)|0))<=(0|n))I=B;else{l=n+6|0,c=16928+((a=0|r[E>>2])<<2)|0,u=g+8|0,h=m+8|0,d=y+8|0,f=x+4|0,T=0,S=n,i=-1;t:for(;;){if(t=b+((E=(0|S)%6|0)<<4)|0,r[x>>2]=r[t>>2],r[x+4>>2]=r[t+4>>2],r[x+8>>2]=r[t+8>>2],r[x+12>>2]=r[t+12>>2],t=T,T=0|xt(x,a,0,1),(0|S)>(0|n)&0!=(0|Gt(e))&&(1!=(0|t)&&(0|r[x>>2])!=(0|i))){switch(q(b+((E+5|0)%6<<4)+4|0,w),q(b+(E<<4)+4|0,p),M=+(0|r[c>>2]),o[g>>3]=3*M,o[u>>3]=0,P=-1.5*M,o[m>>3]=P,o[h>>3]=2.598076211353316*M,o[y>>3]=P,o[d>>3]=-2.598076211353316*M,E=0|r[_>>2],0|r[17008+(80*E|0)+(((0|i)==(0|E)?r[x>>2]:i)<<2)>>2]){case 1:t=m,i=g;break;case 3:t=y,i=m;break;case 2:t=g,i=y;break;default:t=8;break t}se(w,p,i,t,v),0|ae(w,v)||0|ae(p,v)||(yt(v,0|r[_>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2]))}if((0|S)<(0|l)&&(q(f,w),yt(w,0|r[x>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2])),(0|(S=S+1|0))>=(0|A)){t=3;break}i=0|r[x>>2]}3!=(0|t)?8==(0|t)&&C(22557,22521,746,22602):I=B}}function Bt(t,e,n){t|=0,e|=0,n|=0;var i,o=0,s=0,a=0,l=0,c=0;i=I,I=I+160|0,s=i,l=20336,c=(a=o=i+80|0)+72|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));l=20416,c=(a=s)+72|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));o=(c=0==(0|Gt(0|r[e>>2])))?o:s,ut(s=t+4|0),ht(s),0|Gt(0|r[e>>2])&&(rt(s),r[e>>2]=1+(0|r[e>>2])),r[n>>2]=r[t>>2],X(s,o,e=n+4|0),K(e),r[n+16>>2]=r[t>>2],X(s,o+12|0,e=n+20|0),K(e),r[n+32>>2]=r[t>>2],X(s,o+24|0,e=n+36|0),K(e),r[n+48>>2]=r[t>>2],X(s,o+36|0,e=n+52|0),K(e),r[n+64>>2]=r[t>>2],X(s,o+48|0,e=n+68|0),K(e),r[n+80>>2]=r[t>>2],X(s,o+60|0,n=n+84|0),K(n),I=i}function Et(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function Tt(t,e){return e|=0,+l(+(+o[(t|=0)>>3]-+o[e>>3]))<17453292519943298e-27?0|(e=+l(+(+o[t+8>>3]-+o[e+8>>3]))<17453292519943298e-27):0|(e=0)}function St(t,e){t|=0;var n,i,r,s=0;return i=+o[(e|=0)>>3],n=+o[t>>3],s=(r=+d(.5*(i-n)))*r+(s=+d(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+h(+i)*+h(+n)*s),2*+m(+ +c(+s),+ +c(+(1-s)))*6371.007180918475}function Mt(t,e,n){t|=0,n|=0;var i,r,s,a,l=0,u=0,A=0,p=0,y=0,v=0;return v=+o[(e|=0)>>3],s=+o[t>>3],y=+d(.5*(v-s)),A=+o[e+8>>3],r=+o[t+8>>3],p=+d(.5*(A-r)),i=+h(+s),a=+h(+v),p=2*+m(+ +c(+(p=y*y+p*(a*i*p))),+ +c(+(1-p))),y=+o[n>>3],v=+d(.5*(y-v)),l=+o[n+8>>3],A=+d(.5*(l-A)),u=+h(+y),A=2*+m(+ +c(+(A=v*v+A*(a*u*A))),+ +c(+(1-A))),y=+d(.5*(s-y)),l=+d(.5*(r-l)),l=2*+m(+ +c(+(l=y*y+l*(i*u*l))),+ +c(+(1-l))),4*+g(+ +c(+ +f(.5*(u=.5*(p+A+l)))*+f(.5*(u-p))*+f(.5*(u-A))*+f(.5*(u-l))))}function It(t,e){return e=0|Ce(0|(t|=0),0|(e|=0),45),w(),127&e}function Pt(t,e){var n=0,i=0,r=0,o=0,s=0,a=0;if(!(!0&134217728==(-16777216&(e|=0))))return 0|(e=0);if(s=0|Ce(0|(t|=0),0|e,45),w(),(s&=127)>>>0>121)return 0|(e=0);n=0|Ce(0|t,0|e,52),w(),n&=15;do{if(0|n){for(r=1,i=0;;){if(o=0|Ce(0|t,0|e,3*(15-r|0)|0),w(),0!=(0|(o&=7))&(1^i)){if(1==(0|o)&0!=(0|R(s))){a=0,i=13;break}i=1}if(7==(0|o)){a=0,i=13;break}if(!(r>>>0<n>>>0)){i=9;break}r=r+1|0}if(9==(0|i)){if(15!=(0|n))break;return 0|(a=1)}if(13==(0|i))return 0|a}}while(0);for(;;){if(a=0|Ce(0|t,0|e,3*(14-n|0)|0),w(),!(7==(7&a)&!0)){a=0,i=13;break}if(!(n>>>0<14)){a=1,i=13;break}n=n+1|0}return 13==(0|i)?0|a:0}function Dt(t,e,n){n|=0;var i=0,r=0;if(i=0|Ce(0|(t|=0),0|(e|=0),52),w(),(0|(i&=15))>=(0|n)){if((0|i)!=(0|n))if(n>>>0<=15){if(t|=r=0|Be(0|n,0,52),e=w()|-15728641&e,(0|i)>(0|n))do{r=0|Be(7,0,3*(14-n|0)|0),n=n+1|0,t|=r,e=w()|e}while((0|n)<(0|i))}else e=0,t=0}else e=0,t=0;return x(0|e),0|t}function Ft(t,e,n,i){n|=0,i|=0;var o,s=0,a=0,l=0,c=0,u=0,h=0;if(l=0|Ce(0|(t|=0),0|(e|=0),52),w(),(0|n)<16&(0|(l&=15))<=(0|n)){if((0|l)==(0|n))return r[(n=i)>>2]=t,void(r[n+4>>2]=e);if(o=(0|(u=0|ee(7,n-l|0)))/7|0,c=0|Ce(0|t,0|e,45),w(),0|R(127&c)){t:do{if(l)for(a=1;;){if(s=0|Ce(0|t,0|e,3*(15-a|0)|0),w(),0|(s&=7))break t;if(!(a>>>0<l>>>0)){s=0;break}a=a+1|0}else s=0}while(0);a=0==(0|s)}else a=0;if(h=0|Be(l+1|0,0,52),s=w()|-15728641&e,Ft(e=(h|t)&~(e=0|Be(7,0,0|(c=3*(14-l|0)|0))),l=s&~w(),n,i),s=i+(o<<3)|0,!a)return Ft((h=0|Be(1,0,0|c))|e,w()|l,n,s),h=s+(o<<3)|0,Ft((u=0|Be(2,0,0|c))|e,w()|l,n,h),h=h+(o<<3)|0,Ft((u=0|Be(3,0,0|c))|e,w()|l,n,h),h=h+(o<<3)|0,Ft((u=0|Be(4,0,0|c))|e,w()|l,n,h),h=h+(o<<3)|0,Ft((u=0|Be(5,0,0|c))|e,w()|l,n,h),void Ft((u=0|Be(6,0,0|c))|e,w()|l,n,h+(o<<3)|0);a=s+(o<<3)|0,(0|u)>6&&(Me(0|s,0,(h=(a>>>0>(u=s+8|0)>>>0?a:u)+-1+(0-s)|0)+8&-8),s=u+(h>>>3<<3)|0),Ft((h=0|Be(2,0,0|c))|e,w()|l,n,s),h=s+(o<<3)|0,Ft((u=0|Be(3,0,0|c))|e,w()|l,n,h),h=h+(o<<3)|0,Ft((u=0|Be(4,0,0|c))|e,w()|l,n,h),h=h+(o<<3)|0,Ft((u=0|Be(5,0,0|c))|e,w()|l,n,h),Ft((u=0|Be(6,0,0|c))|e,w()|l,n,h+(o<<3)|0)}}function Lt(t,e){var n=0,i=0,r=0;if(r=0|Ce(0|(t|=0),0|(e|=0),45),w(),!(0|R(127&r)))return 0|(r=0);r=0|Ce(0|t,0|e,52),w(),r&=15;t:do{if(r)for(i=1;;){if(n=0|Ce(0|t,0|e,3*(15-i|0)|0),w(),0|(n&=7))break t;if(!(i>>>0<r>>>0)){n=0;break}i=i+1|0}else n=0}while(0);return 0|(r=0==(0|n)&1)}function Ot(t,e){var n=0,i=0,r=0;if(r=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(r&=15))return 0|(r=0);for(i=1;;){if(n=0|Ce(0|t,0|e,3*(15-i|0)|0),w(),0|(n&=7)){i=5;break}if(!(i>>>0<r>>>0)){n=0,i=5;break}i=i+1|0}return 5==(0|i)?0|n:0}function Rt(t,e){var n=0,i=0,r=0,o=0,s=0,a=0,l=0;if(l=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(l&=15))return l=t,x(0|(a=e)),0|l;for(a=1,n=0;;){i=0|Be(7,0,0|(o=3*(15-a|0)|0)),r=0|w(),s=0|Ce(0|t,0|e,0|o),w(),t=(o=0|Be(0|lt(7&s),0,0|o))|t&~i,e=(s=0|w())|e&~r;t:do{if(!n)if(0==(o&i)&0==(s&r))n=0;else if(i=0|Ce(0|t,0|e,52),w(),i&=15){n=1;e:for(;;){switch(s=0|Ce(0|t,0|e,3*(15-n|0)|0),w(),7&s){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<i>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(r=0|Ce(0|t,0|e,0|(s=3*(15-n|0)|0)),w(),o=0|Be(7,0,0|s),e&=~w(),t=t&~o|(s=0|Be(0|lt(7&r),0,0|s)),e|=w(),!(n>>>0<i>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(a>>>0<l>>>0))break;a=a+1|0}return x(0|e),0|t}function kt(t,e){var n=0,i=0,r=0,o=0,s=0;if(i=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(i&=15))return i=t,x(0|(n=e)),0|i;for(n=1;s=0|Ce(0|t,0|e,0|(o=3*(15-n|0)|0)),w(),r=0|Be(7,0,0|o),e&=~w(),t=(o=0|Be(0|lt(7&s),0,0|o))|t&~r,e=w()|e,n>>>0<i>>>0;)n=n+1|0;return x(0|e),0|t}function Ut(t,e){var n=0,i=0,r=0,o=0,s=0,a=0,l=0;if(l=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(l&=15))return l=t,x(0|(a=e)),0|l;for(a=1,n=0;;){i=0|Be(7,0,0|(o=3*(15-a|0)|0)),r=0|w(),s=0|Ce(0|t,0|e,0|o),w(),t=(o=0|Be(0|ct(7&s),0,0|o))|t&~i,e=(s=0|w())|e&~r;t:do{if(!n)if(0==(o&i)&0==(s&r))n=0;else if(i=0|Ce(0|t,0|e,52),w(),i&=15){n=1;e:for(;;){switch(s=0|Ce(0|t,0|e,3*(15-n|0)|0),w(),7&s){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<i>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(o=0|Be(7,0,0|(r=3*(15-n|0)|0)),s=e&~w(),e=0|Ce(0|t,0|e,0|r),w(),t=t&~o|(e=0|Be(0|ct(7&e),0,0|r)),e=s|w(),!(n>>>0<i>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(a>>>0<l>>>0))break;a=a+1|0}return x(0|e),0|t}function zt(t,e){var n=0,i=0,r=0,o=0,s=0;if(i=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(i&=15))return i=t,x(0|(n=e)),0|i;for(n=1;o=0|Be(7,0,0|(s=3*(15-n|0)|0)),r=e&~w(),e=0|Ce(0|t,0|e,0|s),w(),t=(e=0|Be(0|ct(7&e),0,0|s))|t&~o,e=w()|r,n>>>0<i>>>0;)n=n+1|0;return x(0|e),0|t}function Gt(t){return(0|(t|=0))%2|0}function Nt(t,e){t|=0;var n,i;return i=I,I=I+16|0,n=i,(e|=0)>>>0<=15&&2146435072!=(2146435072&r[t+4>>2])&&2146435072!=(2146435072&r[t+8+4>>2])?(!function(t,e,n){var i,r;i=I,I=I+16|0,mt(t|=0,e|=0,n|=0,r=i),Q(r,n+4|0),I=i}(t,e,n),e=0|function(t,e){t|=0;var n,i=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0;if(n=I,I=I+64|0,c=n+40|0,o=n+24|0,s=n+12|0,a=n,Be(0|(e|=0),0,52),i=134225919|w(),!e)return(0|r[t+4>>2])>2||(0|r[t+8>>2])>2||(0|r[t+12>>2])>2?(c=0,x(0|(l=0)),I=n,0|c):(Be(0|U(t),0,45),l=w()|i,c=-1,x(0|l),I=n,0|c);if(r[c>>2]=r[t>>2],r[c+4>>2]=r[t+4>>2],r[c+8>>2]=r[t+8>>2],r[c+12>>2]=r[t+12>>2],l=c+4|0,(0|e)>0)for(t=-1;r[o>>2]=r[l>>2],r[o+4>>2]=r[l+4>>2],r[o+8>>2]=r[l+8>>2],1&e?(et(l),r[s>>2]=r[l>>2],r[s+4>>2]=r[l+4>>2],r[s+8>>2]=r[l+8>>2],it(s)):(nt(l),r[s>>2]=r[l>>2],r[s+4>>2]=r[l+4>>2],r[s+8>>2]=r[l+8>>2],rt(s)),Y(o,s,a),K(a),u=0|Be(7,0,0|(h=3*(15-e|0)|0)),i&=~w(),t=(h=0|Be(0|tt(a),0,0|h))|t&~u,i=w()|i,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|r[l>>2])<=2&&(0|r[c+8>>2])<=2&&(0|r[c+12>>2])<=2){if(e=0|Be(0|(o=0|U(c)),0,45),e|=t,t=w()|-1040385&i,a=0|z(c),!(0|R(o))){if((0|a)<=0)break;for(s=0;;){if(o=0|Ce(0|e,0|t,52),w(),o&=15)for(i=1;c=0|Ce(0|e,0|t,0|(h=3*(15-i|0)|0)),w(),u=0|Be(7,0,0|h),t&=~w(),e=e&~u|(h=0|Be(0|lt(7&c),0,0|h)),t|=w(),i>>>0<o>>>0;)i=i+1|0;if((0|(s=s+1|0))==(0|a))break t}}s=0|Ce(0|e,0|t,52),w(),s&=15;e:do{if(s){i=1;n:for(;;){switch(h=0|Ce(0|e,0|t,3*(15-i|0)|0),w(),7&h){case 1:break n;case 0:break;default:break e}if(!(i>>>0<s>>>0))break e;i=i+1|0}if(0|G(o,0|r[c>>2]))for(i=1;u=0|Be(7,0,0|(c=3*(15-i|0)|0)),h=t&~w(),t=0|Ce(0|e,0|t,0|c),w(),e=e&~u|(t=0|Be(0|ct(7&t),0,0|c)),t=h|w(),i>>>0<s>>>0;)i=i+1|0;else for(i=1;c=0|Ce(0|e,0|t,0|(h=3*(15-i|0)|0)),w(),u=0|Be(7,0,0|h),t&=~w(),e=e&~u|(h=0|Be(0|lt(7&c),0,0|h)),t|=w(),i>>>0<s>>>0;)i=i+1|0}}while(0);if((0|a)>0){i=0;do{e=0|Rt(e,t),t=0|w(),i=i+1|0}while((0|i)!=(0|a))}}else e=0,t=0}while(0);return h=e,x(0|(u=t)),I=n,0|h}(n,e),t=0|w()):(t=0,e=0),x(0|t),I=i,0|e}function Zt(t,e,n){var i,o=0,s=0,a=0;if(i=(n|=0)+4|0,s=0|Ce(0|(t|=0),0|(e|=0),52),w(),s&=15,a=0|Ce(0|t,0|e,45),w(),o=0==(0|s),0|R(127&a)){if(o)return 0|(a=1);o=1}else{if(o)return 0|(a=0);o=0==(0|r[i>>2])&&0==(0|r[n+8>>2])?0!=(0|r[n+12>>2])&1:1}for(n=1;1&n?it(i):rt(i),a=0|Ce(0|t,0|e,3*(15-n|0)|0),w(),ot(i,7&a),n>>>0<s>>>0;)n=n+1|0;return 0|o}function jt(t,e,n){n|=0;var i,o,s=0,a=0,l=0,c=0,u=0,h=0;o=I,I=I+16|0,i=o,h=0|Ce(0|(t|=0),0|(e|=0),45),w(),h&=127;t:do{if(0!=(0|R(h))&&(l=0|Ce(0|t,0|e,52),w(),0!=(0|(l&=15)))){s=1;e:for(;;){switch(u=0|Ce(0|t,0|e,3*(15-s|0)|0),w(),7&u){case 5:break e;case 0:break;default:s=e;break t}if(!(s>>>0<l>>>0)){s=e;break t}s=s+1|0}for(a=1,s=e;c=0|Be(7,0,0|(e=3*(15-a|0)|0)),u=s&~w(),s=0|Ce(0|t,0|s,0|e),w(),t=t&~c|(s=0|Be(0|ct(7&s),0,0|e)),s=u|w(),a>>>0<l>>>0;)a=a+1|0}else s=e}while(0);if(u=7728+(28*h|0)|0,r[n>>2]=r[u>>2],r[n+4>>2]=r[u+4>>2],r[n+8>>2]=r[u+8>>2],r[n+12>>2]=r[u+12>>2],0|Zt(t,s,n)){if(c=n+4|0,r[i>>2]=r[c>>2],r[i+4>>2]=r[c+4>>2],r[i+8>>2]=r[c+8>>2],l=0|Ce(0|t,0|s,52),w(),u=15&l,1&l?(rt(c),l=u+1|0):l=u,0|R(h)){t:do{if(u)for(e=1;;){if(a=0|Ce(0|t,0|s,3*(15-e|0)|0),w(),0|(a&=7)){s=a;break t}if(!(e>>>0<u>>>0)){s=0;break}e=e+1|0}else s=0}while(0);s=4==(0|s)&1}else s=0;if(0|xt(n,l,s,0)){if(0|R(h))do{}while(0!=(0|xt(n,l,0,0)));(0|l)!=(0|u)&&nt(c)}else(0|l)!=(0|u)&&(r[c>>2]=r[i>>2],r[c+4>>2]=r[i+4>>2],r[c+8>>2]=r[i+8>>2]);I=o}else I=o}function Vt(t,e,n){n|=0;var i,r;i=I,I=I+16|0,jt(t|=0,e|=0,r=i),e=0|Ce(0|t,0|e,52),w(),vt(r,15&e,n),I=i}function Ht(t,e,n){n|=0;var i,r,o=0,s=0;r=I,I=I+16|0,jt(t|=0,e|=0,i=r),o=0|Ce(0|t,0|e,45),w(),o=0==(0|R(127&o)),s=0|Ce(0|t,0|e,52),w(),s&=15;t:do{if(!o){if(0|s)for(o=1;;){if(!(0==((0|Be(7,0,3*(15-o|0)|0))&t)&0==(w()&e)))break t;if(!(o>>>0<s>>>0))break;o=o+1|0}return _t(i,s,0,5,n),void(I=r)}}while(0);Ct(i,s,0,6,n),I=r}function Jt(t,e){e|=0;var n,i=0,o=0,s=0,a=0,l=0,c=0;if(Be(0|(t|=0),0,52),n=134225919|w(),(0|t)<1){o=0,i=0;do{0|R(o)&&(Be(0|o,0,45),l=n|w(),r[(t=e+(i<<3)|0)>>2]=-1,r[t+4>>2]=l,i=i+1|0),o=o+1|0}while(122!=(0|o))}else{l=0,i=0;do{if(0|R(l)){for(Be(0|l,0,45),o=1,s=-1,a=n|w();s&=~(c=0|Be(7,0,3*(15-o|0)|0)),a&=~w(),(0|o)!=(0|t);)o=o+1|0;r[(c=e+(i<<3)|0)>>2]=s,r[c+4>>2]=a,i=i+1|0}l=l+1|0}while(122!=(0|l))}}function Wt(t,e,n,i){var o,s=0,a=0,l=0,c=0,u=0;if(o=I,I=I+64|0,l=o,(0|(t|=0))==(0|(n|=0))&(0|(e|=0))==(0|(i|=0))|!1|134217728!=(2013265920&e)|!1|134217728!=(2013265920&i))return I=o,0|(l=0);if(s=0|Ce(0|t,0|e,52),w(),s&=15,a=0|Ce(0|n,0|i,52),w(),(0|s)!=(15&a))return I=o,0|(l=0);if(a=s+-1|0,s>>>0>1&&(u=0|Dt(t,e,a),c=0|w(),(0|u)==(0|(a=0|Dt(n,i,a)))&(0|c)==(0|w()))){if(s=0|Ce(0|t,0|e,0|(a=3*(15^s)|0)),w(),s&=7,a=0|Ce(0|n,0|i,0|a),w(),0==(0|s)|0==(0|(a&=7)))return I=o,0|(u=1);if((0|r[21136+(s<<2)>>2])==(0|a))return I=o,0|(u=1);if((0|r[21168+(s<<2)>>2])==(0|a))return I=o,0|(u=1)}a=(s=l)+56|0;do{r[s>>2]=0,s=s+4|0}while((0|s)<(0|a));return P(t,e,1,l),s=(0|r[(u=l)>>2])==(0|n)&&(0|r[u+4>>2])==(0|i)||(0|r[(u=l+8|0)>>2])==(0|n)&&(0|r[u+4>>2])==(0|i)||(0|r[(u=l+16|0)>>2])==(0|n)&&(0|r[u+4>>2])==(0|i)||(0|r[(u=l+24|0)>>2])==(0|n)&&(0|r[u+4>>2])==(0|i)||(0|r[(u=l+32|0)>>2])==(0|n)&&(0|r[u+4>>2])==(0|i)||(0|r[(u=l+40|0)>>2])==(0|n)&&(0|r[u+4>>2])==(0|i)?1:1&((0|r[(s=l+48|0)>>2])==(0|n)?(0|r[s+4>>2])==(0|i):0),I=o,0|(u=s)}function Qt(t,e,n){n|=0;var i,o,s,a,l=0;if(s=I,I=I+16|0,o=s,l=0|Ce(0|(t|=0),0|(e|=0),56),w(),e=0|function(t,e,n){t|=0,e|=0,n|=0;var i=0,o=0;if(i=0|Lt(t,e),(n+-1|0)>>>0>5)return 0|(n=-1);if(o=0!=(0|i),1==(0|n)&o)return 0|(n=-1);return i=0|function(t,e){t|=0,e|=0;var n=0,i=0,o=0,s=0,a=0,l=0,c=0,u=0;if(u=I,I=I+32|0,o=u+16|0,s=u,jt(t,e,o),a=0|It(t,e),c=0|Ot(t,e),function(t,e){t=7728+(28*(t|=0)|0)|0,r[(e|=0)>>2]=r[t>>2],r[e+4>>2]=r[t+4>>2],r[e+8>>2]=r[t+8>>2],r[e+12>>2]=r[t+12>>2]}(a,s),e=0|function(t,e){t|=0;var n=0,i=0;if((e|=0)>>>0>20)return-1;do{if((0|r[11152+(216*e|0)>>2])!=(0|t))if((0|r[11152+(216*e|0)+8>>2])!=(0|t))if((0|r[11152+(216*e|0)+16>>2])!=(0|t))if((0|r[11152+(216*e|0)+24>>2])!=(0|t))if((0|r[11152+(216*e|0)+32>>2])!=(0|t))if((0|r[11152+(216*e|0)+40>>2])!=(0|t))if((0|r[11152+(216*e|0)+48>>2])!=(0|t))if((0|r[11152+(216*e|0)+56>>2])!=(0|t))if((0|r[11152+(216*e|0)+64>>2])!=(0|t))if((0|r[11152+(216*e|0)+72>>2])!=(0|t))if((0|r[11152+(216*e|0)+80>>2])!=(0|t))if((0|r[11152+(216*e|0)+88>>2])!=(0|t))if((0|r[11152+(216*e|0)+96>>2])!=(0|t))if((0|r[11152+(216*e|0)+104>>2])!=(0|t))if((0|r[11152+(216*e|0)+112>>2])!=(0|t))if((0|r[11152+(216*e|0)+120>>2])!=(0|t))if((0|r[11152+(216*e|0)+128>>2])!=(0|t)){if((0|r[11152+(216*e|0)+136>>2])!=(0|t)){if((0|r[11152+(216*e|0)+144>>2])==(0|t)){t=0,n=2,i=0;break}if((0|r[11152+(216*e|0)+152>>2])==(0|t)){t=0,n=2,i=1;break}if((0|r[11152+(216*e|0)+160>>2])==(0|t)){t=0,n=2,i=2;break}if((0|r[11152+(216*e|0)+168>>2])==(0|t)){t=1,n=2,i=0;break}if((0|r[11152+(216*e|0)+176>>2])==(0|t)){t=1,n=2,i=1;break}if((0|r[11152+(216*e|0)+184>>2])==(0|t)){t=1,n=2,i=2;break}if((0|r[11152+(216*e|0)+192>>2])==(0|t)){t=2,n=2,i=0;break}if((0|r[11152+(216*e|0)+200>>2])==(0|t)){t=2,n=2,i=1;break}if((0|r[11152+(216*e|0)+208>>2])==(0|t)){t=2,n=2,i=2;break}return-1}t=2,n=1,i=2}else t=2,n=1,i=1;else t=2,n=1,i=0;else t=1,n=1,i=2;else t=1,n=1,i=1;else t=1,n=1,i=0;else t=0,n=1,i=2;else t=0,n=1,i=1;else t=0,n=1,i=0;else t=2,n=0,i=2;else t=2,n=0,i=1;else t=2,n=0,i=0;else t=1,n=0,i=2;else t=1,n=0,i=1;else t=1,n=0,i=0;else t=0,n=0,i=2;else t=0,n=0,i=1;else t=0,n=0,i=0}while(0);return 0|r[11152+(216*e|0)+(72*n|0)+(24*t|0)+(i<<3)+4>>2]}(a,0|r[o>>2]),!(0|R(a)))return I=u,0|(c=e);switch(0|a){case 4:t=0,n=14;break;case 14:t=1,n=14;break;case 24:t=2,n=14;break;case 38:t=3,n=14;break;case 49:t=4,n=14;break;case 58:t=5,n=14;break;case 63:t=6,n=14;break;case 72:t=7,n=14;break;case 83:t=8,n=14;break;case 97:t=9,n=14;break;case 107:t=10,n=14;break;case 117:t=11,n=14;break;default:l=0,i=0}14==(0|n)&&(l=0|r[22096+(24*t|0)+8>>2],i=0|r[22096+(24*t|0)+16>>2]);t=0|r[o>>2],(0|t)!=(0|r[s>>2])&&(a=0|k(a))|(0|(t=0|r[o>>2]))==(0|i)&&(e=(e+1|0)%6|0);if(3==(0|c)&(0|t)==(0|i))return I=u,0|(c=(e+5|0)%6|0);if(!(5==(0|c)&(0|t)==(0|l)))return I=u,0|(c=e);return c=(e+1|0)%6|0,I=u,0|c}(t,e),o?0|(n=(5-i+(0|r[22384+(n<<2)>>2])|0)%5|0):0|(n=(6-i+(0|r[22416+(n<<2)>>2])|0)%6|0)}(i=(a=!0&268435456==(2013265920&e))?t:0,t=a?-2130706433&e|134217728:0,7&l),-1==(0|e))return r[n>>2]=0,void(I=s);jt(i,t,o),l=0|Ce(0|i,0|t,52),w(),l&=15,0|Lt(i,t)?_t(o,l,e,2,n):Ct(o,l,e,2,n),I=s}function Kt(t){t|=0;var e,n,i=0;return(e=0|ve(1,12))||C(22691,22646,49,22704),0|(i=0|r[(n=t+4|0)>>2])?(r[(i=i+8|0)>>2]=e,r[n>>2]=e,0|e):(0|r[t>>2]&&C(22721,22646,61,22744),r[(i=t)>>2]=e,r[n>>2]=e,0|e)}function qt(t,e){t|=0,e|=0;var n,i;return(i=0|me(24))||C(22758,22646,78,22772),r[i>>2]=r[e>>2],r[i+4>>2]=r[e+4>>2],r[i+8>>2]=r[e+8>>2],r[i+12>>2]=r[e+12>>2],r[i+16>>2]=0,0|(n=0|r[(e=t+4|0)>>2])?(r[n+16>>2]=i,r[e>>2]=i,0|i):(0|r[t>>2]&&C(22787,22646,82,22772),r[t>>2]=i,r[e>>2]=i,0|i)}function Xt(t){var e,n,i=0,s=0,a=0,c=0,u=0,h=0,d=0,f=0,A=0,p=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,w=0,B=0,E=0,T=0,S=0,M=0,I=0,P=0,D=0,F=0,L=0,O=0,R=0;if(0|r[(c=(t|=0)+8|0)>>2])return 0|(R=1);if(!(a=0|r[t>>2]))return 0|(R=0);i=a,s=0;do{s=s+1|0,i=0|r[i+8>>2]}while(0!=(0|i));if(s>>>0<2)return 0|(R=0);(n=0|me(s<<2))||C(22807,22646,317,22826),(e=0|me(s<<5))||C(22848,22646,321,22826),r[t>>2]=0,r[(S=t+4|0)>>2]=0,r[c>>2]=0,s=0,L=0,T=0,g=0;t:for(;;){if(p=0|r[a>>2]){u=0,h=p;do{if(f=+o[h+8>>3],i=h,h=0|r[h+16>>2],d=+o[(c=(A=0==(0|h))?p:h)+8>>3],+l(+(f-d))>3.141592653589793){R=14;break}u+=(d-f)*(+o[i>>3]+ +o[c>>3])}while(!A);if(14==(0|R)){R=0,u=0,i=p;do{E=+o[i+8>>3],D=0|r[(F=i+16|0)>>2],B=+o[(D=0==(0|D)?p:D)+8>>3],u+=(+o[i>>3]+ +o[D>>3])*((B<0?B+6.283185307179586:B)-(E<0?E+6.283185307179586:E)),i=0|r[(0==(0|i)?a:F)>>2]}while(0!=(0|i))}u>0?(r[n+(L<<2)>>2]=a,L=L+1|0,c=T,i=g):R=19}else R=19;if(19==(0|R)){R=0;do{if(!s){if(g){c=S,h=g+8|0,i=a,s=t;break}if(0|r[t>>2]){R=27;break t}c=S,h=t,i=a,s=t;break}if(0|r[(i=s+8|0)>>2]){R=21;break t}if(!(s=0|ve(1,12))){R=23;break t}r[i>>2]=s,c=s+4|0,h=s,i=g}while(0);if(r[h>>2]=a,r[c>>2]=a,h=e+(T<<5)|0,A=0|r[a>>2]){for(o[(p=e+(T<<5)+8|0)>>3]=17976931348623157e292,o[(g=e+(T<<5)+24|0)>>3]=17976931348623157e292,o[h>>3]=-17976931348623157e292,o[(m=e+(T<<5)+16|0)>>3]=-17976931348623157e292,x=17976931348623157e292,w=-17976931348623157e292,c=0,y=A,f=17976931348623157e292,_=17976931348623157e292,b=-17976931348623157e292,d=-17976931348623157e292;u=+o[y>>3],E=+o[y+8>>3],y=0|r[y+16>>2],B=+o[((v=0==(0|y))?A:y)+8>>3],u<f&&(o[p>>3]=u,f=u),E<_&&(o[g>>3]=E,_=E),u>b?o[h>>3]=u:u=b,E>d&&(o[m>>3]=E,d=E),x=E>0&E<x?E:x,w=E<0&E>w?E:w,c|=+l(+(E-B))>3.141592653589793,!v;)b=u;c&&(o[m>>3]=w,o[g>>3]=x)}else r[h>>2]=0,r[h+4>>2]=0,r[h+8>>2]=0,r[h+12>>2]=0,r[h+16>>2]=0,r[h+20>>2]=0,r[h+24>>2]=0,r[h+28>>2]=0;c=T+1|0}if(a=0|r[(F=a+8|0)>>2],r[F>>2]=0,!a){R=45;break}T=c,g=i}if(21==(0|R))C(22624,22646,35,22658);else if(23==(0|R))C(22678,22646,37,22658);else if(27==(0|R))C(22721,22646,61,22744);else if(45==(0|R)){t:do{if((0|L)>0){for(F=0==(0|c),P=c<<2,D=0==(0|t),I=0,i=0;;){if(M=0|r[n+(I<<2)>>2],F)R=73;else{if(!(T=0|me(P))){R=50;break}if(!(S=0|me(P))){R=52;break}e:do{if(D)s=0;else{for(c=0,s=0,h=t;a=e+(c<<5)|0,0|Yt(0|r[h>>2],a,0|r[M>>2])?(r[T+(s<<2)>>2]=h,r[S+(s<<2)>>2]=a,v=s+1|0):v=s,h=0|r[h+8>>2];)c=c+1|0,s=v;if((0|v)>0)if(a=0|r[T>>2],1==(0|v))s=a;else for(m=0,y=-1,s=a,g=a;;){for(A=0|r[g>>2],a=0,h=0;p=(0|(c=0|r[r[T+(h<<2)>>2]>>2]))==(0|A)?a:a+(1&Yt(c,0|r[S+(h<<2)>>2],0|r[A>>2]))|0,(0|(h=h+1|0))!=(0|v);)a=p;if(s=(c=(0|p)>(0|y))?g:s,(0|(a=m+1|0))==(0|v))break e;m=a,y=c?p:y,g=0|r[T+(a<<2)>>2]}else s=0}}while(0);if(ye(T),ye(S),s){if(a=0|r[(c=s+4|0)>>2])s=a+8|0;else if(0|r[s>>2]){R=70;break}r[s>>2]=M,r[c>>2]=M}else R=73}if(73==(0|R)){if(R=0,0|(i=0|r[M>>2]))do{S=i,i=0|r[i+16>>2],ye(S)}while(0!=(0|i));ye(M),i=2}if((0|(I=I+1|0))>=(0|L)){O=i;break t}}50==(0|R)?C(22863,22646,249,22882):52==(0|R)?C(22901,22646,252,22882):70==(0|R)&&C(22721,22646,61,22744)}else O=0}while(0);return ye(n),ye(e),0|(R=O)}return 0}function Yt(t,e,n){t|=0;var i,s=0,a=0,l=0,c=0,u=0,h=0,d=0;if(!(0|V(e|=0,n|=0)))return 0|(t=0);if(e=0|j(e),i=+o[n>>3],s=e&(s=+o[n+8>>3])<0?s+6.283185307179586:s,!(t=0|r[t>>2]))return 0|(t=0);if(e){e=0,n=t;t:for(;;){for(;c=+o[n>>3],h=+o[n+8>>3],d=0|r[(n=n+16|0)>>2],l=+o[(d=0==(0|d)?t:d)>>3],a=+o[d+8>>3],c>l?(u=c,c=h):(u=l,l=c,c=a,a=h),i<l|i>u;)if(!(n=0|r[n>>2])){n=22;break t}if(s=(c=c<0?c+6.283185307179586:c)==s|(h=a<0?a+6.283185307179586:a)==s?s+-2220446049250313e-31:s,((h+=(i-l)/(u-l)*(c-h))<0?h+6.283185307179586:h)>s&&(e^=1),!(n=0|r[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,n=t;t:for(;;){for(;c=+o[n>>3],h=+o[n+8>>3],d=0|r[(n=n+16|0)>>2],l=+o[(d=0==(0|d)?t:d)>>3],a=+o[d+8>>3],c>l?(u=c,c=h):(u=l,l=c,c=a,a=h),i<l|i>u;)if(!(n=0|r[n>>2])){n=22;break t}if(a+(i-l)/(u-l)*(c-a)>(s=c==s|a==s?s+-2220446049250313e-31:s)&&(e^=1),!(n=0|r[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function $t(t,e,n,o,s){n|=0,o|=0,s|=0;var a,l,c,u,h=0,d=0,f=0,A=0,p=0,g=0,m=0,y=0,v=0,_=0;if(u=I,I=I+32|0,_=u+16|0,c=u,h=0|Ce(0|(t|=0),0|(e|=0),52),w(),h&=15,m=0|Ce(0|n,0|o,52),w(),(0|h)!=(15&m))return I=u,0|(_=1);if(p=0|Ce(0|t,0|e,45),w(),p&=127,g=0|Ce(0|n,0|o,45),w(),m=(0|p)!=(0|(g&=127))){if(7==(0|(f=0|Z(p,g))))return I=u,0|(_=2);7==(0|(A=0|Z(g,p)))?C(22925,22949,151,22959):(y=f,d=A)}else y=0,d=0;a=0|R(p),l=0|R(g),r[_>>2]=0,r[_+4>>2]=0,r[_+8>>2]=0,r[_+12>>2]=0;do{if(y){if(f=(0|(g=0|r[4304+(28*p|0)+(y<<2)>>2]))>0,l)if(f){p=0,A=n,f=o;do{A=0|Ut(A,f),f=0|w(),1==(0|(d=0|ct(d)))&&(d=0|ct(1)),p=p+1|0}while((0|p)!=(0|g));g=d,p=A,A=f}else g=d,p=n,A=o;else if(f){p=0,A=n,f=o;do{A=0|zt(A,f),f=0|w(),d=0|ct(d),p=p+1|0}while((0|p)!=(0|g));g=d,p=A,A=f}else g=d,p=n,A=o;if(Zt(p,A,_),m||C(22972,22949,181,22959),(f=0!=(0|a))&(d=0!=(0|l))&&C(22999,22949,182,22959),f){if(d=0|Ot(t,e),0|i[22032+(7*d|0)+y|0]){h=3;break}p=A=0|r[21200+(28*d|0)+(y<<2)>>2],v=26}else if(d){if(d=0|Ot(p,A),0|i[22032+(7*d|0)+g|0]){h=4;break}p=0,A=0|r[21200+(28*g|0)+(d<<2)>>2],v=26}else d=0;if(26==(0|v))if((0|A)<=-1&&C(23030,22949,212,22959),(0|p)<=-1&&C(23053,22949,213,22959),(0|A)>0){f=_+4|0,d=0;do{at(f),d=d+1|0}while((0|d)!=(0|A));d=p}else d=p;if(r[c>>2]=0,r[c+4>>2]=0,r[c+8>>2]=0,ot(c,y),0|h)for(;0|Gt(h)?it(c):rt(c),(0|h)>1;)h=h+-1|0;if((0|d)>0){h=0;do{at(c),h=h+1|0}while((0|h)!=(0|d))}X(v=_+4|0,c,v),K(v),v=50}else if(Zt(n,o,_),0!=(0|a)&0!=(0|l))if((0|g)!=(0|p)&&C(23077,22949,243,22959),d=0|Ot(t,e),h=0|Ot(n,o),0|i[22032+(7*d|0)+h|0])h=5;else if((0|(d=0|r[21200+(28*d|0)+(h<<2)>>2]))>0){f=_+4|0,h=0;do{at(f),h=h+1|0}while((0|h)!=(0|d));v=50}else v=50;else v=50}while(0);return 50==(0|v)&&(h=_+4|0,r[s>>2]=r[h>>2],r[s+4>>2]=r[h+4>>2],r[s+8>>2]=r[h+8>>2],h=0),I=u,0|(_=h)}function te(t,e,n,i){n|=0,i|=0;var o,s,a=0,l=0,c=0,u=0,h=0,d=0,f=0,A=0,p=0,g=0,m=0,y=0,v=0;if(s=I,I=I+48|0,c=s+36|0,u=s+24|0,h=s+12|0,d=s,l=0|Ce(0|(t|=0),0|(e|=0),52),w(),l&=15,A=0|Ce(0|t,0|e,45),w(),o=0|R(A&=127),Be(0|l,0,52),m=134225919|w(),r[(g=i)>>2]=-1,r[g+4>>2]=m,!l)return(0|r[n>>2])>1||(0|r[n+4>>2])>1||(0|r[n+8>>2])>1||127==(0|(a=0|N(A,0|tt(n))))?(I=s,0|(m=1)):(p=0|Be(0|a,0,45),g=0|w(),g=-1040385&r[(A=i)+4>>2]|g,r[(m=i)>>2]=r[A>>2]|p,r[m+4>>2]=g,I=s,0|(m=0));for(r[c>>2]=r[n>>2],r[c+4>>2]=r[n+4>>2],r[c+8>>2]=r[n+8>>2];r[u>>2]=r[c>>2],r[u+4>>2]=r[c+4>>2],r[u+8>>2]=r[c+8>>2],0|Gt(l)?(et(c),r[h>>2]=r[c>>2],r[h+4>>2]=r[c+4>>2],r[h+8>>2]=r[c+8>>2],it(h)):(nt(c),r[h>>2]=r[c>>2],r[h+4>>2]=r[c+4>>2],r[h+8>>2]=r[c+8>>2],rt(h)),Y(u,h,d),K(d),y=0|r[(g=i)>>2],g=0|r[g+4>>2],n=0|Be(7,0,0|(v=3*(15-l|0)|0)),g&=~w(),v=0|Be(0|tt(d),0,0|v),g=w()|g,r[(m=i)>>2]=v|y&~n,r[m+4>>2]=g,(0|l)>1;)l=l+-1|0;t:do{if((0|r[c>>2])<=1&&(0|r[c+4>>2])<=1&&(0|r[c+8>>2])<=1){d=127==(0|(u=0|N(A,l=0|tt(c))))?0:0|R(u);e:do{if(l){if(o){if(c=21408+(28*(0|Ot(t,e))|0)+(l<<2)|0,(0|(c=0|r[c>>2]))>0){n=0;do{l=0|lt(l),n=n+1|0}while((0|n)!=(0|c))}if(1==(0|l)){a=3;break t}127==(0|(n=0|N(A,l)))&&C(23104,22949,376,23134),0|R(n)?C(23147,22949,377,23134):(p=c,f=l,a=n)}else p=0,f=l,a=u;if((0|(h=0|r[4304+(28*A|0)+(f<<2)>>2]))<=-1&&C(23178,22949,384,23134),!d){if((0|p)<=-1&&C(23030,22949,417,23134),0|p){l=0,n=0|r[(c=i)>>2],c=0|r[c+4>>2];do{n=0|kt(n,c),c=0|w(),r[(v=i)>>2]=n,r[v+4>>2]=c,l=l+1|0}while((0|l)<(0|p))}if((0|h)<=0){l=54;break}for(l=0,n=0|r[(c=i)>>2],c=0|r[c+4>>2];;)if(n=0|kt(n,c),c=0|w(),r[(v=i)>>2]=n,r[v+4>>2]=c,(0|(l=l+1|0))==(0|h)){l=54;break e}}if(7==(0|(u=0|Z(a,A)))&&C(22925,22949,393,23134),n=0|r[(l=i)>>2],l=0|r[l+4>>2],(0|h)>0){c=0;do{n=0|kt(n,l),l=0|w(),r[(v=i)>>2]=n,r[v+4>>2]=l,c=c+1|0}while((0|c)!=(0|h))}if(n=0|Ot(n,l),v=0|k(a),(0|(n=0|r[(v?21824:21616)+(28*u|0)+(n<<2)>>2]))<=-1&&C(23030,22949,412,23134),n){l=0,c=0|r[(u=i)>>2],u=0|r[u+4>>2];do{c=0|Rt(c,u),u=0|w(),r[(v=i)>>2]=c,r[v+4>>2]=u,l=l+1|0}while((0|l)<(0|n));l=54}else l=54}else if(0!=(0|o)&0!=(0|d))if(l=21408+(28*(v=0|Ot(t,e))|0)+(Ot(0|r[(l=i)>>2],0|r[l+4>>2])<<2)|0,(0|(l=0|r[l>>2]))<=-1&&C(23201,22949,433,23134),l){a=0,n=0|r[(c=i)>>2],c=0|r[c+4>>2];do{n=0|kt(n,c),c=0|w(),r[(v=i)>>2]=n,r[v+4>>2]=c,a=a+1|0}while((0|a)<(0|l));a=u,l=54}else a=u,l=55;else a=u,l=54}while(0);if(54==(0|l)&&d&&(l=55),55==(0|l)&&1==(0|Ot(0|r[(v=i)>>2],0|r[v+4>>2]))){a=4;break}m=0|r[(v=i)>>2],v=-1040385&r[v+4>>2],y=0|Be(0|a,0,45),v|=w(),r[(a=i)>>2]=m|y,r[a+4>>2]=v,a=0}else a=2}while(0);return I=s,0|(v=a)}function ee(t,e){var n=0;if(!(e|=0))return 0|(n=1);n=t|=0,t=1;do{t=0|v(0==(1&e)?1:n,t),e>>=1,n=0|v(n,n)}while(0!=(0|e));return 0|t}function ne(t,e,n){t|=0;var i,s,a=0,l=0,c=0,u=0,h=0,d=0,f=0,A=0;if(!(0|V(e|=0,n|=0)))return 0|(A=0);if(e=0|j(e),s=+o[n>>3],a=e&(a=+o[n+8>>3])<0?a+6.283185307179586:a,(0|(A=0|r[t>>2]))<=0)return 0|(A=0);if(i=0|r[t+4>>2],e){e=0,n=-1,t=0;t:for(;;){for(f=t;u=+o[i+(f<<4)>>3],d=+o[i+(f<<4)+8>>3],c=+o[i+((t=(n+2|0)%(0|A)|0)<<4)>>3],l=+o[i+(t<<4)+8>>3],u>c?(h=u,u=d):(h=c,c=u,u=l,l=d),s<c|s>h;){if(!((0|(n=f+1|0))<(0|A))){n=22;break t}t=f,f=n,n=t}if(a=(u=u<0?u+6.283185307179586:u)==a|(d=l<0?l+6.283185307179586:l)==a?a+-2220446049250313e-31:a,((d+=(s-c)/(h-c)*(u-d))<0?d+6.283185307179586:d)>a&&(e^=1),(0|(t=f+1|0))>=(0|A)){n=22;break}n=f}if(22==(0|n))return 0|e}else{e=0,n=-1,t=0;t:for(;;){for(f=t;u=+o[i+(f<<4)>>3],d=+o[i+(f<<4)+8>>3],c=+o[i+((t=(n+2|0)%(0|A)|0)<<4)>>3],l=+o[i+(t<<4)+8>>3],u>c?(h=u,u=d):(h=c,c=u,u=l,l=d),s<c|s>h;){if(!((0|(n=f+1|0))<(0|A))){n=22;break t}t=f,f=n,n=t}if(l+(s-c)/(h-c)*(u-l)>(a=u==a|l==a?a+-2220446049250313e-31:a)&&(e^=1),(0|(t=f+1|0))>=(0|A)){n=22;break}n=f}if(22==(0|n))return 0|e}return 0}function ie(t,e){e|=0;var n,i,s,a,c,u=0,h=0,d=0,f=0,A=0,p=0,g=0,m=0,y=0,v=0,_=0,b=0;if(!(i=0|r[(t|=0)>>2]))return r[e>>2]=0,r[e+4>>2]=0,r[e+8>>2]=0,r[e+12>>2]=0,r[e+16>>2]=0,r[e+20>>2]=0,r[e+24>>2]=0,void(r[e+28>>2]=0);if(o[(s=e+8|0)>>3]=17976931348623157e292,o[(a=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(c=e+16|0)>>3]=-17976931348623157e292,!((0|i)<=0)){for(n=0|r[t+4>>2],m=17976931348623157e292,y=-17976931348623157e292,v=0,t=-1,f=17976931348623157e292,A=17976931348623157e292,g=-17976931348623157e292,h=-17976931348623157e292,_=0;u=+o[n+(_<<4)>>3],p=+o[n+(_<<4)+8>>3],d=+o[n+(((0|(t=t+2|0))==(0|i)?0:t)<<4)+8>>3],u<f&&(o[s>>3]=u,f=u),p<A&&(o[a>>3]=p,A=p),u>g?o[e>>3]=u:u=g,p>h&&(o[c>>3]=p,h=p),m=p>0&p<m?p:m,y=p<0&p>y?p:y,v|=+l(+(p-d))>3.141592653589793,(0|(t=_+1|0))!=(0|i);)b=_,g=u,_=t,t=b;v&&(o[c>>3]=y,o[a>>3]=m)}}function re(t,e){e|=0;var n,i=0,s=0,a=0,c=0,u=0,h=0,d=0,f=0,A=0,p=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,w=0,C=0,B=0,E=0;if(y=0|r[(t|=0)>>2]){if(o[(v=e+8|0)>>3]=17976931348623157e292,o[(_=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(b=e+16|0)>>3]=-17976931348623157e292,(0|y)>0){for(a=0|r[t+4>>2],g=17976931348623157e292,m=-17976931348623157e292,s=0,i=-1,d=17976931348623157e292,f=17976931348623157e292,p=-17976931348623157e292,u=-17976931348623157e292,x=0;c=+o[a+(x<<4)>>3],A=+o[a+(x<<4)+8>>3],h=+o[a+(((0|(B=i+2|0))==(0|y)?0:B)<<4)+8>>3],c<d&&(o[v>>3]=c,d=c),A<f&&(o[_>>3]=A,f=A),c>p?o[e>>3]=c:c=p,A>u&&(o[b>>3]=A,u=A),g=A>0&A<g?A:g,m=A<0&A>m?A:m,s|=+l(+(A-h))>3.141592653589793,(0|(i=x+1|0))!=(0|y);)B=x,p=c,x=i,i=B;s&&(o[b>>3]=m,o[_>>3]=g)}}else r[e>>2]=0,r[e+4>>2]=0,r[e+8>>2]=0,r[e+12>>2]=0,r[e+16>>2]=0,r[e+20>>2]=0,r[e+24>>2]=0,r[e+28>>2]=0;if(!((0|(i=0|r[(B=t+8|0)>>2]))<=0)){n=t+12|0,C=0;do{if(a=0|r[n>>2],s=C,_=e+((C=C+1|0)<<5)|0,b=0|r[a+(s<<3)>>2]){if(o[(x=e+(C<<5)+8|0)>>3]=17976931348623157e292,o[(t=e+(C<<5)+24|0)>>3]=17976931348623157e292,o[_>>3]=-17976931348623157e292,o[(w=e+(C<<5)+16|0)>>3]=-17976931348623157e292,(0|b)>0){for(y=0|r[a+(s<<3)+4>>2],g=17976931348623157e292,m=-17976931348623157e292,a=0,s=-1,v=0,d=17976931348623157e292,f=17976931348623157e292,A=-17976931348623157e292,u=-17976931348623157e292;c=+o[y+(v<<4)>>3],p=+o[y+(v<<4)+8>>3],h=+o[y+(((0|(s=s+2|0))==(0|b)?0:s)<<4)+8>>3],c<d&&(o[x>>3]=c,d=c),p<f&&(o[t>>3]=p,f=p),c>A?o[_>>3]=c:c=A,p>u&&(o[w>>3]=p,u=p),g=p>0&p<g?p:g,m=p<0&p>m?p:m,a|=+l(+(p-h))>3.141592653589793,(0|(s=v+1|0))!=(0|b);)E=v,v=s,A=c,s=E;a&&(o[w>>3]=m,o[t>>3]=g)}}else r[_>>2]=0,r[_+4>>2]=0,r[_+8>>2]=0,r[_+12>>2]=0,r[_+16>>2]=0,r[_+20>>2]=0,r[_+24>>2]=0,r[_+28>>2]=0,i=0|r[B>>2]}while((0|C)<(0|i))}}function oe(t,e,n){var i=0,o=0,s=0;if(!(0|ne(t|=0,e|=0,n|=0)))return 0|(o=0);if((0|r[(o=t+8|0)>>2])<=0)return 0|(o=1);for(i=t+12|0,t=0;;){if(s=t,t=t+1|0,0|ne((0|r[i>>2])+(s<<3)|0,e+(t<<5)|0,n)){t=0,i=6;break}if((0|t)>=(0|r[o>>2])){t=1,i=6;break}}return 6==(0|i)?0|t:0}function se(t,e,n,i,r){e|=0,n|=0,i|=0,r|=0;var s,a,l,c,u,h,d,f=0;c=+o[(t|=0)>>3],l=+o[e>>3]-c,a=+o[t+8>>3],s=+o[e+8>>3]-a,h=+o[n>>3],f=((f=+o[i>>3]-h)*(a-(d=+o[n+8>>3]))-(c-h)*(u=+o[i+8>>3]-d))/(l*u-s*f),o[r>>3]=c+l*f,o[r+8>>3]=a+s*f}function ae(t,e){return e|=0,+o[(t|=0)>>3]!=+o[e>>3]?0|(e=0):0|(e=+o[t+8>>3]==+o[e+8>>3])}function le(t,e){e|=0;var n,i,r;return+((r=+o[(t|=0)>>3]-+o[e>>3])*r+(i=+o[t+8>>3]-+o[e+8>>3])*i+(n=+o[t+16>>3]-+o[e+16>>3])*n)}function ce(t,e,n){t|=0,n|=0;var i=0;(0|(e|=0))>0?(i=0|ve(e,4),r[t>>2]=i,i||C(23230,23253,40,23267)):r[t>>2]=0,r[t+4>>2]=e,r[t+8>>2]=0,r[t+12>>2]=n}function ue(t){var e,n,i,s=0,a=0,c=0,h=0;e=(t|=0)+4|0,n=t+12|0,i=t+8|0;t:for(;;){for(a=0|r[e>>2],s=0;;){if((0|s)>=(0|a))break t;if(c=0|r[t>>2],h=0|r[c+(s<<2)>>2])break;s=s+1|0}s=c+(~~(+l(+ +u(10,+ +(15-(0|r[n>>2])|0))*(+o[h>>3]+ +o[h+8>>3]))%+(0|a))>>>0<<2)|0,a=0|r[s>>2];e:do{if(0|a){if(c=h+32|0,(0|a)==(0|h))r[s>>2]=r[c>>2];else{if(!(s=0|r[(a=a+32|0)>>2]))break;for(;(0|s)!=(0|h);)if(!(s=0|r[(a=s+32|0)>>2]))break e;r[a>>2]=r[c>>2]}ye(h),r[i>>2]=(0|r[i>>2])-1}}while(0)}ye(0|r[t>>2])}function he(t){var e,n=0,i=0;for(e=0|r[(t|=0)+4>>2],i=0;;){if((0|i)>=(0|e)){n=0,i=4;break}if(n=0|r[(0|r[t>>2])+(i<<2)>>2]){i=4;break}i=i+1|0}return 4==(0|i)?0|n:0}function de(t,e){e|=0;var n=0,i=0,s=0,a=0;if(n=~~(+l(+ +u(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,n=(0|r[t>>2])+(n<<2)|0,!(i=0|r[n>>2]))return 0|(a=1);a=e+32|0;do{if((0|i)!=(0|e)){if(!(n=0|r[i+32>>2]))return 0|(a=1);for(s=n;;){if((0|s)==(0|e)){s=8;break}if(!(n=0|r[s+32>>2])){n=1,s=10;break}i=s,s=n}if(8==(0|s)){r[i+32>>2]=r[a>>2];break}if(10==(0|s))return 0|n}else r[n>>2]=r[a>>2]}while(0);return ye(e),r[(a=t+8|0)>>2]=(0|r[a>>2])-1,0|(a=0)}function fe(t,e,n){t|=0,e|=0,n|=0;var i,s=0,a=0,c=0;(i=0|me(40))||C(23283,23253,98,23296),r[i>>2]=r[e>>2],r[i+4>>2]=r[e+4>>2],r[i+8>>2]=r[e+8>>2],r[i+12>>2]=r[e+12>>2],r[(a=i+16|0)>>2]=r[n>>2],r[a+4>>2]=r[n+4>>2],r[a+8>>2]=r[n+8>>2],r[a+12>>2]=r[n+12>>2],r[i+32>>2]=0,a=~~(+l(+ +u(10,+ +(15-(0|r[t+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,a=(0|r[t>>2])+(a<<2)|0,s=0|r[a>>2];do{if(s){for(;!(0|Tt(s,e)&&0|Tt(s+16|0,n));)if(a=0|r[s+32>>2],!(0|r[(s=0==(0|a)?s:a)+32>>2])){c=10;break}if(10==(0|c)){r[s+32>>2]=i;break}return ye(i),0|(c=s)}r[a>>2]=i}while(0);return r[(c=t+8|0)>>2]=1+(0|r[c>>2]),0|(c=i)}function Ae(t,e,n){e|=0,n|=0;var i=0,s=0;if(s=~~(+l(+ +u(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,!(s=0|r[(0|r[t>>2])+(s<<2)>>2]))return 0|(n=0);if(!n){for(t=s;;){if(0|Tt(t,e)){i=10;break}if(!(t=0|r[t+32>>2])){t=0,i=10;break}}if(10==(0|i))return 0|t}for(t=s;;){if(0|Tt(t,e)&&0|Tt(t+16|0,n)){i=10;break}if(!(t=0|r[t+32>>2])){t=0,i=10;break}}return 10==(0|i)?0|t:0}function pe(t,e){e|=0;var n=0;if(n=~~(+l(+ +u(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,!(t=0|r[(0|r[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|Tt(t,e)){e=5;break}if(!(t=0|r[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function ge(t){return 0|+function(t){return+ +Ie(+(t=+t))}(t=+t)}function me(t){t|=0;var e,n=0,i=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0,d=0,f=0,A=0,p=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0;e=I,I=I+16|0,A=e;do{if(t>>>0<245){if(t=(h=t>>>0<11?16:t+11&-8)>>>3,3&(i=(f=0|r[5829])>>>t))return o=0|r[(i=(t=23356+((n=(1&i^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(a=0|r[(s=o+8|0)>>2]))==(0|t)?r[5829]=f&~(1<<n):(r[a+12>>2]=t,r[i>>2]=a),x=n<<3,r[o+4>>2]=3|x,r[(x=o+x+4|0)>>2]=1|r[x>>2],I=e,0|(x=s);if(h>>>0>(d=0|r[5831])>>>0){if(0|i)return n=((n=i<<t&((n=2<<t)|0-n))&0-n)-1|0,a=0|r[(t=(n=23356+((o=((i=(n>>>=c=n>>>12&16)>>>5&8)|c|(a=(n>>>=i)>>>2&4)|(t=(n>>>=a)>>>1&2)|(o=(n>>>=t)>>>1&1))+(n>>>o)|0)<<1<<2)|0)+8|0)>>2],(0|(i=0|r[(c=a+8|0)>>2]))==(0|n)?(t=f&~(1<<o),r[5829]=t):(r[i+12>>2]=n,r[t>>2]=i,t=f),l=(x=o<<3)-h|0,r[a+4>>2]=3|h,r[(s=a+h|0)+4>>2]=1|l,r[a+x>>2]=l,0|d&&(o=0|r[5834],i=23356+((n=d>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5829]=t|n,n=i,t=i+8|0),r[t>>2]=o,r[n+12>>2]=o,r[o+8>>2]=n,r[o+12>>2]=i),r[5831]=l,r[5834]=s,I=e,0|(x=c);if(a=0|r[5830]){for(i=(a&0-a)-1|0,i=u=0|r[23620+(((o=(i>>>=s=i>>>12&16)>>>5&8)|s|(l=(i>>>=o)>>>2&4)|(c=(i>>>=l)>>>1&2)|(u=(i>>>=c)>>>1&1))+(i>>>u)<<2)>>2],c=u,u=(-8&r[u+4>>2])-h|0;(t=0|r[i+16>>2])||(t=0|r[i+20>>2]);)i=t,c=(s=(l=(-8&r[t+4>>2])-h|0)>>>0<u>>>0)?t:c,u=s?l:u;if((l=c+h|0)>>>0>c>>>0){s=0|r[c+24>>2],n=0|r[c+12>>2];do{if((0|n)==(0|c)){if(!(n=0|r[(t=c+20|0)>>2])&&!(n=0|r[(t=c+16|0)>>2])){i=0;break}for(;;)if(i=0|r[(o=n+20|0)>>2])n=i,t=o;else{if(!(i=0|r[(o=n+16|0)>>2]))break;n=i,t=o}r[t>>2]=0,i=n}else i=0|r[c+8>>2],r[i+12>>2]=n,r[n+8>>2]=i,i=n}while(0);do{if(0|s){if(n=0|r[c+28>>2],(0|c)==(0|r[(t=23620+(n<<2)|0)>>2])){if(r[t>>2]=i,!i){r[5830]=a&~(1<<n);break}}else if(r[((0|r[(x=s+16|0)>>2])==(0|c)?x:s+20)>>2]=i,!i)break;r[i+24>>2]=s,0|(n=0|r[c+16>>2])&&(r[i+16>>2]=n,r[n+24>>2]=i),0|(n=0|r[c+20>>2])&&(r[i+20>>2]=n,r[n+24>>2]=i)}}while(0);return u>>>0<16?(x=u+h|0,r[c+4>>2]=3|x,r[(x=c+x+4|0)>>2]=1|r[x>>2]):(r[c+4>>2]=3|h,r[l+4>>2]=1|u,r[l+u>>2]=u,0|d&&(o=0|r[5834],i=23356+((n=d>>>3)<<1<<2)|0,(n=1<<n)&f?n=0|r[(t=i+8|0)>>2]:(r[5829]=n|f,n=i,t=i+8|0),r[t>>2]=o,r[n+12>>2]=o,r[o+8>>2]=n,r[o+12>>2]=i),r[5831]=u,r[5834]=l),I=e,0|(x=c+8|0)}f=h}else f=h}else f=h}else if(t>>>0<=4294967231)if(h=-8&(t=t+11|0),o=0|r[5830]){s=0-h|0,u=(t>>>=8)?h>>>0>16777215?31:h>>>((u=14-((c=((m=t<<(f=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|f|(u=((m<<=c)+245760|0)>>>16&2))+(m<<u>>>15)|0)+7|0)&1|u<<1:0,i=0|r[23620+(u<<2)>>2];t:do{if(i)for(t=0,c=h<<(31==(0|u)?0:25-(u>>>1)),a=0;;){if((l=(-8&r[i+4>>2])-h|0)>>>0<s>>>0){if(!l){t=i,s=0,m=65;break t}t=i,s=l}if(a=0==(0|(m=0|r[i+20>>2]))|(0|m)==(0|(i=0|r[i+16+(c>>>31<<2)>>2]))?a:m,!i){i=a,m=61;break}c<<=1}else i=0,t=0,m=61}while(0);if(61==(0|m)){if(0==(0|i)&0==(0|t)){if(!(t=((t=2<<u)|0-t)&o)){f=h;break}f=(t&0-t)-1|0,t=0,i=0|r[23620+(((a=(f>>>=l=f>>>12&16)>>>5&8)|l|(c=(f>>>=a)>>>2&4)|(u=(f>>>=c)>>>1&2)|(i=(f>>>=u)>>>1&1))+(f>>>i)<<2)>>2]}i?m=65:(c=t,l=s)}if(65==(0|m))for(a=i;;){if(s=(i=(f=(-8&r[a+4>>2])-h|0)>>>0<s>>>0)?f:s,t=i?a:t,(i=0|r[a+16>>2])||(i=0|r[a+20>>2]),!i){c=t,l=s;break}a=i}if(0!=(0|c)&&l>>>0<((0|r[5831])-h|0)>>>0&&(d=c+h|0)>>>0>c>>>0){a=0|r[c+24>>2],n=0|r[c+12>>2];do{if((0|n)==(0|c)){if(!(n=0|r[(t=c+20|0)>>2])&&!(n=0|r[(t=c+16|0)>>2])){n=0;break}for(;;)if(i=0|r[(s=n+20|0)>>2])n=i,t=s;else{if(!(i=0|r[(s=n+16|0)>>2]))break;n=i,t=s}r[t>>2]=0}else x=0|r[c+8>>2],r[x+12>>2]=n,r[n+8>>2]=x}while(0);do{if(a){if(t=0|r[c+28>>2],(0|c)==(0|r[(i=23620+(t<<2)|0)>>2])){if(r[i>>2]=n,!n){o&=~(1<<t),r[5830]=o;break}}else if(r[((0|r[(x=a+16|0)>>2])==(0|c)?x:a+20)>>2]=n,!n)break;r[n+24>>2]=a,0|(t=0|r[c+16>>2])&&(r[n+16>>2]=t,r[t+24>>2]=n),(t=0|r[c+20>>2])&&(r[n+20>>2]=t,r[t+24>>2]=n)}}while(0);t:do{if(l>>>0<16)x=l+h|0,r[c+4>>2]=3|x,r[(x=c+x+4|0)>>2]=1|r[x>>2];else{if(r[c+4>>2]=3|h,r[d+4>>2]=1|l,r[d+l>>2]=l,n=l>>>3,l>>>0<256){i=23356+(n<<1<<2)|0,(t=0|r[5829])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5829]=t|n,n=i,t=i+8|0),r[t>>2]=d,r[n+12>>2]=d,r[d+8>>2]=n,r[d+12>>2]=i;break}if(n=23620+((i=(n=l>>>8)?l>>>0>16777215?31:l>>>((i=14-((_=((x=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(i=((x<<=_)+245760|0)>>>16&2))+(x<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,r[d+28>>2]=i,r[(t=d+16|0)+4>>2]=0,r[t>>2]=0,!(o&(t=1<<i))){r[5830]=o|t,r[n>>2]=d,r[d+24>>2]=n,r[d+12>>2]=d,r[d+8>>2]=d;break}n=0|r[n>>2];e:do{if((-8&r[n+4>>2])!=(0|l)){for(o=l<<(31==(0|i)?0:25-(i>>>1));t=0|r[(i=n+16+(o>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|l)){n=t;break e}o<<=1,n=t}r[i>>2]=d,r[d+24>>2]=n,r[d+12>>2]=d,r[d+8>>2]=d;break t}}while(0);x=0|r[(b=n+8|0)>>2],r[x+12>>2]=d,r[b>>2]=d,r[d+8>>2]=x,r[d+12>>2]=n,r[d+24>>2]=0}}while(0);return I=e,0|(x=c+8|0)}f=h}else f=h;else f=-1}while(0);if((i=0|r[5831])>>>0>=f>>>0)return n=i-f|0,t=0|r[5834],n>>>0>15?(x=t+f|0,r[5834]=x,r[5831]=n,r[x+4>>2]=1|n,r[t+i>>2]=n,r[t+4>>2]=3|f):(r[5831]=0,r[5834]=0,r[t+4>>2]=3|i,r[(x=t+i+4|0)>>2]=1|r[x>>2]),I=e,0|(x=t+8|0);if((l=0|r[5832])>>>0>f>>>0)return _=l-f|0,r[5832]=_,b=(x=0|r[5835])+f|0,r[5835]=b,r[b+4>>2]=1|_,r[x+4>>2]=3|f,I=e,0|(x=x+8|0);if(0|r[5947]?t=0|r[5949]:(r[5949]=4096,r[5948]=4096,r[5950]=-1,r[5951]=-1,r[5952]=0,r[5940]=0,r[5947]=-16&A^1431655768,t=4096),c=f+48|0,(h=(a=t+(u=f+47|0)|0)&(s=0-t|0))>>>0<=f>>>0)return I=e,0|(x=0);if(0|(t=0|r[5939])&&(A=(d=0|r[5937])+h|0)>>>0<=d>>>0|A>>>0>t>>>0)return I=e,0|(x=0);t:do{if(4&r[5940])n=0,m=143;else{i=0|r[5835];e:do{if(i){for(o=23764;!((A=0|r[o>>2])>>>0<=i>>>0&&(A+(0|r[o+4>>2])|0)>>>0>i>>>0);){if(!(t=0|r[o+8>>2])){m=128;break e}o=t}if((n=a-l&s)>>>0<2147483647)if((0|(t=0|Pe(0|n)))==((0|r[o>>2])+(0|r[o+4>>2])|0)){if(-1!=(0|t)){l=n,a=t,m=145;break t}}else o=t,m=136;else n=0}else m=128}while(0);do{if(128==(0|m))if(-1!=(0|(i=0|Pe(0)))&&(n=i,g=(n=(0==((g=(p=0|r[5948])+-1|0)&n)?0:(g+n&0-p)-n|0)+h|0)+(p=0|r[5937])|0,n>>>0>f>>>0&n>>>0<2147483647)){if(0|(A=0|r[5939])&&g>>>0<=p>>>0|g>>>0>A>>>0){n=0;break}if((0|(t=0|Pe(0|n)))==(0|i)){l=n,a=i,m=145;break t}o=t,m=136}else n=0}while(0);do{if(136==(0|m)){if(i=0-n|0,!(c>>>0>n>>>0&n>>>0<2147483647&-1!=(0|o))){if(-1==(0|o)){n=0;break}l=n,a=o,m=145;break t}if((t=u-n+(t=0|r[5949])&0-t)>>>0>=2147483647){l=n,a=o,m=145;break t}if(-1==(0|Pe(0|t))){Pe(0|i),n=0;break}l=t+n|0,a=o,m=145;break t}}while(0);r[5940]=4|r[5940],m=143}}while(0);if(143==(0|m)&&h>>>0<2147483647&&!(-1==(0|(_=0|Pe(0|h)))|1^(v=(y=(g=0|Pe(0))-_|0)>>>0>(f+40|0)>>>0)|_>>>0<g>>>0&-1!=(0|_)&-1!=(0|g)^1)&&(l=v?y:n,a=_,m=145),145==(0|m)){n=(0|r[5937])+l|0,r[5937]=n,n>>>0>(0|r[5938])>>>0&&(r[5938]=n),u=0|r[5835];t:do{if(u){for(n=23764;;){if((0|a)==((t=0|r[n>>2])+(i=0|r[n+4>>2])|0)){m=154;break}if(!(o=0|r[n+8>>2]))break;n=o}if(154==(0|m)&&(b=n+4|0,0==(8&r[n+12>>2]))&&a>>>0>u>>>0&t>>>0<=u>>>0){r[b>>2]=i+l,b=u+(_=0==(7&(_=u+8|0))?0:0-_&7)|0,_=(x=(0|r[5832])+l|0)-_|0,r[5835]=b,r[5832]=_,r[b+4>>2]=1|_,r[u+x+4>>2]=40,r[5836]=r[5951];break}for(a>>>0<(0|r[5833])>>>0&&(r[5833]=a),i=a+l|0,n=23764;;){if((0|r[n>>2])==(0|i)){m=162;break}if(!(t=0|r[n+8>>2]))break;n=t}if(162==(0|m)&&0==(8&r[n+12>>2])){r[n>>2]=a,r[(d=n+4|0)>>2]=(0|r[d>>2])+l,h=(d=a+(0==(7&(d=a+8|0))?0:0-d&7)|0)+f|0,c=(n=i+(0==(7&(n=i+8|0))?0:0-n&7)|0)-d-f|0,r[d+4>>2]=3|f;e:do{if((0|u)==(0|n))x=(0|r[5832])+c|0,r[5832]=x,r[5835]=h,r[h+4>>2]=1|x;else{if((0|r[5834])==(0|n)){x=(0|r[5831])+c|0,r[5831]=x,r[5834]=h,r[h+4>>2]=1|x,r[h+x>>2]=x;break}if(1==(3&(t=0|r[n+4>>2]))){l=-8&t,o=t>>>3;n:do{if(t>>>0<256){if(t=0|r[n+8>>2],(0|(i=0|r[n+12>>2]))==(0|t)){r[5829]=r[5829]&~(1<<o);break}r[t+12>>2]=i,r[i+8>>2]=t;break}a=0|r[n+24>>2],t=0|r[n+12>>2];do{if((0|t)==(0|n)){if(t=0|r[(o=(i=n+16|0)+4|0)>>2])i=o;else if(!(t=0|r[i>>2])){t=0;break}for(;;)if(o=0|r[(s=t+20|0)>>2])t=o,i=s;else{if(!(o=0|r[(s=t+16|0)>>2]))break;t=o,i=s}r[i>>2]=0}else x=0|r[n+8>>2],r[x+12>>2]=t,r[t+8>>2]=x}while(0);if(!a)break;o=23620+((i=0|r[n+28>>2])<<2)|0;do{if((0|r[o>>2])==(0|n)){if(r[o>>2]=t,0|t)break;r[5830]=r[5830]&~(1<<i);break n}if(r[((0|r[(x=a+16|0)>>2])==(0|n)?x:a+20)>>2]=t,!t)break n}while(0);if(r[t+24>>2]=a,0|(o=0|r[(i=n+16|0)>>2])&&(r[t+16>>2]=o,r[o+24>>2]=t),!(i=0|r[i+4>>2]))break;r[t+20>>2]=i,r[i+24>>2]=t}while(0);n=n+l|0,s=l+c|0}else s=c;if(r[(n=n+4|0)>>2]=-2&r[n>>2],r[h+4>>2]=1|s,r[h+s>>2]=s,n=s>>>3,s>>>0<256){i=23356+(n<<1<<2)|0,(t=0|r[5829])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5829]=t|n,n=i,t=i+8|0),r[t>>2]=h,r[n+12>>2]=h,r[h+8>>2]=n,r[h+12>>2]=i;break}n=s>>>8;do{if(n){if(s>>>0>16777215){o=31;break}o=s>>>((o=14-((_=((x=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(o=((x<<=_)+245760|0)>>>16&2))+(x<<o>>>15)|0)+7|0)&1|o<<1}else o=0}while(0);if(n=23620+(o<<2)|0,r[h+28>>2]=o,r[(t=h+16|0)+4>>2]=0,r[t>>2]=0,!((t=0|r[5830])&(i=1<<o))){r[5830]=t|i,r[n>>2]=h,r[h+24>>2]=n,r[h+12>>2]=h,r[h+8>>2]=h;break}n=0|r[n>>2];n:do{if((-8&r[n+4>>2])!=(0|s)){for(o=s<<(31==(0|o)?0:25-(o>>>1));t=0|r[(i=n+16+(o>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|s)){n=t;break n}o<<=1,n=t}r[i>>2]=h,r[h+24>>2]=n,r[h+12>>2]=h,r[h+8>>2]=h;break e}}while(0);x=0|r[(b=n+8|0)>>2],r[x+12>>2]=h,r[b>>2]=h,r[h+8>>2]=x,r[h+12>>2]=n,r[h+24>>2]=0}}while(0);return I=e,0|(x=d+8|0)}for(n=23764;!((t=0|r[n>>2])>>>0<=u>>>0&&(x=t+(0|r[n+4>>2])|0)>>>0>u>>>0);)n=0|r[n+8>>2];n=(t=(t=(s=x+-47|0)+(0==(7&(t=s+8|0))?0:0-t&7)|0)>>>0<(s=u+16|0)>>>0?u:t)+8|0,b=a+(_=0==(7&(_=a+8|0))?0:0-_&7)|0,_=(i=l+-40|0)-_|0,r[5835]=b,r[5832]=_,r[b+4>>2]=1|_,r[a+i+4>>2]=40,r[5836]=r[5951],r[(i=t+4|0)>>2]=27,r[n>>2]=r[5941],r[n+4>>2]=r[5942],r[n+8>>2]=r[5943],r[n+12>>2]=r[5944],r[5941]=a,r[5942]=l,r[5944]=0,r[5943]=n,n=t+24|0;do{b=n,r[(n=n+4|0)>>2]=7}while((b+8|0)>>>0<x>>>0);if((0|t)!=(0|u)){if(a=t-u|0,r[i>>2]=-2&r[i>>2],r[u+4>>2]=1|a,r[t>>2]=a,n=a>>>3,a>>>0<256){i=23356+(n<<1<<2)|0,(t=0|r[5829])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5829]=t|n,n=i,t=i+8|0),r[t>>2]=u,r[n+12>>2]=u,r[u+8>>2]=n,r[u+12>>2]=i;break}if(i=23620+((o=(n=a>>>8)?a>>>0>16777215?31:a>>>((o=14-((_=((x=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(o=((x<<=_)+245760|0)>>>16&2))+(x<<o>>>15)|0)+7|0)&1|o<<1:0)<<2)|0,r[u+28>>2]=o,r[u+20>>2]=0,r[s>>2]=0,!((n=0|r[5830])&(t=1<<o))){r[5830]=n|t,r[i>>2]=u,r[u+24>>2]=i,r[u+12>>2]=u,r[u+8>>2]=u;break}n=0|r[i>>2];e:do{if((-8&r[n+4>>2])!=(0|a)){for(o=a<<(31==(0|o)?0:25-(o>>>1));t=0|r[(i=n+16+(o>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|a)){n=t;break e}o<<=1,n=t}r[i>>2]=u,r[u+24>>2]=n,r[u+12>>2]=u,r[u+8>>2]=u;break t}}while(0);x=0|r[(b=n+8|0)>>2],r[x+12>>2]=u,r[b>>2]=u,r[u+8>>2]=x,r[u+12>>2]=n,r[u+24>>2]=0}}else 0==(0|(x=0|r[5833]))|a>>>0<x>>>0&&(r[5833]=a),r[5941]=a,r[5942]=l,r[5944]=0,r[5838]=r[5947],r[5837]=-1,r[5842]=23356,r[5841]=23356,r[5844]=23364,r[5843]=23364,r[5846]=23372,r[5845]=23372,r[5848]=23380,r[5847]=23380,r[5850]=23388,r[5849]=23388,r[5852]=23396,r[5851]=23396,r[5854]=23404,r[5853]=23404,r[5856]=23412,r[5855]=23412,r[5858]=23420,r[5857]=23420,r[5860]=23428,r[5859]=23428,r[5862]=23436,r[5861]=23436,r[5864]=23444,r[5863]=23444,r[5866]=23452,r[5865]=23452,r[5868]=23460,r[5867]=23460,r[5870]=23468,r[5869]=23468,r[5872]=23476,r[5871]=23476,r[5874]=23484,r[5873]=23484,r[5876]=23492,r[5875]=23492,r[5878]=23500,r[5877]=23500,r[5880]=23508,r[5879]=23508,r[5882]=23516,r[5881]=23516,r[5884]=23524,r[5883]=23524,r[5886]=23532,r[5885]=23532,r[5888]=23540,r[5887]=23540,r[5890]=23548,r[5889]=23548,r[5892]=23556,r[5891]=23556,r[5894]=23564,r[5893]=23564,r[5896]=23572,r[5895]=23572,r[5898]=23580,r[5897]=23580,r[5900]=23588,r[5899]=23588,r[5902]=23596,r[5901]=23596,r[5904]=23604,r[5903]=23604,b=a+(_=0==(7&(_=a+8|0))?0:0-_&7)|0,_=(x=l+-40|0)-_|0,r[5835]=b,r[5832]=_,r[b+4>>2]=1|_,r[a+x+4>>2]=40,r[5836]=r[5951]}while(0);if((n=0|r[5832])>>>0>f>>>0)return _=n-f|0,r[5832]=_,b=(x=0|r[5835])+f|0,r[5835]=b,r[b+4>>2]=1|_,r[x+4>>2]=3|f,I=e,0|(x=x+8|0)}return r[(x=23312)>>2]=12,I=e,0|(x=0)}function ye(t){var e=0,n=0,i=0,o=0,s=0,a=0,l=0,c=0;if(t|=0){n=t+-8|0,o=0|r[5833],c=n+(e=-8&(t=0|r[t+-4>>2]))|0;do{if(1&t)l=n,a=n;else{if(i=0|r[n>>2],!(3&t))return;if(s=i+e|0,(a=n+(0-i)|0)>>>0<o>>>0)return;if((0|r[5834])==(0|a)){if(3!=(3&(e=0|r[(t=c+4|0)>>2]))){l=a,e=s;break}return r[5831]=s,r[t>>2]=-2&e,r[a+4>>2]=1|s,void(r[a+s>>2]=s)}if(n=i>>>3,i>>>0<256){if(t=0|r[a+8>>2],(0|(e=0|r[a+12>>2]))==(0|t)){r[5829]=r[5829]&~(1<<n),l=a,e=s;break}r[t+12>>2]=e,r[e+8>>2]=t,l=a,e=s;break}o=0|r[a+24>>2],t=0|r[a+12>>2];do{if((0|t)==(0|a)){if(t=0|r[(n=(e=a+16|0)+4|0)>>2])e=n;else if(!(t=0|r[e>>2])){t=0;break}for(;;)if(n=0|r[(i=t+20|0)>>2])t=n,e=i;else{if(!(n=0|r[(i=t+16|0)>>2]))break;t=n,e=i}r[e>>2]=0}else l=0|r[a+8>>2],r[l+12>>2]=t,r[t+8>>2]=l}while(0);if(o){if(e=0|r[a+28>>2],(0|r[(n=23620+(e<<2)|0)>>2])==(0|a)){if(r[n>>2]=t,!t){r[5830]=r[5830]&~(1<<e),l=a,e=s;break}}else if(r[((0|r[(l=o+16|0)>>2])==(0|a)?l:o+20)>>2]=t,!t){l=a,e=s;break}r[t+24>>2]=o,0|(n=0|r[(e=a+16|0)>>2])&&(r[t+16>>2]=n,r[n+24>>2]=t),(e=0|r[e+4>>2])?(r[t+20>>2]=e,r[e+24>>2]=t,l=a,e=s):(l=a,e=s)}else l=a,e=s}}while(0);if(!(a>>>0>=c>>>0)&&1&(i=0|r[(t=c+4|0)>>2])){if(2&i)r[t>>2]=-2&i,r[l+4>>2]=1|e,r[a+e>>2]=e,o=e;else{if((0|r[5835])==(0|c)){if(c=(0|r[5832])+e|0,r[5832]=c,r[5835]=l,r[l+4>>2]=1|c,(0|l)!=(0|r[5834]))return;return r[5834]=0,void(r[5831]=0)}if((0|r[5834])==(0|c))return c=(0|r[5831])+e|0,r[5831]=c,r[5834]=a,r[l+4>>2]=1|c,void(r[a+c>>2]=c);o=(-8&i)+e|0,n=i>>>3;do{if(i>>>0<256){if(e=0|r[c+8>>2],(0|(t=0|r[c+12>>2]))==(0|e)){r[5829]=r[5829]&~(1<<n);break}r[e+12>>2]=t,r[t+8>>2]=e;break}s=0|r[c+24>>2],t=0|r[c+12>>2];do{if((0|t)==(0|c)){if(t=0|r[(n=(e=c+16|0)+4|0)>>2])e=n;else if(!(t=0|r[e>>2])){n=0;break}for(;;)if(n=0|r[(i=t+20|0)>>2])t=n,e=i;else{if(!(n=0|r[(i=t+16|0)>>2]))break;t=n,e=i}r[e>>2]=0,n=t}else n=0|r[c+8>>2],r[n+12>>2]=t,r[t+8>>2]=n,n=t}while(0);if(0|s){if(t=0|r[c+28>>2],(0|r[(e=23620+(t<<2)|0)>>2])==(0|c)){if(r[e>>2]=n,!n){r[5830]=r[5830]&~(1<<t);break}}else if(r[((0|r[(i=s+16|0)>>2])==(0|c)?i:s+20)>>2]=n,!n)break;r[n+24>>2]=s,0|(e=0|r[(t=c+16|0)>>2])&&(r[n+16>>2]=e,r[e+24>>2]=n),0|(t=0|r[t+4>>2])&&(r[n+20>>2]=t,r[t+24>>2]=n)}}while(0);if(r[l+4>>2]=1|o,r[a+o>>2]=o,(0|l)==(0|r[5834]))return void(r[5831]=o)}if(t=o>>>3,o>>>0<256)return n=23356+(t<<1<<2)|0,(e=0|r[5829])&(t=1<<t)?t=0|r[(e=n+8|0)>>2]:(r[5829]=e|t,t=n,e=n+8|0),r[e>>2]=l,r[t+12>>2]=l,r[l+8>>2]=t,void(r[l+12>>2]=n);t=23620+((i=(t=o>>>8)?o>>>0>16777215?31:o>>>((i=14-((s=((c=t<<(a=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|a|(i=((c<<=s)+245760|0)>>>16&2))+(c<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,r[l+28>>2]=i,r[l+20>>2]=0,r[l+16>>2]=0,e=0|r[5830],n=1<<i;t:do{if(e&n){t=0|r[t>>2];e:do{if((-8&r[t+4>>2])!=(0|o)){for(i=o<<(31==(0|i)?0:25-(i>>>1));e=0|r[(n=t+16+(i>>>31<<2)|0)>>2];){if((-8&r[e+4>>2])==(0|o)){t=e;break e}i<<=1,t=e}r[n>>2]=l,r[l+24>>2]=t,r[l+12>>2]=l,r[l+8>>2]=l;break t}}while(0);c=0|r[(a=t+8|0)>>2],r[c+12>>2]=l,r[a>>2]=l,r[l+8>>2]=c,r[l+12>>2]=t,r[l+24>>2]=0}else r[5830]=e|n,r[t>>2]=l,r[l+24>>2]=t,r[l+12>>2]=l,r[l+8>>2]=l}while(0);if(c=(0|r[5837])-1|0,r[5837]=c,!(0|c)){for(t=23772;t=0|r[t>>2];)t=t+8|0;r[5837]=-1}}}}function ve(t,e){e|=0;var n=0;return(t|=0)?(n=0|v(e,t),(e|t)>>>0>65535&&(n=((n>>>0)/(t>>>0)|0)==(0|e)?n:-1)):n=0,(t=0|me(n))&&3&r[t+-4>>2]?(Me(0|t,0,0|n),0|t):0|t}function _e(t,e,n,i){return 0|(x(0|(i=(e|=0)-(i|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function be(t){return 0|((t|=0)?31-(0|b(t^t-1)):32)}function xe(t,e,n,i,o){o|=0;var s=0,a=0,l=0,c=0,u=0,h=0,d=0,f=0,A=0,p=0;if(h=t|=0,a=n|=0,l=f=i|=0,!(u=c=e|=0))return s=0!=(0|o),l?s?(r[o>>2]=0|t,r[o+4>>2]=0,o=0,0|(x(0|(f=0)),o)):(o=0,0|(x(0|(f=0)),o)):(s&&(r[o>>2]=(h>>>0)%(a>>>0),r[o+4>>2]=0),o=(h>>>0)/(a>>>0)>>>0,0|(x(0|(f=0)),o));s=0==(0|l);do{if(a){if(!s){if((s=(0|b(0|l))-(0|b(0|u))|0)>>>0<=31){a=d=s+1|0,t=h>>>(d>>>0)&(e=s-31>>31)|u<<(l=31-s|0),e&=u>>>(d>>>0),s=0,l=h<<l;break}return o?(r[o>>2]=0|t,r[o+4>>2]=0|c,o=0,0|(x(0|(f=0)),o)):(o=0,0|(x(0|(f=0)),o))}if((s=a-1|0)&a){a=l=33+(0|b(0|a))-(0|b(0|u))|0,t=(d=32-l|0)-1>>31&u>>>((A=l-32|0)>>>0)|(u<<d|h>>>(l>>>0))&(e=A>>31),e&=u>>>(l>>>0),s=h<<(p=64-l|0)&(c=d>>31),l=(u<<p|h>>>(A>>>0))&c|h<<d&l-33>>31;break}return 0|o&&(r[o>>2]=s&h,r[o+4>>2]=0),1==(0|a)?(p=0|t,0|(x(0|(A=0|c)),p)):(A=u>>>((p=0|be(0|a))>>>0)|0,p=u<<32-p|h>>>(p>>>0),0|(x(0|A),p))}if(s)return 0|o&&(r[o>>2]=(u>>>0)%(a>>>0),r[o+4>>2]=0),p=(u>>>0)/(a>>>0)>>>0,0|(x(0|(A=0)),p);if(!h)return 0|o&&(r[o>>2]=0,r[o+4>>2]=(u>>>0)%(l>>>0)),p=(u>>>0)/(l>>>0)>>>0,0|(x(0|(A=0)),p);if(!((s=l-1|0)&l))return 0|o&&(r[o>>2]=0|t,r[o+4>>2]=s&u),A=0,p=u>>>((0|be(0|l))>>>0),0|(x(0|A),p);if((s=(0|b(0|l))-(0|b(0|u))|0)>>>0<=30){a=e=s+1|0,t=u<<(l=31-s|0)|h>>>(e>>>0),e=u>>>(e>>>0),s=0,l=h<<l;break}return o?(r[o>>2]=0|t,r[o+4>>2]=0|c,p=0,0|(x(0|(A=0)),p)):(p=0,0|(x(0|(A=0)),p))}while(0);if(a){u=0|function(t,e,n,i){return 0|(x((e|=0)+(i|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}(0|(d=0|n),0|(h=0|f),-1,-1),n=0|w(),c=l,l=0;do{i=c,c=s>>>31|c<<1,s=l|s<<1,_e(0|u,0|n,0|(i=t<<1|i>>>31),0|(f=t>>>31|e<<1)),l=1&(A=(p=0|w())>>31|((0|p)<0?-1:0)<<1),t=0|_e(0|i,0|f,A&d,(((0|p)<0?-1:0)>>31|((0|p)<0?-1:0)<<1)&h),e=0|w(),a=a-1|0}while(0!=(0|a));u=c,c=0}else u=l,c=0,l=0;return a=0,0|o&&(r[o>>2]=t,r[o+4>>2]=e),p=s<<1&-2|l,0|(x(0|(A=(0|s)>>>31|(u|a)<<1|c)),p)}function we(t,e,n,i){var o,s;return s=I,I=I+16|0,xe(t|=0,e|=0,n|=0,i|=0,o=0|s),I=s,0|(x(0|r[o+4>>2]),r[o>>2])}function Ce(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(x(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(x(0),e>>>n-32|0)}function Be(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(x(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(x(t<<n-32),0)}function Ee(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+_(+t,+e)}function Te(t){return(t=+t)>=0?+a(t+.5):+y(t-.5)}function Se(t,e,n){t|=0,e|=0;var o,s,a=0;if((0|(n|=0))>=8192)return T(0|t,0|e,0|n),0|t;if(s=0|t,o=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|s;i[t|0]=0|i[e|0],t=t+1|0,e=e+1|0,n=n-1|0}for(a=(n=-4&o)-64|0;(0|t)<=(0|a);)r[t>>2]=r[e>>2],r[t+4>>2]=r[e+4>>2],r[t+8>>2]=r[e+8>>2],r[t+12>>2]=r[e+12>>2],r[t+16>>2]=r[e+16>>2],r[t+20>>2]=r[e+20>>2],r[t+24>>2]=r[e+24>>2],r[t+28>>2]=r[e+28>>2],r[t+32>>2]=r[e+32>>2],r[t+36>>2]=r[e+36>>2],r[t+40>>2]=r[e+40>>2],r[t+44>>2]=r[e+44>>2],r[t+48>>2]=r[e+48>>2],r[t+52>>2]=r[e+52>>2],r[t+56>>2]=r[e+56>>2],r[t+60>>2]=r[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)r[t>>2]=r[e>>2],t=t+4|0,e=e+4|0}else for(n=o-4|0;(0|t)<(0|n);)i[t|0]=0|i[e|0],i[t+1|0]=0|i[e+1|0],i[t+2|0]=0|i[e+2|0],i[t+3|0]=0|i[e+3|0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|o);)i[t|0]=0|i[e|0],t=t+1|0,e=e+1|0;return 0|s}function Me(t,e,n){e|=0;var o,s=0,a=0,l=0;if(o=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)i[t|0]=e,t=t+1|0;for(l=e|e<<8|e<<16|e<<24,a=(s=-4&o)-64|0;(0|t)<=(0|a);)r[t>>2]=l,r[t+4>>2]=l,r[t+8>>2]=l,r[t+12>>2]=l,r[t+16>>2]=l,r[t+20>>2]=l,r[t+24>>2]=l,r[t+28>>2]=l,r[t+32>>2]=l,r[t+36>>2]=l,r[t+40>>2]=l,r[t+44>>2]=l,r[t+48>>2]=l,r[t+52>>2]=l,r[t+56>>2]=l,r[t+60>>2]=l,t=t+64|0;for(;(0|t)<(0|s);)r[t>>2]=l,t=t+4|0}for(;(0|t)<(0|o);)i[t|0]=e,t=t+1|0;return o-n|0}function Ie(t){return(t=+t)>=0?+a(t+.5):+y(t-.5)}function Pe(t){t|=0;var e,n,i;return i=0|E(),(0|t)>0&(0|(e=(n=0|r[s>>2])+t|0))<(0|n)|(0|e)<0?(M(0|e),B(12),-1):(0|e)>(0|i)&&!(0|S(0|e))?(B(12),-1):(r[s>>2]=e,0|n)}return{___uremdi3:we,_bitshift64Lshr:Ce,_bitshift64Shl:Be,_calloc:ve,_cellAreaKm2:function(t,e){var n,i,o,s=0;if(o=I,I=I+192|0,i=o,Vt(t|=0,e|=0,n=o+168|0),Ht(t,e,i),(0|(e=0|r[i>>2]))>0){if(s=+Mt(i+8|0,i+8+((1!=(0|e)&1)<<4)|0,n)+0,1!=(0|e)){t=1;do{s+=+Mt(i+8+(t<<4)|0,i+8+((0|(t=t+1|0))%(0|e)<<4)|0,n)}while((0|t)<(0|e))}}else s=0;return I=o,6371.007180918475*s*6371.007180918475},_cellAreaM2:function(t,e){var n,i,o,s=0;if(o=I,I=I+192|0,i=o,Vt(t|=0,e|=0,n=o+168|0),Ht(t,e,i),(0|(e=0|r[i>>2]))>0){if(s=+Mt(i+8|0,i+8+((1!=(0|e)&1)<<4)|0,n)+0,1!=(0|e)){t=1;do{s+=+Mt(i+8+(t<<4)|0,i+8+((0|(t=t+1|0))%(0|e)<<4)|0,n)}while((0|t)<(0|e))}}else s=0;return I=o,6371.007180918475*s*6371.007180918475*1e3*1e3},_cellAreaRads2:function(t,e){var n,i,o,s=0;if(o=I,I=I+192|0,i=o,Vt(t|=0,e|=0,n=o+168|0),Ht(t,e,i),(0|(e=0|r[i>>2]))<=0)return I=o,+(s=0);if(s=+Mt(i+8|0,i+8+((1!=(0|e)&1)<<4)|0,n)+0,1==(0|e))return I=o,+s;t=1;do{s+=+Mt(i+8+(t<<4)|0,i+8+((0|(t=t+1|0))%(0|e)<<4)|0,n)}while((0|t)<(0|e));return I=o,+s},_compact:function(t,e,n){e|=0;var i,o=0,s=0,a=0,l=0,c=0,u=0,h=0,d=0,f=0,A=0,p=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,C=0,B=0,E=0;if(!(n|=0))return 0|(B=0);if(o=0|r[(s=t|=0)>>2],!0&0==(15728640&(s=0|r[s+4>>2]))){if((0|n)<=0)return 0|(B=0);if(r[(B=e)>>2]=o,r[B+4>>2]=s,1==(0|n))return 0|(B=0);o=1;do{C=0|r[(x=t+(o<<3)|0)+4>>2],r[(B=e+(o<<3)|0)>>2]=r[x>>2],r[B+4>>2]=C,o=o+1|0}while((0|o)!=(0|n));return 0|(o=0)}if(!(C=0|me(x=n<<3)))return 0|(B=-3);if(Se(0|C,0|t,0|x),!(i=0|ve(n,8)))return ye(C),0|(B=-3);o=n;t:for(;;){_=0|Ce(0|(d=0|r[(l=C)>>2]),0|(l=0|r[l+4>>2]),52),w(),b=(_&=15)+-1|0,v=(0|o)>0;e:do{if(v){if(y=((0|o)<0)<<31>>31,g=0|Be(0|b,0,52),m=0|w(),b>>>0>15)for(s=0,t=d,n=l;;){if(!(0==(0|t)&0==(0|n))){if(a=0|Ce(0|t,0|n,52),w(),c=(0|(a&=15))<(0|b),a=(0|a)==(0|b),n=0|we(0|(h=c?0:a?t:0),0|(t=c?0:a?n:0),0|o,0|y),w(),0==(0|(u=0|r[(c=a=i+(n<<3)|0)>>2]))&0==(0|(c=0|r[c+4>>2])))n=h;else for(g=0,p=n,A=c,n=h;;){if((0|g)>(0|o)){B=41;break t}if((0|u)==(0|n)&(-117440513&A)==(0|t)){h=0|Ce(0|u,0|A,56),w(),f=(h&=7)+1|0,m=0|Ce(0|u,0|A,45),w();n:do{if(0|R(127&m)){if(u=0|Ce(0|u,0|A,52),w(),!(u&=15)){c=6;break}for(c=1;;){if(!(0==((m=0|Be(7,0,3*(15-c|0)|0))&n)&0==(w()&t))){c=7;break n}if(!(c>>>0<u>>>0)){c=6;break}c=c+1|0}}else c=7}while(0);if((h+2|0)>>>0>c>>>0){B=51;break t}m=0|Be(0|f,0,56),t=w()|-117440513&t,r[(c=a)>>2]=0,r[c+4>>2]=0,c=p,n|=m}else c=(p+1|0)%(0|o)|0;if(0==(0|(u=0|r[(A=a=i+(c<<3)|0)>>2]))&0==(0|(A=0|r[A+4>>2])))break;g=g+1|0,p=c}r[(m=a)>>2]=n,r[m+4>>2]=t}if((0|(s=s+1|0))>=(0|o))break e;t=0|r[(n=C+(s<<3)|0)>>2],n=0|r[n+4>>2]}for(s=0,t=d,n=l;;){if(!(0==(0|t)&0==(0|n))){if(c=0|Ce(0|t,0|n,52),w(),(0|(c&=15))>=(0|b)){if((0|c)!=(0|b)&&(t|=g,n=-15728641&n|m,c>>>0>=_>>>0)){a=b;do{p=0|Be(7,0,3*(14-a|0)|0),a=a+1|0,t|=p,n=w()|n}while(a>>>0<c>>>0)}}else t=0,n=0;if(c=0|we(0|t,0|n,0|o,0|y),w(),!(0==(0|(h=0|r[(u=a=i+(c<<3)|0)>>2]))&0==(0|(u=0|r[u+4>>2]))))for(p=0;;){if((0|p)>(0|o)){B=41;break t}if((0|h)==(0|t)&(-117440513&u)==(0|n)){f=0|Ce(0|h,0|u,56),w(),A=(f&=7)+1|0,E=0|Ce(0|h,0|u,45),w();n:do{if(0|R(127&E)){if(h=0|Ce(0|h,0|u,52),w(),!(h&=15)){u=6;break}for(u=1;;){if(!(0==((E=0|Be(7,0,3*(15-u|0)|0))&t)&0==(w()&n))){u=7;break n}if(!(u>>>0<h>>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if((f+2|0)>>>0>u>>>0){B=51;break t}E=0|Be(0|A,0,56),n=w()|-117440513&n,r[(A=a)>>2]=0,r[A+4>>2]=0,t|=E}else c=(c+1|0)%(0|o)|0;if(0==(0|(h=0|r[(u=a=i+(c<<3)|0)>>2]))&0==(0|(u=0|r[u+4>>2])))break;p=p+1|0}r[(E=a)>>2]=t,r[E+4>>2]=n}if((0|(s=s+1|0))>=(0|o))break e;t=0|r[(n=C+(s<<3)|0)>>2],n=0|r[n+4>>2]}}}while(0);if((o+5|0)>>>0<11){B=99;break}if(!(m=0|ve((0|o)/6|0,8))){B=58;break}e:do{if(v){p=0,A=0;do{if(!(0==(0|(s=0|r[(t=c=i+(p<<3)|0)>>2]))&0==(0|(t=0|r[t+4>>2])))){u=0|Ce(0|s,0|t,56),w(),n=(u&=7)+1|0,h=-117440513&t,E=0|Ce(0|s,0|t,45),w();n:do{if(0|R(127&E)){if(f=0|Ce(0|s,0|t,52),w(),0|(f&=15))for(a=1;;){if(!(0==(s&(E=0|Be(7,0,3*(15-a|0)|0)))&0==(h&w())))break n;if(!(a>>>0<f>>>0))break;a=a+1|0}s|=t=0|Be(0|n,0,56),t=w()|h,r[(n=c)>>2]=s,r[n+4>>2]=t,n=u+2|0}}while(0);7==(0|n)&&(r[(E=m+(A<<3)|0)>>2]=s,r[E+4>>2]=-117440513&t,A=A+1|0)}p=p+1|0}while((0|p)!=(0|o));if(v){if(g=((0|o)<0)<<31>>31,f=0|Be(0|b,0,52),p=0|w(),b>>>0>15)for(t=0,s=0;;){do{if(!(0==(0|d)&0==(0|l))){for(u=0|Ce(0|d,0|l,52),w(),a=(0|(u&=15))<(0|b),u=(0|u)==(0|b),a=0|we(0|(c=a?0:u?d:0),0|(u=a?0:u?l:0),0|o,0|g),w(),n=0;;){if((0|n)>(0|o)){B=98;break t}if((-117440513&(h=0|r[(E=i+(a<<3)|0)+4>>2]))==(0|u)&&(0|r[E>>2])==(0|c)){B=70;break}if((0|r[(E=i+((a=(a+1|0)%(0|o)|0)<<3)|0)>>2])==(0|c)&&(0|r[E+4>>2])==(0|u))break;n=n+1|0}if(70==(0|B)&&(B=0,!0&100663296==(117440512&h)))break;r[(E=e+(s<<3)|0)>>2]=d,r[E+4>>2]=l,s=s+1|0}}while(0);if((0|(t=t+1|0))>=(0|o)){o=A;break e}d=0|r[(l=C+(t<<3)|0)>>2],l=0|r[l+4>>2]}for(t=0,s=0;;){do{if(!(0==(0|d)&0==(0|l))){if(u=0|Ce(0|d,0|l,52),w(),(0|(u&=15))>=(0|b))if((0|u)!=(0|b))if(n=d|f,a=-15728641&l|p,u>>>0<_>>>0)u=a;else{c=b;do{E=0|Be(7,0,3*(14-c|0)|0),c=c+1|0,n|=E,a=w()|a}while(c>>>0<u>>>0);u=a}else n=d,u=l;else n=0,u=0;for(c=0|we(0|n,0|u,0|o,0|g),w(),a=0;;){if((0|a)>(0|o)){B=98;break t}if((-117440513&(h=0|r[(E=i+(c<<3)|0)+4>>2]))==(0|u)&&(0|r[E>>2])==(0|n)){B=93;break}if((0|r[(E=i+((c=(c+1|0)%(0|o)|0)<<3)|0)>>2])==(0|n)&&(0|r[E+4>>2])==(0|u))break;a=a+1|0}if(93==(0|B)&&(B=0,!0&100663296==(117440512&h)))break;r[(E=e+(s<<3)|0)>>2]=d,r[E+4>>2]=l,s=s+1|0}}while(0);if((0|(t=t+1|0))>=(0|o)){o=A;break e}d=0|r[(l=C+(t<<3)|0)>>2],l=0|r[l+4>>2]}}else s=0,o=A}else s=0,o=0}while(0);if(Me(0|i,0,0|x),Se(0|C,0|m,o<<3),ye(m),!o)break;e=e+(s<<3)|0}return 41==(0|B)?(ye(C),ye(i),0|(E=-1)):51==(0|B)?(ye(C),ye(i),0|(E=-2)):58==(0|B)?(ye(C),ye(i),0|(E=-3)):98==(0|B)?(ye(m),ye(C),ye(i),0|(E=-1)):(99==(0|B)&&Se(0|e,0|C,o<<3),ye(C),ye(i),0|(E=0))},_destroyLinkedPolygon:function(t){var e=0,n=0,i=0,o=0;if(t|=0)for(i=1;;){if(0|(e=0|r[t>>2]))do{if(0|(n=0|r[e>>2]))do{o=n,n=0|r[n+16>>2],ye(o)}while(0!=(0|n));o=e,e=0|r[e+8>>2],ye(o)}while(0!=(0|e));if(e=t,t=0|r[t+8>>2],i||ye(e),!t)break;i=0}},_edgeLengthKm:function(t){return+ +o[20752+((t|=0)<<3)>>3]},_edgeLengthM:function(t){return+ +o[20880+((t|=0)<<3)>>3]},_emscripten_replace_memory:function(t){return i=new Int8Array(t),new Uint8Array(t),r=new Int32Array(t),new Float32Array(t),o=new Float64Array(t),n=t,!0},_exactEdgeLengthKm:function(t,e){var n,i,s=0,a=0,l=0,u=0,f=0,A=0;if(i=I,I=I+176|0,Qt(t|=0,e|=0,n=i),(0|(t=0|r[n>>2]))<=1)return I=i,+(l=0);e=t+-1|0,t=0,s=0,a=+o[n+8>>3],l=+o[n+16>>3];do{f=a,a=+o[n+8+((t=t+1|0)<<4)>>3],A=+d(.5*(a-f)),u=l,l=+o[n+8+(t<<4)+8>>3],u=A*A+(u=+d(.5*(l-u)))*(+h(+f)*+h(+a)*u),s+=2*+m(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return I=i,+(A=6371.007180918475*s)},_exactEdgeLengthM:function(t,e){var n,i,s=0,a=0,l=0,u=0,f=0,A=0;if(i=I,I=I+176|0,Qt(t|=0,e|=0,n=i),(0|(t=0|r[n>>2]))<=1)return I=i,+(l=0);e=t+-1|0,t=0,s=0,a=+o[n+8>>3],l=+o[n+16>>3];do{f=a,a=+o[n+8+((t=t+1|0)<<4)>>3],A=+d(.5*(a-f)),u=l,l=+o[n+8+(t<<4)+8>>3],u=A*A+(u=+d(.5*(l-u)))*(+h(+f)*+h(+a)*u),s+=2*+m(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return I=i,+(A=6371.007180918475*s*1e3)},_exactEdgeLengthRads:function(t,e){var n,i,s=0,a=0,l=0,u=0,f=0,A=0;if(i=I,I=I+176|0,Qt(t|=0,e|=0,n=i),(0|(t=0|r[n>>2]))<=1)return I=i,+(l=0);e=t+-1|0,t=0,s=0,a=+o[n+8>>3],l=+o[n+16>>3];do{f=a,a=+o[n+8+((t=t+1|0)<<4)>>3],A=+d(.5*(a-f)),u=l,l=+o[n+8+(t<<4)+8>>3],u=A*A+(u=+d(.5*(l-u)))*(+h(+a)*+h(+f)*u),s+=2*+m(+ +c(+u),+ +c(+(1-u)))}while((0|t)<(0|e));return I=i,+s},_experimentalH3ToLocalIj:function(t,e,n,i,r){var o,s;return r|=0,s=I,I=I+16|0,(t=0|$t(t|=0,e|=0,n|=0,i|=0,o=s))||(ft(o,r),t=0),I=s,0|t},_experimentalLocalIjToH3:function(t,e,n,i){var r,o;return t|=0,e|=0,i|=0,r=I,I=I+16|0,At(n|=0,o=r),i=0|te(t,e,o,i),I=r,0|i},_free:ye,_geoToH3:Nt,_getDestinationH3IndexFromUnidirectionalEdge:function(t,e){t|=0;var n,i,o=0;return n=I,I=I+16|0,o=n,!0&268435456==(2013265920&(e|=0))?(i=0|Ce(0|t,0|e,56),w(),r[o>>2]=0,o=0|L(t,-2130706433&e|134217728,7&i,o),e=0|w(),x(0|e),I=n,0|o):(o=0,x(0|(e=0)),I=n,0|o)},_getH3IndexesFromUnidirectionalEdge:function(t,e,n){t|=0;var i,o,s,a,l=0;s=I,I=I+16|0,i=s,a=!0&268435456==(2013265920&(e|=0)),o=-2130706433&e|134217728,r[(l=n|=0)>>2]=a?t:0,r[l+4>>2]=a?o:0,a?(e=0|Ce(0|t,0|e,56),w(),r[i>>2]=0,t=0|L(t,o,7&e,i),e=0|w()):(t=0,e=0),r[(l=n+8|0)>>2]=t,r[l+4>>2]=e,I=s},_getH3UnidirectionalEdge:function(t,e,n,i){var o,s,a=0,l=0,c=0,u=0,h=0;if(s=I,I=I+16|0,o=s,!(0|Wt(t|=0,e|=0,n|=0,i|=0)))return u=0,x(0|(c=0)),I=s,0|u;for(c=-2130706433&e,a=(a=0==(0|Lt(t,e)))?1:2;r[o>>2]=0,l=a+1|0,!((0|(h=0|L(t,e,a,o)))==(0|n)&(0|w())==(0|i));){if(!(l>>>0<7)){a=0,t=0,u=6;break}a=l}return 6==(0|u)?(x(0|a),I=s,0|t):(h=0|Be(0|a,0,56),u=c|w()|268435456,h|=t,x(0|u),I=s,0|h)},_getH3UnidirectionalEdgeBoundary:Qt,_getH3UnidirectionalEdgesFromHexagon:function(t,e,n){n|=0;var i,o=0;i=0==(0|Lt(t|=0,e|=0)),e&=-2130706433,r[(o=n)>>2]=i?t:0,r[o+4>>2]=i?285212672|e:0,r[(o=n+8|0)>>2]=t,r[o+4>>2]=301989888|e,r[(o=n+16|0)>>2]=t,r[o+4>>2]=318767104|e,r[(o=n+24|0)>>2]=t,r[o+4>>2]=335544320|e,r[(o=n+32|0)>>2]=t,r[o+4>>2]=352321536|e,r[(n=n+40|0)>>2]=t,r[n+4>>2]=369098752|e},_getOriginH3IndexFromUnidirectionalEdge:function(t,e){var n;return t|=0,x(0|((n=!0&268435456==(2013265920&(e|=0)))?-2130706433&e|134217728:0)),0|(n?t:0)},_getPentagonIndexes:Jt,_getRes0Indexes:function(t){t|=0;var e=0,n=0,i=0;e=0;do{Be(0|e,0,45),i=134225919|w(),r[(n=t+(e<<3)|0)>>2]=-1,r[n+4>>2]=i,e=e+1|0}while(122!=(0|e))},_h3Distance:function(t,e,n,i){var r,o,s;return n|=0,i|=0,s=I,I=I+32|0,o=s,t=0==(0|$t(t|=0,e|=0,t,e,r=s+12|0))&&0==(0|$t(t,e,n,i,o))?0|dt(r,o):-1,I=s,0|t},_h3GetBaseCell:It,_h3GetFaces:function t(e,n,i){i|=0;var o,s=0,a=0,l=0,c=0,u=0,h=0,d=0,f=0;o=I,I=I+128|0,d=o+112|0,l=o+96|0,f=o,a=0|Ce(0|(e|=0),0|(n|=0),52),w(),u=15&a,r[d>>2]=u,c=0|Ce(0|e,0|n,45),w(),c&=127;t:do{if(0|R(c)){if(0|u)for(s=1;;){if(!(0==((h=0|Be(7,0,3*(15-s|0)|0))&e)&0==(w()&n))){a=0;break t}if(!(s>>>0<u>>>0))break;s=s+1|0}if(!(1&a))return h=0|Be(u+1|0,0,52),f=w()|-15728641&n,t((h|e)&~(d=0|Be(7,0,3*(14-u|0)|0)),f&~w(),i),void(I=o);a=1}else a=0}while(0);jt(e,n,l),a?(bt(l,d,f),h=5):(Bt(l,d,f),h=6);t:do{if(0|R(c))if(u)for(s=1;;){if(!(0==((c=0|Be(7,0,3*(15-s|0)|0))&e)&0==(w()&n))){s=8;break t}if(!(s>>>0<u>>>0)){s=20;break}s=s+1|0}else s=20;else s=8}while(0);if(Me(0|i,-1,0|s),a){a=0;do{for(wt(l=f+(a<<4)|0,0|r[d>>2]),l=0|r[l>>2],s=0;!(-1==(0|(u=0|r[(c=i+(s<<2)|0)>>2]))|(0|u)==(0|l));)s=s+1|0;r[c>>2]=l,a=a+1|0}while((0|a)!=(0|h))}else{a=0;do{for(xt(l=f+(a<<4)|0,0|r[d>>2],0,1),l=0|r[l>>2],s=0;!(-1==(0|(u=0|r[(c=i+(s<<2)|0)>>2]))|(0|u)==(0|l));)s=s+1|0;r[c>>2]=l,a=a+1|0}while((0|a)!=(0|h))}I=o},_h3GetResolution:function(t,e){return e=0|Ce(0|(t|=0),0|(e|=0),52),w(),15&e},_h3IndexesAreNeighbors:Wt,_h3IsPentagon:Lt,_h3IsResClassIII:function(t,e){return e=0|Ce(0|(t|=0),0|(e|=0),52),w(),1&e},_h3IsValid:Pt,_h3Line:function(t,e,n,i,o){n|=0,i|=0,o|=0;var s,a=0,c=0,u=0,h=0,d=0,f=0,A=0,p=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,w=0,C=0;if(s=I,I=I+48|0,c=s+12|0,w=s,0==(0|$t(t|=0,e|=0,t,e,a=s+24|0))&&0==(0|$t(t,e,n,i,c))){if((0|(x=0|dt(a,c)))<0)return I=s,0|(w=x);for(r[a>>2]=0,r[a+4>>2]=0,r[a+8>>2]=0,r[c>>2]=0,r[c+4>>2]=0,r[c+8>>2]=0,$t(t,e,t,e,a),$t(t,e,n,i,c),pt(a),pt(c),x?(g=+(0|x),b=a,n=f=0|r[a>>2],i=A=0|r[(v=a+4|0)>>2],a=p=0|r[(_=a+8|0)>>2],m=+((0|r[c>>2])-f|0)/g,y=+((0|r[c+4>>2])-A|0)/g,g=+((0|r[c+8>>2])-p|0)/g):(v=i=a+4|0,_=p=a+8|0,b=a,n=0|r[a>>2],i=0|r[i>>2],a=0|r[p>>2],m=0,y=0,g=0),r[w>>2]=n,r[(p=w+4|0)>>2]=i,r[(A=w+8|0)>>2]=a,f=0;;){C=m*(h=+(0|f))+ +(0|n),u=y*h+ +(0|r[v>>2]),h=g*h+ +(0|r[_>>2]),i=~~+Te(+C),c=~~+Te(+u),n=~~+Te(+h),C=+l(+(+(0|i)-C)),u=+l(+(+(0|c)-u)),h=+l(+(+(0|n)-h));do{if(!(C>u&C>h)){if(d=0-i|0,u>h){a=d-n|0;break}a=c,n=d-c|0;break}i=0-(c+n)|0,a=c}while(0);if(r[w>>2]=i,r[p>>2]=a,r[A>>2]=n,gt(w),te(t,e,w,o+(f<<3)|0),(0|f)==(0|x))break;f=f+1|0,n=0|r[b>>2]}return I=s,0|(w=0)}return I=s,0|(w=-1)},_h3LineSize:function(t,e,n,i){var r,o,s;return n|=0,i|=0,s=I,I=I+32|0,o=s,t=0==(0|$t(t|=0,e|=0,t,e,r=s+12|0))&&0==(0|$t(t,e,n,i,o))?0|dt(r,o):-1,I=s,(t>>>31^1)+t|0},_h3SetToLinkedGeo:function(t,e,n){n|=0;var i,o,s,a=0;if(s=I,I=I+32|0,i=s,function(t,e,n){t|=0,n|=0;var i,o,s=0,a=0,l=0,c=0,u=0;if(o=I,I=I+176|0,i=o,(0|(e|=0))<1)return ce(n,0,0),void(I=o);c=0|Ce(0|r[(c=t)>>2],0|r[c+4>>2],52),w(),ce(n,(0|e)>6?e:6,15&c),c=0;do{if(Ht(0|r[(s=t+(c<<3)|0)>>2],0|r[s+4>>2],i),(0|(s=0|r[i>>2]))>0){u=0;do{l=i+8+(u<<4)|0,(a=0|Ae(n,s=i+8+((0|(u=u+1|0))%(0|s)<<4)|0,l))?de(n,a):fe(n,l,s),s=0|r[i>>2]}while((0|u)<(0|s))}c=c+1|0}while((0|c)!=(0|e));I=o}(t|=0,e|=0,o=s+16|0),r[n>>2]=0,r[n+4>>2]=0,r[n+8>>2]=0,!(t=0|he(o)))return Xt(n),ue(o),void(I=s);do{e=0|Kt(n);do{qt(e,t),a=t+16|0,r[i>>2]=r[a>>2],r[i+4>>2]=r[a+4>>2],r[i+8>>2]=r[a+8>>2],r[i+12>>2]=r[a+12>>2],de(o,t),t=0|pe(o,i)}while(0!=(0|t));t=0|he(o)}while(0!=(0|t));Xt(n),ue(o),I=s},_h3ToCenterChild:function(t,e,n){n|=0;var i=0,r=0;if(i=0|Ce(0|(t|=0),0|(e|=0),52),w(),(0|n)<16&(0|(i&=15))<=(0|n)){if((0|i)!=(0|n)&&(t|=r=0|Be(0|n,0,52),e=w()|-15728641&e,(0|i)<(0|n)))do{r=0|Be(7,0,3*(14-i|0)|0),i=i+1|0,t&=~r,e&=~w()}while((0|i)<(0|n))}else e=0,t=0;return x(0|e),0|t},_h3ToChildren:Ft,_h3ToGeo:Vt,_h3ToGeoBoundary:Ht,_h3ToParent:Dt,_h3UnidirectionalEdgeIsValid:function(t,e){var n=0;if(!(!0&268435456==(2013265920&(e|=0))))return 0|(n=0);switch(n=0|Ce(0|(t|=0),0|e,56),w(),7&n){case 0:case 7:return 0|(n=0)}return!0&16777216==(117440512&e)&0!=(0|Lt(t,n=-2130706433&e|134217728))?0|(n=0):0|(n=0|Pt(t,n))},_hexAreaKm2:function(t){return+ +o[20496+((t|=0)<<3)>>3]},_hexAreaM2:function(t){return+ +o[20624+((t|=0)<<3)>>3]},_hexRing:function(t,e,n,i){t|=0,e|=0,i|=0;var o,s=0,a=0,l=0,c=0,u=0,h=0,d=0;if(o=I,I=I+16|0,d=o,!(n|=0))return r[(d=i)>>2]=t,r[d+4>>2]=e,I=o,0|(d=0);r[d>>2]=0;t:do{if(0|Lt(t,e))t=1;else{if(a=(0|n)>0){s=0,h=t;do{if(0==(0|(h=0|L(h,e,4,d)))&0==(0|(e=0|w()))){t=2;break t}if(s=s+1|0,0|Lt(h,e)){t=1;break t}}while((0|s)<(0|n));if(r[(u=i)>>2]=h,r[u+4>>2]=e,u=n+-1|0,a){a=0,l=1,s=h,t=e;do{if(0==(0|(s=0|L(s,t,2,d)))&0==(0|(t=0|w()))){t=2;break t}if(r[(c=i+(l<<3)|0)>>2]=s,r[c+4>>2]=t,l=l+1|0,0|Lt(s,t)){t=1;break t}a=a+1|0}while((0|a)<(0|n));c=0,a=l;do{if(0==(0|(s=0|L(s,t,3,d)))&0==(0|(t=0|w()))){t=2;break t}if(r[(l=i+(a<<3)|0)>>2]=s,r[l+4>>2]=t,a=a+1|0,0|Lt(s,t)){t=1;break t}c=c+1|0}while((0|c)<(0|n));l=0;do{if(0==(0|(s=0|L(s,t,1,d)))&0==(0|(t=0|w()))){t=2;break t}if(r[(c=i+(a<<3)|0)>>2]=s,r[c+4>>2]=t,a=a+1|0,0|Lt(s,t)){t=1;break t}l=l+1|0}while((0|l)<(0|n));l=0;do{if(0==(0|(s=0|L(s,t,5,d)))&0==(0|(t=0|w()))){t=2;break t}if(r[(c=i+(a<<3)|0)>>2]=s,r[c+4>>2]=t,a=a+1|0,0|Lt(s,t)){t=1;break t}l=l+1|0}while((0|l)<(0|n));l=0;do{if(0==(0|(s=0|L(s,t,4,d)))&0==(0|(t=0|w()))){t=2;break t}if(r[(c=i+(a<<3)|0)>>2]=s,r[c+4>>2]=t,a=a+1|0,0|Lt(s,t)){t=1;break t}l=l+1|0}while((0|l)<(0|n));for(l=0;;){if(0==(0|(s=0|L(s,t,6,d)))&0==(0|(t=0|w()))){t=2;break t}if((0|l)!=(0|u)){if(r[(c=i+(a<<3)|0)>>2]=s,r[c+4>>2]=t,0|Lt(s,t)){t=1;break t}a=a+1|0}if((0|(l=l+1|0))>=(0|n)){l=h,a=e;break}}}else l=h,s=h,a=e,t=e}else r[(l=i)>>2]=t,r[l+4>>2]=e,l=t,s=t,a=e,t=e;t=1&((0|l)!=(0|s)|(0|a)!=(0|t))}}while(0);return I=o,0|(d=t)},_i64Subtract:_e,_kRing:P,_kRingDistances:function(t,e,n,i,r){var o;if(0|D(t|=0,e|=0,n|=0,i|=0,r|=0)){if(Me(0|i,0,(o=1+(0|v(3*n|0,n+1|0))|0)<<3),0|r)return Me(0|r,0,o<<2),void F(t,e,n,i,r,o,0);(r=0|ve(o,4))&&(F(t,e,n,i,r,o,0),ye(r))}},_llvm_minnum_f64:Ee,_llvm_round_f64:Te,_malloc:me,_maxFaceCount:function(t,e){var n=0,i=0;if(i=0|Ce(0|(t|=0),0|(e|=0),45),w(),!(0|R(127&i)))return 0|(i=2);if(i=0|Ce(0|t,0|e,52),w(),!(i&=15))return 0|(i=5);for(n=1;;){if(!(0==((0|Be(7,0,3*(15-n|0)|0))&t)&0==(w()&e))){n=2,t=6;break}if(!(n>>>0<i>>>0)){n=5,t=6;break}n=n+1|0}return 6==(0|t)?0|n:0},_maxH3ToChildrenSize:function(t,e,n){return n|=0,t=0|Ce(0|(t|=0),0|(e|=0),52),w(),(0|n)<16&(0|(t&=15))<=(0|n)?0|(n=0|ee(7,n-t|0)):0|(n=0)},_maxKringSize:function(t){return 1+(0|v(3*(t|=0)|0,t+1|0))|0},_maxPolyfillSize:function(t,e){e|=0;var n,i=0,o=0,s=0,a=0,l=0;if(n=I,I=I+48|0,s=n+8|0,o=n,a=0|r[(l=t|=0)+4>>2],r[(i=o)>>2]=r[l>>2],r[i+4>>2]=a,ie(o,s),s=0|H(s,e),e=0|r[o>>2],(0|(o=0|r[t+8>>2]))<=0)return I=n,0|(l=(l=(a=(0|s)<(0|(l=e)))?l:s)+12|0);i=0|r[t+12>>2],t=0;do{e=(0|r[i+(t<<3)>>2])+e|0,t=t+1|0}while((0|t)<(0|o));return I=n,0|(l=(l=(l=(0|s)<(0|e))?e:s)+12|0)},_maxUncompactSize:function(t,e,n){t|=0,n|=0;var i=0,o=0,s=0,a=0;if((0|(e|=0))<=0)return 0|(n=0);if((0|n)>=16){for(i=0;;){if(!(0==(0|r[(a=t+(i<<3)|0)>>2])&0==(0|r[a+4>>2]))){i=-1,o=13;break}if((0|(i=i+1|0))>=(0|e)){i=0,o=13;break}}if(13==(0|o))return 0|i}i=0,a=0;t:for(;;){s=0|r[(o=t+(a<<3)|0)>>2],o=0|r[o+4>>2];do{if(!(0==(0|s)&0==(0|o))){if(o=0|Ce(0|s,0|o,52),w(),(0|(o&=15))>(0|n)){i=-1,o=13;break t}if((0|o)==(0|n)){i=i+1|0;break}i=(0|ee(7,n-o|0))+i|0;break}}while(0);if((0|(a=a+1|0))>=(0|e)){o=13;break}}return 13==(0|o)?0|i:0},_memcpy:Se,_memset:Me,_numHexagons:function(t){var e;return t=0|r[(e=21008+((t|=0)<<3)|0)>>2],x(0|r[e+4>>2]),0|t},_pentagonIndexCount:function(){return 12},_pointDistKm:St,_pointDistM:function(t,e){t|=0;var n,i,r,s=0;return i=+o[(e|=0)>>3],n=+o[t>>3],s=(r=+d(.5*(i-n)))*r+(s=+d(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+h(+i)*+h(+n)*s),2*+m(+ +c(+s),+ +c(+(1-s)))*6371.007180918475*1e3},_pointDistRads:function(t,e){t|=0;var n,i,r,s=0;return i=+o[(e|=0)>>3],n=+o[t>>3],s=(r=+d(.5*(i-n)))*r+(s=+d(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+h(+i)*+h(+n)*s),2*+m(+ +c(+s),+ +c(+(1-s)))},_polyfill:function(t,e,n){var i,o=0,s=0,a=0,l=0,c=0;if(i=I,I=I+48|0,o=i+8|0,s=i,0|function(t,e,n){t|=0,e|=0,n|=0;var i=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0,d=0,f=0,A=0,p=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,B=0,E=0,T=0,S=0,M=0,P=0,L=0,R=0,k=0,U=0,z=0;z=I,I=I+112|0,L=z+80|0,c=z+72|0,R=z,k=z+56|0,u=t+8|0,U=0|me(32+(r[u>>2]<<5)|0),U||C(22848,22448,800,22456);if(re(t,U),s=t,i=0|r[s+4>>2],l=c,r[l>>2]=r[s>>2],r[l+4>>2]=i,ie(c,L),l=0|H(L,e),i=0|r[c>>2],s=0|r[u>>2],(0|s)>0){a=0|r[t+12>>2],o=0;do{i=(0|r[a+(o<<3)>>2])+i|0,o=o+1|0}while((0|o)!=(0|s))}if(l=(0|l)<(0|i)?i:l,P=l+12|0,o=0|ve(P,8),h=0|ve(P,8),r[L>>2]=0,S=t,M=0|r[S+4>>2],i=c,r[i>>2]=r[S>>2],r[i+4>>2]=M,i=0|O(c,P,e,L,o,h),0|i)return ye(o),ye(h),ye(U),I=z,0|(U=i);t:do{if((0|r[u>>2])>0){for(s=t+12|0,i=0;a=0|O((0|r[s>>2])+(i<<3)|0,P,e,L,o,h),i=i+1|0,!(0|a);)if((0|i)>=(0|r[u>>2]))break t;return ye(o),ye(h),ye(U),I=z,0|(U=a)}}while(0);(0|l)>-12&&Me(0|h,0,((0|P)>1?P:1)<<3);t:do{if((0|r[L>>2])>0){M=((0|P)<0)<<31>>31,b=o,x=h,B=o,E=o,T=h,S=o,i=o,m=o,y=h,v=h,_=h,o=h;e:for(;;){for(g=0|r[L>>2],A=0,p=0,s=0;;){l=(a=R)+56|0;do{r[a>>2]=0,a=a+4|0}while((0|a)<(0|l));if(0|D(c=0|r[(e=b+(A<<3)|0)>>2],e=0|r[e+4>>2],1,R,0)){l=(a=R)+56|0;do{r[a>>2]=0,a=a+4|0}while((0|a)<(0|l));0|(a=0|ve(7,4))&&(F(c,e,1,R,a,7,0),ye(a))}f=0;do{h=0|r[(d=R+(f<<3)|0)>>2],d=0|r[d+4>>2];n:do{if(!(0==(0|h)&0==(0|d))){if(c=0|we(0|h,0|d,0|P,0|M),w(),!(0==(0|(e=0|r[(l=a=n+(c<<3)|0)>>2]))&0==(0|(l=0|r[l+4>>2]))))for(u=0;;){if((0|u)>(0|P))break e;if((0|e)==(0|h)&(0|l)==(0|d))break n;if(0==(0|(e=0|r[(l=a=n+((c=(c+1|0)%(0|P)|0)<<3)|0)>>2]))&0==(0|(l=0|r[l+4>>2])))break;u=u+1|0}0==(0|h)&0==(0|d)||(Vt(h,d,k),0|oe(t,U,k)&&(r[(u=a)>>2]=h,r[u+4>>2]=d,r[(u=x+(s<<3)|0)>>2]=h,r[u+4>>2]=d,s=s+1|0))}}while(0);f=f+1|0}while(f>>>0<7);if((0|(p=p+1|0))>=(0|g))break;A=A+1|0}if((0|g)>0&&Me(0|B,0,g<<3),r[L>>2]=s,!((0|s)>0))break t;h=o,d=_,f=S,A=v,p=y,g=x,o=m,_=i,v=E,y=B,m=h,i=d,S=T,T=f,E=A,B=p,x=b,b=g}return ye(E),ye(T),ye(U),I=z,0|(U=-1)}i=h}while(0);return ye(U),ye(o),ye(i),U=0,I=z,0|U}(t|=0,e|=0,n|=0)){if(a=0|r[(c=t)+4>>2],r[(l=s)>>2]=r[c>>2],r[l+4>>2]=a,ie(s,o),l=0|H(o,e),e=0|r[s>>2],(0|(a=0|r[t+8>>2]))>0){s=0|r[t+12>>2],o=0;do{e=(0|r[s+(o<<3)>>2])+e|0,o=o+1|0}while((0|o)!=(0|a))}(0|(e=(0|l)<(0|e)?e:l))<=-12||Me(0|n,0,8+(((0|(c=e+11|0))>0?c:0)<<3)|0),I=i}else I=i},_res0IndexCount:function(){return 122},_round:Ie,_sbrk:Pe,_sizeOfCoordIJ:function(){return 8},_sizeOfGeoBoundary:function(){return 168},_sizeOfGeoCoord:function(){return 16},_sizeOfGeoPolygon:function(){return 16},_sizeOfGeofence:function(){return 8},_sizeOfH3Index:function(){return 8},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompact:function(t,e,n,i,o){t|=0,n|=0,i|=0,o|=0;var s=0,a=0,l=0,c=0,u=0,h=0;if((0|(e|=0))<=0)return 0|(o=0);if((0|o)>=16){for(s=0;;){if(!(0==(0|r[(h=t+(s<<3)|0)>>2])&0==(0|r[h+4>>2]))){s=14;break}if((0|(s=s+1|0))>=(0|e)){a=0,s=16;break}}if(14==(0|s))return 0|((0|i)>0?-2:-1);if(16==(0|s))return 0|a}s=0,h=0;t:for(;;){a=0|r[(l=u=t+(h<<3)|0)>>2],l=0|r[l+4>>2];do{if(!(0==(0|a)&0==(0|l))){if((0|s)>=(0|i)){a=-1,s=16;break t}if(c=0|Ce(0|a,0|l,52),w(),(0|(c&=15))>(0|o)){a=-2,s=16;break t}if((0|c)==(0|o)){r[(u=n+(s<<3)|0)>>2]=a,r[u+4>>2]=l,s=s+1|0;break}if((0|(a=(0|ee(7,o-c|0))+s|0))>(0|i)){a=-1,s=16;break t}Ft(0|r[u>>2],0|r[u+4>>2],o,n+(s<<3)|0),s=a}}while(0);if((0|(h=h+1|0))>=(0|e)){a=0,s=16;break}}return 16==(0|s)?0|a:0},establishStackSpace:function(t,e){I=t|=0},stackAlloc:function(t){var e;return e=I,I=(I=I+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){I=t|=0},stackSave:function(){return 0|I}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:lt,b:function(t){c=t},c:u,d:function(t,e,n,i){lt("Assertion failed: "+p(t)+", at: "+[e?p(e):"unknown filename",n,i?p(i):"unknown function"])},e:function(t){return n.___errno_location&&(_[n.___errno_location()>>2]=t),t},f:J,g:function(t,e,n){y.set(y.subarray(e,e+n),t)},h:function(t){var e=J(),n=16777216,i=2130706432;if(t>i)return!1;for(var r=Math.max(e,16777216);r<t;)r=r<=536870912?w(2*r,n):Math.min(w((3*r+2147483648)/4,n),i);return!!W(r)},i:function(t){lt("OOM")},j:j,k:V,l:W,m:H,n:function(){var t=H();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),V(t)},o:24032,p:24016},g),$=(n.___uremdi3=Y.___uremdi3,n._bitshift64Lshr=Y._bitshift64Lshr,n._bitshift64Shl=Y._bitshift64Shl,n._calloc=Y._calloc,n._cellAreaKm2=Y._cellAreaKm2,n._cellAreaM2=Y._cellAreaM2,n._cellAreaRads2=Y._cellAreaRads2,n._compact=Y._compact,n._destroyLinkedPolygon=Y._destroyLinkedPolygon,n._edgeLengthKm=Y._edgeLengthKm,n._edgeLengthM=Y._edgeLengthM,n._emscripten_replace_memory=Y._emscripten_replace_memory),tt=(n._exactEdgeLengthKm=Y._exactEdgeLengthKm,n._exactEdgeLengthM=Y._exactEdgeLengthM,n._exactEdgeLengthRads=Y._exactEdgeLengthRads,n._experimentalH3ToLocalIj=Y._experimentalH3ToLocalIj,n._experimentalLocalIjToH3=Y._experimentalLocalIjToH3,n._free=Y._free,n._geoToH3=Y._geoToH3,n._getDestinationH3IndexFromUnidirectionalEdge=Y._getDestinationH3IndexFromUnidirectionalEdge,n._getH3IndexesFromUnidirectionalEdge=Y._getH3IndexesFromUnidirectionalEdge,n._getH3UnidirectionalEdge=Y._getH3UnidirectionalEdge,n._getH3UnidirectionalEdgeBoundary=Y._getH3UnidirectionalEdgeBoundary,n._getH3UnidirectionalEdgesFromHexagon=Y._getH3UnidirectionalEdgesFromHexagon,n._getOriginH3IndexFromUnidirectionalEdge=Y._getOriginH3IndexFromUnidirectionalEdge,n._getPentagonIndexes=Y._getPentagonIndexes,n._getRes0Indexes=Y._getRes0Indexes,n._h3Distance=Y._h3Distance,n._h3GetBaseCell=Y._h3GetBaseCell,n._h3GetFaces=Y._h3GetFaces,n._h3GetResolution=Y._h3GetResolution,n._h3IndexesAreNeighbors=Y._h3IndexesAreNeighbors,n._h3IsPentagon=Y._h3IsPentagon,n._h3IsResClassIII=Y._h3IsResClassIII,n._h3IsValid=Y._h3IsValid,n._h3Line=Y._h3Line,n._h3LineSize=Y._h3LineSize,n._h3SetToLinkedGeo=Y._h3SetToLinkedGeo,n._h3ToCenterChild=Y._h3ToCenterChild,n._h3ToChildren=Y._h3ToChildren,n._h3ToGeo=Y._h3ToGeo,n._h3ToGeoBoundary=Y._h3ToGeoBoundary,n._h3ToParent=Y._h3ToParent,n._h3UnidirectionalEdgeIsValid=Y._h3UnidirectionalEdgeIsValid,n._hexAreaKm2=Y._hexAreaKm2,n._hexAreaM2=Y._hexAreaM2,n._hexRing=Y._hexRing,n._i64Subtract=Y._i64Subtract,n._kRing=Y._kRing,n._kRingDistances=Y._kRingDistances,n._llvm_minnum_f64=Y._llvm_minnum_f64,n._llvm_round_f64=Y._llvm_round_f64,n._malloc=Y._malloc,n._maxFaceCount=Y._maxFaceCount,n._maxH3ToChildrenSize=Y._maxH3ToChildrenSize,n._maxKringSize=Y._maxKringSize,n._maxPolyfillSize=Y._maxPolyfillSize,n._maxUncompactSize=Y._maxUncompactSize,n._memcpy=Y._memcpy,n._memset=Y._memset,n._numHexagons=Y._numHexagons,n._pentagonIndexCount=Y._pentagonIndexCount,n._pointDistKm=Y._pointDistKm,n._pointDistM=Y._pointDistM,n._pointDistRads=Y._pointDistRads,n._polyfill=Y._polyfill,n._res0IndexCount=Y._res0IndexCount,n._round=Y._round,n._sbrk=Y._sbrk,n._sizeOfCoordIJ=Y._sizeOfCoordIJ,n._sizeOfGeoBoundary=Y._sizeOfGeoBoundary,n._sizeOfGeoCoord=Y._sizeOfGeoCoord,n._sizeOfGeoPolygon=Y._sizeOfGeoPolygon,n._sizeOfGeofence=Y._sizeOfGeofence,n._sizeOfH3Index=Y._sizeOfH3Index,n._sizeOfLinkedGeoPolygon=Y._sizeOfLinkedGeoPolygon,n._uncompact=Y._uncompact,n.establishStackSpace=Y.establishStackSpace,n.stackAlloc=Y.stackAlloc),et=n.stackRestore=Y.stackRestore,nt=n.stackSave=Y.stackSave;if(n.asm=Y,n.cwrap=function(t,e,n,i){var r=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&r&&!i?d(t):function(){return f(t,e,n,arguments)}},n.setValue=function(t,e,n,i){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":m[t|0]=e;break;case"i16":v[t>>1]=e;break;case"i32":_[t>>2]=e;break;case"i64":z=[e>>>0,(U=e,+P(U)>=1?U>0?(0|L(+F(U/4294967296),4294967295))>>>0:~~+D((U-+(~~U>>>0))/4294967296)>>>0:0)],_[t>>2]=z[0],_[t+4>>2]=z[1];break;case"float":b[t>>2]=e;break;case"double":x[t>>3]=e;break;default:lt("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return m[t|0];case"i16":return v[t>>1];case"i32":case"i64":return _[t>>2];case"float":return b[t>>2];case"double":return x[t>>3];default:lt("invalid type for getValue: "+e)}return null},n.getTempRet0=u,G){Z(G)||(q=G,G=n.locateFile?n.locateFile(q,s):s+q),O++,n.monitorRunDependencies&&n.monitorRunDependencies(O);var it=function(t){t.byteLength&&(t=new Uint8Array(t)),y.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(t){if(O--,n.monitorRunDependencies&&n.monitorRunDependencies(O),0==O&&(null!==R&&(clearInterval(R),R=null),k)){var e=k;k=null,e()}}()},rt=function(){r(G,it,(function(){throw"could not load memory initializer "+G}))},ot=K(G);if(ot)it(ot.buffer);else if(n.memoryInitializerRequest){var st=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var i=K(n.memoryInitializerRequestURL);if(!i)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+G),void rt();e=i.buffer}it(e)};n.memoryInitializerRequest.response?setTimeout(st,0):n.memoryInitializerRequest.addEventListener("load",st)}else rt()}function at(t){function e(){X||(X=!0,h||(E(S),E(M),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),I.unshift(t);var t;E(I)}()))}t=t||o,O>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),T.unshift(t);var t;E(T)}(),O>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function lt(t){throw n.onAbort&&n.onAbort(t),a(t+=""),l(t),h=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(k=function t(){X||at(),X||(k=t)},n.run=at,n.abort=lt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return at(),t}("object"===typeof i?i:{}),r="number",o={};[["sizeOfH3Index",r],["sizeOfGeoCoord",r],["sizeOfGeoBoundary",r],["sizeOfGeoPolygon",r],["sizeOfGeofence",r],["sizeOfLinkedGeoPolygon",r],["sizeOfCoordIJ",r],["h3IsValid",r,[r,r]],["geoToH3",r,[r,r,r]],["h3ToGeo",null,[r,r,r]],["h3ToGeoBoundary",null,[r,r,r]],["maxKringSize",r,[r]],["kRing",null,[r,r,r,r]],["kRingDistances",null,[r,r,r,r,r]],["hexRing",null,[r,r,r,r]],["maxPolyfillSize",r,[r,r]],["polyfill",null,[r,r,r]],["h3SetToLinkedGeo",null,[r,r,r]],["destroyLinkedPolygon",null,[r]],["compact",r,[r,r,r]],["uncompact",r,[r,r,r,r,r]],["maxUncompactSize",r,[r,r,r]],["h3IsPentagon",r,[r,r]],["h3IsResClassIII",r,[r,r]],["h3GetBaseCell",r,[r,r]],["h3GetResolution",r,[r,r]],["maxFaceCount",r,[r,r]],["h3GetFaces",null,[r,r,r]],["h3ToParent",r,[r,r,r]],["h3ToChildren",null,[r,r,r,r]],["h3ToCenterChild",r,[r,r,r]],["maxH3ToChildrenSize",r,[r,r,r]],["h3IndexesAreNeighbors",r,[r,r,r,r]],["getH3UnidirectionalEdge",r,[r,r,r,r]],["getOriginH3IndexFromUnidirectionalEdge",r,[r,r]],["getDestinationH3IndexFromUnidirectionalEdge",r,[r,r]],["h3UnidirectionalEdgeIsValid",r,[r,r]],["getH3IndexesFromUnidirectionalEdge",null,[r,r,r]],["getH3UnidirectionalEdgesFromHexagon",null,[r,r,r]],["getH3UnidirectionalEdgeBoundary",null,[r,r,r]],["h3Distance",r,[r,r,r,r]],["h3Line",r,[r,r,r,r,r]],["h3LineSize",r,[r,r,r,r]],["experimentalH3ToLocalIj",r,[r,r,r,r,r]],["experimentalLocalIjToH3",r,[r,r,r,r]],["hexAreaM2",r,[r]],["hexAreaKm2",r,[r]],["edgeLengthM",r,[r]],["edgeLengthKm",r,[r]],["pointDistM",r,[r,r]],["pointDistKm",r,[r,r]],["pointDistRads",r,[r,r]],["cellAreaM2",r,[r,r]],["cellAreaKm2",r,[r,r]],["cellAreaRads2",r,[r,r]],["exactEdgeLengthM",r,[r,r]],["exactEdgeLengthKm",r,[r,r]],["exactEdgeLengthRads",r,[r,r]],["numHexagons",r,[r]],["getRes0Indexes",null,[r]],["res0IndexCount",r],["getPentagonIndexes",null,[r,r]],["pentagonIndexCount",r]].forEach((function(t){o[t[0]]=i.cwrap.apply(i,t)}));var s=16,a=4,l=4,c=8,u=o.sizeOfH3Index(),h=o.sizeOfGeoCoord(),d=o.sizeOfGeoBoundary(),f=o.sizeOfGeoPolygon(),A=o.sizeOfGeofence(),p=o.sizeOfLinkedGeoPolygon(),g=(o.sizeOfCoordIJ(),{m:"m",m2:"m2",km:"km",km2:"km2",rads:"rads",rads2:"rads2"});function m(t){if("number"!==typeof t||t<0||t>15||Math.floor(t)!==t)throw new Error("Invalid resolution: "+t)}var y=/[^0-9a-fA-F]/;function v(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!==typeof t||y.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),s);return[parseInt(t.substring(t.length-8),s),e]}function _(t){if(t>=0)return t.toString(s);var e=x(8,(t&=2147483647).toString(s));return e=(parseInt(e[0],s)+8).toString(s)+e.substring(1)}function b(t,e){return _(e)+x(8,_(t))}function x(t,e){for(var n=t-e.length,i="",r=0;r<n;r++)i+="0";return i+=e}function w(t,e,n){for(var r=t.length,o=i._calloc(r,h),s=n?1:0,l=n?0:1,u=0;u<2*r;u+=2)i.HEAPF64.set([t[u/2][s],t[u/2][l]].map(H),o/c+u);return i.HEAPU32.set([r,o],e/a),e}function C(t){return[t,i.getTempRet0()]}function B(t){var e=C(t),n=e[0],i=e[1];return i?b(n,i):null}function E(t,e){void 0===e&&(e=0);var n=i.getValue(t+a*e*2,"i32"),r=i.getValue(t+a*(2*e+1),"i32");return r?b(n,r):null}function T(t,e,n){i.HEAPU32.set(v(t),e/a+2*n)}function S(t,e){for(var n=[],i=0;i<e;i++){var r=E(t,i);null!==r&&n.push(r)}return n}function M(t,e){for(var n=e.length,i=0;i<n;i++)T(e[i],t,i)}function I(t){return 180*i.getValue(t,"double")/Math.PI}function P(t){return[I(t),I(t+c)]}function D(t){return[I(t+c),I(t)]}function F(t,e,n){for(var r=i.getValue(t,"i32"),o=t+c,s=[],a=e?D:P,l=0;l<2*r;l+=2)s.push(a(o+c*l));return n&&s.push(s[0]),s}function L(t){var e=v(t),n=e[0],i=e[1];return Boolean(o.h3IsPentagon(n,i))}function O(t){var e=v(t),n=e[0],i=e[1];return o.h3IsValid(n,i)?o.h3GetResolution(n,i):-1}function R(t,e,n){var r=i._malloc(h);i.HEAPF64.set([t,e].map(H),r/c);var s=B(o.geoToH3(r,n));return i._free(r),s}function k(t){var e=i._malloc(h),n=v(t),r=n[0],s=n[1];o.h3ToGeo(r,s,e);var a=P(e);return i._free(e),a}function U(t,e){var n=i._malloc(d),r=v(t),s=r[0],a=r[1];o.h3ToGeoBoundary(s,a,n);var l=F(n,e,e);return i._free(n),l}function z(t,e){var n=v(t),i=n[0],r=n[1];return B(o.h3ToParent(i,r,e))}function G(t,e){var n=v(t),r=n[0],s=n[1],a=o.maxKringSize(e),l=i._calloc(a,u);o.kRing(r,s,e,l);var c=S(l,a);return i._free(l),c}function N(t,e,n){if(m(e),n=Boolean(n),0===t.length||0===t[0].length)return[];"number"===typeof t[0][0]&&(t=[t]);var r=function(t,e){var n,r=t.length-1,o=i._calloc(f),s=0+A,l=s+a;if(w(t[0],o+0,e),r>0){n=i._calloc(r,A);for(var c=0;c<r;c++)w(t[c+1],n+A*c,e)}return i.setValue(o+s,r,"i32"),i.setValue(o+l,n,"i32"),o}(t,n),s=o.maxPolyfillSize(r,e),l=i._calloc(s,u);o.polyfill(r,e,l);var c=S(l,s);return i._free(l),function(t){var e=0+A,n=e+a,r=a;i._free(i.getValue(t+0+r,"i8*"));var o=i.getValue(t+e,"i32");if(o>0){for(var s=i.getValue(t+n,"i32"),l=0;l<o;l++)i._free(i.getValue(s+A*l+r,"i8*"));i._free(s)}i._free(t)}(r),c}function Z(t,e){if(!t||!t.length)return[];var n=t.length,r=i._calloc(n,u);M(r,t);var s=i._calloc(p),a=s;o.h3SetToLinkedGeo(r,n,s);var h=function(t,e){for(var n,r,o,s,a=[],u=e?D:P;t;){for(a.push(n=[]),r=i.getValue(t,"i8*");r;){for(n.push(o=[]),s=i.getValue(r,"i8*");s;)o.push(u(s)),s=i.getValue(s+2*c,"i8*");e&&o.push(o[0]),r=i.getValue(r+2*l,"i8*")}t=i.getValue(t+2*l,"i8*")}return a}(s,e);return o.destroyLinkedPolygon(a),i._free(a),i._free(r),h}function j(t,e){var n=v(t),i=n[0],r=n[1],s=v(e),a=s[0],l=s[1];return o.h3Distance(i,r,a,l)}function V(t,e){switch(m(t),e){case g.m:return o.edgeLengthM(t);case g.km:return o.edgeLengthKm(t);default:throw new Error("Unknown unit: "+e)}}function H(t){return t*Math.PI/180}},37659:(t,e,n)=>{var i;!function(r,o,s,a){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=o.createElement("div"),h="function",d=Math.round,f=Math.abs,A=Date.now;function p(t,e,n){return setTimeout(x(t,n),e)}function g(t,e,n){return!!Array.isArray(t)&&(m(t,n[e],n),!0)}function m(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==a)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function y(t,e,n){var i="DEPRECATED METHOD: "+e+"\n"+n+" AT \n";return function(){var e=new Error("get-stack-trace"),n=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,i,n),t.apply(this,arguments)}}l="function"!==typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==a&&null!==i)for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}return e}:Object.assign;var v=y((function(t,e,n){for(var i=Object.keys(e),r=0;r<i.length;)(!n||n&&t[i[r]]===a)&&(t[i[r]]=e[i[r]]),r++;return t}),"extend","Use `assign`."),_=y((function(t,e){return v(t,e,!0)}),"merge","Use `assign`.");function b(t,e,n){var i,r=e.prototype;(i=t.prototype=Object.create(r)).constructor=t,i._super=r,n&&l(i,n)}function x(t,e){return function(){return t.apply(e,arguments)}}function w(t,e){return typeof t==h?t.apply(e&&e[0]||a,e):t}function C(t,e){return t===a?e:t}function B(t,e,n){m(M(e),(function(e){t.addEventListener(e,n,!1)}))}function E(t,e,n){m(M(e),(function(e){t.removeEventListener(e,n,!1)}))}function T(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function S(t,e){return t.indexOf(e)>-1}function M(t){return t.trim().split(/\s+/g)}function I(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;i<t.length;){if(n&&t[i][n]==e||!n&&t[i]===e)return i;i++}return-1}function P(t){return Array.prototype.slice.call(t,0)}function D(t,e,n){for(var i=[],r=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];I(r,s)<0&&i.push(t[o]),r[o]=s,o++}return n&&(i=e?i.sort((function(t,n){return t[e]>n[e]})):i.sort()),i}function F(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),o=0;o<c.length;){if((i=(n=c[o])?n+r:e)in t)return i;o++}return a}var L=1;function O(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||r}var R="ontouchstart"in r,k=F(r,"PointerEvent")!==a,U=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),z="touch",G="mouse",N=25,Z=1,j=4,V=8,H=1,J=2,W=4,Q=8,K=16,q=J|W,X=Q|K,Y=q|X,$=["x","y"],tt=["clientX","clientY"];function et(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){w(t.options.enable,[t])&&n.handler(e)},this.init()}function nt(t,e,n){var i=n.pointers.length,r=n.changedPointers.length,o=e&Z&&i-r===0,s=e&(j|V)&&i-r===0;n.isFirst=!!o,n.isFinal=!!s,o&&(t.session={}),n.eventType=e,function(t,e){var n=t.session,i=e.pointers,r=i.length;n.firstInput||(n.firstInput=it(e));r>1&&!n.firstMultiple?n.firstMultiple=it(e):1===r&&(n.firstMultiple=!1);var o=n.firstInput,s=n.firstMultiple,l=s?s.center:o.center,c=e.center=rt(i);e.timeStamp=A(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=lt(l,c),e.distance=at(l,c),function(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==Z&&o.eventType!==j||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y});e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}(n,e),e.offsetDirection=st(e.deltaX,e.deltaY);var u=ot(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=f(u.x)>f(u.y)?u.x:u.y,e.scale=s?(h=s.pointers,d=i,at(d[0],d[1],tt)/at(h[0],h[1],tt)):1,e.rotation=s?function(t,e){return lt(e[1],e[0],tt)+lt(t[1],t[0],tt)}(s.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,i,r,o,s=t.lastInterval||e,l=e.timeStamp-s.timeStamp;if(e.eventType!=V&&(l>N||s.velocity===a)){var c=e.deltaX-s.deltaX,u=e.deltaY-s.deltaY,h=ot(l,c,u);i=h.x,r=h.y,n=f(h.x)>f(h.y)?h.x:h.y,o=st(c,u),t.lastInterval=e}else n=s.velocity,i=s.velocityX,r=s.velocityY,o=s.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=o}(n,e);var h,d;var p=t.element;T(e.srcEvent.target,p)&&(p=e.srcEvent.target);e.target=p}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function it(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:d(t.pointers[n].clientX),clientY:d(t.pointers[n].clientY)},n++;return{timeStamp:A(),pointers:e,center:rt(e),deltaX:t.deltaX,deltaY:t.deltaY}}function rt(t){var e=t.length;if(1===e)return{x:d(t[0].clientX),y:d(t[0].clientY)};for(var n=0,i=0,r=0;r<e;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:d(n/e),y:d(i/e)}}function ot(t,e,n){return{x:e/t||0,y:n/t||0}}function st(t,e){return t===e?H:f(t)>=f(e)?t<0?J:W:e<0?Q:K}function at(t,e,n){n||(n=$);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function lt(t,e,n){n||(n=$);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}et.prototype={handler:function(){},init:function(){this.evEl&&B(this.element,this.evEl,this.domHandler),this.evTarget&&B(this.target,this.evTarget,this.domHandler),this.evWin&&B(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(O(this.element),this.evWin,this.domHandler)}};var ct={mousedown:Z,mousemove:2,mouseup:j},ut="mousedown",ht="mousemove mouseup";function dt(){this.evEl=ut,this.evWin=ht,this.pressed=!1,et.apply(this,arguments)}b(dt,et,{handler:function(t){var e=ct[t.type];e&Z&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=j),this.pressed&&(e&j&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:G,srcEvent:t}))}});var ft={pointerdown:Z,pointermove:2,pointerup:j,pointercancel:V,pointerout:V},At={2:z,3:"pen",4:G,5:"kinect"},pt="pointerdown",gt="pointermove pointerup pointercancel";function mt(){this.evEl=pt,this.evWin=gt,et.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(pt="MSPointerDown",gt="MSPointerMove MSPointerUp MSPointerCancel"),b(mt,et,{handler:function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=ft[i],o=At[t.pointerType]||t.pointerType,s=o==z,a=I(e,t.pointerId,"pointerId");r&Z&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(j|V)&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(a,1))}});var yt={touchstart:Z,touchmove:2,touchend:j,touchcancel:V};function vt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,et.apply(this,arguments)}function _t(t,e){var n=P(t.touches),i=P(t.changedTouches);return e&(j|V)&&(n=D(n.concat(i),"identifier",!0)),[n,i]}b(vt,et,{handler:function(t){var e=yt[t.type];if(e===Z&&(this.started=!0),this.started){var n=_t.call(this,t,e);e&(j|V)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:z,srcEvent:t})}}});var bt={touchstart:Z,touchmove:2,touchend:j,touchcancel:V},xt="touchstart touchmove touchend touchcancel";function wt(){this.evTarget=xt,this.targetIds={},et.apply(this,arguments)}function Ct(t,e){var n=P(t.touches),i=this.targetIds;if(e&(2|Z)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,s=P(t.changedTouches),a=[],l=this.target;if(o=n.filter((function(t){return T(t.target,l)})),e===Z)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;for(r=0;r<s.length;)i[s[r].identifier]&&a.push(s[r]),e&(j|V)&&delete i[s[r].identifier],r++;return a.length?[D(o.concat(a),"identifier",!0),a]:void 0}b(wt,et,{handler:function(t){var e=bt[t.type],n=Ct.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:z,srcEvent:t})}});var Bt=2500;function Et(){et.apply(this,arguments);var t=x(this.handler,this);this.touch=new wt(this.manager,t),this.mouse=new dt(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function Tt(t,e){t&Z?(this.primaryTouch=e.changedPointers[0].identifier,St.call(this,e)):t&(j|V)&&St.call(this,e)}function St(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var i=this.lastTouches;setTimeout((function(){var t=i.indexOf(n);t>-1&&i.splice(t,1)}),Bt)}}function Mt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(e-r.x),s=Math.abs(n-r.y);if(o<=25&&s<=25)return!0}return!1}b(Et,et,{handler:function(t,e,n){var i=n.pointerType==z,r=n.pointerType==G;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)Tt.call(this,e,n);else if(r&&Mt.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var It=F(u.style,"touchAction"),Pt=It!==a,Dt="compute",Ft="auto",Lt="manipulation",Ot="none",Rt="pan-x",kt="pan-y",Ut=function(){if(!Pt)return!1;var t={},e=r.CSS&&r.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!e||r.CSS.supports("touch-action",n)})),t}();function zt(t,e){this.manager=t,this.set(e)}zt.prototype={set:function(t){t==Dt&&(t=this.compute()),Pt&&this.manager.element.style&&Ut[t]&&(this.manager.element.style[It]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return m(this.manager.recognizers,(function(e){w(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(S(t,Ot))return Ot;var e=S(t,Rt),n=S(t,kt);if(e&&n)return Ot;if(e||n)return e?Rt:kt;if(S(t,Lt))return Lt;return Ft}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var i=this.actions,r=S(i,Ot)&&!Ut[Ot],o=S(i,kt)&&!Ut[kt],s=S(i,Rt)&&!Ut[Rt];if(r){var a=1===t.pointers.length,l=t.distance<2,c=t.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return r||o&&n&q||s&&n&X?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Gt=1,Nt=32;function Zt(t){this.options=l({},this.defaults,t||{}),this.id=L++,this.manager=null,this.options.enable=C(this.options.enable,!0),this.state=Gt,this.simultaneous={},this.requireFail=[]}function jt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function Vt(t){return t==K?"down":t==Q?"up":t==J?"left":t==W?"right":""}function Ht(t,e){var n=e.manager;return n?n.get(t):t}function Jt(){Zt.apply(this,arguments)}function Wt(){Jt.apply(this,arguments),this.pX=null,this.pY=null}function Qt(){Jt.apply(this,arguments)}function Kt(){Zt.apply(this,arguments),this._timer=null,this._input=null}function qt(){Jt.apply(this,arguments)}function Xt(){Jt.apply(this,arguments)}function Yt(){Zt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function $t(t,e){return(e=e||{}).recognizers=C(e.recognizers,$t.defaults.preset),new te(t,e)}Zt.prototype={defaults:{},set:function(t){return l(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(g(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Ht(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return g(t,"dropRecognizeWith",this)||(t=Ht(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(g(t,"requireFailure",this))return this;var e=this.requireFail;return-1===I(e,t=Ht(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(g(t,"dropRequireFailure",this))return this;t=Ht(t,this);var e=I(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function i(n){e.manager.emit(n,t)}n<8&&i(e.options.event+jt(n)),i(e.options.event),t.additionalEvent&&i(t.additionalEvent),n>=8&&i(e.options.event+jt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=Nt},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(Nt|Gt)))return!1;t++}return!0},recognize:function(t){var e=l({},t);if(!w(this.options.enable,[this,e]))return this.reset(),void(this.state=Nt);56&this.state&&(this.state=Gt),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},b(Jt,Zt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,i=6&e,r=this.attrTest(t);return i&&(n&V||!r)?16|e:i||r?n&j?8|e:2&e?4|e:2:Nt}}),b(Wt,Jt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Y},getTouchAction:function(){var t=this.options.direction,e=[];return t&q&&e.push(kt),t&X&&e.push(Rt),e},directionTest:function(t){var e=this.options,n=!0,i=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(e.direction&q?(r=0===o?H:o<0?J:W,n=o!=this.pX,i=Math.abs(t.deltaX)):(r=0===s?H:s<0?Q:K,n=s!=this.pY,i=Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&r&e.direction},attrTest:function(t){return Jt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Vt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),b(Qt,Jt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ot]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),b(Kt,Zt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ft]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!i||!n||t.eventType&(j|V)&&!r)this.reset();else if(t.eventType&Z)this.reset(),this._timer=p((function(){this.state=8,this.tryEmit()}),e.time,this);else if(t.eventType&j)return 8;return Nt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&j?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=A(),this.manager.emit(this.options.event,this._input)))}}),b(qt,Jt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ot]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),b(Xt,Jt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:q|X,pointers:1},getTouchAction:function(){return Wt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(q|X)?e=t.overallVelocity:n&q?e=t.overallVelocityX:n&X&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&f(e)>this.options.velocity&&t.eventType&j},emit:function(t){var e=Vt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),b(Yt,Zt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Lt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&Z&&0===this.count)return this.failTimeout();if(i&&r&&n){if(t.eventType!=j)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,s=!this.pCenter||at(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,s&&o?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=p((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return Nt},failTimeout:function(){return this._timer=p((function(){this.state=Nt}),this.options.interval,this),Nt},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),$t.VERSION="2.0.7",$t.defaults={domEvents:!1,touchAction:Dt,enable:!0,inputTarget:null,inputClass:null,preset:[[qt,{enable:!1}],[Qt,{enable:!1},["rotate"]],[Xt,{direction:q}],[Wt,{direction:q},["swipe"]],[Yt],[Yt,{event:"doubletap",taps:2},["tap"]],[Kt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function te(t,e){var n;this.options=l({},$t.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((n=this).options.inputClass||(k?mt:U?wt:R?Et:dt))(n,nt),this.touchAction=new zt(this,this.options.touchAction),ee(this,!0),m(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function ee(t,e){var n,i=t.element;i.style&&(m(t.options.cssProps,(function(r,o){n=F(i.style,o),e?(t.oldCssProps[n]=i.style[n],i.style[n]=r):i.style[n]=t.oldCssProps[n]||""})),e||(t.oldCssProps={}))}te.prototype={set:function(t){return l(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var n;this.touchAction.preventDefaults(t);var i=this.recognizers,r=e.curRecognizer;(!r||r&&8&r.state)&&(r=e.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],2===e.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(t),!r&&14&n.state&&(r=e.curRecognizer=n),o++}},get:function(t){if(t instanceof Zt)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(g(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(g(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=I(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==a&&e!==a){var n=this.handlers;return m(M(t),(function(t){n[t]=n[t]||[],n[t].push(e)})),this}},off:function(t,e){if(t!==a){var n=this.handlers;return m(M(t),(function(t){e?n[t]&&n[t].splice(I(n[t],e),1):delete n[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var n=o.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var i=0;i<n.length;)n[i](e),i++}},destroy:function(){this.element&&ee(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},l($t,{INPUT_START:Z,INPUT_MOVE:2,INPUT_END:j,INPUT_CANCEL:V,STATE_POSSIBLE:Gt,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Nt,DIRECTION_NONE:H,DIRECTION_LEFT:J,DIRECTION_RIGHT:W,DIRECTION_UP:Q,DIRECTION_DOWN:K,DIRECTION_HORIZONTAL:q,DIRECTION_VERTICAL:X,DIRECTION_ALL:Y,Manager:te,Input:et,TouchAction:zt,TouchInput:wt,MouseInput:dt,PointerEventInput:mt,TouchMouseInput:Et,SingleTouchInput:vt,Recognizer:Zt,AttrRecognizer:Jt,Tap:Yt,Pan:Wt,Swipe:Xt,Pinch:Qt,Rotate:qt,Press:Kt,on:B,off:E,each:m,merge:_,extend:v,assign:l,inherit:b,bindFn:x,prefixed:F}),("undefined"!==typeof r?r:"undefined"!==typeof self?self:{}).Hammer=$t,(i=function(){return $t}.call(e,n,e,t))===a||(t.exports=i)}(window,document)},70356:(t,e)=>{e.read=function(t,e,n,i,r){var o,s,a=8*r-i-1,l=(1<<a)-1,c=l>>1,u=-7,h=n?r-1:0,d=n?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=256*s+t[e+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),o-=c}return(f?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,n,i,r,o){var s,a,l,c=8*o-r-1,u=(1<<c)-1,h=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,A=i?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+f]=255&a,f+=A,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;t[n+f]=255&s,f+=A,s/=256,c-=8);t[n+f-A]|=128*p}},42103:function(t,e){!function(n){"use strict";var i="Compound",r="MemberExpression",o="Literal",s=function(t,e){var n=new Error(t+" at character "+e);throw n.index=e,n.description=t,n},a=!0,l={"-":a,"!":a,"~":a,"+":a},c={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},u=function(t){var e,n=0;for(var i in t)(e=i.length)>n&&t.hasOwnProperty(i)&&(n=e);return n},h=u(l),d=u(c),f={true:!0,false:!1,null:null},A=function(t){return c[t]||0},p=function(t,e,n){return{type:"||"===t||"&&"===t?"LogicalExpression":"BinaryExpression",operator:t,left:e,right:n}},g=function(t){return t>=48&&t<=57},m=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=128&&!c[String.fromCharCode(t)]},y=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t>=128&&!c[String.fromCharCode(t)]},v=function(t){for(var e,n,a=0,u=t.charAt,v=t.charCodeAt,_=function(e){return u.call(t,e)},b=function(e){return v.call(t,e)},x=t.length,w=function(){for(var t=b(a);32===t||9===t||10===t||13===t;)t=b(++a)},C=function(){var t,e,n=E();return w(),63!==b(a)?n:(a++,(t=C())||s("Expected expression",a),w(),58===b(a)?(a++,(e=C())||s("Expected expression",a),{type:"ConditionalExpression",test:n,consequent:t,alternate:e}):void s("Expected :",a))},B=function(){w();for(var e=t.substr(a,d),n=e.length;n>0;){if(c.hasOwnProperty(e)&&(!m(b(a))||a+e.length<t.length&&!y(b(a+e.length))))return a+=n,e;e=e.substr(0,--n)}return!1},E=function(){var t,e,n,i,r,o,l,c,u;if(o=T(),!(e=B()))return o;for(r={value:e,prec:A(e)},(l=T())||s("Expected expression after "+e,a),i=[o,r,l];(e=B())&&0!==(n=A(e));){for(r={value:e,prec:n},u=e;i.length>2&&n<=i[i.length-2].prec;)l=i.pop(),e=i.pop().value,o=i.pop(),t=p(e,o,l),i.push(t);(t=T())||s("Expected expression after "+u,a),i.push(r,t)}for(t=i[c=i.length-1];c>1;)t=p(i[c-1].value,i[c-2],t),c-=2;return t},T=function(){var e,n,i;if(w(),e=b(a),g(e)||46===e)return S();if(39===e||34===e)return M();if(91===e)return L();for(i=(n=t.substr(a,h)).length;i>0;){if(l.hasOwnProperty(n)&&(!m(b(a))||a+n.length<t.length&&!y(b(a+n.length))))return a+=i,{type:"UnaryExpression",operator:n,argument:T(),prefix:!0};n=n.substr(0,--i)}return!(!m(e)&&40!==e)&&D()},S=function(){for(var t,e,n="";g(b(a));)n+=_(a++);if(46===b(a))for(n+=_(a++);g(b(a));)n+=_(a++);if("e"===(t=_(a))||"E"===t){for(n+=_(a++),"+"!==(t=_(a))&&"-"!==t||(n+=_(a++));g(b(a));)n+=_(a++);g(b(a-1))||s("Expected exponent ("+n+_(a)+")",a)}return e=b(a),m(e)?s("Variable names cannot start with a number ("+n+_(a)+")",a):46===e&&s("Unexpected period",a),{type:o,value:parseFloat(n),raw:n}},M=function(){for(var t,e="",n=_(a++),i=!1;a<x;){if((t=_(a++))===n){i=!0;break}if("\\"===t)switch(t=_(a++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return i||s('Unclosed quote after "'+e+'"',a),{type:o,value:e,raw:n+e+n}},I=function(){var e,n=b(a),i=a;for(m(n)?a++:s("Unexpected "+_(a),a);a<x&&(n=b(a),y(n));)a++;return e=t.slice(i,a),f.hasOwnProperty(e)?{type:o,value:f[e],raw:e}:"this"===e?{type:"ThisExpression"}:{type:"Identifier",name:e}},P=function(t){for(var e,n,r=[],o=!1,l=0;a<x;){if(w(),(e=b(a))===t){o=!0,a++,41===t&&l&&l>=r.length&&s("Unexpected token "+String.fromCharCode(t),a);break}if(44===e){if(a++,++l!==r.length)if(41===t)s("Unexpected token ,",a);else if(93===t)for(var c=r.length;c<l;c++)r.push(null)}else(n=C())&&n.type!==i||s("Expected comma",a),r.push(n)}return o||s("Expected "+String.fromCharCode(t),a),r},D=function(){var t,e;for(e=40===(t=b(a))?F():I(),w(),t=b(a);46===t||91===t||40===t;)a++,46===t?(w(),e={type:r,computed:!1,object:e,property:I()}):91===t?(e={type:r,computed:!0,object:e,property:C()},w(),93!==(t=b(a))&&s("Unclosed [",a),a++):40===t&&(e={type:"CallExpression",arguments:P(41),callee:e}),w(),t=b(a);return e},F=function(){a++;var t=C();if(w(),41===b(a))return a++,t;s("Unclosed (",a)},L=function(){return a++,{type:"ArrayExpression",elements:P(93)}},O=[];a<x;)59===(e=b(a))||44===e?a++:(n=C())?O.push(n):a<x&&s('Unexpected "'+_(a)+'"',a);return 1===O.length?O[0]:{type:i,body:O}};v.version="0.3.5",v.toString=function(){return"JavaScript Expression Parser (JSEP) v"+v.version},v.addUnaryOp=function(t){return h=Math.max(t.length,h),l[t]=a,this},v.addBinaryOp=function(t,e){return d=Math.max(t.length,d),c[t]=e,this},v.addLiteral=function(t,e){return f[t]=e,this},v.removeUnaryOp=function(t){return delete l[t],t.length===h&&(h=u(l)),this},v.removeAllUnaryOps=function(){return l={},h=0,this},v.removeBinaryOp=function(t){return delete c[t],t.length===d&&(d=u(c)),this},v.removeAllBinaryOps=function(){return c={},d=0,this},v.removeLiteral=function(t){return delete f[t],this},v.removeAllLiterals=function(){return f={},this},t.exports?e=t.exports=v:e.parse=v}()},88687:(t,e,n)=>{"use strict";new Uint8Array([0]);var i,r,o,s,a,l,c,u;!function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"}(i||(i={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(r||(r={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(o||(o={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(s||(s={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(a||(a={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(l||(l={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(c||(c={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(u||(u={}))},9794:function(t){t.exports=function(){"use strict";var t,e,n;function i(i,r){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",s={};t(s),n=r(s),"undefined"!==typeof window&&(n.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=r;else t=r}return i(["exports"],(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=i;function i(t,e,n,i){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=n,this.p2y=i}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var n,i,r,o,s;for(void 0===e&&(e=1e-6),r=t,s=0;s<8;s++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}if((r=t)<(n=0))return n;if(r>(i=1))return i;for(;n<i;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?n=r:i=r,r=.5*(i-n)+n}return r},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var r=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),i=n*this.x+e*this.y;return this.x=e*this.x-n*this.y,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),i=Math.sin(t),r=e.y+i*(this.x-e.x)+n*(this.y-e.y);return this.x=e.x+n*(this.x-e.x)-i*(this.y-e.y),this.y=r,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var s="undefined"!=typeof self?self:{},a=Math.pow(2,53)-1;function l(t,e,i,r){var o=new n(t,e,i,r);return function(t){return o.solve(t)}}var c=l(.25,.1,.25,1);function u(t,e,n){return Math.min(n,Math.max(e,t))}function h(t,e,n){var i=n-e,r=((t-e)%i+i)%i+e;return r===e?n:r}function d(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var i=0,r=e;i<r.length;i+=1){var o=r[i];for(var s in o)t[s]=o[s]}return t}var f=1;function A(){return f++}function p(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function g(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function y(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,n){var i={};for(var r in t)i[r]=e.call(n||this,t[r],r,t);return i}function _(t,e,n){var i={};for(var r in t)e.call(n||this,t[r],r,t)&&(i[r]=t[r]);return i}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?v(t,b):t}var x={};function w(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0)}function C(t,e,n){return(n.y-t.y)*(e.x-t.x)>(e.y-t.y)*(n.x-t.x)}function B(t){for(var e=0,n=0,i=t.length,r=i-1,o=void 0,s=void 0;n<i;r=n++)e+=((s=t[r]).x-(o=t[n]).x)*(o.y+s.y);return e}function E(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function T(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,n,i,r){var o=i||r;return e[n]=!o||o.toLowerCase(),""})),e["max-age"]){var n=parseInt(e["max-age"],10);isNaN(n)?delete e["max-age"]:e["max-age"]=n}return e}var S=null;function M(t){if(null==S){var e=t.navigator?t.navigator.userAgent:null;S=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return S}function I(t){try{var e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var P,D,F,L,O=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),R=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,k=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,U={now:O,frame:function(t){var e=R(t);return{cancel:function(){return k(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var n=s.document.createElement("canvas"),i=n.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return n.width=t.width,n.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return P||(P=s.document.createElement("a")),P.href=t,P.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==D&&(D=s.matchMedia("(prefers-reduced-motion: reduce)")),D.matches)}},z={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},G={supported:!1,testSupport:function(t){!N&&L&&(Z?j(t):F=t)}},N=!1,Z=!1;function j(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,L),t.isContextLost())return;G.supported=!0}catch(t){}t.deleteTexture(e),N=!0}s.document&&((L=s.document.createElement("img")).onload=function(){F&&j(F),F=null,Z=!0},L.onerror=function(){N=!0,F=null},L.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var V="01",H=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function J(t){return 0===t.indexOf("mapbox:")}H.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",V,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},H.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},H.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},H.prototype.normalizeStyleURL=function(t,e){if(!J(t))return t;var n=q(t);return n.path="/styles/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},H.prototype.normalizeGlyphsURL=function(t,e){if(!J(t))return t;var n=q(t);return n.path="/fonts/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},H.prototype.normalizeSourceURL=function(t,e){if(!J(t))return t;var n=q(t);return n.path="/v4/"+n.authority+".json",n.params.push("secure"),this._makeAPIURL(n,this._customAccessToken||e)},H.prototype.normalizeSpriteURL=function(t,e,n,i){var r=q(t);return J(t)?(r.path="/styles/v1"+r.path+"/sprite"+e+n,this._makeAPIURL(r,this._customAccessToken||i)):(r.path+=""+e+n,X(r))},H.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!J(t))return t;var n=q(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,(U.devicePixelRatio>=2||512===e?"@2x":"")+(G.supported?".webp":"$1")),n.path=n.path.replace(/^.+\/v4\//,"/"),n.path="/v4"+n.path;var i=this._customAccessToken||function(t){for(var e=0,n=t;e<n.length;e+=1){var i=n[e].match(/^access_token=(.*)$/);if(i)return i[1]}return null}(n.params)||z.ACCESS_TOKEN;return z.REQUIRE_ACCESS_TOKEN&&i&&this._skuToken&&n.params.push("sku="+this._skuToken),this._makeAPIURL(n,i)},H.prototype.canonicalizeTileURL=function(t,e){var n=q(t);if(!n.path.match(/(^\/v4\/)/)||!n.path.match(/\.[\w]+$/))return t;var i="mapbox://tiles/";i+=n.path.replace("/v4/","");var r=n.params;return e&&(r=r.filter((function(t){return!t.match(/^access_token=/)}))),r.length&&(i+="?"+r.join("&")),i},H.prototype.canonicalizeTileset=function(t,e){for(var n=!!e&&J(e),i=[],r=0,o=t.tiles||[];r<o.length;r+=1){var s=o[r];Q(s)?i.push(this.canonicalizeTileURL(s,n)):i.push(s)}return i},H.prototype._makeAPIURL=function(t,e){var n="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",i=q(z.API_URL);if(t.protocol=i.protocol,t.authority=i.authority,"http"===t.protocol){var r=t.params.indexOf("secure");r>=0&&t.params.splice(r,1)}if("/"!==i.path&&(t.path=""+i.path+t.path),!z.REQUIRE_ACCESS_TOKEN)return X(t);if(!(e=e||z.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+n);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+n);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),X(t)};var W=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Q(t){return W.test(t)}var K=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function q(t){var e=t.match(K);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function X(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function Y(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(s.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var $=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};$.prototype.getStorageKey=function(t){var e,n=Y(z.ACCESS_TOKEN);return e=n&&n.u?s.btoa(encodeURIComponent(n.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):z.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},$.prototype.fetchEventData=function(){var t=I("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{var i=s.localStorage.getItem(e);i&&(this.eventData=JSON.parse(i));var r=s.localStorage.getItem(n);r&&(this.anonId=r)}catch(t){w("Unable to read from LocalStorage")}},$.prototype.saveEventData=function(){var t=I("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{s.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},$.prototype.processRequests=function(t){},$.prototype.postEvent=function(t,e,n,i){var r=this;if(z.EVENTS_URL){var o=q(z.EVENTS_URL);o.params.push("access_token="+(i||z.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.2",skuId:V,userId:this.anonId},a=e?d(s,e):s,l={url:X(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=bt(l,(function(t){r.pendingRequest=null,n(t),r.saveEventData(),r.processRequests(i)}))}},$.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,nt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,n,i){this.skuToken=n,(z.EVENTS_URL&&i||z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return J(t)||Q(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},i)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var n=this.queue.shift(),i=n.id,r=n.timestamp;i&&this.success[i]||(this.anonId||this.fetchEventData(),g(this.anonId)||(this.anonId=p()),this.postEvent(r,{skuToken:this.skuToken},(function(t){t||i&&(e.success[i]=!0)}),t))}},e}($),it=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){z.EVENTS_URL&&z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return J(t)||Q(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var n=Y(z.ACCESS_TOKEN),i=n?n.u:z.ACCESS_TOKEN,r=i!==this.eventData.tokenU;g(this.anonId)||(this.anonId=p(),r=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var s=new Date(this.eventData.lastSuccess),a=new Date(o),l=(o-this.eventData.lastSuccess)/864e5;r=r||l>=1||l<-1||s.getDate()!==a.getDate()}else r=!0;if(!r)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=i)}),t)}},e}($)),rt=it.postTurnstileEvent.bind(it),ot=new nt,st=ot.postMapLoadEvent.bind(ot),at=500,lt=50;function ct(){s.caches&&!tt&&(tt=s.caches.open("mapbox-tiles"))}function ut(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,dt=1/0;function ft(){return null==ht&&(ht=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),ht}var At={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(At);var pt,gt,mt=function(t){function e(e,n,i){401===n&&Q(i)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=n,this.url=i,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),yt=E()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href},vt=function(t,e){if(!(/^file:/.test(n=t.url)||/^file:/.test(yt())&&!/^\w+:/.test(n))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return function(t,e){var n,i=new s.AbortController,r=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:yt(),signal:i.signal}),o=!1,a=!1,l=(n=r.url).indexOf("sku=")>0&&Q(n);"json"===t.type&&r.headers.set("Accept","application/json");var c=function(n,i,o){if(!a){if(n&&"SecurityError"!==n.message&&w(n),i&&o)return u(i);var c=Date.now();s.fetch(r).then((function(n){if(n.ok){var i=l?n.clone():null;return u(n,i,c)}return e(new mt(n.statusText,n.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},u=function(n,i,l){("arrayBuffer"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text()).then((function(t){a||(i&&l&&function(t,e,n){if(ct(),tt){var i={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach((function(t,e){return i.headers.set(e,t)}));var r=T(e.headers.get("Cache-Control")||"");r["no-store"]||(r["max-age"]&&i.headers.set("Expires",new Date(n+1e3*r["max-age"]).toUTCString()),new Date(i.headers.get("Expires")).getTime()-n<42e4||function(t,e){if(void 0===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var n=new s.Response(e,i);ct(),tt&&tt.then((function(e){return e.put(ut(t.url),n)})).catch((function(t){return w(t.message)}))})))}}(r,i,l),o=!0,e(null,t,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((function(t){a||e(new Error(t.message))}))};return l?function(t,e){if(ct(),!tt)return e(null);var n=ut(t.url);tt.then((function(t){t.match(n).then((function(i){var r=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),n=T(t.headers.get("Cache-Control")||"");return e>Date.now()&&!n["no-cache"]}(i);t.delete(n),r&&t.put(n,i.clone()),e(null,i,r)})).catch(e)})).catch(e)}(r,c):c(null,null),{cancel:function(){a=!0,o||i.abort()}}}(t,e);if(E()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var n;return function(t,e){var n=new s.XMLHttpRequest;for(var i in n.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(n.responseType="arraybuffer"),t.headers)n.setRequestHeader(i,t.headers[i]);return"json"===t.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===t.credentials,n.onerror=function(){e(new Error(n.statusText))},n.onload=function(){if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){var i=n.response;if("json"===t.type)try{i=JSON.parse(n.response)}catch(t){return e(t)}e(null,i,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else e(new mt(n.statusText,n.status,t.url))},n.send(t.body),{cancel:function(){return n.abort()}}}(t,e)},_t=function(t,e){return vt(d(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return vt(d(t,{method:"POST"}),e)},xt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";pt=[],gt=0;var wt=function(t,e){if(G.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),gt>=z.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return pt.push(n),n}gt++;var i=!1,r=function(){if(!i)for(i=!0,gt--;pt.length&&gt<z.MAX_PARALLEL_IMAGE_REQUESTS;){var t=pt.shift();t.cancelled||(t.cancel=wt(t.requestParameters,t.callback).cancel)}},o=_t(t,(function(t,n,i,o){r(),t?e(t):n&&(ft()?function(t,e){var n=new s.Blob([new Uint8Array(t)],{type:"image/png"});s.createImageBitmap(n).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(n,e):function(t,e,n,i){var r=new s.Image,o=s.URL;r.onload=function(){e(null,r),o.revokeObjectURL(r.src),r.onload=null,s.requestAnimationFrame((function(){r.src=xt}))},r.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var a=new s.Blob([new Uint8Array(t)],{type:"image/png"});r.cacheControl=n,r.expires=i,r.src=t.byteLength?o.createObjectURL(a):xt}(n,e,i,o))}));return{cancel:function(){o.cancel(),r()}}};function Ct(t,e,n){n[t]&&-1!==n[t].indexOf(e)||(n[t]=n[t]||[],n[t].push(e))}function Bt(t,e,n){if(n&&n[t]){var i=n[t].indexOf(e);-1!==i&&n[t].splice(i,1)}}var Et=function(t,e){void 0===e&&(e={}),d(this,e),this.type=t},Tt=function(t){function e(e,n){void 0===n&&(n={}),t.call(this,"error",d({error:e},n))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Et),St=function(){};St.prototype.on=function(t,e){return this._listeners=this._listeners||{},Ct(t,e,this._listeners),this},St.prototype.off=function(t,e){return Bt(t,e,this._listeners),Bt(t,e,this._oneTimeListeners),this},St.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Ct(t,e,this._oneTimeListeners),this},St.prototype.fire=function(t,e){"string"==typeof t&&(t=new Et(t,e||{}));var n=t.type;if(this.listens(n)){t.target=this;for(var i=0,r=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];i<r.length;i+=1)r[i].call(this,t);for(var o=0,s=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];o<s.length;o+=1){var a=s[o];Bt(n,a,this._oneTimeListeners),a.call(this,t)}var l=this._eventedParent;l&&(d(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof Tt&&console.error(t.error);return this},St.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},St.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Mt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},It=function(t,e,n,i){this.message=(t?t+": ":"")+n,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__)};function Pt(t){var e=t.value;return e?[new It(t.key,e,"constants have been deprecated as of v8")]:[]}function Dt(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var i=0,r=e;i<r.length;i+=1){var o=r[i];for(var s in o)t[s]=o[s]}return t}function Ft(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Lt(t){if(Array.isArray(t))return t.map(Lt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var n in t)e[n]=Lt(t[n]);return e}return Ft(t)}var Ot=function(t){function e(e,n){t.call(this,n),this.message=n,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),Rt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var n=0,i=e;n<i.length;n+=1){var r=i[n];this.bindings[r[0]]=r[1]}};Rt.prototype.concat=function(t){return new Rt(this,t)},Rt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Rt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var kt={kind:"null"},Ut={kind:"number"},zt={kind:"string"},Gt={kind:"boolean"},Nt={kind:"color"},Zt={kind:"object"},jt={kind:"value"},Vt={kind:"collator"},Ht={kind:"formatted"},Jt={kind:"resolvedImage"};function Wt(t,e){return{kind:"array",itemType:t,N:e}}function Qt(t){if("array"===t.kind){var e=Qt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Kt=[kt,Ut,zt,Gt,Nt,Ht,Zt,Wt(jt),Jt];function qt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!qt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var n=0,i=Kt;n<i.length;n+=1)if(!qt(i[n],e))return null}return"Expected "+Qt(t)+" but found "+Qt(e)+" instead."}function Xt(t,e){return e.some((function(e){return e.kind===t.kind}))}function Yt(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var $t=e((function(t,e){var n={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function i(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function s(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in n)return n[a].slice();if("#"===a[0])return 4===a.length?(e=parseInt(a.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===a.length&&(e=parseInt(a.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=a.indexOf("("),c=a.indexOf(")");if(-1!==l&&c+1===a.length){var u=a.substr(0,l),h=a.substr(l+1,c-(l+1)).split(","),d=1;switch(u){case"rgba":if(4!==h.length)return null;d=o(h.pop());case"rgb":return 3!==h.length?null:[r(h[0]),r(h[1]),r(h[2]),d];case"hsla":if(4!==h.length)return null;d=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,A=o(h[1]),p=o(h[2]),g=p<=.5?p*(A+1):p+A-p*A,m=2*p-g;return[i(255*s(m,g,f+1/3)),i(255*s(m,g,f)),i(255*s(m,g,f-1/3)),d];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,n,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=n,this.a=i};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[1],n=t[2],i=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(n)+","+i+")"},te.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,n){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ne=function(t,e,n,i,r){this.text=t,this.image=e,this.scale=n,this.fontStack=i,this.textColor=r},ie=function(t){this.sections=t};ie.fromString=function(t){return new ie([new ne(t,null,null,null,null)])},ie.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ie.factory=function(t){return t instanceof ie?t:ie.fromString(t)},ie.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ie.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e<n.length;e+=1){var i=n[e];if(i.image)t.push(["image",i.image.name]);else{t.push(i.text);var r={};i.fontStack&&(r["text-font"]=["literal",i.fontStack.split(",")]),i.scale&&(r["font-scale"]=i.scale),i.textColor&&(r["text-color"]=["rgba"].concat(i.textColor.toArray())),t.push(r)}}return t};var re=function(t){this.name=t.name,this.available=t.available};function oe(t,e,n,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value ["+[t,e,n,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,n,i]:[t,e,n]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function se(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(t instanceof ie)return!0;if(t instanceof re)return!0;if(Array.isArray(t)){for(var e=0,n=t;e<n.length;e+=1)if(!se(n[e]))return!1;return!0}if("object"==typeof t){for(var i in t)if(!se(t[i]))return!1;return!0}return!1}function ae(t){if(null===t)return kt;if("string"==typeof t)return zt;if("boolean"==typeof t)return Gt;if("number"==typeof t)return Ut;if(t instanceof te)return Nt;if(t instanceof ee)return Vt;if(t instanceof ie)return Ht;if(t instanceof re)return Jt;if(Array.isArray(t)){for(var e,n=t.length,i=0,r=t;i<r.length;i+=1){var o=ae(r[i]);if(e){if(e===o)continue;e=jt;break}e=o}return Wt(e||jt,n)}return Zt}function le(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof te||t instanceof ie||t instanceof re?t.toString():JSON.stringify(t)}re.prototype.toString=function(){return this.name},re.fromString=function(t){return t?new re({name:t,available:!1}):null},re.prototype.serialize=function(){return["image",this.name]};var ce=function(t,e){this.type=t,this.value=e};ce.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!se(t[1]))return e.error("invalid value");var n=t[1],i=ae(n),r=e.expectedType;return"array"!==i.kind||0!==i.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(i=r),new ce(i,n)},ce.prototype.evaluate=function(){return this.value},ce.prototype.eachChild=function(){},ce.prototype.outputDefined=function(){return!0},ce.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof te?["rgba"].concat(this.value.toArray()):this.value instanceof ie?this.value.serialize():this.value};var ue=function(t){this.name="ExpressionEvaluationError",this.message=t};ue.prototype.toJSON=function(){return this.message};var he={string:zt,number:Ut,boolean:Gt,object:Zt},de=function(t,e){this.type=t,this.args=e};de.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n,i=1,r=t[0];if("array"===r){var o,s;if(t.length>2){var a=t[1];if("string"!=typeof a||!(a in he)||"object"===a)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[a],i++}else o=jt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],i++}n=Wt(o,s)}else n=he[r];for(var l=[];i<t.length;i++){var c=e.parse(t[i],i,jt);if(!c)return null;l.push(c)}return new de(n,l)},de.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var n=this.args[e].evaluate(t);if(!qt(this.type,ae(n)))return n;if(e===this.args.length-1)throw new ue("Expected value to be of type "+Qt(this.type)+", but found "+Qt(ae(n))+" instead.")}return null},de.prototype.eachChild=function(t){this.args.forEach(t)},de.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},de.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var n=t.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){e.push(n.kind);var i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var fe=function(t){this.type=Ht,this.sections=t};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n=t[1];if(!Array.isArray(n)&&"object"==typeof n)return e.error("First argument must be an image or text section.");for(var i=[],r=!1,o=1;o<=t.length-1;++o){var s=t[o];if(r&&"object"==typeof s&&!Array.isArray(s)){r=!1;var a=null;if(s["font-scale"]&&!(a=e.parse(s["font-scale"],1,Ut)))return null;var l=null;if(s["text-font"]&&!(l=e.parse(s["text-font"],1,Wt(zt))))return null;var c=null;if(s["text-color"]&&!(c=e.parse(s["text-color"],1,Nt)))return null;var u=i[i.length-1];u.scale=a,u.font=l,u.textColor=c}else{var h=e.parse(t[o],1,jt);if(!h)return null;var d=h.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,i.push({content:h,scale:null,font:null,textColor:null})}}return new fe(i)},fe.prototype.evaluate=function(t){return new ie(this.sections.map((function(e){var n=e.content.evaluate(t);return ae(n)===Jt?new ne("",n,null,null,null):new ne(le(n),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},fe.prototype.eachChild=function(t){for(var e=0,n=this.sections;e<n.length;e+=1){var i=n[e];t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}},fe.prototype.outputDefined=function(){return!1},fe.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e<n.length;e+=1){var i=n[e];t.push(i.content.serialize());var r={};i.scale&&(r["font-scale"]=i.scale.serialize()),i.font&&(r["text-font"]=i.font.serialize()),i.textColor&&(r["text-color"]=i.textColor.serialize()),t.push(r)}return t};var Ae=function(t){this.type=Jt,this.input=t};Ae.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var n=e.parse(t[1],1,zt);return n?new Ae(n):e.error("No image name provided.")},Ae.prototype.evaluate=function(t){var e=this.input.evaluate(t),n=re.fromString(e);return n&&t.availableImages&&(n.available=t.availableImages.indexOf(e)>-1),n},Ae.prototype.eachChild=function(t){t(this.input)},Ae.prototype.outputDefined=function(){return!1},Ae.prototype.serialize=function(){return["image",this.input.serialize()]};var pe={"to-boolean":Gt,"to-color":Nt,"to-number":Ut,"to-string":zt},ge=function(t,e){this.type=t,this.args=e};ge.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n=t[0];if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return e.error("Expected one argument.");for(var i=pe[n],r=[],o=1;o<t.length;o++){var s=e.parse(t[o],o,jt);if(!s)return null;r.push(s)}return new ge(i,r)},ge.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,n,i=0,r=this.args;i<r.length;i+=1){if(n=null,(e=r[i].evaluate(t))instanceof te)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(n=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":oe(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ue(n||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var s=null,a=0,l=this.args;a<l.length;a+=1){if(null===(s=l[a].evaluate(t)))return 0;var c=Number(s);if(!isNaN(c))return c}throw new ue("Could not convert "+JSON.stringify(s)+" to number.")}return"formatted"===this.type.kind?ie.fromString(le(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?re.fromString(le(this.args[0].evaluate(t))):le(this.args[0].evaluate(t))},ge.prototype.eachChild=function(t){this.args.forEach(t)},ge.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ge.prototype.serialize=function(){if("formatted"===this.type.kind)return new fe([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Ae(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var me=["Unknown","Point","LineString","Polygon"],ye=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ye.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ye.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?me[this.feature.type]:this.feature.type:null},ye.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ye.prototype.canonicalID=function(){return this.canonical},ye.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ye.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=te.parse(t)),e};var ve=function(t,e,n,i){this.name=t,this.type=e,this._evaluate=n,this.args=i};ve.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ve.prototype.eachChild=function(t){this.args.forEach(t)},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},ve.parse=function(t,e){var n,i=t[0],r=ve.definitions[i];if(!r)return e.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(r)?r[0]:r.type,s=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=s.filter((function(e){var n=e[0];return!Array.isArray(n)||n.length===t.length-1})),l=null,c=0,u=a;c<u.length;c+=1){var h=u[c],d=h[0],f=h[1];l=new Ne(e.registry,e.path,null,e.scope);for(var A=[],p=!1,g=1;g<t.length;g++){var m=t[g],y=Array.isArray(d)?d[g-1]:d.type,v=l.parse(m,1+A.length,y);if(!v){p=!0;break}A.push(v)}if(!p)if(Array.isArray(d)&&d.length!==A.length)l.error("Expected "+d.length+" arguments, but found "+A.length+" instead.");else{for(var _=0;_<A.length;_++){var b=Array.isArray(d)?d[_]:d.type,x=A[_];l.concat(_+1).checkSubtype(b,x.type)}if(0===l.errors.length)return new ve(i,o,f,A)}}if(1===a.length)(n=e.errors).push.apply(n,l.errors);else{for(var w=(a.length?a:s).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Qt).join(", ")+")":"("+Qt(e.type)+"...)"})).join(" | "),C=[],B=1;B<t.length;B++){var E=e.parse(t[B],1+C.length);if(!E)return null;C.push(Qt(E.type))}e.error("Expected arguments of type "+w+", but found ("+C.join(", ")+") instead.")}return null},ve.register=function(t,e){for(var n in ve.definitions=e,e)t[n]=ve};var _e=function(t,e,n){this.type=Vt,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=e};function be(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function xe(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function we(t,e){var n=(180+t[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,r=Math.pow(2,e.z);return[Math.round(n*r*8192),Math.round(i*r*8192)]}function Ce(t,e,n){return e[1]>t[1]!=n[1]>t[1]&&t[0]<(n[0]-e[0])*(t[1]-e[1])/(n[1]-e[1])+e[0]}function Be(t,e){for(var n,i,r,o,s,a,l,c=!1,u=0,h=e.length;u<h;u++)for(var d=e[u],f=0,A=d.length;f<A-1;f++){if((o=(n=t)[0]-(i=d[f])[0])*(l=n[1]-(r=d[f+1])[1])-(a=n[0]-r[0])*(s=n[1]-i[1])==0&&o*a<=0&&s*l<=0)return!1;Ce(t,d[f],d[f+1])&&(c=!c)}return c}function Ee(t,e){for(var n=0;n<e.length;n++)if(Be(t,e[n]))return!0;return!1}function Te(t,e,n,i){var r=i[0]-n[0],o=i[1]-n[1],s=(t[0]-n[0])*o-r*(t[1]-n[1]),a=(e[0]-n[0])*o-r*(e[1]-n[1]);return s>0&&a<0||s<0&&a>0}function Se(t,e,n){for(var i=0,r=n;i<r.length;i+=1)for(var o=r[i],s=0;s<o.length-1;++s)if(0!=(h=[(u=o[s+1])[0]-(c=o[s])[0],u[1]-c[1]])[0]*(d=[(l=e)[0]-(a=t)[0],l[1]-a[1]])[1]-h[1]*d[0]&&Te(a,l,c,u)&&Te(c,u,a,l))return!0;var a,l,c,u,h,d;return!1}function Me(t,e){for(var n=0;n<t.length;++n)if(!Be(t[n],e))return!1;for(var i=0;i<t.length-1;++i)if(Se(t[i],t[i+1],e))return!1;return!0}function Ie(t,e){for(var n=0;n<e.length;n++)if(Me(t,e[n]))return!0;return!1}function Pe(t,e,n){for(var i=[],r=0;r<t.length;r++){for(var o=[],s=0;s<t[r].length;s++){var a=we(t[r][s],n);be(e,a),o.push(a)}i.push(o)}return i}function De(t,e,n){for(var i=[],r=0;r<t.length;r++){var o=Pe(t[r],e,n);i.push(o)}return i}function Fe(t,e,n,i){if(t[0]<n[0]||t[0]>n[2]){var r=.5*i,o=t[0]-n[0]>r?-i:n[0]-t[0]>r?i:0;0===o&&(o=t[0]-n[2]>r?-i:n[2]-t[0]>r?i:0),t[0]+=o}be(e,t)}function Le(t,e,n,i){for(var r=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],s=[],a=0,l=t;a<l.length;a+=1)for(var c=0,u=l[a];c<u.length;c+=1){var h=u[c],d=[h.x+o[0],h.y+o[1]];Fe(d,e,n,r),s.push(d)}return s}function Oe(t,e,n,i){for(var r,o=8192*Math.pow(2,i.z),s=[8192*i.x,8192*i.y],a=[],l=0,c=t;l<c.length;l+=1){for(var u=[],h=0,d=c[l];h<d.length;h+=1){var f=d[h],A=[f.x+s[0],f.y+s[1]];be(e,A),u.push(A)}a.push(u)}if(e[2]-e[0]<=o/2){(r=e)[0]=r[1]=1/0,r[2]=r[3]=-1/0;for(var p=0,g=a;p<g.length;p+=1)for(var m=0,y=g[p];m<y.length;m+=1)Fe(y[m],e,n,o)}return a}_e.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var n=t[1];if("object"!=typeof n||Array.isArray(n))return e.error("Collator options argument must be an object.");var i=e.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,Gt);if(!i)return null;var r=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,Gt);if(!r)return null;var o=null;return n.locale&&!(o=e.parse(n.locale,1,zt))?null:new _e(i,r,o)},_e.prototype.evaluate=function(t){return new ee(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},_e.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},_e.prototype.outputDefined=function(){return!1},_e.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Re=function(t,e){this.type=Gt,this.geojson=t,this.geometries=e};function ke(t){if(t instanceof ve){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Re)return!1;var e=!0;return t.eachChild((function(t){e&&!ke(t)&&(e=!1)})),e}function Ue(t){if(t instanceof ve&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Ue(t)&&(e=!1)})),e}function ze(t,e){if(t instanceof ve&&e.indexOf(t.name)>=0)return!1;var n=!0;return t.eachChild((function(t){n&&!ze(t,e)&&(n=!1)})),n}Re.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(se(t[1])){var n=t[1];if("FeatureCollection"===n.type)for(var i=0;i<n.features.length;++i){var r=n.features[i].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new Re(n,n.features[i].geometry)}else if("Feature"===n.type){var o=n.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new Re(n,n.geometry)}else if("Polygon"===n.type||"MultiPolygon"===n.type)return new Re(n,n)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Re.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){var o=Pe(e.coordinates,i,r),s=Le(t.geometry(),n,i,r);if(!xe(n,i))return!1;for(var a=0,l=s;a<l.length;a+=1)if(!Be(l[a],o))return!1}if("MultiPolygon"===e.type){var c=De(e.coordinates,i,r),u=Le(t.geometry(),n,i,r);if(!xe(n,i))return!1;for(var h=0,d=u;h<d.length;h+=1)if(!Ee(d[h],c))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){var o=Pe(e.coordinates,i,r),s=Oe(t.geometry(),n,i,r);if(!xe(n,i))return!1;for(var a=0,l=s;a<l.length;a+=1)if(!Me(l[a],o))return!1}if("MultiPolygon"===e.type){var c=De(e.coordinates,i,r),u=Oe(t.geometry(),n,i,r);if(!xe(n,i))return!1;for(var h=0,d=u;h<d.length;h+=1)if(!Ie(d[h],c))return!1}return!0}(t,this.geometries)}return!1},Re.prototype.eachChild=function(){},Re.prototype.outputDefined=function(){return!0},Re.prototype.serialize=function(){return["within",this.geojson]};var Ge=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Ge.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var n=t[1];return e.scope.has(n)?new Ge(n,e.scope.get(n)):e.error('Unknown variable "'+n+'". Make sure "'+n+'" has been bound in an enclosing "let" expression before using it.',1)},Ge.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ge.prototype.eachChild=function(){},Ge.prototype.outputDefined=function(){return!1},Ge.prototype.serialize=function(){return["var",this.name]};var Ne=function(t,e,n,i,r){void 0===e&&(e=[]),void 0===i&&(i=new Rt),void 0===r&&(r=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=i,this.errors=r,this.expectedType=n};function Ze(t,e){for(var n,i=t.length-1,r=0,o=i,s=0;r<=o;)if((n=t[s=Math.floor((r+o)/2)])<=e){if(s===i||e<t[s+1])return s;r=s+1}else{if(!(n>e))throw new ue("Input is not a number.");o=s-1}return 0}Ne.prototype.parse=function(t,e,n,i,r){return void 0===r&&(r={}),e?this.concat(e,n,i)._parse(t,r):this._parse(t,r)},Ne.prototype._parse=function(t,e){function n(t,e,n){return"assert"===n?new de(e,[t]):"coerce"===n?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var r=this.registry[i];if(r){var o=r.parse(t,this);if(!o)return null;if(this.expectedType){var s=this.expectedType,a=o.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==a.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(s,a))return null}else o=n(o,s,e.typeAnnotation||"coerce");else o=n(o,s,e.typeAnnotation||"assert")}if(!(o instanceof ce)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Ge)return t(e.boundExpression);if(e instanceof ve&&"error"===e.name)return!1;if(e instanceof _e)return!1;if(e instanceof Re)return!1;var n=e instanceof ge||e instanceof de,i=!0;return e.eachChild((function(e){i=n?i&&t(e):i&&e instanceof ce})),!!i&&ke(e)&&ze(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var l=new ye;try{o=new ce(o.type,o.evaluate(l))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Ne.prototype.concat=function(t,e,n){var i="number"==typeof t?this.path.concat(t):this.path,r=n?this.scope.concat(n):this.scope;return new Ne(this.registry,i,e||null,r,this.errors)},Ne.prototype.error=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var i=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Ot(i,t))},Ne.prototype.checkSubtype=function(t,e){var n=qt(t,e);return n&&this.error(n),n};var je=function(t,e,n){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,r=n;i<r.length;i+=1){var o=r[i],s=o[1];this.labels.push(o[0]),this.outputs.push(s)}};function Ve(t,e,n){return t*(1-n)+e*n}je.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var n=e.parse(t[1],1,Ut);if(!n)return null;var i=[],r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var o=1;o<t.length;o+=2){var s=1===o?-1/0:t[o],a=t[o+1],l=o,c=o+1;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(i.length&&i[i.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(a,c,r);if(!u)return null;r=r||u.type,i.push([s,u])}return new je(r,n,i)},je.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return n[0].evaluate(t);var r=e.length;return i>=e[r-1]?n[r-1].evaluate(t):n[Ze(e,i)].evaluate(t)},je.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e<n.length;e+=1)t(n[e])},je.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},je.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var He=Object.freeze({__proto__:null,number:Ve,color:function(t,e,n){return new te(Ve(t.r,e.r,n),Ve(t.g,e.g,n),Ve(t.b,e.b,n),Ve(t.a,e.a,n))},array:function(t,e,n){return t.map((function(t,i){return Ve(t,e[i],n)}))}}),Je=6/29*3*(6/29),We=Math.PI/180,Qe=180/Math.PI;function Ke(t){return t>.008856451679035631?Math.pow(t,1/3):t/Je+4/29}function qe(t){return t>6/29?t*t*t:Je*(t-4/29)}function Xe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ye(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $e(t){var e=Ye(t.r),n=Ye(t.g),i=Ye(t.b),r=Ke((.4124564*e+.3575761*n+.1804375*i)/.95047),o=Ke((.2126729*e+.7151522*n+.072175*i)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-Ke((.0193339*e+.119192*n+.9503041*i)/1.08883)),alpha:t.a}}function tn(t){var e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*qe(e),n=.95047*qe(n),i=1.08883*qe(i),new te(Xe(3.2404542*n-1.5371385*e-.4985314*i),Xe(-.969266*n+1.8760108*e+.041556*i),Xe(.0556434*n-.2040259*e+1.0572252*i),t.alpha)}function en(t,e,n){var i=e-t;return t+n*(i>180||i<-180?i-360*Math.round(i/360):i)}var nn={forward:$e,reverse:tn,interpolate:function(t,e,n){return{l:Ve(t.l,e.l,n),a:Ve(t.a,e.a,n),b:Ve(t.b,e.b,n),alpha:Ve(t.alpha,e.alpha,n)}}},rn={forward:function(t){var e=$e(t),n=e.l,i=e.a,r=e.b,o=Math.atan2(r,i)*Qe;return{h:o<0?o+360:o,c:Math.sqrt(i*i+r*r),l:n,alpha:t.a}},reverse:function(t){var e=t.h*We,n=t.c;return tn({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:en(t.h,e.h,n),c:Ve(t.c,e.c,n),l:Ve(t.l,e.l,n),alpha:Ve(t.alpha,e.alpha,n)}}},on=Object.freeze({__proto__:null,lab:nn,hcl:rn}),sn=function(t,e,n,i,r){this.type=t,this.operator=e,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(var o=0,s=r;o<s.length;o+=1){var a=s[o],l=a[1];this.labels.push(a[0]),this.outputs.push(l)}};function an(t,e,n,i){var r=i-n,o=t-n;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}sn.interpolationFactor=function(t,e,i,r){var o=0;if("exponential"===t.name)o=an(e,t.base,i,r);else if("linear"===t.name)o=an(e,1,i,r);else if("cubic-bezier"===t.name){var s=t.controlPoints;o=new n(s[0],s[1],s[2],s[3]).solve(an(e,1,i,r))}return o},sn.parse=function(t,e){var n=t[0],i=t[1],r=t[2],o=t.slice(3);if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){var s=i[1];if("number"!=typeof s)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:s}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);var a=i.slice(1);if(4!==a.length||a.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:a}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(r=e.parse(r,2,Ut)))return null;var l=[],c=null;"interpolate-hcl"===n||"interpolate-lab"===n?c=Nt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u<o.length;u+=2){var h=o[u],d=o[u+1],f=u+3,A=u+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var p=e.parse(d,A,c);if(!p)return null;c=c||p.type,l.push([h,p])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new sn(c,n,i,r,l):e.error("Type "+Qt(c)+" is not interpolatable.")},sn.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return n[0].evaluate(t);var r=e.length;if(i>=e[r-1])return n[r-1].evaluate(t);var o=Ze(e,i),s=sn.interpolationFactor(this.interpolation,i,e[o],e[o+1]),a=n[o].evaluate(t),l=n[o+1].evaluate(t);return"interpolate"===this.operator?He[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?rn.reverse(rn.interpolate(rn.forward(a),rn.forward(l),s)):nn.reverse(nn.interpolate(nn.forward(a),nn.forward(l),s))},sn.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e<n.length;e+=1)t(n[e])},sn.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},sn.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],n=0;n<this.labels.length;n++)e.push(this.labels[n],this.outputs[n].serialize());return e};var ln=function(t,e){this.type=t,this.args=e};ln.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var n=null,i=e.expectedType;i&&"value"!==i.kind&&(n=i);for(var r=[],o=0,s=t.slice(1);o<s.length;o+=1){var a=e.parse(s[o],1+r.length,n,void 0,{typeAnnotation:"omit"});if(!a)return null;n=n||a.type,r.push(a)}var l=i&&r.some((function(t){return qt(i,t.type)}));return new ln(l?jt:n,r)},ln.prototype.evaluate=function(t){for(var e,n=null,i=0,r=0,o=this.args;r<o.length&&(i++,(n=o[r].evaluate(t))&&n instanceof re&&!n.available&&(e||(e=n.name),n=null,i===this.args.length&&(n=e)),null===n);r+=1);return n},ln.prototype.eachChild=function(t){this.args.forEach(t)},ln.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ln.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var cn=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};cn.prototype.evaluate=function(t){return this.result.evaluate(t)},cn.prototype.eachChild=function(t){for(var e=0,n=this.bindings;e<n.length;e+=1)t(n[e][1]);t(this.result)},cn.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var n=[],i=1;i<t.length-1;i+=2){var r=t[i];if("string"!=typeof r)return e.error("Expected string, but found "+typeof r+" instead.",i);if(/[^a-zA-Z0-9_]/.test(r))return e.error("Variable names must contain only alphanumeric characters or '_'.",i);var o=e.parse(t[i+1],i+1);if(!o)return null;n.push([r,o])}var s=e.parse(t[t.length-1],t.length-1,e.expectedType,n);return s?new cn(n,s):null},cn.prototype.outputDefined=function(){return this.result.outputDefined()},cn.prototype.serialize=function(){for(var t=["let"],e=0,n=this.bindings;e<n.length;e+=1){var i=n[e];t.push(i[0],i[1].serialize())}return t.push(this.result.serialize()),t};var un=function(t,e,n){this.type=t,this.index=e,this.input=n};un.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,Ut),i=e.parse(t[2],2,Wt(e.expectedType||jt));return n&&i?new un(i.type.itemType,n,i):null},un.prototype.evaluate=function(t){var e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0)throw new ue("Array index out of bounds: "+e+" < 0.");if(e>=n.length)throw new ue("Array index out of bounds: "+e+" > "+(n.length-1)+".");if(e!==Math.floor(e))throw new ue("Array index must be an integer, but found "+e+" instead.");return n[e]},un.prototype.eachChild=function(t){t(this.index),t(this.input)},un.prototype.outputDefined=function(){return!1},un.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var hn=function(t,e){this.type=Gt,this.needle=t,this.haystack=e};hn.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,jt),i=e.parse(t[2],2,jt);return n&&i?Xt(n.type,[Gt,zt,Ut,kt,jt])?new hn(n,i):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Qt(n.type)+" instead"):null},hn.prototype.evaluate=function(t){var e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!n)return!1;if(!Yt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Qt(ae(e))+" instead.");if(!Yt(n,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Qt(ae(n))+" instead.");return n.indexOf(e)>=0},hn.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},hn.prototype.outputDefined=function(){return!0},hn.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var dn=function(t,e,n){this.type=Ut,this.needle=t,this.haystack=e,this.fromIndex=n};dn.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,jt),i=e.parse(t[2],2,jt);if(!n||!i)return null;if(!Xt(n.type,[Gt,zt,Ut,kt,jt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Qt(n.type)+" instead");if(4===t.length){var r=e.parse(t[3],3,Ut);return r?new dn(n,i,r):null}return new dn(n,i)},dn.prototype.evaluate=function(t){var e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!Yt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Qt(ae(e))+" instead.");if(!Yt(n,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Qt(ae(n))+" instead.");if(this.fromIndex){var i=this.fromIndex.evaluate(t);return n.indexOf(e,i)}return n.indexOf(e)},dn.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},dn.prototype.outputDefined=function(){return!1},dn.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var fn=function(t,e,n,i,r,o){this.inputType=t,this.type=e,this.input=n,this.cases=i,this.outputs=r,this.otherwise=o};fn.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var n,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var r={},o=[],s=2;s<t.length-1;s+=2){var a=t[s],l=t[s+1];Array.isArray(a)||(a=[a]);var c=e.concat(s);if(0===a.length)return c.error("Expected at least one branch label.");for(var u=0,h=a;u<h.length;u+=1){var d=h[u];if("number"!=typeof d&&"string"!=typeof d)return c.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,ae(d)))return null}else n=ae(d);if(void 0!==r[String(d)])return c.error("Branch labels must be unique.");r[String(d)]=o.length}var f=e.parse(l,s,i);if(!f)return null;i=i||f.type,o.push(f)}var A=e.parse(t[1],1,jt);if(!A)return null;var p=e.parse(t[t.length-1],t.length-1,i);return p?"value"!==A.type.kind&&e.concat(1).checkSubtype(n,A.type)?null:new fn(n,i,A,r,o,p):null},fn.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ae(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},fn.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},fn.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},fn.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],n=[],i={},r=0,o=Object.keys(this.cases).sort();r<o.length;r+=1){var s=o[r];void 0===(h=i[this.cases[s]])?(i[this.cases[s]]=n.length,n.push([this.cases[s],[s]])):n[h][1].push(s)}for(var a=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,c=n;l<c.length;l+=1){var u=c[l],h=u[0],d=u[1];e.push(1===d.length?a(d[0]):d.map(a)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var An=function(t,e,n){this.type=t,this.branches=e,this.otherwise=n};An.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i=[],r=1;r<t.length-1;r+=2){var o=e.parse(t[r],r,Gt);if(!o)return null;var s=e.parse(t[r+1],r+1,n);if(!s)return null;i.push([o,s]),n=n||s.type}var a=e.parse(t[t.length-1],t.length-1,n);return a?new An(n,i,a):null},An.prototype.evaluate=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var i=n[e],r=i[1];if(i[0].evaluate(t))return r.evaluate(t)}return this.otherwise.evaluate(t)},An.prototype.eachChild=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var i=n[e],r=i[1];t(i[0]),t(r)}t(this.otherwise)},An.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},An.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var pn=function(t,e,n,i){this.type=t,this.input=e,this.beginIndex=n,this.endIndex=i};function gn(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function mn(t,e,n,i){return 0===i.compare(e,n)}function yn(t,e,n){var i="=="!==t&&"!="!==t;return function(){function r(t,e,n){this.type=Gt,this.lhs=t,this.rhs=e,this.collator=n,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return r.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var n=t[0],o=e.parse(t[1],1,jt);if(!o)return null;if(!gn(n,o.type))return e.concat(1).error('"'+n+"\" comparisons are not supported for type '"+Qt(o.type)+"'.");var s=e.parse(t[2],2,jt);if(!s)return null;if(!gn(n,s.type))return e.concat(2).error('"'+n+"\" comparisons are not supported for type '"+Qt(s.type)+"'.");if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot compare types '"+Qt(o.type)+"' and '"+Qt(s.type)+"'.");i&&("value"===o.type.kind&&"value"!==s.type.kind?o=new de(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new de(o.type,[s])));var a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(a=e.parse(t[3],3,Vt)))return null}return new r(o,s,a)},r.prototype.evaluate=function(r){var o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(i&&this.hasUntypedArgument){var a=ae(o),l=ae(s);if(a.kind!==l.kind||"string"!==a.kind&&"number"!==a.kind)throw new ue('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+a.kind+", "+l.kind+") instead.")}if(this.collator&&!i&&this.hasUntypedArgument){var c=ae(o),u=ae(s);if("string"!==c.kind||"string"!==u.kind)return e(r,o,s)}return this.collator?n(r,o,s,this.collator.evaluate(r)):e(r,o,s)},r.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},r.prototype.outputDefined=function(){return!0},r.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},r}()}pn.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,jt),i=e.parse(t[2],2,Ut);if(!n||!i)return null;if(!Xt(n.type,[Wt(jt),zt,jt]))return e.error("Expected first argument to be of type array or string, but found "+Qt(n.type)+" instead");if(4===t.length){var r=e.parse(t[3],3,Ut);return r?new pn(n.type,n,i,r):null}return new pn(n.type,n,i)},pn.prototype.evaluate=function(t){var e=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(!Yt(e,["string","array"]))throw new ue("Expected first argument to be of type array or string, but found "+Qt(ae(e))+" instead.");if(this.endIndex){var i=this.endIndex.evaluate(t);return e.slice(n,i)}return e.slice(n)},pn.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},pn.prototype.outputDefined=function(){return!1},pn.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var vn=yn("==",(function(t,e,n){return e===n}),mn),_n=yn("!=",(function(t,e,n){return e!==n}),(function(t,e,n,i){return!mn(0,e,n,i)})),bn=yn("<",(function(t,e,n){return e<n}),(function(t,e,n,i){return i.compare(e,n)<0})),xn=yn(">",(function(t,e,n){return e>n}),(function(t,e,n,i){return i.compare(e,n)>0})),wn=yn("<=",(function(t,e,n){return e<=n}),(function(t,e,n,i){return i.compare(e,n)<=0})),Cn=yn(">=",(function(t,e,n){return e>=n}),(function(t,e,n,i){return i.compare(e,n)>=0})),Bn=function(t,e,n,i,r){this.type=zt,this.number=t,this.locale=e,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=r};Bn.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var n=e.parse(t[1],1,Ut);if(!n)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var r=null;if(i.locale&&!(r=e.parse(i.locale,1,zt)))return null;var o=null;if(i.currency&&!(o=e.parse(i.currency,1,zt)))return null;var s=null;if(i["min-fraction-digits"]&&!(s=e.parse(i["min-fraction-digits"],1,Ut)))return null;var a=null;return i["max-fraction-digits"]&&!(a=e.parse(i["max-fraction-digits"],1,Ut))?null:new Bn(n,r,o,s,a)},Bn.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Bn.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Bn.prototype.outputDefined=function(){return!1},Bn.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var En=function(t){this.type=Ut,this.input=t};En.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?e.error("Expected argument of type string or array, but found "+Qt(n.type)+" instead."):new En(n):null},En.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ue("Expected value to be of type string or array, but found "+Qt(ae(e))+" instead.")},En.prototype.eachChild=function(t){t(this.input)},En.prototype.outputDefined=function(){return!1},En.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Tn={"==":vn,"!=":_n,">":xn,"<":bn,">=":Cn,"<=":wn,array:de,at:un,boolean:de,case:An,coalesce:ln,collator:_e,format:fe,image:Ae,in:hn,"index-of":dn,interpolate:sn,"interpolate-hcl":sn,"interpolate-lab":sn,length:En,let:cn,literal:ce,match:fn,number:de,"number-format":Bn,object:de,slice:pn,step:je,string:de,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:Ge,within:Re};function Sn(t,e){var n=e[0],i=e[1],r=e[2],o=e[3];n=n.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);var s=o?o.evaluate(t):1,a=oe(n,i,r,s);if(a)throw new ue(a);return new te(n/255*s,i/255*s,r/255*s,s)}function Mn(t,e){return t in e}function In(t,e){var n=e[t];return void 0===n?null:n}function Pn(t){return{type:t}}function Dn(t){return{result:"success",value:t}}function Fn(t){return{result:"error",value:t}}function Ln(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function On(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Rn(t){return!!t.expression&&t.expression.interpolated}function kn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Un(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function zn(t){return t}function Gn(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function Nn(t,e,n,i,r){return Gn(typeof n===r?i[n]:void 0,t.default,e.default)}function Zn(t,e,n){if("number"!==kn(n))return Gn(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[i-1][0])return t.stops[i-1][1];var r=Ze(t.stops.map((function(t){return t[0]})),n);return t.stops[r][1]}function jn(t,e,n){var i=void 0!==t.base?t.base:1;if("number"!==kn(n))return Gn(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[r-1][0])return t.stops[r-1][1];var o=Ze(t.stops.map((function(t){return t[0]})),n),s=function(t,e,n,i){var r=i-n,o=t-n;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}(n,i,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1],c=He[e.type]||zn;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=on[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),s))}}return"function"==typeof a.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=a.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==n&&void 0!==i)return c(n,i,s)}}:c(a,l,s)}function Vn(t,e,n){return"color"===e.type?n=te.parse(n):"formatted"===e.type?n=ie.fromString(n.toString()):"resolvedImage"===e.type?n=re.fromString(n.toString()):kn(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),Gn(n,t.default,e.default)}ve.register(Tn,{error:[{kind:"error"},[zt],function(t,e){throw new ue(e[0].evaluate(t))}],typeof:[zt,[jt],function(t,e){return Qt(ae(e[0].evaluate(t)))}],"to-rgba":[Wt(Ut,4),[Nt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Nt,[Ut,Ut,Ut],Sn],rgba:[Nt,[Ut,Ut,Ut,Ut],Sn],has:{type:Gt,overloads:[[[zt],function(t,e){return Mn(e[0].evaluate(t),t.properties())}],[[zt,Zt],function(t,e){var n=e[1];return Mn(e[0].evaluate(t),n.evaluate(t))}]]},get:{type:jt,overloads:[[[zt],function(t,e){return In(e[0].evaluate(t),t.properties())}],[[zt,Zt],function(t,e){var n=e[1];return In(e[0].evaluate(t),n.evaluate(t))}]]},"feature-state":[jt,[zt],function(t,e){return In(e[0].evaluate(t),t.featureState||{})}],properties:[Zt,[],function(t){return t.properties()}],"geometry-type":[zt,[],function(t){return t.geometryType()}],id:[jt,[],function(t){return t.id()}],zoom:[Ut,[],function(t){return t.globals.zoom}],"heatmap-density":[Ut,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ut,[],function(t){return t.globals.lineProgress||0}],accumulated:[jt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ut,Pn(Ut),function(t,e){for(var n=0,i=0,r=e;i<r.length;i+=1)n+=r[i].evaluate(t);return n}],"*":[Ut,Pn(Ut),function(t,e){for(var n=1,i=0,r=e;i<r.length;i+=1)n*=r[i].evaluate(t);return n}],"-":{type:Ut,overloads:[[[Ut,Ut],function(t,e){var n=e[1];return e[0].evaluate(t)-n.evaluate(t)}],[[Ut],function(t,e){return-e[0].evaluate(t)}]]},"/":[Ut,[Ut,Ut],function(t,e){var n=e[1];return e[0].evaluate(t)/n.evaluate(t)}],"%":[Ut,[Ut,Ut],function(t,e){var n=e[1];return e[0].evaluate(t)%n.evaluate(t)}],ln2:[Ut,[],function(){return Math.LN2}],pi:[Ut,[],function(){return Math.PI}],e:[Ut,[],function(){return Math.E}],"^":[Ut,[Ut,Ut],function(t,e){var n=e[1];return Math.pow(e[0].evaluate(t),n.evaluate(t))}],sqrt:[Ut,[Ut],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Ut,[Ut],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Ut,[Ut],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Ut,[Ut],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Ut,[Ut],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Ut,[Ut],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Ut,[Ut],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Ut,[Ut],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Ut,[Ut],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Ut,[Ut],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Ut,Pn(Ut),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Ut,Pn(Ut),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Ut,[Ut],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Ut,[Ut],function(t,e){var n=e[0].evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[Ut,[Ut],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Ut,[Ut],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Gt,[zt,jt],function(t,e){var n=e[0],i=e[1];return t.properties()[n.value]===i.value}],"filter-id-==":[Gt,[jt],function(t,e){var n=e[0];return t.id()===n.value}],"filter-type-==":[Gt,[zt],function(t,e){var n=e[0];return t.geometryType()===n.value}],"filter-<":[Gt,[zt,jt],function(t,e){var n=e[0],i=e[1],r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r<o}],"filter-id-<":[Gt,[jt],function(t,e){var n=e[0],i=t.id(),r=n.value;return typeof i==typeof r&&i<r}],"filter->":[Gt,[zt,jt],function(t,e){var n=e[0],i=e[1],r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r>o}],"filter-id->":[Gt,[jt],function(t,e){var n=e[0],i=t.id(),r=n.value;return typeof i==typeof r&&i>r}],"filter-<=":[Gt,[zt,jt],function(t,e){var n=e[0],i=e[1],r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r<=o}],"filter-id-<=":[Gt,[jt],function(t,e){var n=e[0],i=t.id(),r=n.value;return typeof i==typeof r&&i<=r}],"filter->=":[Gt,[zt,jt],function(t,e){var n=e[0],i=e[1],r=t.properties()[n.value],o=i.value;return typeof r==typeof o&&r>=o}],"filter-id->=":[Gt,[jt],function(t,e){var n=e[0],i=t.id(),r=n.value;return typeof i==typeof r&&i>=r}],"filter-has":[Gt,[jt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Gt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Gt,[Wt(zt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Gt,[Wt(jt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Gt,[zt,Wt(jt)],function(t,e){var n=e[0];return e[1].value.indexOf(t.properties()[n.value])>=0}],"filter-in-large":[Gt,[zt,Wt(jt)],function(t,e){var n=e[0],i=e[1];return function(t,e,n,i){for(;n<=i;){var r=n+i>>1;if(e[r]===t)return!0;e[r]>t?i=r-1:n=r+1}return!1}(t.properties()[n.value],i.value,0,i.value.length-1)}],all:{type:Gt,overloads:[[[Gt,Gt],function(t,e){var n=e[1];return e[0].evaluate(t)&&n.evaluate(t)}],[Pn(Gt),function(t,e){for(var n=0,i=e;n<i.length;n+=1)if(!i[n].evaluate(t))return!1;return!0}]]},any:{type:Gt,overloads:[[[Gt,Gt],function(t,e){var n=e[1];return e[0].evaluate(t)||n.evaluate(t)}],[Pn(Gt),function(t,e){for(var n=0,i=e;n<i.length;n+=1)if(i[n].evaluate(t))return!0;return!1}]]},"!":[Gt,[Gt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Gt,[zt],function(t,e){var n=t.globals&&t.globals.isSupportedScript;return!n||n(e[0].evaluate(t))}],upcase:[zt,[zt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[zt,[zt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[zt,Pn(jt),function(t,e){return e.map((function(e){return le(e.evaluate(t))})).join("")}],"resolved-locale":[zt,[Vt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Hn=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new ye,this._defaultValue=e?function(t){return"color"===t.type&&Un(t.default)?new te(0,0,0,0):"color"===t.type?te.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function Jn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Tn}function Wn(t,e){var n=new Ne(Tn,[],e?function(t){var e={color:Nt,string:zt,number:Ut,enum:zt,boolean:Gt,formatted:Ht,resolvedImage:Jt};return"array"===t.type?Wt(e[t.value]||jt,t.length):e[t.type]}(e):void 0),i=n.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?Dn(new Hn(i,e)):Fn(n.errors)}Hn.prototype.evaluateWithoutErrorHandling=function(t,e,n,i,r,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=n,this._evaluator.canonical=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Hn.prototype.evaluate=function(t,e,n,i,r,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null;try{var s=this.expression.evaluate(this._evaluator);if(null==s||"number"==typeof s&&s!=s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ue("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(s)+" instead.");return s}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Qn=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ue(e.expression)};Qn.prototype.evaluateWithoutErrorHandling=function(t,e,n,i,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,i,r,o)},Qn.prototype.evaluate=function(t,e,n,i,r,o){return this._styleExpression.evaluate(t,e,n,i,r,o)};var Kn=function(t,e,n,i){this.kind=t,this.zoomStops=n,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ue(e.expression),this.interpolationType=i};function qn(t,e){if("error"===(t=Wn(t,e)).result)return t;var n=t.value.expression,i=ke(n);if(!i&&!Ln(e))return Fn([new Ot("","data expressions not supported")]);var r=ze(n,["zoom"]);if(!r&&!On(e))return Fn([new Ot("","zoom expressions not supported")]);var o=function t(e){var n=null;if(e instanceof cn)n=t(e.result);else if(e instanceof ln)for(var i=0,r=e.args;i<r.length&&!(n=t(r[i]));i+=1);else(e instanceof je||e instanceof sn)&&e.input instanceof ve&&"zoom"===e.input.name&&(n=e);return n instanceof Ot||e.eachChild((function(e){var i=t(e);i instanceof Ot?n=i:!n&&i?n=new Ot("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&i&&n!==i&&(n=new Ot("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n}(n);return o||r?o instanceof Ot?Fn([o]):o instanceof sn&&!Rn(e)?Fn([new Ot("",'"interpolate" expressions cannot be used with this property')]):Dn(o?new Kn(i?"camera":"composite",t.value,o.labels,o instanceof sn?o.interpolation:void 0):new Qn(i?"constant":"source",t.value)):Fn([new Ot("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Kn.prototype.evaluateWithoutErrorHandling=function(t,e,n,i,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,i,r,o)},Kn.prototype.evaluate=function(t,e,n,i,r,o){return this._styleExpression.evaluate(t,e,n,i,r,o)},Kn.prototype.interpolationFactor=function(t,e,n){return this.interpolationType?sn.interpolationFactor(this.interpolationType,t,e,n):0};var Xn=function(t,e){this._parameters=t,this._specification=e,Dt(this,function t(e,n){var i,r,o,s="color"===n.type,a=e.stops&&"object"==typeof e.stops[0][0],l=a||!(a||void 0!==e.property),c=e.type||(Rn(n)?"exponential":"interval");if(s&&((e=Dt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],te.parse(t[1])]}))),e.default=te.parse(e.default?e.default:n.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!on[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)i=jn;else if("interval"===c)i=Zn;else if("categorical"===c){i=Nn,r=Object.create(null);for(var u=0,h=e.stops;u<h.length;u+=1){var d=h[u];r[d[0]]=d[1]}o=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');i=Vn}if(a){for(var f={},A=[],p=0;p<e.stops.length;p++){var g=e.stops[p],m=g[0].zoom;void 0===f[m]&&(f[m]={zoom:m,type:e.type,property:e.property,default:e.default,stops:[]},A.push(m)),f[m].stops.push([g[0].value,g[1]])}for(var y=[],v=0,_=A;v<_.length;v+=1){var b=_[v];y.push([f[b].zoom,t(f[b],n)])}var x={name:"linear"};return{kind:"composite",interpolationType:x,interpolationFactor:sn.interpolationFactor.bind(void 0,x),zoomStops:y.map((function(t){return t[0]})),evaluate:function(t,i){var r=t.zoom;return jn({stops:y,base:e.base},n,r).evaluate(r,i)}}}if(l){var w="exponential"===c?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:w,interpolationFactor:sn.interpolationFactor.bind(void 0,w),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return i(e,n,t.zoom,r,o)}}}return{kind:"source",evaluate:function(t,s){var a=s&&s.properties?s.properties[e.property]:void 0;return void 0===a?Gn(e.default,n.default):i(e,n,a,r,o)}}}(this._parameters,this._specification))};function Yn(t){var e=t.key,n=t.value,i=t.valueSpec||{},r=t.objectElementValidators||{},o=t.style,s=t.styleSpec,a=[],l=kn(n);if("object"!==l)return[new It(e,n,"object expected, "+l+" found")];for(var c in n){var u=c.split(".")[0],h=i[u]||i["*"],d=void 0;if(r[u])d=r[u];else if(i[u])d=wi;else if(r["*"])d=r["*"];else{if(!i["*"]){a.push(new It(e,n[c],'unknown property "'+c+'"'));continue}d=wi}a=a.concat(d({key:(e?e+".":e)+c,value:n[c],valueSpec:h,style:o,styleSpec:s,object:n,objectKey:c},n))}for(var f in i)r[f]||i[f].required&&void 0===i[f].default&&void 0===n[f]&&a.push(new It(e,n,'missing required property "'+f+'"'));return a}function $n(t){var e=t.value,n=t.valueSpec,i=t.style,r=t.styleSpec,o=t.key,s=t.arrayElementValidator||wi;if("array"!==kn(e))return[new It(o,e,"array expected, "+kn(e)+" found")];if(n.length&&e.length!==n.length)return[new It(o,e,"array length "+n.length+" expected, length "+e.length+" found")];if(n["min-length"]&&e.length<n["min-length"])return[new It(o,e,"array length at least "+n["min-length"]+" expected, length "+e.length+" found")];var a={type:n.value,values:n.values};r.$version<7&&(a.function=n.function),"object"===kn(n.value)&&(a=n.value);for(var l=[],c=0;c<e.length;c++)l=l.concat(s({array:e,arrayIndex:c,value:e[c],valueSpec:a,style:i,styleSpec:r,key:o+"["+c+"]"}));return l}function ti(t){var e=t.key,n=t.value,i=t.valueSpec,r=kn(n);return"number"===r&&n!=n&&(r="NaN"),"number"!==r?[new It(e,n,"number expected, "+r+" found")]:"minimum"in i&&n<i.minimum?[new It(e,n,n+" is less than the minimum value "+i.minimum)]:"maximum"in i&&n>i.maximum?[new It(e,n,n+" is greater than the maximum value "+i.maximum)]:[]}function ei(t){var e,n,i,r=t.valueSpec,o=Ft(t.value.type),s={},a="categorical"!==o&&void 0===t.value.property,l=!a,c="array"===kn(t.value.stops)&&"array"===kn(t.value.stops[0])&&"object"===kn(t.value.stops[0][0]),u=Yn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new It(t.key,t.value,'identity function may not have a "stops" property')];var e=[],n=t.value;return e=e.concat($n({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===kn(n)&&0===n.length&&e.push(new It(t.key,n,"array must have at least one stop")),e},default:function(t){return wi({key:t.key,value:t.value,valueSpec:r,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&a&&u.push(new It(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||u.push(new It(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Rn(t.valueSpec)&&u.push(new It(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Ln(t.valueSpec)?u.push(new It(t.key,t.value,"property functions not supported")):a&&!On(t.valueSpec)&&u.push(new It(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||u.push(new It(t.key,t.value,'"property" property is required')),u;function h(t){var e=[],o=t.value,a=t.key;if("array"!==kn(o))return[new It(a,o,"array expected, "+kn(o)+" found")];if(2!==o.length)return[new It(a,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==kn(o[0]))return[new It(a,o,"object expected, "+kn(o[0])+" found")];if(void 0===o[0].zoom)return[new It(a,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new It(a,o,"object stop key must have value")];if(i&&i>Ft(o[0].zoom))return[new It(a,o[0].zoom,"stop zoom values must appear in ascending order")];Ft(o[0].zoom)!==i&&(i=Ft(o[0].zoom),n=void 0,s={}),e=e.concat(Yn({key:a+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:ti,value:d}}))}else e=e.concat(d({key:a+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Jn(Lt(o[1]))?e.concat([new It(a+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(wi({key:a+"[1]",value:o[1],valueSpec:r,style:t.style,styleSpec:t.styleSpec}))}function d(t,i){var a=kn(t.value),l=Ft(t.value),c=null!==t.value?t.value:i;if(e){if(a!==e)return[new It(t.key,c,a+" stop domain type must match previous stop domain type "+e)]}else e=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new It(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==o){var u="number expected, "+a+" found";return Ln(r)&&void 0===o&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new It(t.key,c,u)]}return"categorical"!==o||"number"!==a||isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===a&&void 0!==n&&l<n?[new It(t.key,c,"stop domain values must appear in ascending order")]:(n=l,"categorical"===o&&l in s?[new It(t.key,c,"stop domain values must be unique")]:(s[l]=!0,[])):[new It(t.key,c,"integer expected, found "+l)]}}function ni(t){var e=("property"===t.expressionContext?qn:Wn)(Lt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new It(""+t.key+e.key,t.value,e.message)}));var n=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!n.outputDefined())return[new It(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Ue(n))return[new It(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Ue(n))return[new It(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!ze(n,["zoom","feature-state"]))return[new It(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!ke(n))return[new It(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ii(t){var e=t.key,n=t.value,i=t.valueSpec,r=[];return Array.isArray(i.values)?-1===i.values.indexOf(Ft(n))&&r.push(new It(e,n,"expected one of ["+i.values.join(", ")+"], "+JSON.stringify(n)+" found")):-1===Object.keys(i.values).indexOf(Ft(n))&&r.push(new It(e,n,"expected one of ["+Object.keys(i.values).join(", ")+"], "+JSON.stringify(n)+" found")),r}function ri(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,n=t.slice(1);e<n.length;e+=1){var i=n[e];if(!ri(i)&&"boolean"!=typeof i)return!1}return!0;default:return!0}}Xn.deserialize=function(t){return new Xn(t._parameters,t._specification)},Xn.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var oi={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function si(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};ri(t)||(t=li(t));var e=Wn(t,oi);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,n,i){return e.value.evaluate(t,n,{},i)},needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var n=1;n<e.length;n++)if(t(e[n]))return!0;return!1}(t)}}function ai(t,e){return t<e?-1:t>e?1:0}function li(t){if(!t)return!0;var e,n=t[0];return t.length<=1?"any"!==n:"=="===n?ci(t[1],t[2],"=="):"!="===n?di(ci(t[1],t[2],"==")):"<"===n||">"===n||"<="===n||">="===n?ci(t[1],t[2],n):"any"===n?(e=t.slice(1),["any"].concat(e.map(li))):"all"===n?["all"].concat(t.slice(1).map(li)):"none"===n?["all"].concat(t.slice(1).map(li).map(di)):"in"===n?ui(t[1],t.slice(2)):"!in"===n?di(ui(t[1],t.slice(2))):"has"===n?hi(t[1]):"!has"===n?di(hi(t[1])):"within"!==n||t}function ci(t,e,n){switch(t){case"$type":return["filter-type-"+n,e];case"$id":return["filter-id-"+n,e];default:return["filter-"+n,t,e]}}function ui(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(ai)]]:["filter-in-small",t,["literal",e]]}}function hi(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function di(t){return["!",t]}function fi(t){return ri(Lt(t.value))?ni(Dt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var n=e.value,i=e.key;if("array"!==kn(n))return[new It(i,n,"array expected, "+kn(n)+" found")];var r,o=e.styleSpec,s=[];if(n.length<1)return[new It(i,n,"filter array must have at least 1 element")];switch(s=s.concat(ii({key:i+"[0]",value:n[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ft(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===Ft(n[1])&&s.push(new It(i,n,'"$type" cannot be use with operator "'+n[0]+'"'));case"==":case"!=":3!==n.length&&s.push(new It(i,n,'filter array for operator "'+n[0]+'" must have 3 elements'));case"in":case"!in":n.length>=2&&"string"!==(r=kn(n[1]))&&s.push(new It(i+"[1]",n[1],"string expected, "+r+" found"));for(var a=2;a<n.length;a++)r=kn(n[a]),"$type"===Ft(n[1])?s=s.concat(ii({key:i+"["+a+"]",value:n[a],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&s.push(new It(i+"["+a+"]",n[a],"string, number, or boolean expected, "+r+" found"));break;case"any":case"all":case"none":for(var l=1;l<n.length;l++)s=s.concat(t({key:i+"["+l+"]",value:n[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":r=kn(n[1]),2!==n.length?s.push(new It(i,n,'filter array for "'+n[0]+'" operator must have 2 elements')):"string"!==r&&s.push(new It(i+"[1]",n[1],"string expected, "+r+" found"));break;case"within":r=kn(n[1]),2!==n.length?s.push(new It(i,n,'filter array for "'+n[0]+'" operator must have 2 elements')):"object"!==r&&s.push(new It(i+"[1]",n[1],"object expected, "+r+" found"))}return s}(t)}function Ai(t,e){var n=t.key,i=t.style,r=t.styleSpec,o=t.value,s=t.objectKey,a=r[e+"_"+t.layerType];if(!a)return[];var l=s.match(/^(.*)-transition$/);if("paint"===e&&l&&a[l[1]]&&a[l[1]].transition)return wi({key:n,value:o,valueSpec:r.transition,style:i,styleSpec:r});var c,u=t.valueSpec||a[s];if(!u)return[new It(n,o,'unknown property "'+s+'"')];if("string"===kn(o)&&Ln(u)&&!u.tokens&&(c=/^{([^}]+)}$/.exec(o)))return[new It(n,o,'"'+s+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(c[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===s&&i&&!i.glyphs&&h.push(new It(n,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&Un(Lt(o))&&"identity"===Ft(o.type)&&h.push(new It(n,o,'"text-font" does not support identity functions'))),h.concat(wi({key:t.key,value:o,valueSpec:u,style:i,styleSpec:r,expressionContext:"property",propertyType:e,propertyKey:s}))}function pi(t){return Ai(t,"paint")}function gi(t){return Ai(t,"layout")}function mi(t){var e=[],n=t.value,i=t.key,r=t.style,o=t.styleSpec;n.type||n.ref||e.push(new It(i,n,'either "type" or "ref" is required'));var s,a=Ft(n.type),l=Ft(n.ref);if(n.id)for(var c=Ft(n.id),u=0;u<t.arrayIndex;u++){var h=r.layers[u];Ft(h.id)===c&&e.push(new It(i,n.id,'duplicate layer id "'+n.id+'", previously used at line '+h.id.__line__))}if("ref"in n)["type","source","source-layer","filter","layout"].forEach((function(t){t in n&&e.push(new It(i,n[t],'"'+t+'" is prohibited for ref layers'))})),r.layers.forEach((function(t){Ft(t.id)===l&&(s=t)})),s?s.ref?e.push(new It(i,n.ref,"ref cannot reference another ref layer")):a=Ft(s.type):e.push(new It(i,n.ref,'ref layer "'+l+'" not found'));else if("background"!==a)if(n.source){var d=r.sources&&r.sources[n.source],f=d&&Ft(d.type);d?"vector"===f&&"raster"===a?e.push(new It(i,n.source,'layer "'+n.id+'" requires a raster source')):"raster"===f&&"raster"!==a?e.push(new It(i,n.source,'layer "'+n.id+'" requires a vector source')):"vector"!==f||n["source-layer"]?"raster-dem"===f&&"hillshade"!==a?e.push(new It(i,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!n.paint||!n.paint["line-gradient"]||"geojson"===f&&d.lineMetrics||e.push(new It(i,n,'layer "'+n.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new It(i,n,'layer "'+n.id+'" must specify a "source-layer"')):e.push(new It(i,n.source,'source "'+n.source+'" not found'))}else e.push(new It(i,n,'missing required property "source"'));return e=e.concat(Yn({key:i,value:n,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return wi({key:i+".type",value:n.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"})},filter:fi,layout:function(t){return Yn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return gi(Dt({layerType:a},t))}}})},paint:function(t){return Yn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return pi(Dt({layerType:a},t))}}})}}}))}function yi(t){var e=t.value,n=t.key,i=kn(e);return"string"!==i?[new It(n,e,"string expected, "+i+" found")]:[]}var vi={promoteId:function(t){var e=t.key,n=t.value;if("string"===kn(n))return yi({key:e,value:n});var i=[];for(var r in n)i.push.apply(i,yi({key:e+"."+r,value:n[r]}));return i}};function _i(t){var e=t.value,n=t.key,i=t.styleSpec,r=t.style;if(!e.type)return[new It(n,e,'"type" is required')];var o,s=Ft(e.type);switch(s){case"vector":case"raster":case"raster-dem":return Yn({key:n,value:e,valueSpec:i["source_"+s.replace("-","_")],style:t.style,styleSpec:i,objectElementValidators:vi});case"geojson":if(o=Yn({key:n,value:e,valueSpec:i.source_geojson,style:r,styleSpec:i,objectElementValidators:vi}),e.cluster)for(var a in e.clusterProperties){var l=e.clusterProperties[a],c=l[0],u="string"==typeof c?[c,["accumulated"],["get",a]]:c;o.push.apply(o,ni({key:n+"."+a+".map",value:l[1],expressionContext:"cluster-map"})),o.push.apply(o,ni({key:n+"."+a+".reduce",value:u,expressionContext:"cluster-reduce"}))}return o;case"video":return Yn({key:n,value:e,valueSpec:i.source_video,style:r,styleSpec:i});case"image":return Yn({key:n,value:e,valueSpec:i.source_image,style:r,styleSpec:i});case"canvas":return[new It(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ii({key:n+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:r,styleSpec:i})}}function bi(t){var e=t.value,n=t.styleSpec,i=n.light,r=t.style,o=[],s=kn(e);if(void 0===e)return o;if("object"!==s)return o.concat([new It("light",e,"object expected, "+s+" found")]);for(var a in e){var l=a.match(/^(.*)-transition$/);o=o.concat(l&&i[l[1]]&&i[l[1]].transition?wi({key:a,value:e[a],valueSpec:n.transition,style:r,styleSpec:n}):i[a]?wi({key:a,value:e[a],valueSpec:i[a],style:r,styleSpec:n}):[new It(a,e[a],'unknown property "'+a+'"')])}return o}var xi={"*":function(){return[]},array:$n,boolean:function(t){var e=t.value,n=t.key,i=kn(e);return"boolean"!==i?[new It(n,e,"boolean expected, "+i+" found")]:[]},number:ti,color:function(t){var e=t.key,n=t.value,i=kn(n);return"string"!==i?[new It(e,n,"color expected, "+i+" found")]:null===$t(n)?[new It(e,n,'color expected, "'+n+'" found')]:[]},constants:Pt,enum:ii,filter:fi,function:ei,layer:mi,object:Yn,source:_i,light:bi,string:yi,formatted:function(t){return 0===yi(t).length?[]:ni(t)},resolvedImage:function(t){return 0===yi(t).length?[]:ni(t)}};function wi(t){var e=t.value,n=t.valueSpec,i=t.styleSpec;return n.expression&&Un(Ft(e))?ei(t):n.expression&&Jn(Lt(e))?ni(t):n.type&&xi[n.type]?xi[n.type](t):Yn(Dt({},t,{valueSpec:n.type?i[n.type]:n}))}function Ci(t){var e=t.value,n=t.key,i=yi(t);return i.length||(-1===e.indexOf("{fontstack}")&&i.push(new It(n,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&i.push(new It(n,e,'"glyphs" url must include a "{range}" token'))),i}function Bi(t,e){void 0===e&&(e=Mt);var n=[];return n=n.concat(wi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Ci,"*":function(){return[]}}})),t.constants&&(n=n.concat(Pt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Ei(n)}function Ei(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Ti(t){return function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return Ei(t.apply(this,e))}}Bi.source=Ti(_i),Bi.light=Ti(bi),Bi.layer=Ti(mi),Bi.filter=Ti(fi),Bi.paintProperty=Ti(pi),Bi.layoutProperty=Ti(gi);var Si=Bi,Mi=Si.light,Ii=Si.paintProperty,Pi=Si.layoutProperty;function Di(t,e){var n=!1;if(e&&e.length)for(var i=0,r=e;i<r.length;i+=1)t.fire(new Tt(new Error(r[i].message))),n=!0;return n}var Fi=Li;function Li(t,e,n){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var r=new Int32Array(this.arrayBuffer);t=r[0],this.d=(e=r[1])+2*(n=r[2]);for(var o=0;o<this.d*this.d;o++){var s=r[3+o],a=r[3+o+1];i.push(s===a?null:r.subarray(s,a))}var l=r[3+i.length+1];this.keys=r.subarray(r[3+i.length],l),this.bboxes=r.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*n;for(var c=0;c<this.d*this.d;c++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=n,this.scale=e/t,this.uid=0;var u=n/e*t;this.min=-u,this.max=t+u}Li.prototype.insert=function(t,e,n,i,r){this._forEachCell(e,n,i,r,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(r)},Li.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Li.prototype._insertCell=function(t,e,n,i,r,o){this.cells[r].push(o)},Li.prototype.query=function(t,e,n,i,r){var o=this.min,s=this.max;if(t<=o&&e<=o&&s<=n&&s<=i&&!r)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(t,e,n,i,this._queryCell,a,{},r),a},Li.prototype._queryCell=function(t,e,n,i,r,o,s,a){var l=this.cells[r];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===s[d]){var f=4*d;(a?a(u[f+0],u[f+1],u[f+2],u[f+3]):t<=u[f+2]&&e<=u[f+3]&&n>=u[f+0]&&i>=u[f+1])?(s[d]=!0,o.push(c[d])):s[d]=!1}}},Li.prototype._forEachCell=function(t,e,n,i,r,o,s,a){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(n),h=this._convertToCellCoord(i),d=l;d<=u;d++)for(var f=c;f<=h;f++){var A=this.d*f+d;if((!a||a(this._convertFromCellCoord(d),this._convertFromCellCoord(f),this._convertFromCellCoord(d+1),this._convertFromCellCoord(f+1)))&&r.call(this,t,e,n,i,A,o,s,a))return}},Li.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Li.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Li.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,n=0,i=0;i<this.cells.length;i++)n+=this.cells[i].length;var r=new Int32Array(e+n+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;for(var o=e,s=0;s<t.length;s++){var a=t[s];r[3+s]=o,r.set(a,o),o+=a.length}return r[3+t.length]=o,r.set(this.keys,o),r[3+t.length+1]=o+=this.keys.length,r.set(this.bboxes,o),o+=this.bboxes.length,r.buffer};var Oi=s.ImageData,Ri=s.ImageBitmap,ki={};function Ui(t,e,n){void 0===n&&(n={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),ki[t]={klass:e,omit:n.omit||[],shallow:n.shallow||[]}}for(var zi in Ui("Object",Object),Fi.serialize=function(t,e){var n=t.toArrayBuffer();return e&&e.push(n),{buffer:n}},Fi.deserialize=function(t){return new Fi(t.buffer)},Ui("Grid",Fi),Ui("Color",te),Ui("Error",Error),Ui("ResolvedImage",re),Ui("StylePropertyFunction",Xn),Ui("StyleExpression",Hn,{omit:["_evaluator"]}),Ui("ZoomDependentExpression",Kn),Ui("ZoomConstantExpression",Qn),Ui("CompoundExpression",ve,{omit:["_evaluate"]}),Tn)Tn[zi]._classRegistryKey||Ui("Expression_"+zi,Tn[zi]);function Gi(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Ni(t){return Ri&&t instanceof Ri}function Zi(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Gi(t)||Ni(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var n=t;return e&&e.push(n.buffer),n}if(t instanceof Oi)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var i=[],r=0,o=t;r<o.length;r+=1)i.push(Zi(o[r],e));return i}if("object"==typeof t){var s=t.constructor,a=s._classRegistryKey;if(!a)throw new Error("can't serialize object of unregistered class");var l=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var c in t)if(t.hasOwnProperty(c)&&!(ki[a].omit.indexOf(c)>=0)){var u=t[c];l[c]=ki[a].shallow.indexOf(c)>=0?u:Zi(u,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==a&&(l.$name=a),l}throw new Error("can't serialize object of type "+typeof t)}function ji(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Gi(t)||Ni(t)||ArrayBuffer.isView(t)||t instanceof Oi)return t;if(Array.isArray(t))return t.map(ji);if("object"==typeof t){var e=t.$name||"Object",n=ki[e].klass;if(!n)throw new Error("can't deserialize unregistered class "+e);if(n.deserialize)return n.deserialize(t);for(var i=Object.create(n.prototype),r=0,o=Object.keys(t);r<o.length;r+=1){var s=o[r];if("$name"!==s){var a=t[s];i[s]=ki[e].shallow.indexOf(s)>=0?a:ji(a)}}return i}throw new Error("can't deserialize object of type "+typeof t)}var Vi=function(){this.first=!0};Vi.prototype.update=function(t,e){var n=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=n,!0))};var Hi={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Ji(t){for(var e=0,n=t;e<n.length;e+=1)if(Wi(n[e].charCodeAt(0)))return!0;return!1}function Wi(t){return!(746!==t&&747!==t&&(t<4352||!(Hi["Bopomofo Extended"](t)||Hi.Bopomofo(t)||Hi["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Hi["CJK Compatibility Ideographs"](t)||Hi["CJK Compatibility"](t)||Hi["CJK Radicals Supplement"](t)||Hi["CJK Strokes"](t)||!(!Hi["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Hi["CJK Unified Ideographs Extension A"](t)||Hi["CJK Unified Ideographs"](t)||Hi["Enclosed CJK Letters and Months"](t)||Hi["Hangul Compatibility Jamo"](t)||Hi["Hangul Jamo Extended-A"](t)||Hi["Hangul Jamo Extended-B"](t)||Hi["Hangul Jamo"](t)||Hi["Hangul Syllables"](t)||Hi.Hiragana(t)||Hi["Ideographic Description Characters"](t)||Hi.Kanbun(t)||Hi["Kangxi Radicals"](t)||Hi["Katakana Phonetic Extensions"](t)||Hi.Katakana(t)&&12540!==t||!(!Hi["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Hi["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Hi["Unified Canadian Aboriginal Syllabics"](t)||Hi["Unified Canadian Aboriginal Syllabics Extended"](t)||Hi["Vertical Forms"](t)||Hi["Yijing Hexagram Symbols"](t)||Hi["Yi Syllables"](t)||Hi["Yi Radicals"](t))))}function Qi(t){return!(Wi(t)||function(t){return!!(Hi["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Hi["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Hi["Letterlike Symbols"](t)||Hi["Number Forms"](t)||Hi["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Hi["Control Pictures"](t)&&9251!==t||Hi["Optical Character Recognition"](t)||Hi["Enclosed Alphanumerics"](t)||Hi["Geometric Shapes"](t)||Hi["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Hi["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Hi["CJK Symbols and Punctuation"](t)||Hi.Katakana(t)||Hi["Private Use Area"](t)||Hi["CJK Compatibility Forms"](t)||Hi["Small Form Variants"](t)||Hi["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Ki(t){return t>=1424&&t<=2303||Hi["Arabic Presentation Forms-A"](t)||Hi["Arabic Presentation Forms-B"](t)}function qi(t,e){return!(!e&&Ki(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Hi.Khmer(t))}function Xi(t){for(var e=0,n=t;e<n.length;e+=1)if(Ki(n[e].charCodeAt(0)))return!0;return!1}var Yi=null,$i="unavailable",tr=null,er=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&($i="error"),Yi&&Yi(t)};function nr(){ir.fire(new Et("pluginStateChange",{pluginStatus:$i,pluginURL:tr}))}var ir=new St,rr=function(){return $i},or=function(){if("deferred"!==$i||!tr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$i="loading",nr(),tr&&_t({url:tr},(function(t){t?er(t):($i="loaded",nr())}))},sr={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===$i||null!=sr.applyArabicShaping},isLoading:function(){return"loading"===$i},setState:function(t){$i=t.pluginStatus,tr=t.pluginURL},isParsed:function(){return null!=sr.applyArabicShaping&&null!=sr.processBidirectionalText&&null!=sr.processStyledBidirectionalText},getPluginURL:function(){return tr}},ar=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Vi,this.transition={})};ar.prototype.isSupportedScript=function(t){return function(t,e){for(var n=0,i=t;n<i.length;n+=1)if(!qi(i[n].charCodeAt(0),e))return!1;return!0}(t,sr.isLoaded())},ar.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},ar.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),n=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*e}};var lr=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Un(t))return new Xn(t,e);if(Jn(t)){var n=qn(t,e);if("error"===n.result)throw new Error(n.value.map((function(t){return t.key+": "+t.message})).join(", "));return n.value}var i=t;return"string"==typeof t&&"color"===e.type&&(i=te.parse(t)),{kind:"constant",evaluate:function(){return i}}}(void 0===e?t.specification.default:e,t.specification)};lr.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},lr.prototype.possiblyEvaluate=function(t,e,n){return this.property.possiblyEvaluate(this,t,e,n)};var cr=function(t){this.property=t,this.value=new lr(t,void 0)};cr.prototype.transitioned=function(t,e){return new hr(this.property,this.value,e,d({},t.transition,this.transition),t.now)},cr.prototype.untransitioned=function(){return new hr(this.property,this.value,null,{},0)};var ur=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ur.prototype.getValue=function(t){return b(this._values[t].value.value)},ur.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new cr(this._values[t].property)),this._values[t].value=new lr(this._values[t].property,null===e?void 0:b(e))},ur.prototype.getTransition=function(t){return b(this._values[t].transition)},ur.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new cr(this._values[t].property)),this._values[t].transition=b(e)||void 0},ur.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e+=1){var i=n[e],r=this.getValue(i);void 0!==r&&(t[i]=r);var o=this.getTransition(i);void 0!==o&&(t[i+"-transition"]=o)}return t},ur.prototype.transitioned=function(t,e){for(var n=new dr(this._properties),i=0,r=Object.keys(this._values);i<r.length;i+=1){var o=r[i];n._values[o]=this._values[o].transitioned(t,e._values[o])}return n},ur.prototype.untransitioned=function(){for(var t=new dr(this._properties),e=0,n=Object.keys(this._values);e<n.length;e+=1){var i=n[e];t._values[i]=this._values[i].untransitioned()}return t};var hr=function(t,e,n,i,r){this.property=t,this.value=e,this.begin=r+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=n)};hr.prototype.possiblyEvaluate=function(t,e,n){var i=t.now||0,r=this.value.possiblyEvaluate(t,e,n),o=this.prior;if(o){if(i>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(i<this.begin)return o.possiblyEvaluate(t,e,n);var s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,n),r,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}(s))}return r};var dr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};dr.prototype.possiblyEvaluate=function(t,e,n){for(var i=new pr(this._properties),r=0,o=Object.keys(this._values);r<o.length;r+=1){var s=o[r];i._values[s]=this._values[s].possiblyEvaluate(t,e,n)}return i},dr.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1};var fr=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};fr.prototype.getValue=function(t){return b(this._values[t].value)},fr.prototype.setValue=function(t,e){this._values[t]=new lr(this._values[t].property,null===e?void 0:b(e))},fr.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e+=1){var i=n[e],r=this.getValue(i);void 0!==r&&(t[i]=r)}return t},fr.prototype.possiblyEvaluate=function(t,e,n){for(var i=new pr(this._properties),r=0,o=Object.keys(this._values);r<o.length;r+=1){var s=o[r];i._values[s]=this._values[s].possiblyEvaluate(t,e,n)}return i};var Ar=function(t,e,n){this.property=t,this.value=e,this.parameters=n};Ar.prototype.isConstant=function(){return"constant"===this.value.kind},Ar.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Ar.prototype.evaluate=function(t,e,n,i){return this.property.evaluate(this.value,this.parameters,t,e,n,i)};var pr=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};pr.prototype.get=function(t){return this._values[t]};var gr=function(t){this.specification=t};gr.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},gr.prototype.interpolate=function(t,e,n){var i=He[this.specification.type];return i?i(t,e,n):t};var mr=function(t,e){this.specification=t,this.overrides=e};mr.prototype.possiblyEvaluate=function(t,e,n,i){return new Ar(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},n,i)}:t.expression,e)},mr.prototype.interpolate=function(t,e,n){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Ar(this,{kind:"constant",value:void 0},t.parameters);var i=He[this.specification.type];return i?new Ar(this,{kind:"constant",value:i(t.value.value,e.value.value,n)},t.parameters):t},mr.prototype.evaluate=function(t,e,n,i,r,o){return"constant"===t.kind?t.value:t.evaluate(e,n,i,r,o)};var yr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,n,i){if(void 0===t.value)return new Ar(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var r=t.expression.evaluate(e,null,{},n,i),o="resolvedImage"===t.property.specification.type&&"string"!=typeof r?r.name:r,s=this._calculate(o,o,o,e);return new Ar(this,{kind:"constant",value:s},e)}if("camera"===t.expression.kind){var a=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Ar(this,{kind:"constant",value:a},e)}return new Ar(this,t.expression,e)},e.prototype.evaluate=function(t,e,n,i,r,o){if("source"===t.kind){var s=t.evaluate(e,n,i,r,o);return this._calculate(s,s,s,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},n,i),t.evaluate({zoom:Math.floor(e.zoom)},n,i),t.evaluate({zoom:Math.floor(e.zoom)+1},n,i),e):t.value},e.prototype._calculate=function(t,e,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},e.prototype.interpolate=function(t){return t},e}(mr),vr=function(t){this.specification=t};vr.prototype.possiblyEvaluate=function(t,e,n,i){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e,null,{},n,i);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new ar(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ar(Math.floor(e.zoom),e)),t.expression.evaluate(new ar(Math.floor(e.zoom+1),e)),e)}},vr.prototype._calculate=function(t,e,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},vr.prototype.interpolate=function(t){return t};var _r=function(t){this.specification=t};_r.prototype.possiblyEvaluate=function(t,e,n,i){return!!t.expression.evaluate(e,null,{},n,i)},_r.prototype.interpolate=function(){return!1};var br=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var n=t[e];n.specification.overridable&&this.overridableProperties.push(e);var i=this.defaultPropertyValues[e]=new lr(n,void 0),r=this.defaultTransitionablePropertyValues[e]=new cr(n);this.defaultTransitioningPropertyValues[e]=r.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}};Ui("DataDrivenProperty",mr),Ui("DataConstantProperty",gr),Ui("CrossFadedDataDrivenProperty",yr),Ui("CrossFadedProperty",vr),Ui("ColorRampProperty",_r);var xr=function(t){function e(e,n){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),n.layout&&(this._unevaluatedLayout=new fr(n.layout)),n.paint)){for(var i in this._transitionablePaint=new ur(n.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var r in e.layout)this.setLayoutProperty(r,e.layout[r],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new pr(n.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,n){void 0===n&&(n={}),null!=e&&this._validate(Pi,"layers."+this.id+".layout."+t,t,e,n)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return y(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,n){if(void 0===n&&(n={}),null!=e&&this._validate(Ii,"layers."+this.id+".paint."+t,t,e,n))return!1;if(y(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var i=this._transitionablePaint._values[t],r="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var a=this._transitionablePaint._values[t].value;return a.isDataDriven()||o||r||this._handleOverridablePaintPropertyUpdate(t,s,a)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,n){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),_(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,n,i,r){return void 0===r&&(r={}),(!r||!1!==r.validate)&&Di(this,t.call(Si,{key:e,layerType:this.type,objectKey:n,value:i,styleSpec:Mt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Ar&&Ln(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(St),wr={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Cr=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Br=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Er(t,e){void 0===e&&(e=1);var n=0,i=0;return{members:t.map((function(t){var r=wr[t.type].BYTES_PER_ELEMENT,o=n=Tr(n,Math.max(e,r)),s=t.components||1;return i=Math.max(i,r),n+=r*s,{name:t.name,type:t.type,components:s,offset:o}})),size:Tr(n,Math.max(i,e)),alignment:e}}function Tr(t,e){return Math.ceil(t/e)*e}Br.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Br.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Br.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Br.prototype.clear=function(){this.length=0},Br.prototype.resize=function(t){this.reserve(t),this.length=t},Br.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Br.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Sr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var i=2*t;return this.int16[i+0]=e,this.int16[i+1]=n,t},e}(Br);Sr.prototype.bytesPerElement=4,Ui("StructArrayLayout2i4",Sr);var Mr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n,i)},e.prototype.emplace=function(t,e,n,i,r){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=n,this.int16[o+2]=i,this.int16[o+3]=r,t},e}(Br);Mr.prototype.bytesPerElement=8,Ui("StructArrayLayout4i8",Mr);var Ir=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,n,i,r,o)},e.prototype.emplace=function(t,e,n,i,r,o,s){var a=6*t;return this.int16[a+0]=e,this.int16[a+1]=n,this.int16[a+2]=i,this.int16[a+3]=r,this.int16[a+4]=o,this.int16[a+5]=s,t},e}(Br);Ir.prototype.bytesPerElement=12,Ui("StructArrayLayout2i4i12",Ir);var Pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,n,i,r,o)},e.prototype.emplace=function(t,e,n,i,r,o,s){var a=4*t,l=8*t;return this.int16[a+0]=e,this.int16[a+1]=n,this.uint8[l+4]=i,this.uint8[l+5]=r,this.uint8[l+6]=o,this.uint8[l+7]=s,t},e}(Br);Pr.prototype.bytesPerElement=8,Ui("StructArrayLayout2i4ub8",Pr);var Dr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var i=2*t;return this.float32[i+0]=e,this.float32[i+1]=n,t},e}(Br);Dr.prototype.bytesPerElement=8,Ui("StructArrayLayout2f8",Dr);var Fr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o,s,a,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,n,i,r,o,s,a,l,c)},e.prototype.emplace=function(t,e,n,i,r,o,s,a,l,c,u){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=n,this.uint16[h+2]=i,this.uint16[h+3]=r,this.uint16[h+4]=o,this.uint16[h+5]=s,this.uint16[h+6]=a,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t},e}(Br);Fr.prototype.bytesPerElement=20,Ui("StructArrayLayout10ui20",Fr);var Lr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o,s,a,l,c,u,h){var d=this.length;return this.resize(d+1),this.emplace(d,t,e,n,i,r,o,s,a,l,c,u,h)},e.prototype.emplace=function(t,e,n,i,r,o,s,a,l,c,u,h,d){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=n,this.int16[f+2]=i,this.int16[f+3]=r,this.uint16[f+4]=o,this.uint16[f+5]=s,this.uint16[f+6]=a,this.uint16[f+7]=l,this.int16[f+8]=c,this.int16[f+9]=u,this.int16[f+10]=h,this.int16[f+11]=d,t},e}(Br);Lr.prototype.bytesPerElement=24,Ui("StructArrayLayout4i4ui4i24",Lr);var Or=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n)},e.prototype.emplace=function(t,e,n,i){var r=3*t;return this.float32[r+0]=e,this.float32[r+1]=n,this.float32[r+2]=i,t},e}(Br);Or.prototype.bytesPerElement=12,Ui("StructArrayLayout3f12",Or);var Rr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Br);Rr.prototype.bytesPerElement=4,Ui("StructArrayLayout1ul4",Rr);var kr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o,s,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,n,i,r,o,s,a,l)},e.prototype.emplace=function(t,e,n,i,r,o,s,a,l,c){var u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=n,this.int16[u+2]=i,this.int16[u+3]=r,this.int16[u+4]=o,this.int16[u+5]=s,this.uint32[h+3]=a,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}(Br);kr.prototype.bytesPerElement=20,Ui("StructArrayLayout6i1ul2ui20",kr);var Ur=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,n,i,r,o)},e.prototype.emplace=function(t,e,n,i,r,o,s){var a=6*t;return this.int16[a+0]=e,this.int16[a+1]=n,this.int16[a+2]=i,this.int16[a+3]=r,this.int16[a+4]=o,this.int16[a+5]=s,t},e}(Br);Ur.prototype.bytesPerElement=12,Ui("StructArrayLayout2i2i2i12",Ur);var zr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,n,i,r)},e.prototype.emplace=function(t,e,n,i,r,o){var s=4*t,a=8*t;return this.float32[s+0]=e,this.float32[s+1]=n,this.float32[s+2]=i,this.int16[a+6]=r,this.int16[a+7]=o,t},e}(Br);zr.prototype.bytesPerElement=16,Ui("StructArrayLayout2f1f2i16",zr);var Gr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n,i)},e.prototype.emplace=function(t,e,n,i,r){var o=12*t,s=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=n,this.float32[s+1]=i,this.float32[s+2]=r,t},e}(Br);Gr.prototype.bytesPerElement=12,Ui("StructArrayLayout2ub2f12",Gr);var Nr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n)},e.prototype.emplace=function(t,e,n,i){var r=3*t;return this.uint16[r+0]=e,this.uint16[r+1]=n,this.uint16[r+2]=i,t},e}(Br);Nr.prototype.bytesPerElement=6,Ui("StructArrayLayout3ui6",Nr);var Zr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o,s,a,l,c,u,h,d,f,A,p,g){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,n,i,r,o,s,a,l,c,u,h,d,f,A,p,g)},e.prototype.emplace=function(t,e,n,i,r,o,s,a,l,c,u,h,d,f,A,p,g,m){var y=24*t,v=12*t,_=48*t;return this.int16[y+0]=e,this.int16[y+1]=n,this.uint16[y+2]=i,this.uint16[y+3]=r,this.uint32[v+2]=o,this.uint32[v+3]=s,this.uint32[v+4]=a,this.uint16[y+10]=l,this.uint16[y+11]=c,this.uint16[y+12]=u,this.float32[v+7]=h,this.float32[v+8]=d,this.uint8[_+36]=f,this.uint8[_+37]=A,this.uint8[_+38]=p,this.uint32[v+10]=g,this.int16[y+22]=m,t},e}(Br);Zr.prototype.bytesPerElement=48,Ui("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Zr);var jr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i,r,o,s,a,l,c,u,h,d,f,A,p,g,m,y,v,_,b,x,w,C,B,E,T){var S=this.length;return this.resize(S+1),this.emplace(S,t,e,n,i,r,o,s,a,l,c,u,h,d,f,A,p,g,m,y,v,_,b,x,w,C,B,E,T)},e.prototype.emplace=function(t,e,n,i,r,o,s,a,l,c,u,h,d,f,A,p,g,m,y,v,_,b,x,w,C,B,E,T,S){var M=34*t,I=17*t;return this.int16[M+0]=e,this.int16[M+1]=n,this.int16[M+2]=i,this.int16[M+3]=r,this.int16[M+4]=o,this.int16[M+5]=s,this.int16[M+6]=a,this.int16[M+7]=l,this.uint16[M+8]=c,this.uint16[M+9]=u,this.uint16[M+10]=h,this.uint16[M+11]=d,this.uint16[M+12]=f,this.uint16[M+13]=A,this.uint16[M+14]=p,this.uint16[M+15]=g,this.uint16[M+16]=m,this.uint16[M+17]=y,this.uint16[M+18]=v,this.uint16[M+19]=_,this.uint16[M+20]=b,this.uint16[M+21]=x,this.uint16[M+22]=w,this.uint32[I+12]=C,this.float32[I+13]=B,this.float32[I+14]=E,this.float32[I+15]=T,this.float32[I+16]=S,t},e}(Br);jr.prototype.bytesPerElement=68,Ui("StructArrayLayout8i15ui1ul4f68",jr);var Vr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Br);Vr.prototype.bytesPerElement=4,Ui("StructArrayLayout1f4",Vr);var Hr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n)},e.prototype.emplace=function(t,e,n,i){var r=3*t;return this.int16[r+0]=e,this.int16[r+1]=n,this.int16[r+2]=i,t},e}(Br);Hr.prototype.bytesPerElement=6,Ui("StructArrayLayout3i6",Hr);var Jr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n)},e.prototype.emplace=function(t,e,n,i){var r=4*t;return this.uint32[2*t+0]=e,this.uint16[r+2]=n,this.uint16[r+3]=i,t},e}(Br);Jr.prototype.bytesPerElement=8,Ui("StructArrayLayout1ul2ui8",Jr);var Wr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var i=2*t;return this.uint16[i+0]=e,this.uint16[i+1]=n,t},e}(Br);Wr.prototype.bytesPerElement=4,Ui("StructArrayLayout2ui4",Wr);var Qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Br);Qr.prototype.bytesPerElement=2,Ui("StructArrayLayout1ui2",Qr);var Kr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,i){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n,i)},e.prototype.emplace=function(t,e,n,i,r){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=n,this.float32[o+2]=i,this.float32[o+3]=r,t},e}(Br);Kr.prototype.bytesPerElement=16,Ui("StructArrayLayout4f16",Kr);var qr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.anchorPoint.get=function(){return new r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(Cr);qr.prototype.size=20;var Xr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new qr(this,t)},e}(kr);Ui("CollisionBoxArray",Xr);var Yr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},n.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},n.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},n.segment.get=function(){return this._structArray.uint16[this._pos2+10]},n.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},n.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},n.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},n.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},n.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},n.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},n.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},n.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},n.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},n.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,n),e}(Cr);Yr.prototype.size=48;var $r=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Yr(this,t)},e}(Zr);Ui("PlacedSymbolArray",$r);var to=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},n.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},n.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},n.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},n.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},n.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},n.key.get=function(){return this._structArray.uint16[this._pos2+8]},n.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},n.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},n.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},n.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},n.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},n.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},n.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},n.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},n.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},n.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},n.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},n.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},n.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},n.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},n.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},n.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},n.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,n),e}(Cr);to.prototype.size=68;var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new to(this,t)},e}(jr);Ui("SymbolInstanceArray",eo);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Vr);Ui("GlyphOffsetArray",no);var io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Hr);Ui("SymbolLineVertexArray",io);var ro=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,n),e}(Cr);ro.prototype.size=8;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ro(this,t)},e}(Jr);Ui("FeatureIndexArray",oo);var so=Er([{name:"a_pos",components:2,type:"Int16"}],4).members,ao=function(t){void 0===t&&(t=[]),this.segments=t};function lo(t,e){return 256*(t=u(Math.floor(t),0,255))+u(Math.floor(e),0,255)}ao.prototype.prepareSegment=function(t,e,n,i){var r=this.segments[this.segments.length-1];return t>ao.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+ao.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!r||r.vertexLength+t>ao.MAX_VERTEX_ARRAY_LENGTH||r.sortKey!==i)&&(r={vertexOffset:e.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},void 0!==i&&(r.sortKey=i),this.segments.push(r)),r},ao.prototype.get=function(){return this.segments},ao.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var n=e[t];for(var i in n.vaos)n.vaos[i].destroy()}},ao.simpleSegment=function(t,e,n,i){return new ao([{vertexOffset:t,primitiveOffset:e,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])},ao.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ui("SegmentVector",ao);var co=Er([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),uo=e((function(t){t.exports=function(t,e){var n,i,r,o,s,a,l,c;for(i=t.length-(n=3&t.length),r=e,s=3432918353,a=461845907,c=0;c<i;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,r=27492+(65535&(o=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,n){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=t.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0}})),ho=e((function(t){t.exports=function(t,e){for(var n,i=t.length,r=e^i,o=0;i>=4;)n=1540483477*(65535&(n=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(n>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:r^=(255&t.charCodeAt(o+2))<<16;case 2:r^=(255&t.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}})),fo=uo,Ao=ho;fo.murmur3=uo,fo.murmur2=Ao;var po=function(){this.ids=[],this.positions=[],this.indexed=!1};po.prototype.add=function(t,e,n,i){this.ids.push(mo(t)),this.positions.push(e,n,i)},po.prototype.getPositions=function(t){for(var e=mo(t),n=0,i=this.ids.length-1;n<i;){var r=n+i>>1;this.ids[r]>=e?i=r:n=r+1}for(var o=[];this.ids[n]===e;)o.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return o},po.serialize=function(t,e){var n=new Float64Array(t.ids),i=new Uint32Array(t.positions);return function t(e,n,i,r){for(;i<r;){for(var o=e[i+r>>1],s=i-1,a=r+1;;){do{s++}while(e[s]<o);do{a--}while(e[a]>o);if(s>=a)break;yo(e,s,a),yo(n,3*s,3*a),yo(n,3*s+1,3*a+1),yo(n,3*s+2,3*a+2)}a-i<r-a?(t(e,n,i,a),i=a+1):(t(e,n,a+1,r),r=a)}}(n,i,0,n.length-1),e&&e.push(n.buffer,i.buffer),{ids:n,positions:i}},po.deserialize=function(t){var e=new po;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var go=Math.pow(2,53)-1;function mo(t){var e=+t;return!isNaN(e)&&e<=go?e:fo(String(t))}function yo(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}Ui("FeaturePositionMap",po);var vo=function(t,e){this.gl=t.gl,this.location=e},_o=function(t){function e(e,n){t.call(this,e,n),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(vo),bo=function(t){function e(e,n){t.call(this,e,n),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(vo),xo=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(vo),wo=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(vo),Co=function(t){function e(e,n){t.call(this,e,n),this.current=[0,0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(vo),Bo=function(t){function e(e,n){t.call(this,e,n),this.current=te.transparent}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(vo),Eo=new Float32Array(16),To=function(t){function e(e,n){t.call(this,e,n),this.current=Eo}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(vo);function So(t){return[lo(255*t.r,255*t.g),lo(255*t.b,255*t.a)]}var Mo=function(t,e,n){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=n};Mo.prototype.setUniform=function(t,e,n){t.set(n.constantOr(this.value))},Mo.prototype.getBinding=function(t,e,n){return"color"===this.type?new Bo(t,e):new bo(t,e)};var Io=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Io.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Io.prototype.setUniform=function(t,e,n,i){var r="u_pattern_to"===i?this.patternTo:"u_pattern_from"===i?this.patternFrom:"u_pixel_ratio_to"===i?this.pixelRatioTo:"u_pixel_ratio_from"===i?this.pixelRatioFrom:null;r&&t.set(r)},Io.prototype.getBinding=function(t,e,n){return"u_pattern"===n.substr(0,9)?new Co(t,e):new bo(t,e)};var Po=function(t,e,n,i){this.expression=t,this.type=n,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===n?2:1,offset:0}})),this.paintVertexArray=new i};Po.prototype.populatePaintArray=function(t,e,n,i,r){var o=this.paintVertexArray.length,s=this.expression.evaluate(new ar(0),e,{},i,[],r);this.paintVertexArray.resize(t),this._setPaintValue(o,t,s)},Po.prototype.updatePaintArray=function(t,e,n,i){var r=this.expression.evaluate({zoom:0},n,i);this._setPaintValue(t,e,r)},Po.prototype._setPaintValue=function(t,e,n){if("color"===this.type)for(var i=So(n),r=t;r<e;r++)this.paintVertexArray.emplace(r,i[0],i[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}},Po.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Po.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Do=function(t,e,n,i,r,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=n,this.useIntegerZoom=i,this.zoom=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===n?4:2,offset:0}})),this.paintVertexArray=new o};Do.prototype.populatePaintArray=function(t,e,n,i,r){var o=this.expression.evaluate(new ar(this.zoom),e,{},i,[],r),s=this.expression.evaluate(new ar(this.zoom+1),e,{},i,[],r),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,o,s)},Do.prototype.updatePaintArray=function(t,e,n,i){var r=this.expression.evaluate({zoom:this.zoom},n,i),o=this.expression.evaluate({zoom:this.zoom+1},n,i);this._setPaintValue(t,e,r,o)},Do.prototype._setPaintValue=function(t,e,n,i){if("color"===this.type)for(var r=So(n),o=So(i),s=t;s<e;s++)this.paintVertexArray.emplace(s,r[0],r[1],o[0],o[1]);else{for(var a=t;a<e;a++)this.paintVertexArray.emplace(a,n,i);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(i))}},Do.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Do.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Do.prototype.setUniform=function(t,e){var n=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,i=u(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);t.set(i)},Do.prototype.getBinding=function(t,e,n){return new bo(t,e)};var Fo=function(t,e,n,i,r,o){this.expression=t,this.type=e,this.useIntegerZoom=n,this.zoom=i,this.layerId=o,this.zoomInPaintVertexArray=new r,this.zoomOutPaintVertexArray=new r};Fo.prototype.populatePaintArray=function(t,e,n){var i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,e.patterns&&e.patterns[this.layerId],n)},Fo.prototype.updatePaintArray=function(t,e,n,i,r){this._setPaintValues(t,e,n.patterns&&n.patterns[this.layerId],r)},Fo.prototype._setPaintValues=function(t,e,n,i){if(i&&n){var r=i[n.min],o=i[n.mid],s=i[n.max];if(r&&o&&s)for(var a=t;a<e;a++)this.zoomInPaintVertexArray.emplace(a,o.tl[0],o.tl[1],o.br[0],o.br[1],r.tl[0],r.tl[1],r.br[0],r.br[1],o.pixelRatio,r.pixelRatio),this.zoomOutPaintVertexArray.emplace(a,o.tl[0],o.tl[1],o.br[0],o.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],o.pixelRatio,s.pixelRatio)}},Fo.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,co.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,co.members,this.expression.isStateDependent))},Fo.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Lo=function(t,e,n){this.binders={},this._buffers=[];var i=[];for(var r in t.paint._values)if(n(r)){var o=t.paint.get(r);if(o instanceof Ar&&Ln(o.property.specification)){var s=Ro(r,t.type),a=o.value,l=o.property.specification.type,c=o.property.useIntegerZoom,u=o.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===a.kind)this.binders[r]=h?new Io(a.value,s):new Mo(a.value,s,l),i.push("/u_"+r);else if("source"===a.kind||h){var d=ko(r,l,"source");this.binders[r]=h?new Fo(a,l,c,e,d,t.id):new Po(a,s,l,d),i.push("/a_"+r)}else{var f=ko(r,l,"composite");this.binders[r]=new Do(a,s,l,c,e,f),i.push("/z_"+r)}}}this.cacheKey=i.sort().join("")};Lo.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Po||e instanceof Do?e.maxValue:0},Lo.prototype.populatePaintArrays=function(t,e,n,i,r){for(var o in this.binders){var s=this.binders[o];(s instanceof Po||s instanceof Do||s instanceof Fo)&&s.populatePaintArray(t,e,n,i,r)}},Lo.prototype.setConstantPatternPositions=function(t,e){for(var n in this.binders){var i=this.binders[n];i instanceof Io&&i.setConstantPatternPositions(t,e)}},Lo.prototype.updatePaintArrays=function(t,e,n,i,r){var o=!1;for(var s in t)for(var a=0,l=e.getPositions(s);a<l.length;a+=1){var c=l[a],u=n.feature(c.index);for(var h in this.binders){var d=this.binders[h];if((d instanceof Po||d instanceof Do||d instanceof Fo)&&!0===d.expression.isStateDependent){var f=i.paint.get(h);d.expression=f.value,d.updatePaintArray(c.start,c.end,u,t[s],r),o=!0}}}return o},Lo.prototype.defines=function(){var t=[];for(var e in this.binders){var n=this.binders[e];(n instanceof Mo||n instanceof Io)&&t.push.apply(t,n.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},Lo.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var n=this.binders[e];if(n instanceof Po||n instanceof Do)for(var i=0;i<n.paintVertexAttributes.length;i++)t.push(n.paintVertexAttributes[i].name);else if(n instanceof Fo)for(var r=0;r<co.members.length;r++)t.push(co.members[r].name)}return t},Lo.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var n=this.binders[e];if(n instanceof Mo||n instanceof Io||n instanceof Do)for(var i=0,r=n.uniformNames;i<r.length;i+=1)t.push(r[i])}return t},Lo.prototype.getPaintVertexBuffers=function(){return this._buffers},Lo.prototype.getUniforms=function(t,e){var n=[];for(var i in this.binders){var r=this.binders[i];if(r instanceof Mo||r instanceof Io||r instanceof Do)for(var o=0,s=r.uniformNames;o<s.length;o+=1){var a=s[o];if(e[a]){var l=r.getBinding(t,e[a],a);n.push({name:a,property:i,binding:l})}}}return n},Lo.prototype.setUniforms=function(t,e,n,i){for(var r=0,o=e;r<o.length;r+=1){var s=o[r],a=s.name,l=s.property;this.binders[l].setUniform(s.binding,i,n.get(l),a)}},Lo.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var n=this.binders[e];if(t&&n instanceof Fo){var i=2===t.fromScale?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(n instanceof Po||n instanceof Do)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}},Lo.prototype.upload=function(t){for(var e in this.binders){var n=this.binders[e];(n instanceof Po||n instanceof Do||n instanceof Fo)&&n.upload(t)}this.updatePaintBuffers()},Lo.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Po||e instanceof Do||e instanceof Fo)&&e.destroy()}};var Oo=function(t,e,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var i=0,r=t;i<r.length;i+=1){var o=r[i];this.programConfigurations[o.id]=new Lo(o,e,n)}this.needsUpload=!1,this._featureMap=new po,this._bufferOffset=0};function Ro(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function ko(t,e,n){var i={color:{source:Dr,composite:Kr},number:{source:Vr,composite:Dr}},r=function(t){return{"line-pattern":{source:Fr,composite:Fr},"fill-pattern":{source:Fr,composite:Fr},"fill-extrusion-pattern":{source:Fr,composite:Fr}}[t]}(t);return r&&r[n]||i[e][n]}Oo.prototype.populatePaintArrays=function(t,e,n,i,r,o){for(var s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(t,e,i,r,o);void 0!==e.id&&this._featureMap.add(e.id,n,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},Oo.prototype.updatePaintArrays=function(t,e,n,i){for(var r=0,o=n;r<o.length;r+=1){var s=o[r];this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(t,this._featureMap,e,s,i)||this.needsUpload}},Oo.prototype.get=function(t){return this.programConfigurations[t]},Oo.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Oo.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Ui("ConstantBinder",Mo),Ui("CrossFadedConstantBinder",Io),Ui("SourceExpressionBinder",Po),Ui("CrossFadedCompositeBinder",Fo),Ui("CompositeExpressionBinder",Do),Ui("ProgramConfiguration",Lo,{omit:["_buffers"]}),Ui("ProgramConfigurationSet",Oo);var Uo=Math.pow(2,14)-1,zo=-Uo-1;function Go(t){for(var e=8192/t.extent,n=t.loadGeometry(),i=0;i<n.length;i++)for(var r=n[i],o=0;o<r.length;o++){var s=r[o],a=Math.round(s.x*e),l=Math.round(s.y*e);s.x=u(a,zo,Uo),s.y=u(l,zo,Uo),(a<s.x||a>s.x+1||l<s.y||l>s.y+1)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return n}function No(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Go(t):[]}}function Zo(t,e,n,i,r){t.emplaceBack(2*e+(i+1)/2,2*n+(r+1)/2)}var jo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Sr,this.indexArray=new Nr,this.segments=new ao,this.programConfigurations=new Oo(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Vo(t,e){for(var n=0;n<t.length;n++)if($o(e,t[n]))return!0;for(var i=0;i<e.length;i++)if($o(t,e[i]))return!0;return!!Qo(t,e)}function Ho(t,e,n){return!!$o(t,e)||!!qo(e,t,n)}function Jo(t,e){if(1===t.length)return Yo(e,t[0]);for(var n=0;n<e.length;n++)for(var i=e[n],r=0;r<i.length;r++)if($o(t,i[r]))return!0;for(var o=0;o<t.length;o++)if(Yo(e,t[o]))return!0;for(var s=0;s<e.length;s++)if(Qo(t,e[s]))return!0;return!1}function Wo(t,e,n){if(t.length>1){if(Qo(t,e))return!0;for(var i=0;i<e.length;i++)if(qo(e[i],t,n))return!0}for(var r=0;r<t.length;r++)if(qo(t[r],e,n))return!0;return!1}function Qo(t,e){if(0===t.length||0===e.length)return!1;for(var n=0;n<t.length-1;n++)for(var i=t[n],r=t[n+1],o=0;o<e.length-1;o++)if(Ko(i,r,e[o],e[o+1]))return!0;return!1}function Ko(t,e,n,i){return C(t,n,i)!==C(e,n,i)&&C(t,e,n)!==C(t,e,i)}function qo(t,e,n){var i=n*n;if(1===e.length)return t.distSqr(e[0])<i;for(var r=1;r<e.length;r++)if(Xo(t,e[r-1],e[r])<i)return!0;return!1}function Xo(t,e,n){var i=e.distSqr(n);if(0===i)return t.distSqr(e);var r=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/i;return t.distSqr(r<0?e:r>1?n:n.sub(e)._mult(r)._add(e))}function Yo(t,e){for(var n,i,r,o=!1,s=0;s<t.length;s++)for(var a=0,l=(n=t[s]).length-1;a<n.length;l=a++)(i=n[a]).y>e.y!=(r=n[l]).y>e.y&&e.x<(r.x-i.x)*(e.y-i.y)/(r.y-i.y)+i.x&&(o=!o);return o}function $o(t,e){for(var n=!1,i=0,r=t.length-1;i<t.length;r=i++){var o=t[i],s=t[r];o.y>e.y!=s.y>e.y&&e.x<(s.x-o.x)*(e.y-o.y)/(s.y-o.y)+o.x&&(n=!n)}return n}function ts(t,e,n){var i=n[0],r=n[2];if(t.x<i.x&&e.x<i.x||t.x>r.x&&e.x>r.x||t.y<i.y&&e.y<i.y||t.y>r.y&&e.y>r.y)return!1;var o=C(t,e,n[0]);return o!==C(t,e,n[1])||o!==C(t,e,n[2])||o!==C(t,e,n[3])}function es(t,e,n){var i=e.paint.get(t).value;return"constant"===i.kind?i.value:n.programConfigurations.get(e.id).getMaxValue(t)}function ns(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function is(t,e,n,i,o){if(!e[0]&&!e[1])return t;var s=r.convert(e)._mult(o);"viewport"===n&&s._rotate(-i);for(var a=[],l=0;l<t.length;l++)a.push(t[l].sub(s));return a}jo.prototype.populate=function(t,e,n){var i=this.layers[0],r=[],o=null;"circle"===i.type&&(o=i.layout.get("circle-sort-key"));for(var s=0,a=t;s<a.length;s+=1){var l=a[s],c=l.feature,u=l.id,h=l.index,d=l.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,A=No(c,f);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),A,n)){var p=o?o.evaluate(A,{},n):void 0,g={id:u,properties:c.properties,type:c.type,sourceLayerIndex:d,index:h,geometry:f?A.geometry:Go(c),patterns:{},sortKey:p};r.push(g)}}o&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,y=r;m<y.length;m+=1){var v=y[m],_=v.geometry,b=v.index,x=v.sourceLayerIndex,w=t[b].feature;this.addFeature(v,_,b,n),e.featureIndex.insert(w,_,b,x,this.index)}},jo.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},jo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},jo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},jo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,so),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},jo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},jo.prototype.addFeature=function(t,e,n,i){for(var r=0,o=e;r<o.length;r+=1)for(var s=0,a=o[r];s<a.length;s+=1){var l=a[s],c=l.x,u=l.y;if(!(c<0||c>=8192||u<0||u>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),d=h.vertexLength;Zo(this.layoutVertexArray,c,u,-1,-1),Zo(this.layoutVertexArray,c,u,1,-1),Zo(this.layoutVertexArray,c,u,1,1),Zo(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(d,d+1,d+2),this.indexArray.emplaceBack(d,d+3,d+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,{},i)},Ui("CircleBucket",jo,{omit:["layers"]});var rs=new br({"circle-sort-key":new mr(Mt.layout_circle["circle-sort-key"])}),os={paint:new br({"circle-radius":new mr(Mt.paint_circle["circle-radius"]),"circle-color":new mr(Mt.paint_circle["circle-color"]),"circle-blur":new mr(Mt.paint_circle["circle-blur"]),"circle-opacity":new mr(Mt.paint_circle["circle-opacity"]),"circle-translate":new gr(Mt.paint_circle["circle-translate"]),"circle-translate-anchor":new gr(Mt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new gr(Mt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new gr(Mt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new mr(Mt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new mr(Mt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new mr(Mt.paint_circle["circle-stroke-opacity"])}),layout:rs},ss="undefined"!=typeof Float32Array?Float32Array:Array;function as(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ls(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],A=e[11],p=e[12],g=e[13],m=e[14],y=e[15],v=n[0],_=n[1],b=n[2],x=n[3];return t[0]=v*i+_*a+b*h+x*p,t[1]=v*r+_*l+b*d+x*g,t[2]=v*o+_*c+b*f+x*m,t[3]=v*s+_*u+b*A+x*y,t[4]=(v=n[4])*i+(_=n[5])*a+(b=n[6])*h+(x=n[7])*p,t[5]=v*r+_*l+b*d+x*g,t[6]=v*o+_*c+b*f+x*m,t[7]=v*s+_*u+b*A+x*y,t[8]=(v=n[8])*i+(_=n[9])*a+(b=n[10])*h+(x=n[11])*p,t[9]=v*r+_*l+b*d+x*g,t[10]=v*o+_*c+b*f+x*m,t[11]=v*s+_*u+b*A+x*y,t[12]=(v=n[12])*i+(_=n[13])*a+(b=n[14])*h+(x=n[15])*p,t[13]=v*r+_*l+b*d+x*g,t[14]=v*o+_*c+b*f+x*m,t[15]=v*s+_*u+b*A+x*y,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,n=arguments.length;n--;)e+=t[n]*t[n];return Math.sqrt(e)});var cs,us=ls;function hs(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*o+n[12]*s,t[1]=n[1]*i+n[5]*r+n[9]*o+n[13]*s,t[2]=n[2]*i+n[6]*r+n[10]*o+n[14]*s,t[3]=n[3]*i+n[7]*r+n[11]*o+n[15]*s,t}cs=new ss(3),ss!=Float32Array&&(cs[0]=0,cs[1]=0,cs[2]=0),function(){var t=new ss(4);ss!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var ds=(function(){var t=new ss(2);ss!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,os)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new jo(t)},e.prototype.queryRadius=function(t){var e=t;return es("circle-radius",this,e)+es("circle-stroke-width",this,e)+ns(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,r,o,s,a){for(var l=is(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,s),c=this.paint.get("circle-radius").evaluate(e,n)+this.paint.get("circle-stroke-width").evaluate(e,n),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(t,e){return t.map((function(t){return fs(t,e)}))}(l,a),d=u?c*s:c,f=0,A=i;f<A.length;f+=1)for(var p=0,g=A[f];p<g.length;p+=1){var m=g[p],y=u?m:fs(m,a),v=d,_=hs([],[m.x,m.y,0,1],a);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?v*=_[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(v*=o.cameraToCenterDistance/_[3]),Ho(h,y,v))return!0}return!1},e}(xr));function fs(t,e){var n=hs([],[t.x,t.y,0,1],e);return new r(n[0]/n[3],n[1]/n[3])}var As=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(jo);function ps(t,e,n,i){var r=e.width,o=e.height;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==r*o*n)throw new RangeError("mismatched image size")}else i=new Uint8Array(r*o*n);return t.width=r,t.height=o,t.data=i,t}function gs(t,e,n){var i=e.width,r=e.height;if(i!==t.width||r!==t.height){var o=ps({},{width:i,height:r},n);ms(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,r)},n),t.width=i,t.height=r,t.data=o.data}}function ms(t,e,n,i,r,o){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||n.x>t.width-r.width||n.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>e.width||r.height>e.height||i.x>e.width-r.width||i.y>e.height-r.height)throw new RangeError("out of range destination coordinates for image copy");for(var s=t.data,a=e.data,l=0;l<r.height;l++)for(var c=((n.y+l)*t.width+n.x)*o,u=((i.y+l)*e.width+i.x)*o,h=0;h<r.width*o;h++)a[u+h]=s[c+h];return e}Ui("HeatmapBucket",As,{omit:["layers"]});var ys=function(t,e){ps(this,t,1,e)};ys.prototype.resize=function(t){gs(this,t,1)},ys.prototype.clone=function(){return new ys({width:this.width,height:this.height},new Uint8Array(this.data))},ys.copy=function(t,e,n,i,r){ms(t,e,n,i,r,1)};var vs=function(t,e){ps(this,t,4,e)};vs.prototype.resize=function(t){gs(this,t,4)},vs.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},vs.prototype.clone=function(){return new vs({width:this.width,height:this.height},new Uint8Array(this.data))},vs.copy=function(t,e,n,i,r){ms(t,e,n,i,r,4)},Ui("AlphaImage",ys),Ui("RGBAImage",vs);var _s={paint:new br({"heatmap-radius":new mr(Mt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new mr(Mt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new gr(Mt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new _r(Mt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new gr(Mt.paint_heatmap["heatmap-opacity"])})};function bs(t){var e={},n=t.resolution||256,i=t.clips?t.clips.length:1,r=t.image||new vs({width:n,height:i}),o=function(n,i,o){e[t.evaluationKey]=o;var s=t.expression.evaluate(e);r.data[n+i+0]=Math.floor(255*s.r/s.a),r.data[n+i+1]=Math.floor(255*s.g/s.a),r.data[n+i+2]=Math.floor(255*s.b/s.a),r.data[n+i+3]=Math.floor(255*s.a)};if(t.clips)for(var s=0,a=0;s<i;++s,a+=4*n)for(var l=0,c=0;l<n;l++,c+=4){var u=l/(n-1),h=t.clips[s];o(a,c,h.start*(1-u)+h.end*u)}else for(var d=0,f=0;d<n;d++,f+=4)o(0,f,d/(n-1));return r}var xs=function(t){function e(e){t.call(this,e,_s),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new As(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=bs({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(xr),ws={paint:new br({"hillshade-illumination-direction":new gr(Mt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new gr(Mt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new gr(Mt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new gr(Mt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new gr(Mt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new gr(Mt.paint_hillshade["hillshade-accent-color"])})},Cs=function(t){function e(e){t.call(this,e,ws)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(xr),Bs=Er([{name:"a_pos",components:2,type:"Int16"}],4).members,Es=Ss,Ts=Ss;function Ss(t,e,n){n=n||2;var i,r,o,s,a,l,c,u=e&&e.length,h=u?e[0]*n:t.length,d=Ms(t,0,h,n,!0),f=[];if(!d||d.next===d.prev)return f;if(u&&(d=function(t,e,n,i){var r,o,s,a=[];for(r=0,o=e.length;r<o;r++)(s=Ms(t,e[r]*i,r<o-1?e[r+1]*i:t.length,i,!1))===s.next&&(s.steiner=!0),a.push(Gs(s));for(a.sort(Rs),r=0;r<a.length;r++)ks(a[r],n),n=Is(n,n.next);return n}(t,e,d,n)),t.length>80*n){i=o=t[0],r=s=t[1];for(var A=n;A<h;A+=n)(a=t[A])<i&&(i=a),(l=t[A+1])<r&&(r=l),a>o&&(o=a),l>s&&(s=l);c=0!==(c=Math.max(o-i,s-r))?1/c:0}return Ps(d,f,n,i,r,c),f}function Ms(t,e,n,i,r){var o,s;if(r===$s(t,e,n,i)>0)for(o=e;o<n;o+=i)s=qs(o,t[o],t[o+1],s);else for(o=n-i;o>=e;o-=i)s=qs(o,t[o],t[o+1],s);return s&&Vs(s,s.next)&&(Xs(s),s=s.next),s}function Is(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!Vs(i,i.next)&&0!==js(i.prev,i,i.next))i=i.next;else{if(Xs(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function Ps(t,e,n,i,r,o,s){if(t){!s&&o&&function(t,e,n,i){var r=t;do{null===r.z&&(r.z=zs(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,o,s,a,l,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e<c&&(a++,i=i.nextZ);e++);for(l=c;a>0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,c*=2}while(s>1)}(r)}(t,i,r,o);for(var a,l,c=t;t.prev!==t.next;)if(a=t.prev,l=t.next,o?Fs(t,i,r,o):Ds(t))e.push(a.i/n),e.push(t.i/n),e.push(l.i/n),Xs(t),t=l.next,c=l.next;else if((t=l)===c){s?1===s?Ps(t=Ls(Is(t),e,n),e,n,i,r,o,2):2===s&&Os(t,e,n,i,r,o):Ps(Is(t),e,n,i,r,o,1);break}}}function Ds(t){var e=t.prev,n=t,i=t.next;if(js(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Ns(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&js(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Fs(t,e,n,i){var r=t.prev,o=t,s=t.next;if(js(r,o,s)>=0)return!1;for(var a=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,l=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,c=zs(r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,e,n,i),u=zs(a,l,e,n,i),h=t.prevZ,d=t.nextZ;h&&h.z>=c&&d&&d.z<=u;){if(h!==t.prev&&h!==t.next&&Ns(r.x,r.y,o.x,o.y,s.x,s.y,h.x,h.y)&&js(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,d!==t.prev&&d!==t.next&&Ns(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&js(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;h&&h.z>=c;){if(h!==t.prev&&h!==t.next&&Ns(r.x,r.y,o.x,o.y,s.x,s.y,h.x,h.y)&&js(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;d&&d.z<=u;){if(d!==t.prev&&d!==t.next&&Ns(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&js(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Ls(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!Vs(r,o)&&Hs(r,i,i.next,o)&&Qs(r,o)&&Qs(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),Xs(i),Xs(i.next),i=t=o),i=i.next}while(i!==t);return Is(i)}function Os(t,e,n,i,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Zs(s,a)){var l=Ks(s,a);return s=Is(s,s.next),l=Is(l,l.next),Ps(s,e,n,i,r,o),void Ps(l,e,n,i,r,o)}a=a.next}s=s.next}while(s!==t)}function Rs(t,e){return t.x-e.x}function ks(t,e){if(e=function(t,e){var n,i=e,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>s){if(s=a,a===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===s)return n;var l,c=n,u=n.x,h=n.y,d=1/0;i=n;do{r>=i.x&&i.x>=u&&r!==i.x&&Ns(o<h?r:s,o,u,h,o<h?s:r,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(r-i.x),Qs(i,t)&&(l<d||l===d&&(i.x>n.x||i.x===n.x&&Us(n,i)))&&(n=i,d=l)),i=i.next}while(i!==c);return n}(t,e)){var n=Ks(e,t);Is(e,e.next),Is(n,n.next)}}function Us(t,e){return js(t.prev,t,e.prev)<0&&js(e.next,t,t.next)<0}function zs(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Gs(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function Ns(t,e,n,i,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(i-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(r-s)*(i-a)>=0}function Zs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Hs(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Qs(t,e)&&Qs(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(js(t.prev,t,e.prev)||js(t,e.prev,e))||Vs(t,e)&&js(t.prev,t,t.next)>0&&js(e.prev,e,e.next)>0)}function js(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Vs(t,e){return t.x===e.x&&t.y===e.y}function Hs(t,e,n,i){var r=Ws(js(t,e,n)),o=Ws(js(t,e,i)),s=Ws(js(n,i,t)),a=Ws(js(n,i,e));return r!==o&&s!==a||!(0!==r||!Js(t,n,e))||!(0!==o||!Js(t,i,e))||!(0!==s||!Js(n,t,i))||!(0!==a||!Js(n,e,i))}function Js(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Ws(t){return t>0?1:t<0?-1:0}function Qs(t,e){return js(t.prev,t,t.next)<0?js(t,e,t.next)>=0&&js(t,t.prev,e)>=0:js(t,e,t.prev)<0||js(t,t.next,e)<0}function Ks(t,e){var n=new Ys(t.i,t.x,t.y),i=new Ys(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function qs(t,e,n,i){var r=new Ys(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Xs(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ys(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function $s(t,e,n,i){for(var r=0,o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}function ta(t,e,n,i,r){!function t(e,n,i,r,o){for(;r>i;){if(r-i>600){var s=r-i+1,a=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(a-s/2<0?-1:1);t(e,n,Math.max(i,Math.floor(n-a*c/s+u)),Math.min(r,Math.floor(n+(s-a)*c/s+u)),o)}var h=e[n],d=i,f=r;for(ea(e,i,n),o(e[r],h)>0&&ea(e,i,r);d<f;){for(ea(e,d,f),d++,f--;o(e[d],h)<0;)d++;for(;o(e[f],h)>0;)f--}0===o(e[i],h)?ea(e,i,f):ea(e,++f,r),f<=n&&(i=f+1),n<=f&&(r=f-1)}}(t,e,n||0,i||t.length-1,r||na)}function ea(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function na(t,e){return t<e?-1:t>e?1:0}function ia(t,e){var n=t.length;if(n<=1)return[t];for(var i,r,o=[],s=0;s<n;s++){var a=B(t[s]);0!==a&&(t[s].area=Math.abs(a),void 0===r&&(r=a<0),r===a<0?(i&&o.push(i),i=[t[s]]):i.push(t[s]))}if(i&&o.push(i),e>1)for(var l=0;l<o.length;l++)o[l].length<=e||(ta(o[l],e,1,o[l].length-1,ra),o[l]=o[l].slice(0,e));return o}function ra(t,e){return e.area-t.area}function oa(t,e,n){for(var i=n.patternDependencies,r=!1,o=0,s=e;o<s.length;o+=1){var a=s[o].paint.get(t+"-pattern");a.isConstant()||(r=!0);var l=a.constantOr(null);l&&(r=!0,i[l.to]=!0,i[l.from]=!0)}return r}function sa(t,e,n,i,r){for(var o=r.patternDependencies,s=0,a=e;s<a.length;s+=1){var l=a[s],c=l.paint.get(t+"-pattern").value;if("constant"!==c.kind){var u=c.evaluate({zoom:i-1},n,{},r.availableImages),h=c.evaluate({zoom:i},n,{},r.availableImages),d=c.evaluate({zoom:i+1},n,{},r.availableImages);h=h&&h.name?h.name:h,d=d&&d.name?d.name:d,o[u=u&&u.name?u.name:u]=!0,o[h]=!0,o[d]=!0,n.patterns[l.id]={min:u,mid:h,max:d}}}return n}Ss.deviation=function(t,e,n,i){var r=e&&e.length,o=Math.abs($s(t,0,r?e[0]*n:t.length,n));if(r)for(var s=0,a=e.length;s<a;s++)o-=Math.abs($s(t,e[s]*n,s<a-1?e[s+1]*n:t.length,n));var l=0;for(s=0;s<i.length;s+=3){var c=i[s]*n,u=i[s+1]*n,h=i[s+2]*n;l+=Math.abs((t[c]-t[h])*(t[u+1]-t[c+1])-(t[c]-t[u])*(t[h+1]-t[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},Ss.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[r][o][s]);r>0&&n.holes.push(i+=t[r-1].length)}return n},Es.default=Ts;var aa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Sr,this.indexArray=new Nr,this.indexArray2=new Wr,this.programConfigurations=new Oo(t.layers,t.zoom),this.segments=new ao,this.segments2=new ao,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};aa.prototype.populate=function(t,e,n){this.hasPattern=oa("fill",this.layers,e);for(var i=this.layers[0].layout.get("fill-sort-key"),r=[],o=0,s=t;o<s.length;o+=1){var a=s[o],l=a.feature,c=a.id,u=a.index,h=a.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,f=No(l,d);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),f,n)){var A=i?i.evaluate(f,{},n,e.availableImages):void 0,p={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:d?f.geometry:Go(l),patterns:{},sortKey:A};r.push(p)}}i&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,m=r;g<m.length;g+=1){var y=m[g],v=y.geometry,_=y.index,b=y.sourceLayerIndex;if(this.hasPattern){var x=sa("fill",this.layers,y,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(y,v,_,n,{});e.featureIndex.insert(t[_].feature,v,_,b,this.index)}},aa.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},aa.prototype.addFeatures=function(t,e,n){for(var i=0,r=this.patternFeatures;i<r.length;i+=1){var o=r[i];this.addFeature(o,o.geometry,o.index,e,n)}},aa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},aa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},aa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Bs),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},aa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},aa.prototype.addFeature=function(t,e,n,i,r){for(var o=0,s=ia(e,500);o<s.length;o+=1){for(var a=s[o],l=0,c=0,u=a;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),d=h.vertexLength,f=[],A=[],p=0,g=a;p<g.length;p+=1){var m=g[p];if(0!==m.length){m!==a[0]&&A.push(f.length/2);var y=this.segments2.prepareSegment(m.length,this.layoutVertexArray,this.indexArray2),v=y.vertexLength;this.layoutVertexArray.emplaceBack(m[0].x,m[0].y),this.indexArray2.emplaceBack(v+m.length-1,v),f.push(m[0].x),f.push(m[0].y);for(var _=1;_<m.length;_++)this.layoutVertexArray.emplaceBack(m[_].x,m[_].y),this.indexArray2.emplaceBack(v+_-1,v+_),f.push(m[_].x),f.push(m[_].y);y.vertexLength+=m.length,y.primitiveLength+=m.length}}for(var b=Es(f,A),x=0;x<b.length;x+=3)this.indexArray.emplaceBack(d+b[x],d+b[x+1],d+b[x+2]);h.vertexLength+=l,h.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,r,i)},Ui("FillBucket",aa,{omit:["layers","patternFeatures"]});var la=new br({"fill-sort-key":new mr(Mt.layout_fill["fill-sort-key"])}),ca={paint:new br({"fill-antialias":new gr(Mt.paint_fill["fill-antialias"]),"fill-opacity":new mr(Mt.paint_fill["fill-opacity"]),"fill-color":new mr(Mt.paint_fill["fill-color"]),"fill-outline-color":new mr(Mt.paint_fill["fill-outline-color"]),"fill-translate":new gr(Mt.paint_fill["fill-translate"]),"fill-translate-anchor":new gr(Mt.paint_fill["fill-translate-anchor"]),"fill-pattern":new yr(Mt.paint_fill["fill-pattern"])}),layout:la},ua=function(t){function e(e){t.call(this,e,ca)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,n){t.prototype.recalculate.call(this,e,n);var i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new aa(t)},e.prototype.queryRadius=function(){return ns(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,r,o,s){return Jo(is(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,s),i)},e.prototype.isTileClipped=function(){return!0},e}(xr),ha=Er([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,da=fa;function fa(t,e,n,i,r){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=r,t.readFields(Aa,this,e)}function Aa(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){for(var n=t.readVarint()+t.pos;t.pos<n;){var i=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[i]=r}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function pa(t){for(var e,n,i=0,r=0,o=t.length,s=o-1;r<o;s=r++)i+=((n=t[s]).x-(e=t[r]).x)*(e.y+n.y);return i}fa.types=["Unknown","Point","LineString","Polygon"],fa.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,i=1,o=0,s=0,a=0,l=[];t.pos<n;){if(o<=0){var c=t.readVarint();i=7&c,o=c>>3}if(o--,1===i||2===i)s+=t.readSVarint(),a+=t.readSVarint(),1===i&&(e&&l.push(e),e=[]),e.push(new r(s,a));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&l.push(e),l},fa.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,i=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;t.pos<e;){if(i<=0){var u=t.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)(r+=t.readSVarint())<s&&(s=r),r>a&&(a=r),(o+=t.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==n)throw new Error("unknown command "+n)}return[s,l,a,c]},fa.prototype.toGeoJSON=function(t,e,n){var i,r,o=this.extent*Math.pow(2,n),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),c=fa.types[this.type];function u(t){for(var e=0;e<t.length;e++){var n=t[e];t[e]=[360*(n.x+s)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(n.y+a)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];u(l=h);break;case 2:for(i=0;i<l.length;i++)u(l[i]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var n,i,r=[],o=0;o<e;o++){var s=pa(t[o]);0!==s&&(void 0===i&&(i=s<0),i===s<0?(n&&r.push(n),n=[t[o]]):n.push(t[o]))}return n&&r.push(n),r}(l),i=0;i<l.length;i++)for(r=0;r<l[i].length;r++)u(l[i][r])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var ga=ma;function ma(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ya,this,e),this.length=this._features.length}function ya(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){for(var e=null,n=t.readVarint()+t.pos;t.pos<n;){var i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(n))}function va(t,e,n){if(3===t){var i=new ga(n,n.readVarint()+n.pos);i.length&&(e[i.name]=i)}}ma.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new da(this._pbf,e,this.extent,this._keys,this._values)};var _a={VectorTile:function(t,e){this.layers=t.readFields(va,{},e)},VectorTileFeature:da,VectorTileLayer:ga},ba=_a.VectorTileFeature.types,xa=Math.pow(2,13);function wa(t,e,n,i,r,o,s,a){t.emplaceBack(e,n,2*Math.floor(i*xa)+s,r*xa*2,o*xa*2,Math.round(a))}var Ca=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ir,this.indexArray=new Nr,this.programConfigurations=new Oo(t.layers,t.zoom),this.segments=new ao,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ba(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Ca.prototype.populate=function(t,e,n){this.features=[],this.hasPattern=oa("fill-extrusion",this.layers,e);for(var i=0,r=t;i<r.length;i+=1){var o=r[i],s=o.feature,a=o.id,l=o.index,c=o.sourceLayerIndex,u=this.layers[0]._featureFilter.needGeometry,h=No(s,u);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),h,n)){var d={id:a,sourceLayerIndex:c,index:l,geometry:u?h.geometry:Go(s),properties:s.properties,type:s.type,patterns:{}};this.hasPattern?this.features.push(sa("fill-extrusion",this.layers,d,this.zoom,e)):this.addFeature(d,d.geometry,l,n,{}),e.featureIndex.insert(s,d.geometry,l,c,this.index,!0)}}},Ca.prototype.addFeatures=function(t,e,n){for(var i=0,r=this.features;i<r.length;i+=1){var o=r[i];this.addFeature(o,o.geometry,o.index,e,n)}},Ca.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Ca.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ca.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ca.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ha),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ca.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ca.prototype.addFeature=function(t,e,n,i,r){for(var o=0,s=ia(e,500);o<s.length;o+=1){for(var a=s[o],l=0,c=0,u=a;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),d=0,f=a;d<f.length;d+=1){var A=f[d];if(0!==A.length&&!((D=A).every((function(t){return t.x<0}))||D.every((function(t){return t.x>8192}))||D.every((function(t){return t.y<0}))||D.every((function(t){return t.y>8192}))))for(var p=0,g=0;g<A.length;g++){var m=A[g];if(g>=1){var y=A[g-1];if(!Ba(m,y)){h.vertexLength+4>ao.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=m.sub(y)._perp()._unit(),_=y.dist(m);p+_>32768&&(p=0),wa(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,0,p),wa(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,1,p),wa(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,0,p+=_),wa(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,1,p);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>ao.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===ba[t.type]){for(var x=[],w=[],C=h.vertexLength,B=0,E=a;B<E.length;B+=1){var T=E[B];if(0!==T.length){T!==a[0]&&w.push(x.length/2);for(var S=0;S<T.length;S++){var M=T[S];wa(this.layoutVertexArray,M.x,M.y,0,0,1,1,0),x.push(M.x),x.push(M.y)}}}for(var I=Es(x,w),P=0;P<I.length;P+=3)this.indexArray.emplaceBack(C+I[P],C+I[P+2],C+I[P+1]);h.primitiveLength+=I.length/3,h.vertexLength+=l}}var D;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,r,i)},Ui("FillExtrusionBucket",Ca,{omit:["layers","features"]});var Ea={paint:new br({"fill-extrusion-opacity":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new mr(Mt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new yr(Mt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new mr(Mt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new mr(Mt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Ta=function(t){function e(e){t.call(this,e,Ea)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Ca(t)},e.prototype.queryRadius=function(){return ns(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,s,a,l){var c=is(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,a),u=this.paint.get("fill-extrusion-height").evaluate(e,n),h=this.paint.get("fill-extrusion-base").evaluate(e,n),d=function(t,e,n,i){for(var o=[],s=0,a=t;s<a.length;s+=1){var l=a[s],c=[l.x,l.y,0,1];hs(c,c,e),o.push(new r(c[0]/c[3],c[1]/c[3]))}return o}(c,l),f=function(t,e,n,i){for(var o=[],s=[],a=i[8]*e,l=i[9]*e,c=i[10]*e,u=i[11]*e,h=i[8]*n,d=i[9]*n,f=i[10]*n,A=i[11]*n,p=0,g=t;p<g.length;p+=1){for(var m=[],y=[],v=0,_=g[p];v<_.length;v+=1){var b=_[v],x=b.x,w=b.y,C=i[0]*x+i[4]*w+i[12],B=i[1]*x+i[5]*w+i[13],E=i[2]*x+i[6]*w+i[14],T=i[3]*x+i[7]*w+i[15],S=E+c,M=T+u,I=C+h,P=B+d,D=E+f,F=T+A,L=new r((C+a)/M,(B+l)/M);L.z=S/M,m.push(L);var O=new r(I/F,P/F);O.z=D/F,y.push(O)}o.push(m),s.push(y)}return[o,s]}(i,h,u,l);return function(t,e,n){var i=1/0;Jo(n,e)&&(i=Ma(n,e[0]));for(var r=0;r<e.length;r++)for(var o=e[r],s=t[r],a=0;a<o.length-1;a++){var l=o[a],c=[l,o[a+1],s[a+1],s[a],l];Vo(n,c)&&(i=Math.min(i,Ma(n,c)))}return i!==1/0&&i}(f[0],f[1],d)},e}(xr);function Sa(t,e){return t.x*e.x+t.y*e.y}function Ma(t,e){if(1===t.length){for(var n,i=0,r=e[i++];!n||r.equals(n);)if(!(n=e[i++]))return 1/0;for(;i<e.length;i++){var o=e[i],s=t[0],a=n.sub(r),l=o.sub(r),c=s.sub(r),u=Sa(a,a),h=Sa(a,l),d=Sa(l,l),f=Sa(c,a),A=Sa(c,l),p=u*d-h*h,g=(d*f-h*A)/p,m=(u*A-h*f)/p,y=r.z*(1-g-m)+n.z*g+o.z*m;if(isFinite(y))return y}return 1/0}for(var v=1/0,_=0,b=e;_<b.length;_+=1)v=Math.min(v,b[_].z);return v}var Ia=Er([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Pa=Er([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Da=_a.VectorTileFeature.types,Fa=Math.cos(Math.PI/180*37.5),La=Math.pow(2,14)/.5,Oa=function(t){var e=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(t){e.gradients[t.id]={}})),this.layoutVertexArray=new Pr,this.layoutVertexArray2=new Dr,this.indexArray=new Nr,this.programConfigurations=new Oo(t.layers,t.zoom),this.segments=new ao,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Oa.prototype.populate=function(t,e,n){this.hasPattern=oa("line",this.layers,e);for(var i=this.layers[0].layout.get("line-sort-key"),r=[],o=0,s=t;o<s.length;o+=1){var a=s[o],l=a.feature,c=a.id,u=a.index,h=a.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,f=No(l,d);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),f,n)){var A=i?i.evaluate(f,{},n):void 0,p={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:d?f.geometry:Go(l),patterns:{},sortKey:A};r.push(p)}}i&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,m=r;g<m.length;g+=1){var y=m[g],v=y.geometry,_=y.index,b=y.sourceLayerIndex;if(this.hasPattern){var x=sa("line",this.layers,y,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(y,v,_,n,{});e.featureIndex.insert(t[_].feature,v,_,b,this.index)}},Oa.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Oa.prototype.addFeatures=function(t,e,n){for(var i=0,r=this.patternFeatures;i<r.length;i+=1){var o=r[i];this.addFeature(o,o.geometry,o.index,e,n)}},Oa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Oa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Oa.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Pa)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ia),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Oa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Oa.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},Oa.prototype.addFeature=function(t,e,n,i,r){var o=this.layers[0].layout,s=o.get("line-join").evaluate(t,{}),a=o.get("line-cap"),l=o.get("line-miter-limit"),c=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var u=0,h=e;u<h.length;u+=1)this.addLine(h[u],t,s,a,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,r,i)},Oa.prototype.addLine=function(t,e,n,i,r,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var s=0;s<t.length-1;s++)this.totalDistance+=t[s].dist(t[s+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var a="Polygon"===Da[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c<l-1&&t[c].equals(t[c+1]);)c++;if(!(l<(a?3:2))){"bevel"===n&&(r=1.05);var u,h=this.overscaling<=16?122880/(512*this.overscaling):0,d=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),f=void 0,A=void 0,p=void 0,g=void 0;this.e1=this.e2=-1,a&&(g=t[c].sub(u=t[l-2])._unit()._perp());for(var m=c;m<l;m++)if(!(A=m===l-1?a?t[c+1]:void 0:t[m+1])||!t[m].equals(A)){g&&(p=g),u&&(f=u),u=t[m],g=A?A.sub(u)._unit()._perp():p;var y=(p=p||g).add(g);0===y.x&&0===y.y||y._unit();var v=p.x*g.x+p.y*g.y,_=y.x*g.x+y.y*g.y,b=0!==_?1/_:1/0,x=2*Math.sqrt(2-2*_),w=_<Fa&&f&&A,C=p.x*g.y-p.y*g.x>0;if(w&&m>c){var B=u.dist(f);if(B>2*h){var E=u.sub(u.sub(f)._mult(h/B)._round());this.updateDistance(f,E),this.addCurrentVertex(E,p,0,0,d),f=E}}var T=f&&A,S=T?n:a?"butt":i;if(T&&"round"===S&&(b<o?S="miter":b<=2&&(S="fakeround")),"miter"===S&&b>r&&(S="bevel"),"bevel"===S&&(b>2&&(S="flipbevel"),b<r&&(S="miter")),f&&this.updateDistance(f,u),"miter"===S)y._mult(b),this.addCurrentVertex(u,y,0,0,d);else if("flipbevel"===S){if(b>100)y=g.mult(-1);else{var M=b*p.add(g).mag()/p.sub(g).mag();y._perp()._mult(M*(C?-1:1))}this.addCurrentVertex(u,y,0,0,d),this.addCurrentVertex(u,y.mult(-1),0,0,d)}else if("bevel"===S||"fakeround"===S){var I=-Math.sqrt(b*b-1),P=C?I:0,D=C?0:I;if(f&&this.addCurrentVertex(u,p,P,D,d),"fakeround"===S)for(var F=Math.round(180*x/Math.PI/20),L=1;L<F;L++){var O=L/F;if(.5!==O){var R=O-.5;O+=O*R*(O-1)*((1.0904+v*(v*(3.55645-1.43519*v)-3.2452))*R*R+(.848013+v*(.215638*v-1.06021)))}var k=g.sub(p)._mult(O)._add(p)._unit()._mult(C?-1:1);this.addHalfVertex(u,k.x,k.y,!1,C,0,d)}A&&this.addCurrentVertex(u,g,-P,-D,d)}else if("butt"===S)this.addCurrentVertex(u,y,0,0,d);else if("square"===S){var U=f?1:-1;this.addCurrentVertex(u,y,U,U,d)}else"round"===S&&(f&&(this.addCurrentVertex(u,p,0,0,d),this.addCurrentVertex(u,p,1,1,d,!0)),A&&(this.addCurrentVertex(u,g,-1,-1,d,!0),this.addCurrentVertex(u,g,0,0,d)));if(w&&m<l-1){var z=u.dist(A);if(z>2*h){var G=u.add(A.sub(u)._mult(h/z)._round());this.updateDistance(u,G),this.addCurrentVertex(G,g,0,0,d),u=G}}}}},Oa.prototype.addCurrentVertex=function(t,e,n,i,r,o){void 0===o&&(o=!1);var s=e.y*i-e.x,a=-e.y-e.x*i;this.addHalfVertex(t,e.x+e.y*n,e.y-e.x*n,o,!1,n,r),this.addHalfVertex(t,s,a,o,!0,-i,r),this.distance>La/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,n,i,r,o))},Oa.prototype.addHalfVertex=function(t,e,n,i,r,o,s){var a=.5*(this.lineClips?this.scaledDistance*(La-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(i?1:0),(t.y<<1)+(r?1:0),Math.round(63*e)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&a)<<2,a>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var l=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),s.primitiveLength++),r?this.e2=l:this.e1=l},Oa.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Oa.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Ui("LineBucket",Oa,{omit:["layers","patternFeatures"]});var Ra=new br({"line-cap":new gr(Mt.layout_line["line-cap"]),"line-join":new mr(Mt.layout_line["line-join"]),"line-miter-limit":new gr(Mt.layout_line["line-miter-limit"]),"line-round-limit":new gr(Mt.layout_line["line-round-limit"]),"line-sort-key":new mr(Mt.layout_line["line-sort-key"])}),ka={paint:new br({"line-opacity":new mr(Mt.paint_line["line-opacity"]),"line-color":new mr(Mt.paint_line["line-color"]),"line-translate":new gr(Mt.paint_line["line-translate"]),"line-translate-anchor":new gr(Mt.paint_line["line-translate-anchor"]),"line-width":new mr(Mt.paint_line["line-width"]),"line-gap-width":new mr(Mt.paint_line["line-gap-width"]),"line-offset":new mr(Mt.paint_line["line-offset"]),"line-blur":new mr(Mt.paint_line["line-blur"]),"line-dasharray":new vr(Mt.paint_line["line-dasharray"]),"line-pattern":new yr(Mt.paint_line["line-pattern"]),"line-gradient":new _r(Mt.paint_line["line-gradient"])}),layout:Ra},Ua=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,n){return n=new ar(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),t.prototype.possiblyEvaluate.call(this,e,n)},e.prototype.evaluate=function(e,n,i,r){return n=d({},n,{zoom:Math.floor(n.zoom)}),t.prototype.evaluate.call(this,e,n,i,r)},e}(mr))(ka.paint.properties["line-width"].specification);Ua.useIntegerZoom=!0;var za=function(t){function e(e){t.call(this,e,ka),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof je,this.gradientVersion=(this.gradientVersion+1)%a)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,n){t.prototype.recalculate.call(this,e,n),this.paint._values["line-floorwidth"]=Ua.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Oa(t)},e.prototype.queryRadius=function(t){var e=t,n=Ga(es("line-width",this,e),es("line-gap-width",this,e)),i=es("line-offset",this,e);return n/2+Math.abs(i)+ns(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,s,a){var l=is(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,a),c=a/2*Ga(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),u=this.paint.get("line-offset").evaluate(e,n);return u&&(i=function(t,e){for(var n=[],i=new r(0,0),o=0;o<t.length;o++){for(var s=t[o],a=[],l=0;l<s.length;l++){var c=s[l],u=s[l+1],h=0===l?i:c.sub(s[l-1])._unit()._perp(),d=l===s.length-1?i:u.sub(c)._unit()._perp(),f=h._add(d)._unit();f._mult(1/(f.x*d.x+f.y*d.y)),a.push(f._mult(e)._add(c))}n.push(a)}return n}(i,u*a)),function(t,e,n){for(var i=0;i<e.length;i++){var r=e[i];if(t.length>=3)for(var o=0;o<r.length;o++)if($o(t,r[o]))return!0;if(Wo(t,r,n))return!0}return!1}(l,i,c)},e.prototype.isTileClipped=function(){return!0},e}(xr);function Ga(t,e){return e>0?e+2*t:t}var Na=Er([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Za=Er([{name:"a_projected_pos",components:3,type:"Float32"}],4),ja=(Er([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Er([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Va=(Er([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Er([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ha=Er([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ja(t,e,n){return t.sections.forEach((function(t){t.text=function(t,e,n){var i=e.layout.get("text-transform").evaluate(n,{});return"uppercase"===i?t=t.toLocaleUpperCase():"lowercase"===i&&(t=t.toLocaleLowerCase()),sr.applyArabicShaping&&(t=sr.applyArabicShaping(t)),t}(t.text,e,n)})),t}Er([{name:"triangle",components:3,type:"Uint16"}]),Er([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Er([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Er([{type:"Float32",name:"offsetX"}]),Er([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Wa={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},Qa=function(t,e,n,i,r){var o,s,a=8*r-i-1,l=(1<<a)-1,c=l>>1,u=-7,h=n?r-1:0,d=n?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=256*s+t[e+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),o-=c}return(f?-1:1)*s*Math.pow(2,o-i)},Ka=function(t,e,n,i,r,o){var s,a,l,c=8*o-r-1,u=(1<<c)-1,h=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,A=i?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+f]=255&a,f+=A,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;t[n+f]=255&s,f+=A,s/=256,c-=8);t[n+f-A]|=128*p},qa=Xa;function Xa(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Xa.Varint=0,Xa.Fixed64=1,Xa.Bytes=2,Xa.Fixed32=5;var Ya="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function $a(t){return t.type===Xa.Bytes?t.readVarint()+t.pos:t.pos+1}function tl(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function el(t,e,n){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(i);for(var r=n.pos-1;r>=t;r--)n.buf[r+i]=n.buf[r]}function nl(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function il(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function rl(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function ol(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function sl(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function al(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function ll(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function cl(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function ul(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function hl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function dl(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function fl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Al(t,e,n){1===t&&n.readMessage(pl,e)}function pl(t,e,n){if(3===t){var i=n.readMessage(gl,{}),r=i.width,o=i.height,s=i.left,a=i.top,l=i.advance;e.push({id:i.id,bitmap:new ys({width:r+6,height:o+6},i.bitmap),metrics:{width:r,height:o,left:s,top:a,advance:l}})}}function gl(t,e,n){1===t?e.id=n.readVarint():2===t?e.bitmap=n.readBytes():3===t?e.width=n.readVarint():4===t?e.height=n.readVarint():5===t?e.left=n.readSVarint():6===t?e.top=n.readSVarint():7===t&&(e.advance=n.readVarint())}function ml(t){for(var e=0,n=0,i=0,r=t;i<r.length;i+=1){var o=r[i];e+=o.w*o.h,n=Math.max(n,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),n),h:1/0}],a=0,l=0,c=0,u=t;c<u.length;c+=1)for(var h=u[c],d=s.length-1;d>=0;d--){var f=s[d];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,l=Math.max(l,h.y+h.h),a=Math.max(a,h.x+h.w),h.w===f.w&&h.h===f.h){var A=s.pop();d<s.length&&(s[d]=A)}else h.h===f.h?(f.x+=h.w,f.w-=h.w):h.w===f.w?(f.y+=h.h,f.h-=h.h):(s.push({x:f.x+h.w,y:f.y,w:f.w-h.w,h:h.h}),f.y+=h.h,f.h-=h.h);break}}return{w:a,h:l,fill:e/(a*l)||0}}Xa.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var i=this.readVarint(),r=i>>3,o=this.pos;this.type=7&i,t(r,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=fl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*hl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*fl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Qa(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Qa(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,i=this.buf;return e=127&(n=i[this.pos++]),n<128?e:(e|=(127&(n=i[this.pos++]))<<7,n<128?e:(e|=(127&(n=i[this.pos++]))<<14,n<128?e:(e|=(127&(n=i[this.pos++]))<<21,n<128?e:function(t,e,n){var i,r,o=n.buf;if(i=(112&(r=o[n.pos++]))>>4,r<128)return tl(t,i,e);if(i|=(127&(r=o[n.pos++]))<<3,r<128)return tl(t,i,e);if(i|=(127&(r=o[n.pos++]))<<10,r<128)return tl(t,i,e);if(i|=(127&(r=o[n.pos++]))<<17,r<128)return tl(t,i,e);if(i|=(127&(r=o[n.pos++]))<<24,r<128)return tl(t,i,e);if(i|=(1&(r=o[n.pos++]))<<31,r<128)return tl(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ya?function(t,e,n){return Ya.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){for(var i="",r=e;r<n;){var o,s,a,l=t[r],c=null,u=l>239?4:l>223?3:l>191?2:1;if(r+u>n)break;1===u?l<128&&(c=l):2===u?128==(192&(o=t[r+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(s=t[r+2],128==(192&(o=t[r+1]))&&128==(192&s)&&((c=(15&l)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(s=t[r+2],a=t[r+3],128==(192&(o=t[r+1]))&&128==(192&s)&&128==(192&a)&&((c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,i+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),i+=String.fromCharCode(c),r+=u}return i}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Xa.Bytes)return t.push(this.readVarint(e));var n=$a(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Xa.Bytes)return t.push(this.readSVarint());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Xa.Bytes)return t.push(this.readBoolean());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Xa.Bytes)return t.push(this.readFloat());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Xa.Bytes)return t.push(this.readDouble());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Xa.Bytes)return t.push(this.readFixed32());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Xa.Bytes)return t.push(this.readSFixed32());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Xa.Bytes)return t.push(this.readFixed64());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Xa.Bytes)return t.push(this.readSFixed64());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Xa.Varint)for(;this.buf[this.pos++]>127;);else if(e===Xa.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Xa.Fixed32)this.pos+=4;else{if(e!==Xa.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),dl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),dl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),dl(this.buf,-1&t,this.pos),dl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),dl(this.buf,-1&t,this.pos),dl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,i;if(t>=0?(n=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,n.buf[n.pos]=127&(t>>>=7)}(n,0,e),function(t,e){var n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var i,r,o=0;o<e.length;o++){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){i>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):r=i;continue}if(i<56320){t[n++]=239,t[n++]=191,t[n++]=189,r=i;continue}i=r-55296<<10|i-56320|65536,r=null}else r&&(t[n++]=239,t[n++]=191,t[n++]=189,r=null);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:(i<65536?t[n++]=i>>12|224:(t[n++]=i>>18|240,t[n++]=i>>12&63|128),t[n++]=i>>6&63|128),t[n++]=63&i|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&el(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),Ka(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ka(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var i=this.pos-n;i>=128&&el(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,n){this.writeTag(t,Xa.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,nl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,il,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,sl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,rl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ol,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,al,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ll,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,cl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ul,e)},writeBytesField:function(t,e){this.writeTag(t,Xa.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Xa.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Xa.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Xa.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Xa.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Xa.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Xa.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Xa.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Xa.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Xa.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var yl=function(t,e){var n=e.pixelRatio,i=e.version,r=e.stretchX,o=e.stretchY,s=e.content;this.paddedRect=t,this.pixelRatio=n,this.stretchX=r,this.stretchY=o,this.content=s,this.version=i},vl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};vl.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},vl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},vl.tlbr.get=function(){return this.tl.concat(this.br)},vl.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(yl.prototype,vl);var _l=function(t,e){var n={},i={};this.haveRenderCallbacks=[];var r=[];this.addImages(t,n,r),this.addImages(e,i,r);var o=ml(r),s=new vs({width:o.w||1,height:o.h||1});for(var a in t){var l=t[a],c=n[a].paddedRect;vs.copy(l.data,s,{x:0,y:0},{x:c.x+1,y:c.y+1},l.data)}for(var u in e){var h=e[u],d=i[u].paddedRect,f=d.x+1,A=d.y+1,p=h.data.width,g=h.data.height;vs.copy(h.data,s,{x:0,y:0},{x:f,y:A},h.data),vs.copy(h.data,s,{x:0,y:g-1},{x:f,y:A-1},{width:p,height:1}),vs.copy(h.data,s,{x:0,y:0},{x:f,y:A+g},{width:p,height:1}),vs.copy(h.data,s,{x:p-1,y:0},{x:f-1,y:A},{width:1,height:g}),vs.copy(h.data,s,{x:0,y:0},{x:f+p,y:A},{width:1,height:g})}this.image=s,this.iconPositions=n,this.patternPositions=i};_l.prototype.addImages=function(t,e,n){for(var i in t){var r=t[i],o={x:0,y:0,w:r.data.width+2,h:r.data.height+2};n.push(o),e[i]=new yl(o,r),r.hasRenderCallback&&this.haveRenderCallbacks.push(i)}},_l.prototype.patchUpdatedImages=function(t,e){for(var n in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[n],t.getImage(n),e),this.patchUpdatedImage(this.patternPositions[n],t.getImage(n),e)},_l.prototype.patchUpdatedImage=function(t,e,n){if(t&&e&&t.version!==e.version){t.version=e.version;var i=t.tl;n.update(e.data,void 0,{x:i[0],y:i[1]})}},Ui("ImagePosition",yl),Ui("ImageAtlas",_l);var bl={horizontal:1,vertical:2,horizontalOnly:3},xl=function(){this.scale=1,this.fontStack="",this.imageName=null};xl.forText=function(t,e){var n=new xl;return n.scale=t||1,n.fontStack=e,n},xl.forImage=function(t){var e=new xl;return e.imageName=t,e};var wl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Cl(t,e,n,i,r,o,s,a,l,c,u,h,d,f,A,p){var g,m=wl.fromFeature(t,r);h===bl.vertical&&m.verticalizePunctuation();var y=sr.processBidirectionalText,v=sr.processStyledBidirectionalText;if(y&&1===m.sections.length){g=[];for(var _=0,b=y(m.toString(),Pl(m,c,o,e,i,f,A));_<b.length;_+=1){var x=b[_],w=new wl;w.text=x,w.sections=m.sections;for(var C=0;C<x.length;C++)w.sectionIndex.push(0);g.push(w)}}else if(v){g=[];for(var B=0,E=v(m.text,m.sectionIndex,Pl(m,c,o,e,i,f,A));B<E.length;B+=1){var T=E[B],S=new wl;S.text=T[0],S.sectionIndex=T[1],S.sections=m.sections,g.push(S)}}else g=function(t,e){for(var n=[],i=t.text,r=0,o=0,s=e;o<s.length;o+=1){var a=s[o];n.push(t.substring(r,a)),r=a}return r<i.length&&n.push(t.substring(r,i.length)),n}(m,Pl(m,c,o,e,i,f,A));var M=[],I={positionedLines:M,text:m.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,n,i,r,o,s,a,l,c,u,h){for(var d=0,f=-17,A=0,p=0,g="right"===a?1:"left"===a?0:.5,m=0,y=0,v=r;y<v.length;y+=1){var _=v[y];_.trim();var b=_.getMaxScale(),x=24*(b-1),w={positionedGlyphs:[],lineOffset:0};t.positionedLines[m]=w;var C=w.positionedGlyphs,B=0;if(_.length()){for(var E=0;E<_.length();E++){var T=_.getSection(E),S=_.getSectionIndex(E),M=_.getCharCode(E),I=0,P=null,D=null,F=null,L=24,O=!(l===bl.horizontal||!u&&!Wi(M)||u&&(Bl[M]||(V=M,Hi.Arabic(V)||Hi["Arabic Supplement"](V)||Hi["Arabic Extended-A"](V)||Hi["Arabic Presentation Forms-A"](V)||Hi["Arabic Presentation Forms-B"](V))));if(T.imageName){var R=i[T.imageName];if(!R)continue;F=T.imageName,t.iconsInText=t.iconsInText||!0,D=R.paddedRect;var k=R.displaySize;T.scale=24*T.scale/h,I=x+(24-k[1]*T.scale),L=(P={width:k[0],height:k[1],left:1,top:-3,advance:O?k[1]:k[0]}).advance;var U=O?k[0]*T.scale-24*b:k[1]*T.scale-24*b;U>0&&U>B&&(B=U)}else{var z=n[T.fontStack],G=z&&z[M];if(G&&G.rect)D=G.rect,P=G.metrics;else{var N=e[T.fontStack],Z=N&&N[M];if(!Z)continue;P=Z.metrics}I=24*(b-T.scale)}O?(t.verticalizable=!0,C.push({glyph:M,imageName:F,x:d,y:f+I,vertical:O,scale:T.scale,fontStack:T.fontStack,sectionIndex:S,metrics:P,rect:D}),d+=L*T.scale+c):(C.push({glyph:M,imageName:F,x:d,y:f+I,vertical:O,scale:T.scale,fontStack:T.fontStack,sectionIndex:S,metrics:P,rect:D}),d+=P.advance*T.scale+c)}0!==C.length&&(A=Math.max(d-c,A),Fl(C,0,C.length-1,g,B)),d=0;var j=o*b+B;w.lineOffset=Math.max(B,x),f+=j,p=Math.max(j,p),++m}else f+=o,++m}var V,H=f- -17,J=Dl(s),W=J.horizontalAlign,Q=J.verticalAlign;(function(t,e,n,i,r,o,s,a,l){var c,u=(e-n)*r;c=o!==s?-a*i- -17:(-i*l+.5)*s;for(var h=0,d=t;h<d.length;h+=1)for(var f=0,A=d[h].positionedGlyphs;f<A.length;f+=1){var p=A[f];p.x+=u,p.y+=c}})(t.positionedLines,g,W,Q,A,p,o,H,r.length),t.top+=-Q*H,t.bottom=t.top+H,t.left+=-W*A,t.right=t.left+A}(I,e,n,i,g,s,a,l,h,c,d,p),!function(t){for(var e=0,n=t;e<n.length;e+=1)if(0!==n[e].positionedGlyphs.length)return!1;return!0}(M)&&I}wl.fromFeature=function(t,e){for(var n=new wl,i=0;i<t.sections.length;i++){var r=t.sections[i];r.image?n.addImageSection(r):n.addTextSection(r,e)}return n},wl.prototype.length=function(){return this.text.length},wl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},wl.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},wl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},wl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",n=0;n<t.length;n++){var i=t.charCodeAt(n+1)||null,r=t.charCodeAt(n-1)||null;e+=i&&Qi(i)&&!Wa[t[n+1]]||r&&Qi(r)&&!Wa[t[n-1]]||!Wa[t[n]]?t[n]:Wa[t[n]]}return e}(this.text)},wl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Bl[this.text.charCodeAt(e)];e++)t++;for(var n=this.text.length,i=this.text.length-1;i>=0&&i>=t&&Bl[this.text.charCodeAt(i)];i--)n--;this.text=this.text.substring(t,n),this.sectionIndex=this.sectionIndex.slice(t,n)},wl.prototype.substring=function(t,e){var n=new wl;return n.text=this.text.substring(t,e),n.sectionIndex=this.sectionIndex.slice(t,e),n.sections=this.sections,n},wl.prototype.toString=function(){return this.text},wl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,n){return Math.max(e,t.sections[n].scale)}),0)},wl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(xl.forText(t.scale,t.fontStack||e));for(var n=this.sections.length-1,i=0;i<t.text.length;++i)this.sectionIndex.push(n)},wl.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCharCode(n),this.sections.push(xl.forImage(e)),this.sectionIndex.push(this.sections.length-1)):w("Reached maximum number of images 6401")}else w("Can't add FormattedSection with an empty image.")},wl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Bl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},El={};function Tl(t,e,n,i,r,o){if(e.imageName){var s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/o+r:0}var a=n[e.fontStack],l=a&&a[t];return l?l.metrics.advance*e.scale+r:0}function Sl(t,e,n,i){var r=Math.pow(t-e,2);return i?t<e?r/2:2*r:r+Math.abs(n)*n}function Ml(t,e,n){var i=0;return 10===t&&(i-=1e4),n&&(i+=150),40!==t&&65288!==t||(i+=50),41!==e&&65289!==e||(i+=50),i}function Il(t,e,n,i,r,o){for(var s=null,a=Sl(e,n,r,o),l=0,c=i;l<c.length;l+=1){var u=c[l],h=Sl(e-u.x,n,r,o)+u.badness;h<=a&&(s=u,a=h)}return{index:t,x:e,priorBreak:s,badness:a}}function Pl(t,e,n,i,r,o,s){if("point"!==o)return[];if(!t)return[];for(var a,l=[],c=function(t,e,n,i,r,o){for(var s=0,a=0;a<t.length();a++){var l=t.getSection(a);s+=Tl(t.getCharCode(a),l,i,r,e,o)}return s/Math.max(1,Math.ceil(s/n))}(t,e,n,i,r,s),u=t.text.indexOf("\u200b")>=0,h=0,d=0;d<t.length();d++){var f=t.getSection(d),A=t.getCharCode(d);if(Bl[A]||(h+=Tl(A,f,i,r,e,s)),d<t.length()-1){var p=!((a=A)<11904||!(Hi["Bopomofo Extended"](a)||Hi.Bopomofo(a)||Hi["CJK Compatibility Forms"](a)||Hi["CJK Compatibility Ideographs"](a)||Hi["CJK Compatibility"](a)||Hi["CJK Radicals Supplement"](a)||Hi["CJK Strokes"](a)||Hi["CJK Symbols and Punctuation"](a)||Hi["CJK Unified Ideographs Extension A"](a)||Hi["CJK Unified Ideographs"](a)||Hi["Enclosed CJK Letters and Months"](a)||Hi["Halfwidth and Fullwidth Forms"](a)||Hi.Hiragana(a)||Hi["Ideographic Description Characters"](a)||Hi["Kangxi Radicals"](a)||Hi["Katakana Phonetic Extensions"](a)||Hi.Katakana(a)||Hi["Vertical Forms"](a)||Hi["Yi Radicals"](a)||Hi["Yi Syllables"](a)));(El[A]||p||f.imageName)&&l.push(Il(d+1,h,c,l,Ml(A,t.getCharCode(d+1),p&&u),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Il(t.length(),h,c,l,0,!0))}function Dl(t){var e=.5,n=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:e,verticalAlign:n}}function Fl(t,e,n,i,r){if(i||r)for(var o=t[n],s=(t[n].x+o.metrics.advance*o.scale)*i,a=e;a<=n;a++)t[a].x-=s,t[a].y+=r}function Ll(t,e,n,i,r,o){var s,a=t.image;if(a.content){var l=a.content,c=a.pixelRatio||1;s=[l[0]/c,l[1]/c,a.displaySize[0]-l[2]/c,a.displaySize[1]-l[3]/c]}var u,h,d,f,A=e.left*o,p=e.right*o;"width"===n||"both"===n?(f=r[0]+A-i[3],h=r[0]+p+i[1]):h=(f=r[0]+(A+p-a.displaySize[0])/2)+a.displaySize[0];var g=e.top*o,m=e.bottom*o;return"height"===n||"both"===n?(u=r[1]+g-i[0],d=r[1]+m+i[2]):d=(u=r[1]+(g+m-a.displaySize[1])/2)+a.displaySize[1],{image:a,top:u,right:h,bottom:d,left:f,collisionPadding:s}}El[10]=!0,El[32]=!0,El[38]=!0,El[40]=!0,El[41]=!0,El[43]=!0,El[45]=!0,El[47]=!0,El[173]=!0,El[183]=!0,El[8203]=!0,El[8208]=!0,El[8211]=!0,El[8231]=!0;var Ol=function(t){function e(e,n,i,r){t.call(this,e,n),this.angle=i,void 0!==r&&(this.segment=r)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(r);function Rl(t,e){var n=e.expression;if("constant"===n.kind)return{kind:"constant",layoutSize:n.evaluate(new ar(t+1))};if("source"===n.kind)return{kind:"source"};for(var i=n.zoomStops,r=n.interpolationType,o=0;o<i.length&&i[o]<=t;)o++;for(var s=o=Math.max(0,o-1);s<i.length&&i[s]<t+1;)s++;s=Math.min(i.length-1,s);var a=i[o],l=i[s];return"composite"===n.kind?{kind:"composite",minZoom:a,maxZoom:l,interpolationType:r}:{kind:"camera",minZoom:a,maxZoom:l,minSize:n.evaluate(new ar(a)),maxSize:n.evaluate(new ar(l)),interpolationType:r}}function kl(t,e,n){var i=e.uSize,r=n.lowerSize;return"source"===t.kind?r/128:"composite"===t.kind?Ve(r/128,n.upperSize/128,e.uSizeT):i}function Ul(t,e){var n=0,i=0;if("constant"===t.kind)i=t.layoutSize;else if("source"!==t.kind){var r=t.interpolationType,o=r?u(sn.interpolationFactor(r,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?i=Ve(t.minSize,t.maxSize,o):n=o}return{uSizeT:n,uSize:i}}Ui("Anchor",Ol);var zl=Object.freeze({__proto__:null,getSizeData:Rl,evaluateSizeForFeature:kl,evaluateSizeForZoom:Ul,SIZE_PACK_FACTOR:128});function Gl(t,e,n,i,r){if(void 0===e.segment)return!0;for(var o=e,s=e.segment+1,a=0;a>-n/2;){if(--s<0)return!1;a-=t[s].dist(o),o=t[s]}a+=t[s].dist(t[s+1]),s++;for(var l=[],c=0;a<n/2;){var u=t[s],h=t[s+1];if(!h)return!1;var d=t[s-1].angleTo(u)-u.angleTo(h);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:d}),c+=d;a-l[0].distance>i;)c-=l.shift().angleDelta;if(c>r)return!1;s++,a+=u.dist(h)}return!0}function Nl(t){for(var e=0,n=0;n<t.length-1;n++)e+=t[n].dist(t[n+1]);return e}function Zl(t,e,n){return t?.6*e*n:0}function jl(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Vl(t,e,n,i,r,o){for(var s=Zl(n,r,o),a=jl(n,i)*o,l=0,c=Nl(t)/2,u=0;u<t.length-1;u++){var h=t[u],d=t[u+1],f=h.dist(d);if(l+f>c){var A=(c-l)/f,p=Ve(h.x,d.x,A),g=Ve(h.y,d.y,A),m=new Ol(p,g,d.angleTo(h),u);return m._round(),!s||Gl(t,m,a,s,e)?m:void 0}l+=f}}function Hl(t,e,n,i,r,o,s,a,l){var c=Zl(i,o,s),u=jl(i,r),h=u*s,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),function t(e,n,i,r,o,s,a,l,c){for(var u=s/2,h=Nl(e),d=0,f=n-i,A=[],p=0;p<e.length-1;p++){for(var g=e[p],m=e[p+1],y=g.dist(m),v=m.angleTo(g);f+i<d+y;){var _=((f+=i)-d)/y,b=Ve(g.x,m.x,_),x=Ve(g.y,m.y,_);if(b>=0&&b<c&&x>=0&&x<c&&f-u>=0&&f+u<=h){var w=new Ol(b,x,v,p);w._round(),r&&!Gl(e,w,s,r,o)||A.push(w)}}d+=y}return l||A.length||a||(A=t(e,d/2,i,r,o,s,a,!0,c)),A}(t,d?e/2*a%e:(u/2+2*o)*s*a%e,e,c,n,h,d,!1,l)}function Jl(t,e,n,i,o){for(var s=[],a=0;a<t.length;a++)for(var l=t[a],c=void 0,u=0;u<l.length-1;u++){var h=l[u],d=l[u+1];h.x<e&&d.x<e||(h.x<e?h=new r(e,h.y+(e-h.x)/(d.x-h.x)*(d.y-h.y))._round():d.x<e&&(d=new r(e,h.y+(e-h.x)/(d.x-h.x)*(d.y-h.y))._round()),h.y<n&&d.y<n||(h.y<n?h=new r(h.x+(n-h.y)/(d.y-h.y)*(d.x-h.x),n)._round():d.y<n&&(d=new r(h.x+(n-h.y)/(d.y-h.y)*(d.x-h.x),n)._round()),h.x>=i&&d.x>=i||(h.x>=i?h=new r(i,h.y+(i-h.x)/(d.x-h.x)*(d.y-h.y))._round():d.x>=i&&(d=new r(i,h.y+(i-h.x)/(d.x-h.x)*(d.y-h.y))._round()),h.y>=o&&d.y>=o||(h.y>=o?h=new r(h.x+(o-h.y)/(d.y-h.y)*(d.x-h.x),o)._round():d.y>=o&&(d=new r(h.x+(o-h.y)/(d.y-h.y)*(d.x-h.x),o)._round()),c&&h.equals(c[c.length-1])||s.push(c=[h]),c.push(d)))))}return s}function Wl(t,e,n,i){var o=[],s=t.image,a=s.pixelRatio,l=s.paddedRect.w-2,c=s.paddedRect.h-2,u=t.right-t.left,h=t.bottom-t.top,d=s.stretchX||[[0,l]],f=s.stretchY||[[0,c]],A=function(t,e){return t+e[1]-e[0]},p=d.reduce(A,0),g=f.reduce(A,0),m=l-p,y=c-g,v=0,_=p,b=0,x=g,w=0,C=m,B=0,E=y;if(s.content&&i){var T=s.content;v=Ql(d,0,T[0]),b=Ql(f,0,T[1]),_=Ql(d,T[0],T[2]),x=Ql(f,T[1],T[3]),w=T[0]-v,B=T[1]-b,C=T[2]-T[0]-_,E=T[3]-T[1]-x}var S=function(i,o,l,c){var d=ql(i.stretch-v,_,u,t.left),f=Xl(i.fixed-w,C,i.stretch,p),A=ql(o.stretch-b,x,h,t.top),m=Xl(o.fixed-B,E,o.stretch,g),y=ql(l.stretch-v,_,u,t.left),T=Xl(l.fixed-w,C,l.stretch,p),S=ql(c.stretch-b,x,h,t.top),M=Xl(c.fixed-B,E,c.stretch,g),I=new r(d,A),P=new r(y,A),D=new r(y,S),F=new r(d,S),L=new r(f/a,m/a),O=new r(T/a,M/a),R=e*Math.PI/180;if(R){var k=Math.sin(R),U=Math.cos(R),z=[U,-k,k,U];I._matMult(z),P._matMult(z),F._matMult(z),D._matMult(z)}var G=i.stretch+i.fixed,N=o.stretch+o.fixed;return{tl:I,tr:P,bl:F,br:D,tex:{x:s.paddedRect.x+1+G,y:s.paddedRect.y+1+N,w:l.stretch+l.fixed-G,h:c.stretch+c.fixed-N},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:L,pixelOffsetBR:O,minFontScaleX:C/a/u,minFontScaleY:E/a/h,isSDF:n}};if(i&&(s.stretchX||s.stretchY))for(var M=Kl(d,m,p),I=Kl(f,y,g),P=0;P<M.length-1;P++)for(var D=M[P],F=M[P+1],L=0;L<I.length-1;L++)o.push(S(D,I[L],F,I[L+1]));else o.push(S({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return o}function Ql(t,e,n){for(var i=0,r=0,o=t;r<o.length;r+=1){var s=o[r];i+=Math.max(e,Math.min(n,s[1]))-Math.max(e,Math.min(n,s[0]))}return i}function Kl(t,e,n){for(var i=[{fixed:-1,stretch:0}],r=0,o=t;r<o.length;r+=1){var s=o[r],a=s[0],l=s[1],c=i[i.length-1];i.push({fixed:a-c.stretch,stretch:c.stretch}),i.push({fixed:a-c.stretch,stretch:c.stretch+(l-a)})}return i.push({fixed:e+1,stretch:n}),i}function ql(t,e,n,i){return t/e*n+i}function Xl(t,e,n,i){return t-e*n/i}var Yl=function(t,e,n,i,o,s,a,l,c,u){if(this.boxStartIndex=t.length,c){var h=s.top,d=s.bottom,f=s.collisionPadding;f&&(h-=f[1],d+=f[3]);var A=d-h;A>0&&(A=Math.max(10,A),this.circleDiameter=A)}else{var p=s.top*a-l,g=s.bottom*a+l,m=s.left*a-l,y=s.right*a+l,v=s.collisionPadding;if(v&&(m-=v[0]*a,p-=v[1]*a,y+=v[2]*a,g+=v[3]*a),u){var _=new r(m,p),b=new r(y,p),x=new r(m,g),w=new r(y,g),C=u*Math.PI/180;_._rotate(C),b._rotate(C),x._rotate(C),w._rotate(C),m=Math.min(_.x,b.x,x.x,w.x),y=Math.max(_.x,b.x,x.x,w.x),p=Math.min(_.y,b.y,x.y,w.y),g=Math.max(_.y,b.y,x.y,w.y)}t.emplaceBack(e.x,e.y,m,p,y,g,n,i,o)}this.boxEndIndex=t.length},$l=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};function tc(t,e){return t<e?-1:t>e?1:0}function ec(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);for(var i=1/0,o=1/0,s=-1/0,a=-1/0,l=t[0],c=0;c<l.length;c++){var u=l[c];(!c||u.x<i)&&(i=u.x),(!c||u.y<o)&&(o=u.y),(!c||u.x>s)&&(s=u.x),(!c||u.y>a)&&(a=u.y)}var h=Math.min(s-i,a-o),d=h/2,f=new $l([],nc);if(0===h)return new r(i,o);for(var A=i;A<s;A+=h)for(var p=o;p<a;p+=h)f.push(new ic(A+d,p+d,d,t));for(var g=function(t){for(var e=0,n=0,i=0,r=t[0],o=0,s=r.length,a=s-1;o<s;a=o++){var l=r[o],c=r[a],u=l.x*c.y-c.x*l.y;n+=(l.x+c.x)*u,i+=(l.y+c.y)*u,e+=3*u}return new ic(n/e,i/e,0,t)}(t),m=f.length;f.length;){var y=f.pop();(y.d>g.d||!g.d)&&(g=y,n&&console.log("found best %d after %d probes",Math.round(1e4*y.d)/1e4,m)),y.max-g.d<=e||(f.push(new ic(y.p.x-(d=y.h/2),y.p.y-d,d,t)),f.push(new ic(y.p.x+d,y.p.y-d,d,t)),f.push(new ic(y.p.x-d,y.p.y+d,d,t)),f.push(new ic(y.p.x+d,y.p.y+d,d,t)),m+=4)}return n&&(console.log("num probes: "+m),console.log("best distance: "+g.d)),g.p}function nc(t,e){return e.max-t.max}function ic(t,e,n,i){this.p=new r(t,e),this.h=n,this.d=function(t,e){for(var n=!1,i=1/0,r=0;r<e.length;r++)for(var o=e[r],s=0,a=o.length,l=a-1;s<a;l=s++){var c=o[s],u=o[l];c.y>t.y!=u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(n=!n),i=Math.min(i,Xo(t,c,u))}return(n?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}$l.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},$l.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},$l.prototype.peek=function(){return this.data[0]},$l.prototype._up=function(t){for(var e=this.data,n=this.compare,i=e[t];t>0;){var r=t-1>>1,o=e[r];if(n(i,o)>=0)break;e[t]=o,t=r}e[t]=i},$l.prototype._down=function(t){for(var e=this.data,n=this.compare,i=this.length>>1,r=e[t];t<i;){var o=1+(t<<1),s=e[o],a=o+1;if(a<this.length&&n(e[a],s)<0&&(o=a,s=e[a]),n(s,r)>=0)break;e[t]=s,t=o}e[t]=r};var rc=Number.POSITIVE_INFINITY;function oc(t,e){return e[1]!==rc?function(t,e,n){var i=0,r=0;switch(e=Math.abs(e),n=Math.abs(n),t){case"top-right":case"top-left":case"top":r=n-7;break;case"bottom-right":case"bottom-left":case"bottom":r=7-n}switch(t){case"top-right":case"bottom-right":case"right":i=-e;break;case"top-left":case"bottom-left":case"left":i=e}return[i,r]}(t,e[0],e[1]):function(t,e){var n=0,i=0;e<0&&(e=0);var r=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":i=r-7;break;case"bottom-right":case"bottom-left":i=7-r;break;case"bottom":i=7-e;break;case"top":i=e-7}switch(t){case"top-right":case"bottom-right":n=-r;break;case"top-left":case"bottom-left":n=r;break;case"left":n=e;break;case"right":n=-e}return[n,i]}(t,e[0])}function sc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function ac(t,e,n,i,o,s,a,l,c,u,h,d,f,A,p){var g=function(t,e,n,i,o,s,a,l){for(var c=i.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,u=[],h=0,d=e.positionedLines;h<d.length;h+=1)for(var f=d[h],A=0,p=f.positionedGlyphs;A<p.length;A+=1){var g=p[A];if(g.rect){var m=g.rect||{},y=4,v=!0,_=1,b=0,x=(o||l)&&g.vertical,w=g.metrics.advance*g.scale/2;if(l&&e.verticalizable&&(b=f.lineOffset/2-(g.imageName?-(24-g.metrics.width*g.scale)/2:24*(g.scale-1))),g.imageName){var C=a[g.imageName];v=C.sdf,y=1/(_=C.pixelRatio)}var B=o?[g.x+w,g.y]:[0,0],E=o?[0,0]:[g.x+w+n[0],g.y+n[1]-b],T=[0,0];x&&(T=E,E=[0,0]);var S=(g.metrics.left-y)*g.scale-w+E[0],M=(-g.metrics.top-y)*g.scale+E[1],I=S+m.w*g.scale/_,P=M+m.h*g.scale/_,D=new r(S,M),F=new r(I,M),L=new r(S,P),O=new r(I,P);if(x){var R=new r(-w,w- -17),k=-Math.PI/2,U=12-w,z=new r(22-U,-(g.imageName?U:0)),G=new(Function.prototype.bind.apply(r,[null].concat(T)));D._rotateAround(k,R)._add(z)._add(G),F._rotateAround(k,R)._add(z)._add(G),L._rotateAround(k,R)._add(z)._add(G),O._rotateAround(k,R)._add(z)._add(G)}if(c){var N=Math.sin(c),Z=Math.cos(c),j=[Z,-N,N,Z];D._matMult(j),F._matMult(j),L._matMult(j),O._matMult(j)}var V=new r(0,0),H=new r(0,0);u.push({tl:D,tr:F,bl:L,br:O,tex:m,writingMode:e.writingMode,glyphOffset:B,sectionIndex:g.sectionIndex,isSDF:v,pixelOffsetTL:V,pixelOffsetBR:H,minFontScaleX:0,minFontScaleY:0})}}return u}(0,n,l,o,s,a,i,t.allowVerticalPlacement),m=t.textSizeData,y=null;"source"===m.kind?(y=[128*o.layout.get("text-size").evaluate(a,{})])[0]>32640&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===m.kind&&((y=[128*A.compositeTextSizes[0].evaluate(a,{},p),128*A.compositeTextSizes[1].evaluate(a,{},p)])[0]>32640||y[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,g,y,l,s,a,u,e,c.lineStartIndex,c.lineLength,f,p);for(var v=0,_=h;v<_.length;v+=1)d[_[v]]=t.text.placedSymbolArray.length-1;return 4*g.length}function lc(t){for(var e in t)return t[e];return null}function cc(t,e,n,i){var r=t.compareText;if(e in r){for(var o=r[e],s=o.length-1;s>=0;s--)if(i.dist(o[s])<n)return!0}else r[e]=[];return r[e].push(i),!1}var uc=_a.VectorTileFeature.types,hc=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function dc(t,e,n,i,r,o,s,a,l,c,u,h,d){var f=a?Math.min(32640,Math.round(a[0])):0,A=a?Math.min(32640,Math.round(a[1])):0;t.emplaceBack(e,n,Math.round(32*i),Math.round(32*r),o,s,(f<<1)+(l?1:0),A,16*c,16*u,256*h,256*d)}function fc(t,e,n){t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n)}function Ac(t){for(var e=0,n=t.sections;e<n.length;e+=1)if(Xi(n[e].text))return!0;return!1}var pc=function(t){this.layoutVertexArray=new Lr,this.indexArray=new Nr,this.programConfigurations=t,this.segments=new ao,this.dynamicLayoutVertexArray=new Or,this.opacityVertexArray=new Rr,this.placedSymbolArray=new $r};pc.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},pc.prototype.upload=function(t,e,n,i){this.isEmpty()||(n&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Na.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Za.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,hc,!0),this.opacityVertexBuffer.itemSize=1),(n||i)&&this.programConfigurations.upload(t))},pc.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Ui("SymbolBuffers",pc);var gc=function(t,e,n){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new n,this.segments=new ao,this.collisionVertexArray=new Gr};gc.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,ja.members,!0)},gc.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Ui("CollisionBuffers",gc);var mc=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=as([]),this.placementViewportMatrix=as([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Rl(this.zoom,e["text-size"]),this.iconSizeData=Rl(this.zoom,e["icon-size"]);var n=this.layers[0].layout,i=n.get("symbol-sort-key"),r=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==r&&void 0!==i.constantOr(1),this.sortFeaturesByY=("viewport-y"===r||"auto"===r&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((function(t){return bl[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};mc.prototype.createArrays=function(){this.text=new pc(new Oo(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new pc(new Oo(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new no,this.lineVertexArray=new io,this.symbolInstances=new eo},mc.prototype.calculateGlyphDependencies=function(t,e,n,i,r){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(n||i)&&r){var s=Wa[t.charAt(o)];s&&(e[s.charCodeAt(0)]=!0)}},mc.prototype.populate=function(t,e,n){var i=this.layers[0],r=i.layout,o=r.get("text-font"),s=r.get("text-field"),a=r.get("icon-image"),l=("constant"!==s.value.kind||s.value.value instanceof ie&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==a.value.kind||!!a.value.value||Object.keys(a.parameters).length>0,u=r.get("symbol-sort-key");if(this.features=[],l||c){for(var h=e.iconDependencies,d=e.glyphDependencies,f=e.availableImages,A=new ar(this.zoom),p=0,g=t;p<g.length;p+=1){var m=g[p],y=m.feature,v=m.id,_=m.index,b=m.sourceLayerIndex,x=i._featureFilter.needGeometry,w=No(y,x);if(i._featureFilter.filter(A,w,n)){x||(w.geometry=Go(y));var C=void 0;if(l){var B=i.getValueAndResolveTokens("text-field",w,n,f),E=ie.factory(B);Ac(E)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===rr()||this.hasRTLText&&sr.isParsed())&&(C=Ja(E,i,w))}var T=void 0;if(c){var S=i.getValueAndResolveTokens("icon-image",w,n,f);T=S instanceof re?S:re.fromString(S)}if(C||T){var M=this.sortFeaturesByKey?u.evaluate(w,{},n):void 0;if(this.features.push({id:v,text:C,icon:T,index:_,sourceLayerIndex:b,geometry:w.geometry,properties:y.properties,type:uc[y.type],sortKey:M}),T&&(h[T.name]=!0),C){var I=o.evaluate(w,{},n).join(","),P="map"===r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(bl.vertical)>=0;for(var D=0,F=C.sections;D<F.length;D+=1){var L=F[D];if(L.image)h[L.image.name]=!0;else{var O=Ji(C.toString()),R=L.fontStack||I,k=d[R]=d[R]||{};this.calculateGlyphDependencies(L.text,k,P,this.allowVerticalPlacement,O)}}}}}}"line"===r.get("symbol-placement")&&(this.features=function(t){var e={},n={},i=[],r=0;function o(e){i.push(t[e]),r++}function s(t,e,r){var o=n[t];return delete n[t],n[e]=o,i[o].geometry[0].pop(),i[o].geometry[0]=i[o].geometry[0].concat(r[0]),o}function a(t,n,r){var o=e[n];return delete e[n],e[t]=o,i[o].geometry[0].shift(),i[o].geometry[0]=r[0].concat(i[o].geometry[0]),o}function l(t,e,n){var i=n?e[0][e[0].length-1]:e[0][0];return t+":"+i.x+":"+i.y}for(var c=0;c<t.length;c++){var u=t[c],h=u.geometry,d=u.text?u.text.toString():null;if(d){var f=l(d,h),A=l(d,h,!0);if(f in n&&A in e&&n[f]!==e[A]){var p=a(f,A,h),g=s(f,A,i[p].geometry);delete e[f],delete n[A],n[l(d,i[g].geometry,!0)]=g,i[p].geometry=null}else f in n?s(f,A,h):A in e?a(f,A,h):(o(c),e[f]=r-1,n[A]=r-1)}else o(c)}return i.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},mc.prototype.update=function(t,e,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,n),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,n))},mc.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},mc.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},mc.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},mc.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},mc.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},mc.prototype.addToLineVertexArray=function(t,e){var n=this.lineVertexArray.length;if(void 0!==t.segment){for(var i=t.dist(e[t.segment+1]),r=t.dist(e[t.segment]),o={},s=t.segment+1;s<e.length;s++)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s<e.length-1&&(i+=e[s+1].dist(e[s]));for(var a=t.segment||0;a>=0;a--)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:r},a>0&&(r+=e[a-1].dist(e[a]));for(var l=0;l<e.length;l++){var c=o[l];this.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}},mc.prototype.addSymbols=function(t,e,n,i,r,o,s,a,l,c,u,h){for(var d=t.indexArray,f=t.layoutVertexArray,A=t.segments.prepareSegment(4*e.length,f,d,this.canOverlap?o.sortKey:void 0),p=this.glyphOffsetArray.length,g=A.vertexLength,m=this.allowVerticalPlacement&&s===bl.vertical?Math.PI/2:0,y=o.text&&o.text.sections,v=0;v<e.length;v++){var _=e[v],b=_.tl,x=_.tr,w=_.bl,C=_.br,B=_.tex,E=_.pixelOffsetTL,T=_.pixelOffsetBR,S=_.minFontScaleX,M=_.minFontScaleY,I=_.glyphOffset,P=_.isSDF,D=_.sectionIndex,F=A.vertexLength,L=I[1];dc(f,a.x,a.y,b.x,L+b.y,B.x,B.y,n,P,E.x,E.y,S,M),dc(f,a.x,a.y,x.x,L+x.y,B.x+B.w,B.y,n,P,T.x,E.y,S,M),dc(f,a.x,a.y,w.x,L+w.y,B.x,B.y+B.h,n,P,E.x,T.y,S,M),dc(f,a.x,a.y,C.x,L+C.y,B.x+B.w,B.y+B.h,n,P,T.x,T.y,S,M),fc(t.dynamicLayoutVertexArray,a,m),d.emplaceBack(F,F+1,F+2),d.emplaceBack(F+1,F+2,F+3),A.vertexLength+=4,A.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(I[0]),v!==e.length-1&&D===e[v+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,o,o.index,{},h,y&&y[D])}t.placedSymbolArray.emplaceBack(a.x,a.y,p,this.glyphOffsetArray.length-p,g,l,c,a.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,u)},mc.prototype._addCollisionDebugVertex=function(t,e,n,i,r,o){return e.emplaceBack(0,0),t.emplaceBack(n.x,n.y,i,r,Math.round(o.x),Math.round(o.y))},mc.prototype.addCollisionDebugVertices=function(t,e,n,i,o,s,a){var l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),c=l.vertexLength,u=o.layoutVertexArray,h=o.collisionVertexArray,d=a.anchorX,f=a.anchorY;this._addCollisionDebugVertex(u,h,s,d,f,new r(t,e)),this._addCollisionDebugVertex(u,h,s,d,f,new r(n,e)),this._addCollisionDebugVertex(u,h,s,d,f,new r(n,i)),this._addCollisionDebugVertex(u,h,s,d,f,new r(t,i)),l.vertexLength+=4;var A=o.indexArray;A.emplaceBack(c,c+1),A.emplaceBack(c+1,c+2),A.emplaceBack(c+2,c+3),A.emplaceBack(c+3,c),l.primitiveLength+=4},mc.prototype.addDebugCollisionBoxes=function(t,e,n,i){for(var r=t;r<e;r++){var o=this.collisionBoxArray.get(r);this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,i?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,n)}},mc.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new gc(Ur,Va.members,Wr),this.iconCollisionBox=new gc(Ur,Va.members,Wr);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},mc.prototype._deserializeCollisionBoxesForSymbol=function(t,e,n,i,r,o,s,a,l){for(var c={},u=e;u<n;u++){var h=t.get(u);c.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},c.textFeatureIndex=h.featureIndex;break}for(var d=i;d<r;d++){var f=t.get(d);c.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.verticalTextFeatureIndex=f.featureIndex;break}for(var A=o;A<s;A++){var p=t.get(A);c.iconBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},c.iconFeatureIndex=p.featureIndex;break}for(var g=a;g<l;g++){var m=t.get(g);c.verticalIconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},c.verticalIconFeatureIndex=m.featureIndex;break}return c},mc.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var n=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}},mc.prototype.hasTextData=function(){return this.text.segments.get().length>0},mc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},mc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},mc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},mc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},mc.prototype.addIndicesForPlacedSymbol=function(t,e){for(var n=t.placedSymbolArray.get(e),i=n.vertexStartIndex+4*n.numGlyphs,r=n.vertexStartIndex;r<i;r+=4)t.indexArray.emplaceBack(r,r+1,r+2),t.indexArray.emplaceBack(r+1,r+2,r+3)},mc.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),n=Math.cos(t),i=[],r=[],o=[],s=0;s<this.symbolInstances.length;++s){o.push(s);var a=this.symbolInstances.get(s);i.push(0|Math.round(e*a.anchorX+n*a.anchorY)),r.push(a.featureIndex)}return o.sort((function(t,e){return i[t]-i[e]||r[e]-r[t]})),o},mc.prototype.addToSortKeyRanges=function(t,e){var n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===e?n.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},mc.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var n=0,i=this.symbolInstanceIndexes;n<i.length;n+=1){var r=this.symbolInstances.get(i[n]);this.featureSortOrder.push(r.featureIndex),[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex].forEach((function(t,n,i){t>=0&&i.indexOf(t)===n&&e.addIndicesForPlacedSymbol(e.text,t)})),r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Ui("SymbolBucket",mc,{omit:["layers","collisionBoxArray","features","compareText"]}),mc.MAX_GLYPHS=65535,mc.addDynamicAttributes=fc;var yc=new br({"symbol-placement":new gr(Mt.layout_symbol["symbol-placement"]),"symbol-spacing":new gr(Mt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new gr(Mt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new mr(Mt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new gr(Mt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new gr(Mt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new gr(Mt.layout_symbol["icon-ignore-placement"]),"icon-optional":new gr(Mt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new gr(Mt.layout_symbol["icon-rotation-alignment"]),"icon-size":new mr(Mt.layout_symbol["icon-size"]),"icon-text-fit":new gr(Mt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new gr(Mt.layout_symbol["icon-text-fit-padding"]),"icon-image":new mr(Mt.layout_symbol["icon-image"]),"icon-rotate":new mr(Mt.layout_symbol["icon-rotate"]),"icon-padding":new gr(Mt.layout_symbol["icon-padding"]),"icon-keep-upright":new gr(Mt.layout_symbol["icon-keep-upright"]),"icon-offset":new mr(Mt.layout_symbol["icon-offset"]),"icon-anchor":new mr(Mt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new gr(Mt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new gr(Mt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new gr(Mt.layout_symbol["text-rotation-alignment"]),"text-field":new mr(Mt.layout_symbol["text-field"]),"text-font":new mr(Mt.layout_symbol["text-font"]),"text-size":new mr(Mt.layout_symbol["text-size"]),"text-max-width":new mr(Mt.layout_symbol["text-max-width"]),"text-line-height":new gr(Mt.layout_symbol["text-line-height"]),"text-letter-spacing":new mr(Mt.layout_symbol["text-letter-spacing"]),"text-justify":new mr(Mt.layout_symbol["text-justify"]),"text-radial-offset":new mr(Mt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new gr(Mt.layout_symbol["text-variable-anchor"]),"text-anchor":new mr(Mt.layout_symbol["text-anchor"]),"text-max-angle":new gr(Mt.layout_symbol["text-max-angle"]),"text-writing-mode":new gr(Mt.layout_symbol["text-writing-mode"]),"text-rotate":new mr(Mt.layout_symbol["text-rotate"]),"text-padding":new gr(Mt.layout_symbol["text-padding"]),"text-keep-upright":new gr(Mt.layout_symbol["text-keep-upright"]),"text-transform":new mr(Mt.layout_symbol["text-transform"]),"text-offset":new mr(Mt.layout_symbol["text-offset"]),"text-allow-overlap":new gr(Mt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new gr(Mt.layout_symbol["text-ignore-placement"]),"text-optional":new gr(Mt.layout_symbol["text-optional"])}),vc={paint:new br({"icon-opacity":new mr(Mt.paint_symbol["icon-opacity"]),"icon-color":new mr(Mt.paint_symbol["icon-color"]),"icon-halo-color":new mr(Mt.paint_symbol["icon-halo-color"]),"icon-halo-width":new mr(Mt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new mr(Mt.paint_symbol["icon-halo-blur"]),"icon-translate":new gr(Mt.paint_symbol["icon-translate"]),"icon-translate-anchor":new gr(Mt.paint_symbol["icon-translate-anchor"]),"text-opacity":new mr(Mt.paint_symbol["text-opacity"]),"text-color":new mr(Mt.paint_symbol["text-color"],{runtimeType:Nt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new mr(Mt.paint_symbol["text-halo-color"]),"text-halo-width":new mr(Mt.paint_symbol["text-halo-width"]),"text-halo-blur":new mr(Mt.paint_symbol["text-halo-blur"]),"text-translate":new gr(Mt.paint_symbol["text-translate"]),"text-translate-anchor":new gr(Mt.paint_symbol["text-translate-anchor"])}),layout:yc},_c=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:kt,this.defaultValue=t};_c.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},_c.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},_c.prototype.outputDefined=function(){return!1},_c.prototype.serialize=function(){return null},Ui("FormatSectionOverride",_c,{omit:["defaultValue"]});var bc=function(t){function e(e){t.call(this,e,vc)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,n){if(t.prototype.recalculate.call(this,e,n),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var i=this.layout.get("text-writing-mode");if(i){for(var r=[],o=0,s=i;o<s.length;o+=1){var a=s[o];r.indexOf(a)<0&&r.push(a)}this.layout._values["text-writing-mode"]=r}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,n,i){var r=this.layout.get(t).evaluate(e,{},n,i),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||Jn(o.value)||!r?r:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,n){return n in t?String(t[n]):""}))}(e.properties,r)},e.prototype.createBucket=function(t){return new mc(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,n=vc.paint.overridableProperties;t<n.length;t+=1){var i=n[t];if(e.hasPaintOverride(this.layout,i)){var r,o=this.paint.get(i),s=new _c(o),a=new Hn(s,o.property.specification);r="constant"===o.value.kind||"source"===o.value.kind?new Qn("source",a):new Kn("composite",a,o.value.zoomStops,o.value._interpolationType),this.paint._values[i]=new Ar(o.property,r,o.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,n,i){return!(!this.layout||n.isDataDriven()||i.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var n=t.get("text-field"),i=vc.paint.properties[e],r=!1,o=function(t){for(var e=0,n=t;e<n.length;e+=1)if(i.overrides&&i.overrides.hasOverride(n[e]))return void(r=!0)};if("constant"===n.value.kind&&n.value.value instanceof ie)o(n.value.value.sections);else if("source"===n.value.kind){var s=function(t){r||(t instanceof ce&&ae(t.value)===Ht?o(t.value.sections):t instanceof fe?o(t.sections):t.eachChild(s))},a=n.value;a._styleExpression&&s(a._styleExpression.expression)}return r},e}(xr),xc={paint:new br({"background-color":new gr(Mt.paint_background["background-color"]),"background-pattern":new vr(Mt.paint_background["background-pattern"]),"background-opacity":new gr(Mt.paint_background["background-opacity"])})},wc=function(t){function e(e){t.call(this,e,xc)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(xr),Cc={paint:new br({"raster-opacity":new gr(Mt.paint_raster["raster-opacity"]),"raster-hue-rotate":new gr(Mt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new gr(Mt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new gr(Mt.paint_raster["raster-brightness-max"]),"raster-saturation":new gr(Mt.paint_raster["raster-saturation"]),"raster-contrast":new gr(Mt.paint_raster["raster-contrast"]),"raster-resampling":new gr(Mt.paint_raster["raster-resampling"]),"raster-fade-duration":new gr(Mt.paint_raster["raster-fade-duration"])})},Bc=function(t){function e(e){t.call(this,e,Cc)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(xr),Ec=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(xr),Tc={circle:ds,heatmap:xs,hillshade:Cs,fill:ua,"fill-extrusion":Ta,line:za,symbol:bc,background:wc,raster:Bc},Sc=s.HTMLImageElement,Mc=s.HTMLCanvasElement,Ic=s.HTMLVideoElement,Pc=s.ImageData,Dc=s.ImageBitmap,Fc=function(t,e,n,i){this.context=t,this.format=n,this.texture=t.gl.createTexture(),this.update(e,i)};Fc.prototype.update=function(t,e,n){var i=t.width,r=t.height,o=!(this.size&&this.size[0]===i&&this.size[1]===r||n),s=this.context,a=s.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),a.bindTexture(a.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===a.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[i,r],t instanceof Sc||t instanceof Mc||t instanceof Ic||t instanceof Pc||Dc&&t instanceof Dc?a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,a.UNSIGNED_BYTE,t):a.texImage2D(a.TEXTURE_2D,0,this.format,i,r,0,this.format,a.UNSIGNED_BYTE,t.data);else{var l=n||{x:0,y:0},c=l.x,u=l.y;t instanceof Sc||t instanceof Mc||t instanceof Ic||t instanceof Pc||Dc&&t instanceof Dc?a.texSubImage2D(a.TEXTURE_2D,0,c,u,a.RGBA,a.UNSIGNED_BYTE,t):a.texSubImage2D(a.TEXTURE_2D,0,c,u,i,r,a.RGBA,a.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&a.generateMipmap(a.TEXTURE_2D)},Fc.prototype.bind=function(t,e,n){var i=this.context.gl;i.bindTexture(i.TEXTURE_2D,this.texture),n!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(n=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)},Fc.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Fc.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Lc=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Lc.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},Lc.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Oc=function(t,e,n){this.target=t,this.parent=e,this.mapId=n,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},m(["receive","process"],this),this.invoker=new Lc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=E()?t:s};function Rc(t,e,n){var i=2*Math.PI*6378137/256/Math.pow(2,n);return[t*i-2*Math.PI*6378137/2,e*i-2*Math.PI*6378137/2]}Oc.prototype.send=function(t,e,n,i,r){var o=this;void 0===r&&(r=!1);var s=Math.round(1e18*Math.random()).toString(36).substring(0,10);n&&(this.callbacks[s]=n);var a=M(this.globalScope)?void 0:[];return this.target.postMessage({id:s,type:t,hasCallback:!!n,targetMapId:i,mustQueue:r,sourceMapId:this.mapId,data:Zi(e,a)},a),{cancel:function(){n&&delete o.callbacks[s],o.target.postMessage({id:s,type:"<cancel>",targetMapId:i,sourceMapId:o.mapId})}}},Oc.prototype.receive=function(t){var e=t.data,n=e.id;if(n&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[n];var i=this.cancelCallbacks[n];delete this.cancelCallbacks[n],i&&i()}else E()||e.mustQueue?(this.tasks[n]=e,this.taskQueue.push(n),this.invoker.trigger()):this.processTask(n,e)},Oc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Oc.prototype.processTask=function(t,e){var n=this;if("<response>"===e.type){var i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(ji(e.error)):i(null,ji(e.data)))}else{var r=!1,o=M(this.globalScope)?void 0:[],s=e.hasCallback?function(e,i){r=!0,delete n.cancelCallbacks[t],n.target.postMessage({id:t,type:"<response>",sourceMapId:n.mapId,error:e?Zi(e):null,data:Zi(i,o)},o)}:function(t){r=!0},a=null,l=ji(e.data);if(this.parent[e.type])a=this.parent[e.type](e.sourceMapId,l,s);else if(this.parent.getWorkerSource){var c=e.type.split(".");a=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,s)}else s(new Error("Could not find function "+e.type));!r&&a&&a.cancel&&(this.cancelCallbacks[t]=a.cancel)}},Oc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var kc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};kc.prototype.setNorthEast=function(t){return this._ne=t instanceof Uc?new Uc(t.lng,t.lat):Uc.convert(t),this},kc.prototype.setSouthWest=function(t){return this._sw=t instanceof Uc?new Uc(t.lng,t.lat):Uc.convert(t),this},kc.prototype.extend=function(t){var e,n,i=this._sw,r=this._ne;if(t instanceof Uc)e=t,n=t;else{if(!(t instanceof kc))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(kc.convert(t)):this.extend(Uc.convert(t)):this;if(n=t._ne,!(e=t._sw)||!n)return this}return i||r?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),r.lng=Math.max(n.lng,r.lng),r.lat=Math.max(n.lat,r.lat)):(this._sw=new Uc(e.lng,e.lat),this._ne=new Uc(n.lng,n.lat)),this},kc.prototype.getCenter=function(){return new Uc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},kc.prototype.getSouthWest=function(){return this._sw},kc.prototype.getNorthEast=function(){return this._ne},kc.prototype.getNorthWest=function(){return new Uc(this.getWest(),this.getNorth())},kc.prototype.getSouthEast=function(){return new Uc(this.getEast(),this.getSouth())},kc.prototype.getWest=function(){return this._sw.lng},kc.prototype.getSouth=function(){return this._sw.lat},kc.prototype.getEast=function(){return this._ne.lng},kc.prototype.getNorth=function(){return this._ne.lat},kc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},kc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},kc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},kc.prototype.contains=function(t){var e=Uc.convert(t),n=e.lng,i=e.lat,r=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(r=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&r},kc.convert=function(t){return!t||t instanceof kc?t:new kc(t)};var Uc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Uc.prototype.wrap=function(){return new Uc(h(this.lng,-180,180),this.lat)},Uc.prototype.toArray=function(){return[this.lng,this.lat]},Uc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Uc.prototype.distanceTo=function(t){var e=Math.PI/180,n=this.lat*e,i=t.lat*e,r=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(r,1))},Uc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return new kc(new Uc(this.lng-n,this.lat-e),new Uc(this.lng+n,this.lat+e))},Uc.convert=function(t){if(t instanceof Uc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Uc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Uc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var zc=2*Math.PI*6371008.8;function Gc(t){return zc*Math.cos(t*Math.PI/180)}function Nc(t){return(180+t)/360}function Zc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function jc(t,e){return t/Gc(e)}function Vc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Hc=function(t,e,n){void 0===n&&(n=0),this.x=+t,this.y=+e,this.z=+n};Hc.fromLngLat=function(t,e){void 0===e&&(e=0);var n=Uc.convert(t);return new Hc(Nc(n.lng),Zc(n.lat),jc(e,n.lat))},Hc.prototype.toLngLat=function(){return new Uc(360*this.x-180,Vc(this.y))},Hc.prototype.toAltitude=function(){return this.z*Gc(Vc(this.y))},Hc.prototype.meterInMercatorCoordinateUnits=function(){return 1/zc*(t=Vc(this.y),1/Math.cos(t*Math.PI/180));var t};var Jc=function(t,e,n){this.z=t,this.x=e,this.y=n,this.key=Kc(0,t,t,e,n)};Jc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Jc.prototype.url=function(t,e){var n,i,r,o,s,a=(i=this.y,r=this.z,o=Rc(256*(n=this.x),256*(i=Math.pow(2,r)-i-1),r),s=Rc(256*(n+1),256*(i+1),r),o[0]+","+o[1]+","+s[0]+","+s[1]),l=function(t,e,n){for(var i,r="",o=t;o>0;o--)r+=(e&(i=1<<o-1)?1:0)+(n&i?2:0);return r}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",l).replace("{bbox-epsg-3857}",a)},Jc.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new r(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Jc.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Wc=function(t,e){this.wrap=t,this.canonical=e,this.key=Kc(t,e.z,e.z,e.x,e.y)},Qc=function(t,e,n,i,r){this.overscaledZ=t,this.wrap=e,this.canonical=new Jc(n,+i,+r),this.key=Kc(e,t,n,i,r)};function Kc(t,e,n,i,r){(t*=2)<0&&(t=-1*t-1);var o=1<<n;return(o*o*t+o*r+i).toString(36)+n.toString(36)+e.toString(36)}Qc.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Qc.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Qc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Qc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Qc.prototype.calculateScaledKey=function(t,e){var n=this.canonical.z-t;return t>this.canonical.z?Kc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Kc(this.wrap*+e,t,t,this.canonical.x>>n,this.canonical.y>>n)},Qc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Qc.prototype.children=function(t){if(this.overscaledZ>=t)return[new Qc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,n=2*this.canonical.x,i=2*this.canonical.y;return[new Qc(e,this.wrap,e,n,i),new Qc(e,this.wrap,e,n+1,i),new Qc(e,this.wrap,e,n,i+1),new Qc(e,this.wrap,e,n+1,i+1)]},Qc.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Qc.prototype.wrapped=function(){return new Qc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Qc.prototype.unwrapTo=function(t){return new Qc(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Qc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Qc.prototype.toUnwrapped=function(){return new Wc(this.wrap,this.canonical)},Qc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Qc.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Hc(t.x-this.wrap,t.y))},Ui("CanonicalTileID",Jc),Ui("OverscaledTileID",Qc,{omit:["posMatrix"]});var qc=function(t,e,n){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(n&&"mapbox"!==n&&"terrarium"!==n)return w('"'+n+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var i=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=n||"mapbox";for(var r=0;r<i;r++)this.data[this._idx(-1,r)]=this.data[this._idx(0,r)],this.data[this._idx(i,r)]=this.data[this._idx(i-1,r)],this.data[this._idx(r,-1)]=this.data[this._idx(r,0)],this.data[this._idx(r,i)]=this.data[this._idx(r,i-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(i,-1)]=this.data[this._idx(i-1,0)],this.data[this._idx(-1,i)]=this.data[this._idx(0,i-1)],this.data[this._idx(i,i)]=this.data[this._idx(i-1,i-1)]};qc.prototype.get=function(t,e){var n=new Uint8Array(this.data.buffer),i=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(n[i],n[i+1],n[i+2])},qc.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},qc.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},qc.prototype._unpackMapbox=function(t,e,n){return(256*t*256+256*e+n)/10-1e4},qc.prototype._unpackTerrarium=function(t,e,n){return 256*t+e+n/256-32768},qc.prototype.getPixels=function(){return new vs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},qc.prototype.backfillBorder=function(t,e,n){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var i=e*this.dim,r=e*this.dim+this.dim,o=n*this.dim,s=n*this.dim+this.dim;switch(e){case-1:i=r-1;break;case 1:r=i+1}switch(n){case-1:o=s-1;break;case 1:s=o+1}for(var a=-e*this.dim,l=-n*this.dim,c=o;c<s;c++)for(var u=i;u<r;u++)this.data[this._idx(u,c)]=t.data[this._idx(u+a,c+l)]},Ui("DEMData",qc);var Xc=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var n=t[e];this._stringToNumber[n]=e,this._numberToString[e]=n}};Xc.prototype.encode=function(t){return this._stringToNumber[t]},Xc.prototype.decode=function(t){return this._numberToString[t]};var Yc=function(t,e,n,i,r){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=n,t._y=i,this.properties=t.properties,this.id=r},$c={geometry:{configurable:!0}};$c.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},$c.geometry.set=function(t){this._geometry=t},Yc.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Yc.prototype,$c);var tu=function(){this.state={},this.stateChanges={},this.deletedStates={}};tu.prototype.updateState=function(t,e,n){var i=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},d(this.stateChanges[t][i],n),null===this.deletedStates[t])for(var r in this.deletedStates[t]={},this.state[t])r!==i&&(this.deletedStates[t][r]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][i])for(var o in this.deletedStates[t][i]={},this.state[t][i])n[o]||(this.deletedStates[t][i][o]=null);else for(var s in n)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][s]&&delete this.deletedStates[t][i][s]},tu.prototype.removeFeatureState=function(t,e,n){if(null!==this.deletedStates[t]){var i=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},n&&void 0!==e)null!==this.deletedStates[t][i]&&(this.deletedStates[t][i]=this.deletedStates[t][i]||{},this.deletedStates[t][i][n]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][i])for(n in this.deletedStates[t][i]={},this.stateChanges[t][i])this.deletedStates[t][i][n]=null;else this.deletedStates[t][i]=null;else this.deletedStates[t]=null}},tu.prototype.getState=function(t,e){var n=String(e),i=d({},(this.state[t]||{})[n],(this.stateChanges[t]||{})[n]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var r=this.deletedStates[t][e];if(null===r)return{};for(var o in r)delete i[o]}return i},tu.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},tu.prototype.coalesceChanges=function(t,e){var n={};for(var i in this.stateChanges){this.state[i]=this.state[i]||{};var r={};for(var o in this.stateChanges[i])this.state[i][o]||(this.state[i][o]={}),d(this.state[i][o],this.stateChanges[i][o]),r[o]=this.state[i][o];n[i]=r}for(var s in this.deletedStates){this.state[s]=this.state[s]||{};var a={};if(null===this.deletedStates[s])for(var l in this.state[s])a[l]={},this.state[s][l]={};else for(var c in this.deletedStates[s]){if(null===this.deletedStates[s][c])this.state[s][c]={};else for(var u=0,h=Object.keys(this.deletedStates[s][c]);u<h.length;u+=1)delete this.state[s][c][h[u]];a[c]=this.state[s][c]}n[s]=n[s]||{},d(n[s],a)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(var f in t)t[f].setFeatureState(n,e)};var eu=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Fi(8192,16,0),this.grid3D=new Fi(8192,16,0),this.featureIndexArray=new oo,this.promoteId=e};function nu(t,e,n,i,r){return v(t,(function(t,o){var s=e instanceof pr?e.get(o):null;return s&&s.evaluate?s.evaluate(n,i,r):s}))}function iu(t){for(var e=1/0,n=1/0,i=-1/0,r=-1/0,o=0,s=t;o<s.length;o+=1){var a=s[o];e=Math.min(e,a.x),n=Math.min(n,a.y),i=Math.max(i,a.x),r=Math.max(r,a.y)}return{minX:e,minY:n,maxX:i,maxY:r}}function ru(t,e){return e-t}eu.prototype.insert=function(t,e,n,i,r,o){var s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,i,r);for(var a=o?this.grid3D:this.grid,l=0;l<e.length;l++){for(var c=e[l],u=[1/0,1/0,-1/0,-1/0],h=0;h<c.length;h++){var d=c[h];u[0]=Math.min(u[0],d.x),u[1]=Math.min(u[1],d.y),u[2]=Math.max(u[2],d.x),u[3]=Math.max(u[3],d.y)}u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&a.insert(s,u[0],u[1],u[2],u[3])}},eu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new _a.VectorTile(new qa(this.rawTileData)).layers,this.sourceLayerCoder=new Xc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},eu.prototype.query=function(t,e,n,i){var o=this;this.loadVTLayers();for(var s=t.params||{},a=8192/t.tileSize/t.scale,l=si(s.filter),c=t.queryGeometry,u=t.queryPadding*a,h=iu(c),d=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),f=iu(t.cameraQueryGeometry),A=this.grid3D.query(f.minX-u,f.minY-u,f.maxX+u,f.maxY+u,(function(e,n,i,o){return function(t,e,n,i,o){for(var s=0,a=t;s<a.length;s+=1){var l=a[s];if(e<=l.x&&n<=l.y&&i>=l.x&&o>=l.y)return!0}var c=[new r(e,n),new r(e,o),new r(i,o),new r(i,n)];if(t.length>2)for(var u=0,h=c;u<h.length;u+=1)if($o(t,h[u]))return!0;for(var d=0;d<t.length-1;d++)if(ts(t[d],t[d+1],c))return!0;return!1}(t.cameraQueryGeometry,e-u,n-u,i+u,o+u)})),p=0,g=A;p<g.length;p+=1)d.push(g[p]);d.sort(ru);for(var m,y={},v=function(r){var u=d[r];if(u!==m){m=u;var h=o.featureIndexArray.get(u),f=null;o.loadMatchingFeature(y,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,l,s.layers,s.availableImages,e,n,i,(function(e,n,i){return f||(f=Go(e)),n.queryIntersectsFeature(c,e,i,f,o.z,t.transform,a,t.pixelPosMatrix)}))}},_=0;_<d.length;_++)v(_);return y},eu.prototype.loadMatchingFeature=function(t,e,n,i,r,o,s,a,l,c,u){var h=this.bucketLayerIDs[e];if(!o||function(t,e){for(var n=0;n<t.length;n++)if(e.indexOf(t[n])>=0)return!0;return!1}(o,h)){var f=this.sourceLayerCoder.decode(n),A=this.vtLayers[f].feature(i);if(r.needGeometry){var p=No(A,!0);if(!r.filter(new ar(this.tileID.overscaledZ),p,this.tileID.canonical))return}else if(!r.filter(new ar(this.tileID.overscaledZ),A))return;for(var g=this.getId(A,f),m=0;m<h.length;m++){var y=h[m];if(!(o&&o.indexOf(y)<0)){var v=a[y];if(v){var _={};void 0!==g&&c&&(_=c.getState(v.sourceLayer||"_geojsonTileLayer",g));var b=d({},l[y]);b.paint=nu(b.paint,v.paint,A,_,s),b.layout=nu(b.layout,v.layout,A,_,s);var x=!u||u(A,v,_);if(x){var w=new Yc(A,this.z,this.x,this.y,g);w.layer=b;var C=t[y];void 0===C&&(C=t[y]=[]),C.push({featureIndex:i,feature:w,intersectionZ:x})}}}}}},eu.prototype.lookupSymbolFeatures=function(t,e,n,i,r,o,s,a){var l={};this.loadVTLayers();for(var c=si(r),u=0,h=t;u<h.length;u+=1)this.loadMatchingFeature(l,n,i,h[u],c,o,s,a,e);return l},eu.prototype.hasLayer=function(t){for(var e=0,n=this.bucketLayerIDs;e<n.length;e+=1)for(var i=0,r=n[e];i<r.length;i+=1)if(t===r[i])return!0;return!1},eu.prototype.getId=function(t,e){var n=t.id;return this.promoteId&&"boolean"==typeof(n=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(n=Number(n)),n},Ui("FeatureIndex",eu,{omit:["rawTileData","sourceLayerCoder"]});var ou=function(t,e){this.tileID=t,this.uid=A(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ou.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<U.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},ou.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},ou.prototype.loadVectorData=function(t,e,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var i in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var n={};if(!e)return n;for(var i=function(){var t=o[r],i=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==i.length){t.layers=i,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return i.filter((function(e){return e.id===t}))[0]})));for(var s=0,a=i;s<a.length;s+=1)n[a[s].id]=t}},r=0,o=t;r<o.length;r+=1)i();return n}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var r=this.buckets[i];if(r instanceof mc){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var s=this.buckets[o];if(s instanceof mc&&s.hasRTLText){this.hasRTLText=!0,sr.isLoading()||sr.isLoaded()||"deferred"!==rr()||or();break}}for(var a in this.queryPadding=0,this.buckets){var l=this.buckets[a];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(a).queryRadius(l))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Xr},ou.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ou.prototype.getBucket=function(t){return this.buckets[t.id]},ou.prototype.upload=function(t){for(var e in this.buckets){var n=this.buckets[e];n.uploadPending()&&n.upload(t)}var i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Fc(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Fc(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)},ou.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},ou.prototype.queryRenderedFeatures=function(t,e,n,i,r,o,s,a,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:r,scale:o,tileSize:this.tileSize,pixelPosMatrix:c,transform:a,params:s,queryPadding:this.queryPadding*l},t,e,n):{}},ou.prototype.querySourceFeatures=function(t,e){var n=this.latestFeatureIndex;if(n&&n.rawTileData){var i=n.loadVTLayers(),r=e?e.sourceLayer:"",o=i._geojsonTileLayer||i[r];if(o)for(var s=si(e&&e.filter),a=this.tileID.canonical,l=a.z,c=a.x,u=a.y,h={z:l,x:c,y:u},d=0;d<o.length;d++){var f=o.feature(d);if(s.needGeometry){var A=No(f,!0);if(!s.filter(new ar(this.tileID.overscaledZ),A,this.tileID.canonical))continue}else if(!s.filter(new ar(this.tileID.overscaledZ),f))continue;var p=n.getId(f,r),g=new Yc(f,l,c,u,p);g.tile=h,t.push(g)}}},ou.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},ou.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ou.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var n=T(t.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var i=Date.now(),r=!1;if(this.expirationTime>i)r=!1;else if(e)if(this.expirationTime<e)r=!0;else{var o=this.expirationTime-e;o?this.expirationTime=i+Math.max(o,3e4):r=!0}else r=!0;r?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ou.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},ou.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var n=this.latestFeatureIndex.loadVTLayers();for(var i in this.buckets)if(e.style.hasLayer(i)){var r=this.buckets[i],o=r.layers[0].sourceLayer||"_geojsonTileLayer",s=n[o],a=t[o];if(s&&a&&0!==Object.keys(a).length){r.update(a,s,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=e&&e.style&&e.style.getLayer(i);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(r)))}}}},ou.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},ou.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<U.now()},ou.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ou.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=U.now()+t},ou.prototype.setDependencies=function(t,e){for(var n={},i=0,r=e;i<r.length;i+=1)n[r[i]]=!0;this.dependencies[t]=n},ou.prototype.hasDependency=function(t,e){for(var n=0,i=t;n<i.length;n+=1){var r=this.dependencies[i[n]];if(r)for(var o=0,s=e;o<s.length;o+=1)if(r[s[o]])return!0}return!1};var su=s.performance,au=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},su.mark(this._marks.start)};au.prototype.finish=function(){su.mark(this._marks.end);var t=su.getEntriesByName(this._marks.measure);return 0===t.length&&(su.measure(this._marks.measure,this._marks.start,this._marks.end),t=su.getEntriesByName(this._marks.measure),su.clearMarks(this._marks.start),su.clearMarks(this._marks.end),su.clearMeasures(this._marks.measure)),t},t.Actor=Oc,t.AlphaImage=ys,t.CanonicalTileID=Jc,t.CollisionBoxArray=Xr,t.Color=te,t.DEMData=qc,t.DataConstantProperty=gr,t.DictionaryCoder=Xc,t.EXTENT=8192,t.ErrorEvent=Tt,t.EvaluationParameters=ar,t.Event=Et,t.Evented=St,t.FeatureIndex=eu,t.FillBucket=aa,t.FillExtrusionBucket=Ca,t.ImageAtlas=_l,t.ImagePosition=yl,t.LineBucket=Oa,t.LngLat=Uc,t.LngLatBounds=kc,t.MercatorCoordinate=Hc,t.ONE_EM=24,t.OverscaledTileID=Qc,t.Point=r,t.Point$1=r,t.Properties=br,t.Protobuf=qa,t.RGBAImage=vs,t.RequestManager=H,t.RequestPerformance=au,t.ResourceType=At,t.SegmentVector=ao,t.SourceFeatureState=tu,t.StructArrayLayout1ui2=Qr,t.StructArrayLayout2f1f2i16=zr,t.StructArrayLayout2i4=Sr,t.StructArrayLayout3ui6=Nr,t.StructArrayLayout4i8=Mr,t.SymbolBucket=mc,t.Texture=Fc,t.Tile=ou,t.Transitionable=ur,t.Uniform1f=bo,t.Uniform1i=_o,t.Uniform2f=xo,t.Uniform3f=wo,t.Uniform4f=Co,t.UniformColor=Bo,t.UniformMatrix4f=To,t.UnwrappedTileID=Wc,t.ValidationError=It,t.WritingMode=bl,t.ZoomHistory=Vi,t.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},t.addDynamicAttributes=fc,t.asyncAll=function(t,e,n){if(!t.length)return n(null,[]);var i=t.length,r=new Array(t.length),o=null;t.forEach((function(t,s){e(t,(function(t,e){t&&(o=t),r[s]=e,0==--i&&n(o,r)}))}))},t.bezier=l,t.bindAll=m,t.browser=U,t.cacheEntryPossiblyAdded=function(t){++dt>lt&&(t.getActor().send("enforceCacheSizeLimit",at),dt=0)},t.clamp=u,t.clearTileCache=function(t){var e=s.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Jl,t.clone=function(t){var e=new ss(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new ss(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Ha,t.config=z,t.create=function(){var t=new ss(16);return ss!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new ss(9);return ss!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new ss(4);return ss!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Wn,t.createLayout=Er,t.createStyleLayer=function(t){return"custom"===t.type?new Ec(t):new Tc[t.type](t)},t.cross=function(t,e,n){var i=e[0],r=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=r*l-o*a,t[1]=o*s-i*l,t[2]=i*a-r*s,t},t.deepEqual=function t(e,n){if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(var i=0;i<e.length;i++)if(!t(e[i],n[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==n){if("object"!=typeof n)return!1;if(Object.keys(e).length!==Object.keys(n).length)return!1;for(var r in e)if(!t(e[r],n[r]))return!1;return!0}return e===n},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=c,t.emitValidationErrors=Di,t.endsWith=y,t.enforceCacheSizeLimit=function(t){ct(),tt&&tt.then((function(e){e.keys().then((function(n){for(var i=0;i<n.length-t;i++)e.delete(n[i])}))}))},t.evaluateSizeForFeature=kl,t.evaluateSizeForZoom=Ul,t.evaluateVariableOffset=oc,t.evented=ir,t.extend=d,t.featureFilter=si,t.filterObject=_,t.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=Dl,t.getAnchorJustification=sc,t.getArrayBuffer=_t,t.getImage=wt,t.getJSON=function(t,e){return vt(d(t,{type:"json"}),e)},t.getRTLTextPluginStatus=rr,t.getReferrer=yt,t.getVideo=function(t,e){var n,i,r=s.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(var o=0;o<t.length;o++){var a=s.document.createElement("source");n=t[o],i=void 0,(i=s.document.createElement("a")).href=n,(i.protocol!==s.document.location.protocol||i.host!==s.document.location.host)&&(r.crossOrigin="Anonymous"),a.src=t[o],r.appendChild(a)}return{cancel:function(){}}},t.identity=as,t.invert=function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],A=e[12],p=e[13],g=e[14],m=e[15],y=n*a-i*s,v=n*l-r*s,_=n*c-o*s,b=i*l-r*a,x=i*c-o*a,w=r*c-o*l,C=u*p-h*A,B=u*g-d*A,E=u*m-f*A,T=h*g-d*p,S=h*m-f*p,M=d*m-f*g,I=y*M-v*S+_*T+b*E-x*B+w*C;return I?(t[0]=(a*M-l*S+c*T)*(I=1/I),t[1]=(r*S-i*M-o*T)*I,t[2]=(p*w-g*x+m*b)*I,t[3]=(d*x-h*w-f*b)*I,t[4]=(l*E-s*M-c*B)*I,t[5]=(n*M-r*E+o*B)*I,t[6]=(g*_-A*w-m*v)*I,t[7]=(u*w-d*_+f*v)*I,t[8]=(s*S-a*E+c*C)*I,t[9]=(i*E-n*S-o*C)*I,t[10]=(A*x-p*_+m*y)*I,t[11]=(h*_-u*x-f*y)*I,t[12]=(a*B-s*T-l*C)*I,t[13]=(n*T-i*B+r*C)*I,t[14]=(p*v-A*b-g*y)*I,t[15]=(u*b-h*v+d*y)*I,t):null},t.isChar=Hi,t.isMapboxURL=J,t.keysDifference=function(t,e){var n=[];for(var i in t)i in e||n.push(i);return n},t.makeRequest=vt,t.mapObject=v,t.mercatorXfromLng=Nc,t.mercatorYfromLat=Zc,t.mercatorZfromAltitude=jc,t.mul=us,t.multiply=ls,t.mvt=_a,t.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.normalize=function(t,e){var n=e[0],i=e[1],r=e[2],o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=Ve,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,n,i,r,o,s){var a=1/(e-n),l=1/(i-r),c=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*a,t[13]=(r+i)*l,t[14]=(s+o)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new qa(t).readFields(Al,[])},t.pbf=qa,t.performSymbolLayout=function(t,e,n,i,r,o,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var a=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var u=t.textSizeData,h=u.maxZoom;c.compositeTextSizes=[l["text-size"].possiblyEvaluate(new ar(u.minZoom),s),l["text-size"].possiblyEvaluate(new ar(h),s)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,f=d.maxZoom;c.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new ar(d.minZoom),s),l["icon-size"].possiblyEvaluate(new ar(f),s)]}c.layoutTextSize=l["text-size"].possiblyEvaluate(new ar(t.zoom+1),s),c.layoutIconSize=l["icon-size"].possiblyEvaluate(new ar(t.zoom+1),s),c.textMaxSize=l["text-size"].possiblyEvaluate(new ar(18));for(var A=24*a.get("text-line-height"),p="map"===a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement"),g=a.get("text-keep-upright"),m=a.get("text-size"),y=function(){var o=_[v],l=a.get("text-font").evaluate(o,{},s).join(","),u=m.evaluate(o,{},s),h=c.layoutTextSize.evaluate(o,{},s),d=c.layoutIconSize.evaluate(o,{},s),f={horizontal:{},vertical:void 0},y=o.text,b=[0,0];if(y){var x=y.toString(),C=24*a.get("text-letter-spacing").evaluate(o,{},s),B=function(t){for(var e=0,n=t;e<n.length;e+=1)if(i=n[e].charCodeAt(0),Hi.Arabic(i)||Hi["Arabic Supplement"](i)||Hi["Arabic Extended-A"](i)||Hi["Arabic Presentation Forms-A"](i)||Hi["Arabic Presentation Forms-B"](i))return!1;var i;return!0}(x)?C:0,E=a.get("text-anchor").evaluate(o,{},s),T=a.get("text-variable-anchor");if(!T){var S=a.get("text-radial-offset").evaluate(o,{},s);b=S?oc(E,[24*S,rc]):a.get("text-offset").evaluate(o,{},s).map((function(t){return 24*t}))}var M=p?"center":a.get("text-justify").evaluate(o,{},s),I=a.get("symbol-placement"),P="point"===I?24*a.get("text-max-width").evaluate(o,{},s):0,D=function(){t.allowVerticalPlacement&&Ji(x)&&(f.vertical=Cl(y,e,n,r,l,P,A,E,"left",B,b,bl.vertical,!0,I,h,u))};if(!p&&T){for(var F="auto"===M?T.map((function(t){return sc(t)})):[M],L=!1,O=0;O<F.length;O++){var R=F[O];if(!f.horizontal[R])if(L)f.horizontal[R]=f.horizontal[0];else{var k=Cl(y,e,n,r,l,P,A,"center",R,B,b,bl.horizontal,!1,I,h,u);k&&(f.horizontal[R]=k,L=1===k.positionedLines.length)}}D()}else{"auto"===M&&(M=sc(E));var U=Cl(y,e,n,r,l,P,A,E,M,B,b,bl.horizontal,!1,I,h,u);U&&(f.horizontal[M]=U),D(),Ji(x)&&p&&g&&(f.vertical=Cl(y,e,n,r,l,P,A,E,M,B,b,bl.vertical,!1,I,h,u))}}var z=void 0,G=!1;if(o.icon&&o.icon.name){var N=i[o.icon.name];N&&(z=function(t,e,n){var i=Dl(n),r=e[0]-t.displaySize[0]*i.horizontalAlign,o=e[1]-t.displaySize[1]*i.verticalAlign;return{image:t,top:o,bottom:o+t.displaySize[1],left:r,right:r+t.displaySize[0]}}(r[o.icon.name],a.get("icon-offset").evaluate(o,{},s),a.get("icon-anchor").evaluate(o,{},s)),G=N.sdf,void 0===t.sdfIcons?t.sdfIcons=N.sdf:t.sdfIcons!==N.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(N.pixelRatio!==t.pixelRatio||0!==a.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var Z=lc(f.horizontal)||f.vertical;t.iconsInText=!!Z&&Z.iconsInText,(Z||z)&&function(t,e,n,i,r,o,s,a,l,c,u){var h=o.textMaxSize.evaluate(e,{});void 0===h&&(h=s);var d,f=t.layers[0].layout,A=f.get("icon-offset").evaluate(e,{},u),p=lc(n.horizontal),g=s/24,m=t.tilePixelRatio*g,y=t.tilePixelRatio*h/24,v=t.tilePixelRatio*a,_=t.tilePixelRatio*f.get("symbol-spacing"),b=f.get("text-padding")*t.tilePixelRatio,x=f.get("icon-padding")*t.tilePixelRatio,C=f.get("text-max-angle")/180*Math.PI,B="map"===f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),E="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),T=f.get("symbol-placement"),S=_/2,M=f.get("icon-text-fit");i&&"none"!==M&&(t.allowVerticalPlacement&&n.vertical&&(d=Ll(i,n.vertical,M,f.get("icon-text-fit-padding"),A,g)),p&&(i=Ll(i,p,M,f.get("icon-text-fit-padding"),A,g)));var I=function(a,h){h.x<0||h.x>=8192||h.y<0||h.y>=8192||function(t,e,n,i,r,o,s,a,l,c,u,h,d,f,A,p,g,m,y,v,_,b,x,C,B){var E,T,S,M,I,P=t.addToLineVertexArray(e,n),D=0,F=0,L=0,O=0,R=-1,k=-1,U={},z=fo(""),G=0,N=0;if(void 0===a._unevaluatedLayout.getValue("text-radial-offset")?(G=(E=a.layout.get("text-offset").evaluate(_,{},C).map((function(t){return 24*t})))[0],N=E[1]):(G=24*a.layout.get("text-radial-offset").evaluate(_,{},C),N=rc),t.allowVerticalPlacement&&i.vertical){var Z=a.layout.get("text-rotate").evaluate(_,{},C)+90;M=new Yl(l,e,c,u,h,i.vertical,d,f,A,Z),s&&(I=new Yl(l,e,c,u,h,s,g,m,A,Z))}if(r){var j=a.layout.get("icon-rotate").evaluate(_,{}),V="none"!==a.layout.get("icon-text-fit"),H=Wl(r,j,x,V),J=s?Wl(s,j,x,V):void 0;S=new Yl(l,e,c,u,h,r,g,m,!1,j),D=4*H.length;var W=t.iconSizeData,Q=null;"source"===W.kind?(Q=[128*a.layout.get("icon-size").evaluate(_,{})])[0]>32640&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===W.kind&&((Q=[128*b.compositeIconSizes[0].evaluate(_,{},C),128*b.compositeIconSizes[1].evaluate(_,{},C)])[0]>32640||Q[1]>32640)&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,H,Q,v,y,_,!1,e,P.lineStartIndex,P.lineLength,-1,C),R=t.icon.placedSymbolArray.length-1,J&&(F=4*J.length,t.addSymbols(t.icon,J,Q,v,y,_,bl.vertical,e,P.lineStartIndex,P.lineLength,-1,C),k=t.icon.placedSymbolArray.length-1)}for(var K in i.horizontal){var q=i.horizontal[K];if(!T){z=fo(q.text);var X=a.layout.get("text-rotate").evaluate(_,{},C);T=new Yl(l,e,c,u,h,q,d,f,A,X)}var Y=1===q.positionedLines.length;if(L+=ac(t,e,q,o,a,A,_,p,P,i.vertical?bl.horizontal:bl.horizontalOnly,Y?Object.keys(i.horizontal):[K],U,R,b,C),Y)break}i.vertical&&(O+=ac(t,e,i.vertical,o,a,A,_,p,P,bl.vertical,["vertical"],U,k,b,C));var $=T?T.boxStartIndex:t.collisionBoxArray.length,tt=T?T.boxEndIndex:t.collisionBoxArray.length,et=M?M.boxStartIndex:t.collisionBoxArray.length,nt=M?M.boxEndIndex:t.collisionBoxArray.length,it=S?S.boxStartIndex:t.collisionBoxArray.length,rt=S?S.boxEndIndex:t.collisionBoxArray.length,ot=I?I.boxStartIndex:t.collisionBoxArray.length,st=I?I.boxEndIndex:t.collisionBoxArray.length,at=-1,lt=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};at=lt(T,at),at=lt(M,at),at=lt(S,at);var ct=(at=lt(I,at))>-1?1:0;ct&&(at*=B/24),t.glyphOffsetArray.length>=mc.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,U.right>=0?U.right:-1,U.center>=0?U.center:-1,U.left>=0?U.left:-1,U.vertical||-1,R,k,z,$,tt,et,nt,it,rt,ot,st,c,L,O,D,F,ct,0,d,G,N,at)}(t,h,a,n,i,r,d,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,B,l,v,x,E,A,e,o,c,u,s)};if("line"===T)for(var P=0,D=Jl(e.geometry,0,0,8192,8192);P<D.length;P+=1)for(var F=D[P],L=0,O=Hl(F,_,C,n.vertical||p,i,24,y,t.overscaling,8192);L<O.length;L+=1){var R=O[L];p&&cc(t,p.text,S,R)||I(F,R)}else if("line-center"===T)for(var k=0,U=e.geometry;k<U.length;k+=1){var z=U[k];if(z.length>1){var G=Vl(z,C,n.vertical||p,i,24,y);G&&I(z,G)}}else if("Polygon"===e.type)for(var N=0,Z=ia(e.geometry,0);N<Z.length;N+=1){var j=Z[N],V=ec(j,16);I(j[0],new Ol(V.x,V.y,0))}else if("LineString"===e.type)for(var H=0,J=e.geometry;H<J.length;H+=1){var W=J[H];I(W,new Ol(W[0].x,W[0].y,0))}else if("Point"===e.type)for(var Q=0,K=e.geometry;Q<K.length;Q+=1)for(var q=0,X=K[Q];q<X.length;q+=1){var Y=X[q];I([Y],new Ol(Y.x,Y.y,0))}}(t,o,f,z,i,c,h,d,b,G,s)},v=0,_=t.features;v<_.length;v+=1)y();o&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,n,i,r){var o,s=1/Math.tan(e/2);return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+i)*(o=1/(i-r)),t[14]=2*r*i*o):(t[10]=-1,t[14]=-2*i),t},t.pick=function(t,e){for(var n={},i=0;i<e.length;i++){var r=e[i];r in t&&(n[r]=t[r])}return n},t.plugin=sr,t.polygonIntersectsPolygon=Vo,t.postMapLoadEvent=st,t.postTurnstileEvent=rt,t.potpack=ml,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Ui,t.registerForPluginStateChange=function(t){return t({pluginStatus:$i,pluginURL:tr}),ir.on("pluginStateChange",t),t},t.renderColorRamp=bs,t.rotate=function(t,e,n){var i=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(n),l=Math.cos(n);return t[0]=i*l+o*a,t[1]=r*l+s*a,t[2]=i*-a+o*l,t[3]=r*-a+s*l,t},t.rotateX=function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*i,t[5]=s*r+u*i,t[6]=a*r+h*i,t[7]=l*r+d*i,t[8]=c*r-o*i,t[9]=u*r-s*i,t[10]=h*r-a*i,t[11]=d*r-l*i,t},t.rotateZ=function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+c*i,t[1]=s*r+u*i,t[2]=a*r+h*i,t[3]=l*r+d*i,t[4]=c*r-o*i,t[5]=u*r-s*i,t[6]=h*r-a*i,t[7]=d*r-l*i,t},t.scale=function(t,e,n){var i=n[0],r=n[1],o=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},t.scale$2=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},t.setCacheLimits=function(t,e){at=t,lt=e},t.setRTLTextPlugin=function(t,e,n){if(void 0===n&&(n=!1),"deferred"===$i||"loading"===$i||"loaded"===$i)throw new Error("setRTLTextPlugin cannot be called multiple times.");tr=U.resolveURL(t),$i="deferred",Yi=e,nr(),n||or()},t.sphericalToCartesian=function(t){var e=t[0],n=t[1],i=t[2];return n+=90,n*=Math.PI/180,i*=Math.PI/180,{x:e*Math.cos(n)*Math.sin(i),y:e*Math.sin(n)*Math.sin(i),z:e*Math.cos(i)}},t.sqrLen=function(t){var e=t[0],n=t[1];return e*e+n*n},t.styleSpec=Mt,t.sub=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},t.symbolSize=zl,t.transformMat3=function(t,e,n){var i=e[0],r=e[1],o=e[2];return t[0]=i*n[0]+r*n[3]+o*n[6],t[1]=i*n[1]+r*n[4]+o*n[7],t[2]=i*n[2]+r*n[5]+o*n[8],t},t.transformMat4=hs,t.translate=function(t,e,n){var i,r,o,s,a,l,c,u,h,d,f,A,p=n[0],g=n[1],m=n[2];return e===t?(t[12]=e[0]*p+e[4]*g+e[8]*m+e[12],t[13]=e[1]*p+e[5]*g+e[9]*m+e[13],t[14]=e[2]*p+e[6]*g+e[10]*m+e[14],t[15]=e[3]*p+e[7]*g+e[11]*m+e[15]):(r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],A=e[11],t[0]=i=e[0],t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=f,t[11]=A,t[12]=i*p+a*g+h*m+e[12],t[13]=r*p+l*g+d*m+e[13],t[14]=o*p+c*g+f*m+e[14],t[15]=s*p+u*g+A*m+e[15]),t},t.triggerPluginCompletionEvent=er,t.uniqueId=A,t.validateCustomStyleLayer=function(t){var e=[],n=t.id;return void 0===n&&e.push({message:"layers."+n+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+n+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+n+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Mi,t.validateStyle=Si,t.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},t.vectorTile=_a,t.version="1.13.2",t.warnOnce=w,t.webpSupported=G,t.window=s,t.wrap=h})),i(["./shared"],(function(t){function e(t){var n=typeof t;if("number"===n||"boolean"===n||"string"===n||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var i="[",r=0,o=t;r<o.length;r+=1)i+=e(o[r])+",";return i+"]"}for(var s=Object.keys(t).sort(),a="{",l=0;l<s.length;l++)a+=JSON.stringify(s[l])+":"+e(t[s[l]])+",";return a+"}"}function n(n){for(var i="",r=0,o=t.refProperties;r<o.length;r+=1)i+="/"+e(n[o[r]]);return i}var i=function(t){this.keyCache={},t&&this.replace(t)};i.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},i.prototype.update=function(e,i){for(var r=this,o=0,s=e;o<s.length;o+=1){var a=s[o];this._layerConfigs[a.id]=a;var l=this._layers[a.id]=t.createStyleLayer(a);l._featureFilter=t.featureFilter(l.filter),this.keyCache[a.id]&&delete this.keyCache[a.id]}for(var c=0,u=i;c<u.length;c+=1){var h=u[c];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var d=0,f=function(t,e){for(var i={},r=0;r<t.length;r++){var o=e&&e[t[r].id]||n(t[r]);e&&(e[t[r].id]=o);var s=i[o];s||(s=i[o]=[]),s.push(t[r])}var a=[];for(var l in i)a.push(i[l]);return a}(t.values(this._layerConfigs),this.keyCache);d<f.length;d+=1){var A=f[d].map((function(t){return r._layers[t.id]})),p=A[0];if("none"!==p.visibility){var g=p.source||"",m=this.familiesBySource[g];m||(m=this.familiesBySource[g]={});var y=p.sourceLayer||"_geojsonTileLayer",v=m[y];v||(v=m[y]=[]),v.push(A)}}};var r=function(e){var n={},i=[];for(var r in e){var o=e[r],s=n[r]={};for(var a in o){var l=o[+a];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var c={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};i.push(c),s[a]={rect:c,metrics:l.metrics}}}}var u=t.potpack(i),h=new t.AlphaImage({width:u.w||1,height:u.h||1});for(var d in e){var f=e[d];for(var A in f){var p=f[+A];if(p&&0!==p.bitmap.width&&0!==p.bitmap.height){var g=n[d][A].rect;t.AlphaImage.copy(p.bitmap,h,{x:0,y:0},{x:g.x+1,y:g.y+1},p.bitmap)}}}this.image=h,this.positions=n};t.register("GlyphAtlas",r);var o=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId};function s(e,n,i){for(var r=new t.EvaluationParameters(n),o=0,s=e;o<s.length;o+=1)s[o].recalculate(r,i)}function a(e,n){var i=t.getArrayBuffer(e.request,(function(e,i,r,o){e?n(e):i&&n(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(i)),rawData:i,cacheControl:r,expires:o})}));return function(){i.cancel(),n()}}o.prototype.parse=function(e,n,i,o,a){var l=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var c=new t.DictionaryCoder(Object.keys(e.layers).sort()),u=new t.FeatureIndex(this.tileID,this.promoteId);u.bucketLayerIDs=[];var h,d,f,A,p={},g={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:i},m=n.familiesBySource[this.source];for(var y in m){var v=e.layers[y];if(v){1===v.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+y+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var _=c.encode(y),b=[],x=0;x<v.length;x++){var w=v.feature(x),C=u.getId(w,y);b.push({feature:w,id:C,index:x,sourceLayerIndex:_})}for(var B=0,E=m[y];B<E.length;B+=1){var T=E[B],S=T[0];S.minzoom&&this.zoom<Math.floor(S.minzoom)||S.maxzoom&&this.zoom>=S.maxzoom||"none"!==S.visibility&&(s(T,this.zoom,i),(p[S.id]=S.createBucket({index:u.bucketLayerIDs.length,layers:T,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(b,g,this.tileID.canonical),u.bucketLayerIDs.push(T.map((function(t){return t.id}))))}}}var M=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(M).length?o.send("getGlyphs",{uid:this.uid,stacks:M},(function(t,e){h||(h=t,d=e,D.call(l))})):d={};var I=Object.keys(g.iconDependencies);I.length?o.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,f=e,D.call(l))})):f={};var P=Object.keys(g.patternDependencies);function D(){if(h)return a(h);if(d&&f&&A){var e=new r(d),n=new t.ImageAtlas(f,A);for(var o in p){var l=p[o];l instanceof t.SymbolBucket?(s(l.layers,this.zoom,i),t.performSymbolLayout(l,d,e.positions,f,n.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(s(l.layers,this.zoom,i),l.addFeatures(g,this.tileID.canonical,n.patternPositions))}this.status="done",a(null,{buckets:t.values(p).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:n,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?o.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,A=e,D.call(l))})):A={},D.call(this)};var l=function(t,e,n,i){this.actor=t,this.layerIndex=e,this.availableImages=n,this.loadVectorData=i||a,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,n){var i=this,r=e.uid;this.loading||(this.loading={});var s=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),a=this.loading[r]=new o(e);a.abort=this.loadVectorData(e,(function(e,o){if(delete i.loading[r],e||!o)return a.status="done",i.loaded[r]=a,n(e);var l=o.rawData,c={};o.expires&&(c.expires=o.expires),o.cacheControl&&(c.cacheControl=o.cacheControl);var u={};if(s){var h=s.finish();h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}a.vectorTile=o.vectorTile,a.parse(o.vectorTile,i.layerIndex,i.availableImages,i.actor,(function(e,i){if(e||!i)return n(e);n(null,t.extend({rawTileData:l.slice(0)},i,c,u))})),i.loaded=i.loaded||{},i.loaded[r]=a}))},l.prototype.reloadTile=function(t,e){var n=this,i=this.loaded,r=t.uid,o=this;if(i&&i[r]){var s=i[r];s.showCollisionBoxes=t.showCollisionBoxes;var a=function(t,i){var r=s.reloadCallback;r&&(delete s.reloadCallback,s.parse(s.vectorTile,o.layerIndex,n.availableImages,o.actor,r)),e(t,i)};"parsing"===s.status?s.reloadCallback=a:"done"===s.status&&(s.vectorTile?s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}},l.prototype.abortTile=function(t,e){var n=this.loading,i=t.uid;n&&n[i]&&n[i].abort&&(n[i].abort(),delete n[i]),e()},l.prototype.removeTile=function(t,e){var n=this.loaded,i=t.uid;n&&n[i]&&delete n[i],e()};var c=t.window.ImageBitmap,u=function(){this.loaded={}};function h(t,e){if(0!==t.length){d(t[0],e);for(var n=1;n<t.length;n++)d(t[n],!e)}}function d(t,e){for(var n=0,i=0,r=t.length,o=r-1;i<r;o=i++)n+=(t[i][0]-t[o][0])*(t[o][1]+t[i][1]);n>=0!=!!e&&t.reverse()}u.prototype.loadTile=function(e,n){var i=e.uid,r=e.encoding,o=e.rawImageData,s=c&&o instanceof c?this.getImageData(o):o,a=new t.DEMData(i,s,r);this.loaded=this.loaded||{},this.loaded[i]=a,n(null,a)},u.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var n=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:n.width,height:n.height},n.data)},u.prototype.removeTile=function(t){var e=this.loaded,n=t.uid;e&&e[n]&&delete e[n]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,A=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};A.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],n=0,i=this._feature.geometry;n<i.length;n+=1){var r=i[n];e.push([new t.Point$1(r[0],r[1])])}return e}for(var o=[],s=0,a=this._feature.geometry;s<a.length;s+=1){for(var l=[],c=0,u=a[s];c<u.length;c+=1){var h=u[c];l.push(new t.Point$1(h[0],h[1]))}o.push(l)}return o},A.prototype.toGeoJSON=function(t,e,n){return f.call(this,t,e,n)};var p=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};p.prototype.feature=function(t){return new A(this._features[t])};var g=t.vectorTile.VectorTileFeature,m=y;function y(t,e){this.options=e||{},this.features=t,this.length=t.length}function v(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}y.prototype.feature=function(t){return new v(this.features[t],this.options.extent)},v.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var n=0;n<e.length;n++){for(var i=e[n],r=[],o=0;o<i.length;o++)r.push(new t.Point$1(i[o][0],i[o][1]));this.geometry.push(r)}return this.geometry},v.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,n=-1/0,i=1/0,r=-1/0,o=0;o<t.length;o++)for(var s=t[o],a=0;a<s.length;a++){var l=s[a];e=Math.min(e,l.x),n=Math.max(n,l.x),i=Math.min(i,l.y),r=Math.max(r,l.y)}return[e,i,n,r]},v.prototype.toGeoJSON=g.prototype.toGeoJSON;var _=x,b=m;function x(e){var n=new t.pbf;return function(t,e){for(var n in t.layers)e.writeMessage(3,w,t.layers[n])}(e,n),n.finish()}function w(t,e){var n;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var i={keys:[],values:[],keycache:{},valuecache:{}};for(n=0;n<t.length;n++)i.feature=t.feature(n),e.writeMessage(2,C,i);var r=i.keys;for(n=0;n<r.length;n++)e.writeStringField(3,r[n]);var o=i.values;for(n=0;n<o.length;n++)e.writeMessage(4,M,o[n])}function C(t,e){var n=t.feature;void 0!==n.id&&e.writeVarintField(1,n.id),e.writeMessage(2,B,t),e.writeVarintField(3,n.type),e.writeMessage(4,S,n)}function B(t,e){var n=t.feature,i=t.keys,r=t.values,o=t.keycache,s=t.valuecache;for(var a in n.properties){var l=o[a];void 0===l&&(i.push(a),o[a]=l=i.length-1),e.writeVarint(l);var c=n.properties[a],u=typeof c;"string"!==u&&"boolean"!==u&&"number"!==u&&(c=JSON.stringify(c));var h=u+":"+c,d=s[h];void 0===d&&(r.push(c),s[h]=d=r.length-1),e.writeVarint(d)}}function E(t,e){return(e<<3)+(7&t)}function T(t){return t<<1^t>>31}function S(t,e){for(var n=t.loadGeometry(),i=t.type,r=0,o=0,s=n.length,a=0;a<s;a++){var l=n[a],c=1;1===i&&(c=l.length),e.writeVarint(E(1,c));for(var u=3===i?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==i&&e.writeVarint(E(2,u-1));var d=l[h].x-r,f=l[h].y-o;e.writeVarint(T(d)),e.writeVarint(T(f)),r+=d,o+=f}3===i&&e.writeVarint(E(7,1))}}function M(t,e){var n=typeof t;"string"===n?e.writeStringField(1,t):"boolean"===n?e.writeBooleanField(7,t):"number"===n&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function I(t,e,n,i){P(t,n,i),P(e,2*n,2*i),P(e,2*n+1,2*i+1)}function P(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function D(t,e,n,i){var r=t-n,o=e-i;return r*r+o*o}_.fromVectorTileJs=x,_.fromGeojsonVt=function(t,e){e=e||{};var n={};for(var i in t)n[i]=new m(t[i].features,e),n[i].name=i,n[i].version=e.version,n[i].extent=e.extent;return x({layers:n})},_.GeoJSONWrapper=b;var F=function(t){return t[0]},L=function(t){return t[1]},O=function(t,e,n,i,r){void 0===e&&(e=F),void 0===n&&(n=L),void 0===i&&(i=64),void 0===r&&(r=Float64Array),this.nodeSize=i,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,s=this.ids=new o(t.length),a=this.coords=new r(2*t.length),l=0;l<t.length;l++)s[l]=l,a[2*l]=e(t[l]),a[2*l+1]=n(t[l]);!function t(e,n,i,r,o,s){if(!(o-r<=i)){var a=r+o>>1;!function t(e,n,i,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,l=i-r+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);t(e,n,i,Math.max(r,Math.floor(i-l*u/a+h)),Math.min(o,Math.floor(i+(a-l)*u/a+h)),s)}var d=n[2*i+s],f=r,A=o;for(I(e,n,r,i),n[2*o+s]>d&&I(e,n,r,o);f<A;){for(I(e,n,f,A),f++,A--;n[2*f+s]<d;)f++;for(;n[2*A+s]>d;)A--}n[2*r+s]===d?I(e,n,r,A):I(e,n,++A,o),A<=i&&(r=A+1),i<=A&&(o=A-1)}}(e,n,a,r,o,s%2),t(e,n,i,r,a-1,s+1),t(e,n,i,a+1,o,s+1)}}(s,a,i,0,s.length-1,0)};O.prototype.range=function(t,e,n,i){return function(t,e,n,i,r,o,s){for(var a,l,c=[0,t.length-1,0],u=[];c.length;){var h=c.pop(),d=c.pop(),f=c.pop();if(d-f<=s)for(var A=f;A<=d;A++)l=e[2*A+1],(a=e[2*A])>=n&&a<=r&&l>=i&&l<=o&&u.push(t[A]);else{var p=Math.floor((f+d)/2);l=e[2*p+1],(a=e[2*p])>=n&&a<=r&&l>=i&&l<=o&&u.push(t[p]);var g=(h+1)%2;(0===h?n<=a:i<=l)&&(c.push(f),c.push(p-1),c.push(g)),(0===h?r>=a:o>=l)&&(c.push(p+1),c.push(d),c.push(g))}}return u}(this.ids,this.coords,t,e,n,i,this.nodeSize)},O.prototype.within=function(t,e,n){return function(t,e,n,i,r,o){for(var s=[0,t.length-1,0],a=[],l=r*r;s.length;){var c=s.pop(),u=s.pop(),h=s.pop();if(u-h<=o)for(var d=h;d<=u;d++)D(e[2*d],e[2*d+1],n,i)<=l&&a.push(t[d]);else{var f=Math.floor((h+u)/2),A=e[2*f],p=e[2*f+1];D(A,p,n,i)<=l&&a.push(t[f]);var g=(c+1)%2;(0===c?n-r<=A:i-r<=p)&&(s.push(h),s.push(f-1),s.push(g)),(0===c?n+r>=A:i+r>=p)&&(s.push(f+1),s.push(u),s.push(g))}}return a}(this.ids,this.coords,t,e,n,this.nodeSize)};var R={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},k=function(t){this.options=V(Object.create(R),t),this.trees=new Array(this.options.maxZoom+1)};function U(t,e,n,i,r){return{x:t,y:e,zoom:1/0,id:n,parentId:-1,numPoints:i,properties:r}}function z(t,e){var n=t.geometry.coordinates,i=n[1];return{x:Z(n[0]),y:j(i),zoom:1/0,index:e,parentId:-1}}function G(t){return{type:"Feature",id:t.id,properties:N(t),geometry:{type:"Point",coordinates:[(i=t.x,360*(i-.5)),(e=t.y,n=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var e,n,i}function N(t){var e=t.numPoints,n=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return V(V({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function Z(t){return t/360+.5}function j(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function V(t,e){for(var n in e)t[n]=e[n];return t}function H(t){return t.x}function J(t){return t.y}function W(t,e,n,i,r,o){var s=r-n,a=o-i;if(0!==s||0!==a){var l=((t-n)*s+(e-i)*a)/(s*s+a*a);l>1?(n=r,i=o):l>0&&(n+=s*l,i+=a*l)}return(s=t-n)*s+(a=e-i)*a}function Q(t,e,n,i){var r={id:void 0===t?null:t,type:e,geometry:n,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,n=t.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)K(t,e);else if("Polygon"===n||"MultiLineString"===n)for(var i=0;i<e.length;i++)K(t,e[i]);else if("MultiPolygon"===n)for(i=0;i<e.length;i++)for(var r=0;r<e[i].length;r++)K(t,e[i][r])}(r),r}function K(t,e){for(var n=0;n<e.length;n+=3)t.minX=Math.min(t.minX,e[n]),t.minY=Math.min(t.minY,e[n+1]),t.maxX=Math.max(t.maxX,e[n]),t.maxY=Math.max(t.maxY,e[n+1])}function q(t,e,n,i){if(e.geometry){var r=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),a=[],l=e.id;if(n.promoteId?l=e.properties[n.promoteId]:n.generateId&&(l=i||0),"Point"===o)X(r,a);else if("MultiPoint"===o)for(var c=0;c<r.length;c++)X(r[c],a);else if("LineString"===o)Y(r,a,s,!1);else if("MultiLineString"===o){if(n.lineMetrics){for(c=0;c<r.length;c++)Y(r[c],a=[],s,!1),t.push(Q(l,"LineString",a,e.properties));return}$(r,a,s,!1)}else if("Polygon"===o)$(r,a,s,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<e.geometry.geometries.length;c++)q(t,{id:l,geometry:e.geometry.geometries[c],properties:e.properties},n,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<r.length;c++){var u=[];$(r[c],u,s,!0),a.push(u)}}t.push(Q(l,o,a,e.properties))}}function X(t,e){e.push(tt(t[0])),e.push(et(t[1])),e.push(0)}function Y(t,e,n,i){for(var r,o,s=0,a=0;a<t.length;a++){var l=tt(t[a][0]),c=et(t[a][1]);e.push(l),e.push(c),e.push(0),a>0&&(s+=i?(r*c-l*o)/2:Math.sqrt(Math.pow(l-r,2)+Math.pow(c-o,2))),r=l,o=c}var u=e.length-3;e[2]=1,function t(e,n,i,r){for(var o,s=r,a=i-n>>1,l=i-n,c=e[n],u=e[n+1],h=e[i],d=e[i+1],f=n+3;f<i;f+=3){var A=W(e[f],e[f+1],c,u,h,d);if(A>s)o=f,s=A;else if(A===s){var p=Math.abs(f-a);p<l&&(o=f,l=p)}}s>r&&(o-n>3&&t(e,n,o,r),e[o+2]=s,i-o>3&&t(e,o,i,r))}(e,0,u,n),e[u+2]=1,e.size=Math.abs(s),e.start=0,e.end=e.size}function $(t,e,n,i){for(var r=0;r<t.length;r++){var o=[];Y(t[r],o,n,i),e.push(o)}}function tt(t){return t/360+.5}function et(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function nt(t,e,n,i,r,o,s,a){if(i/=e,o>=(n/=e)&&s<i)return t;if(s<n||o>=i)return null;for(var l=[],c=0;c<t.length;c++){var u=t[c],h=u.geometry,d=u.type,f=0===r?u.minX:u.minY,A=0===r?u.maxX:u.maxY;if(f>=n&&A<i)l.push(u);else if(!(A<n||f>=i)){var p=[];if("Point"===d||"MultiPoint"===d)it(h,p,n,i,r);else if("LineString"===d)rt(h,p,n,i,r,!1,a.lineMetrics);else if("MultiLineString"===d)st(h,p,n,i,r,!1);else if("Polygon"===d)st(h,p,n,i,r,!0);else if("MultiPolygon"===d)for(var g=0;g<h.length;g++){var m=[];st(h[g],m,n,i,r,!0),m.length&&p.push(m)}if(p.length){if(a.lineMetrics&&"LineString"===d){for(g=0;g<p.length;g++)l.push(Q(u.id,d,p[g],u.tags));continue}"LineString"!==d&&"MultiLineString"!==d||(1===p.length?(d="LineString",p=p[0]):d="MultiLineString"),"Point"!==d&&"MultiPoint"!==d||(d=3===p.length?"Point":"MultiPoint"),l.push(Q(u.id,d,p,u.tags))}}}return l.length?l:null}function it(t,e,n,i,r){for(var o=0;o<t.length;o+=3){var s=t[o+r];s>=n&&s<=i&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function rt(t,e,n,i,r,o,s){for(var a,l,c=ot(t),u=0===r?lt:ct,h=t.start,d=0;d<t.length-3;d+=3){var f=t[d],A=t[d+1],p=t[d+2],g=t[d+3],m=t[d+4],y=0===r?f:A,v=0===r?g:m,_=!1;s&&(a=Math.sqrt(Math.pow(f-g,2)+Math.pow(A-m,2))),y<n?v>n&&(l=u(c,f,A,g,m,n),s&&(c.start=h+a*l)):y>i?v<i&&(l=u(c,f,A,g,m,i),s&&(c.start=h+a*l)):at(c,f,A,p),v<n&&y>=n&&(l=u(c,f,A,g,m,n),_=!0),v>i&&y<=i&&(l=u(c,f,A,g,m,i),_=!0),!o&&_&&(s&&(c.end=h+a*l),e.push(c),c=ot(t)),s&&(h+=a)}var b=t.length-3;f=t[b],A=t[b+1],p=t[b+2],(y=0===r?f:A)>=n&&y<=i&&at(c,f,A,p),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&at(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function st(t,e,n,i,r,o){for(var s=0;s<t.length;s++)rt(t[s],e,n,i,r,o,!1)}function at(t,e,n,i){t.push(e),t.push(n),t.push(i)}function lt(t,e,n,i,r,o){var s=(o-e)/(i-e);return t.push(o),t.push(n+(r-n)*s),t.push(1),s}function ct(t,e,n,i,r,o){var s=(o-n)/(r-n);return t.push(e+(i-e)*s),t.push(o),t.push(1),s}function ut(t,e){for(var n=[],i=0;i<t.length;i++){var r,o=t[i],s=o.type;if("Point"===s||"MultiPoint"===s||"LineString"===s)r=ht(o.geometry,e);else if("MultiLineString"===s||"Polygon"===s){r=[];for(var a=0;a<o.geometry.length;a++)r.push(ht(o.geometry[a],e))}else if("MultiPolygon"===s)for(r=[],a=0;a<o.geometry.length;a++){for(var l=[],c=0;c<o.geometry[a].length;c++)l.push(ht(o.geometry[a][c],e));r.push(l)}n.push(Q(o.id,s,r,o.tags))}return n}function ht(t,e){var n=[];n.size=t.size,void 0!==t.start&&(n.start=t.start,n.end=t.end);for(var i=0;i<t.length;i+=3)n.push(t[i]+e,t[i+1],t[i+2]);return n}function dt(t,e){if(t.transformed)return t;var n,i,r,o=1<<t.z,s=t.x,a=t.y;for(n=0;n<t.features.length;n++){var l=t.features[n],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(i=0;i<c.length;i+=2)l.geometry.push(ft(c[i],c[i+1],e,o,s,a));else for(i=0;i<c.length;i++){var h=[];for(r=0;r<c[i].length;r+=2)h.push(ft(c[i][r],c[i][r+1],e,o,s,a));l.geometry.push(h)}}return t.transformed=!0,t}function ft(t,e,n,i,r,o){return[Math.round(n*(t*i-r)),Math.round(n*(e*i-o))]}function At(t,e,n,i,r){for(var o=e===r.maxZoom?0:r.tolerance/((1<<e)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:i,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<t.length;a++){s.numFeatures++,pt(s,t[a],o,r);var l=t[a].minX,c=t[a].minY,u=t[a].maxX,h=t[a].maxY;l<s.minX&&(s.minX=l),c<s.minY&&(s.minY=c),u>s.maxX&&(s.maxX=u),h>s.maxY&&(s.maxY=h)}return s}function pt(t,e,n,i){var r=e.geometry,o=e.type,s=[];if("Point"===o||"MultiPoint"===o)for(var a=0;a<r.length;a+=3)s.push(r[a]),s.push(r[a+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)gt(s,r,t,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(a=0;a<r.length;a++)gt(s,r[a],t,n,"Polygon"===o,0===a);else if("MultiPolygon"===o)for(var l=0;l<r.length;l++){var c=r[l];for(a=0;a<c.length;a++)gt(s,c[a],t,n,!0,0===a)}if(s.length){var u=e.tags||null;if("LineString"===o&&i.lineMetrics){for(var h in u={},e.tags)u[h]=e.tags[h];u.mapbox_clip_start=r.start/r.size,u.mapbox_clip_end=r.end/r.size}var d={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:u};null!==e.id&&(d.id=e.id),t.features.push(d)}}function gt(t,e,n,i,r,o){var s=i*i;if(i>0&&e.size<(r?s:i))n.numPoints+=e.length/3;else{for(var a=[],l=0;l<e.length;l+=3)(0===i||e[l+2]>s)&&(n.numSimplified++,a.push(e[l]),a.push(e[l+1])),n.numPoints++;r&&function(t,e){for(var n=0,i=0,r=t.length,o=r-2;i<r;o=i,i+=2)n+=(t[i]-t[o])*(t[i+1]+t[o+1]);if(n>0===e)for(i=0,r=t.length;i<r/2;i+=2){var s=t[i],a=t[i+1];t[i]=t[r-2-i],t[i+1]=t[r-1-i],t[r-2-i]=s,t[r-1-i]=a}}(a,o),t.push(a)}}function mt(t,e){var n=(e=this.options=function(t,e){for(var n in e)t[n]=e[n];return t}(Object.create(this.options),e)).debug;if(n&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=function(t,e){var n=[];if("FeatureCollection"===t.type)for(var i=0;i<t.features.length;i++)q(n,t.features[i],e,i);else q(n,"Feature"===t.type?t:{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(i=function(t,e){var n=e.buffer/e.extent,i=t,r=nt(t,1,-1-n,n,0,-1,2,e),o=nt(t,1,1-n,2+n,0,-1,2,e);return(r||o)&&(i=nt(t,1,-n,1+n,0,-1,2,e)||[],r&&(i=ut(r,1).concat(i)),o&&(i=i.concat(ut(o,-1)))),i}(i,e)).length&&this.splitTile(i,0,0,0),n&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function yt(t,e,n){return 32*((1<<t)*n+e)+t}function vt(t,e){var n=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var i=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!i)return e(null,null);var r=new p(i.features),o=_(r);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:r,rawData:o.buffer})}k.prototype.load=function(t){var e=this.options,n=e.log,i=e.minZoom,r=e.maxZoom,o=e.nodeSize;n&&console.time("total time");var s="prepare "+t.length+" points";n&&console.time(s),this.points=t;for(var a=[],l=0;l<t.length;l++)t[l].geometry&&a.push(z(t[l],l));this.trees[r+1]=new O(a,H,J,o,Float32Array),n&&console.timeEnd(s);for(var c=r;c>=i;c--){var u=+Date.now();a=this._cluster(a,c),this.trees[c]=new O(a,H,J,o,Float32Array),n&&console.log("z%d: %d clusters in %dms",c,a.length,+Date.now()-u)}return n&&console.timeEnd("total time"),this},k.prototype.getClusters=function(t,e){var n=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),r=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,r=180;else if(n>r){var s=this.getClusters([n,i,180,o],e),a=this.getClusters([-180,i,r,o],e);return s.concat(a)}for(var l=this.trees[this._limitZoom(e)],c=[],u=0,h=l.range(Z(n),j(o),Z(r),j(i));u<h.length;u+=1){var d=l.points[h[u]];c.push(d.numPoints?G(d):this.points[d.index])}return c},k.prototype.getChildren=function(t){var e=this._getOriginId(t),n=this._getOriginZoom(t),i="No cluster with the specified id.",r=this.trees[n];if(!r)throw new Error(i);var o=r.points[e];if(!o)throw new Error(i);for(var s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),a=[],l=0,c=r.within(o.x,o.y,s);l<c.length;l+=1){var u=r.points[c[l]];u.parentId===t&&a.push(u.numPoints?G(u):this.points[u.index])}if(0===a.length)throw new Error(i);return a},k.prototype.getLeaves=function(t,e,n){var i=[];return this._appendLeaves(i,t,e=e||10,n=n||0,0),i},k.prototype.getTile=function(t,e,n){var i=this.trees[this._limitZoom(t)],r=Math.pow(2,t),o=this.options,s=o.radius/o.extent,a=(n-s)/r,l=(n+1+s)/r,c={features:[]};return this._addTileFeatures(i.range((e-s)/r,a,(e+1+s)/r,l),i.points,e,n,r,c),0===e&&this._addTileFeatures(i.range(1-s/r,a,1,l),i.points,r,n,r,c),e===r-1&&this._addTileFeatures(i.range(0,a,s/r,l),i.points,-1,n,r,c),c.features.length?c:null},k.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var n=this.getChildren(t);if(e++,1!==n.length)break;t=n[0].properties.cluster_id}return e},k.prototype._appendLeaves=function(t,e,n,i,r){for(var o=0,s=this.getChildren(e);o<s.length;o+=1){var a=s[o],l=a.properties;if(l&&l.cluster?r+l.point_count<=i?r+=l.point_count:r=this._appendLeaves(t,l.cluster_id,n,i,r):r<i?r++:t.push(a),t.length===n)break}return r},k.prototype._addTileFeatures=function(t,e,n,i,r,o){for(var s=0,a=t;s<a.length;s+=1){var l=e[a[s]],c=l.numPoints,u={type:1,geometry:[[Math.round(this.options.extent*(l.x*r-n)),Math.round(this.options.extent*(l.y*r-i))]],tags:c?N(l):this.points[l.index].properties},h=void 0;c?h=l.id:this.options.generateId?h=l.index:this.points[l.index].id&&(h=this.points[l.index].id),void 0!==h&&(u.id=h),o.features.push(u)}},k.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},k.prototype._cluster=function(t,e){for(var n=[],i=this.options,r=i.reduce,o=i.minPoints,s=i.radius/(i.extent*Math.pow(2,e)),a=0;a<t.length;a++){var l=t[a];if(!(l.zoom<=e)){l.zoom=e;for(var c=this.trees[e+1],u=c.within(l.x,l.y,s),h=l.numPoints||1,d=h,f=0,A=u;f<A.length;f+=1){var p=c.points[A[f]];p.zoom>e&&(d+=p.numPoints||1)}if(d>=o){for(var g=l.x*h,m=l.y*h,y=r&&h>1?this._map(l,!0):null,v=(a<<5)+(e+1)+this.points.length,_=0,b=u;_<b.length;_+=1){var x=c.points[b[_]];if(!(x.zoom<=e)){x.zoom=e;var w=x.numPoints||1;g+=x.x*w,m+=x.y*w,x.parentId=v,r&&(y||(y=this._map(l,!0)),r(y,this._map(x)))}}l.parentId=v,n.push(U(g/d,m/d,v,d,y))}else if(n.push(l),d>1)for(var C=0,B=u;C<B.length;C+=1){var E=c.points[B[C]];E.zoom<=e||(E.zoom=e,n.push(E))}}}return n},k.prototype._getOriginId=function(t){return t-this.points.length>>5},k.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},k.prototype._map=function(t,e){if(t.numPoints)return e?V({},t.properties):t.properties;var n=this.points[t.index].properties,i=this.options.map(n);return e&&i===n?V({},i):i},mt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},mt.prototype.splitTile=function(t,e,n,i,r,o,s){for(var a=[t,e,n,i],l=this.options,c=l.debug;a.length;){i=a.pop(),n=a.pop(),e=a.pop(),t=a.pop();var u=1<<e,h=yt(e,n,i),d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=At(t,e,n,i,l),this.tileCoords.push({z:e,x:n,y:i}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,i,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(d.source=t,r){if(e===l.maxZoom||e===r)continue;var A=1<<r-e;if(n!==Math.floor(o/A)||i!==Math.floor(s/A))continue}else if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue;if(d.source=null,0!==t.length){c>1&&console.time("clipping");var p,g,m,y,v,_,b=.5*l.buffer/l.extent,x=.5-b,w=.5+b,C=1+b;p=g=m=y=null,v=nt(t,u,n-b,n+w,0,d.minX,d.maxX,l),_=nt(t,u,n+x,n+C,0,d.minX,d.maxX,l),t=null,v&&(p=nt(v,u,i-b,i+w,1,d.minY,d.maxY,l),g=nt(v,u,i+x,i+C,1,d.minY,d.maxY,l),v=null),_&&(m=nt(_,u,i-b,i+w,1,d.minY,d.maxY,l),y=nt(_,u,i+x,i+C,1,d.minY,d.maxY,l),_=null),c>1&&console.timeEnd("clipping"),a.push(p||[],e+1,2*n,2*i),a.push(g||[],e+1,2*n,2*i+1),a.push(m||[],e+1,2*n+1,2*i),a.push(y||[],e+1,2*n+1,2*i+1)}}},mt.prototype.getTile=function(t,e,n){var i=this.options,r=i.extent,o=i.debug;if(t<0||t>24)return null;var s=1<<t,a=yt(t,e=(e%s+s)%s,n);if(this.tiles[a])return dt(this.tiles[a],r);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var l,c=t,u=e,h=n;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[yt(c,u,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,u,h),o>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[a]?dt(this.tiles[a],r):null):null};var _t=function(e){function n(t,n,i,r){e.call(this,t,n,i,vt),r&&(this.loadGeoJSON=r)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},n.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var n=this._pendingCallback,i=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var r=!!(i&&i.request&&i.request.collectResourceTiming)&&new t.RequestPerformance(i.request);this.loadGeoJSON(i,(function(o,s){if(o||!s)return n(o);if("object"!=typeof s)return n(new Error("Input data given to '"+i.source+"' is not a valid GeoJSON object."));!function t(e,n){var i,r=e&&e.type;if("FeatureCollection"===r)for(i=0;i<e.features.length;i++)t(e.features[i],n);else if("GeometryCollection"===r)for(i=0;i<e.geometries.length;i++)t(e.geometries[i],n);else if("Feature"===r)t(e.geometry,n);else if("Polygon"===r)h(e.coordinates,n);else if("MultiPolygon"===r)for(i=0;i<e.coordinates.length;i++)h(e.coordinates[i],n);return e}(s,!0);try{if(i.filter){var a=t.createExpression(i.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===a.result)throw new Error(a.value.map((function(t){return t.key+": "+t.message})).join(", "));var l=s.features.filter((function(t){return a.value.evaluate({zoom:0},t)}));s={type:"FeatureCollection",features:l}}e._geoJSONIndex=i.cluster?new k(function(e){var n=e.superclusterOptions,i=e.clusterProperties;if(!i||!n)return n;for(var r={},o={},s={accumulated:null,zoom:0},a={properties:null},l=Object.keys(i),c=0,u=l;c<u.length;c+=1){var h=u[c],d=i[h],f=d[0],A=t.createExpression(d[1]),p=t.createExpression("string"==typeof f?[f,["accumulated"],["get",h]]:f);r[h]=A.value,o[h]=p.value}return n.map=function(t){a.properties=t;for(var e={},n=0,i=l;n<i.length;n+=1){var o=i[n];e[o]=r[o].evaluate(s,a)}return e},n.reduce=function(t,e){a.properties=e;for(var n=0,i=l;n<i.length;n+=1){var r=i[n];s.accumulated=t[r],t[r]=o[r].evaluate(s,a)}},n}(i)).load(s.features):function(t,e){return new mt(t,e)}(s,i.geojsonVtOptions)}catch(o){return n(o)}e.loaded={};var c={};if(r){var u=r.finish();u&&(c.resourceTiming={},c.resourceTiming[i.source]=JSON.parse(JSON.stringify(u)))}n(null,c)}))}},n.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},n.prototype.reloadTile=function(t,n){var i=this.loaded;return i&&i[t.uid]?e.prototype.reloadTile.call(this,t,n):this.loadTile(t,n)},n.prototype.loadGeoJSON=function(e,n){if(e.request)t.getJSON(e.request,n);else{if("string"!=typeof e.data)return n(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return n(null,JSON.parse(e.data))}catch(t){return n(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},n.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},n.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},n.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},n.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},n}(l),bt=function(e){var n=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:_t},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(n.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');n.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return bt.prototype.setReferrer=function(t,e){this.referrer=e},bt.prototype.setImages=function(t,e,n){for(var i in this.availableImages[t]=e,this.workerSources[t]){var r=this.workerSources[t][i];for(var o in r)r[o].availableImages=e}n()},bt.prototype.setLayers=function(t,e,n){this.getLayerIndex(t).replace(e),n()},bt.prototype.updateLayers=function(t,e,n){this.getLayerIndex(t).update(e.layers,e.removedIds),n()},bt.prototype.loadTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).loadTile(e,n)},bt.prototype.loadDEMTile=function(t,e,n){this.getDEMWorkerSource(t,e.source).loadTile(e,n)},bt.prototype.reloadTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).reloadTile(e,n)},bt.prototype.abortTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).abortTile(e,n)},bt.prototype.removeTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).removeTile(e,n)},bt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},bt.prototype.removeSource=function(t,e,n){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var i=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==i.removeSource?i.removeSource(e,n):n()}},bt.prototype.loadWorkerSource=function(t,e,n){try{this.self.importScripts(e.url),n()}catch(t){n(t.toString())}},bt.prototype.syncRTLPluginState=function(e,n,i){try{t.plugin.setState(n);var r=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=r){this.self.importScripts(r);var o=t.plugin.isParsed();i(o?void 0:new Error("RTL Text Plugin failed to import scripts from "+r),o)}}catch(t){i(t.toString())}},bt.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},bt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i),e},bt.prototype.getWorkerSource=function(t,e,n){var i=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][n]||(this.workerSources[t][e][n]=new this.workerSourceTypes[e]({send:function(e,n,r){i.actor.send(e,n,r,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][n]},bt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new u),this.demWorkerSources[t][e]},bt.prototype.enforceCacheSizeLimit=function(e,n){t.enforceCacheSizeLimit(n)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new bt(self)),bt})),i(["./shared"],(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!n(t)}function n(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,n=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(n);try{e=new Worker(i),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(i),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var n=e.getImageData(0,0,1,1);return n&&n.width===t.width}()?(void 0===i[n=t&&t.failIfMajorPerformanceCaveat]&&(i[n]=function(t){var n=function(t){var n=document.createElement("canvas"),i=Object.create(e.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=t,n.probablySupportsContext?n.probablySupportsContext("webgl",i)||n.probablySupportsContext("experimental-webgl",i):n.supportsContext?n.supportsContext("webgl",i)||n.supportsContext("experimental-webgl",i):n.getContext("webgl",i)||n.getContext("experimental-webgl",i)}(t);if(!n)return!1;var i=n.createShader(n.VERTEX_SHADER);return!(!i||n.isContextLost())&&(n.shaderSource(i,"void main() {}"),n.compileShader(i),!0===n.getShaderParameter(i,n.COMPILE_STATUS))}(n)),i[n]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var n}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=n);var i={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),n={create:function(e,n,i){var r=t.window.document.createElement(e);return void 0!==n&&(r.className=n),i&&i.appendChild(r),r},createNS:function(e,n){return t.window.document.createElementNS(e,n)}},i=t.window.document&&t.window.document.documentElement.style;function r(t){if(!i)return t[0];for(var e=0;e<t.length;e++)if(t[e]in i)return t[e];return t[0]}var o,s=r(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);n.disableDrag=function(){i&&s&&(o=i[s],i[s]="none")},n.enableDrag=function(){i&&s&&(i[s]=o)};var a=r(["transform","WebkitTransform"]);n.setTransform=function(t,e){t.style[a]=e};var l=!1;try{var c=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",c,c),t.window.removeEventListener("test",c,c)}catch(t){l=!1}n.addEventListener=function(t,e,n,i){void 0===i&&(i={}),t.addEventListener(e,n,"passive"in i&&l?i:i.capture)},n.removeEventListener=function(t,e,n,i){void 0===i&&(i={}),t.removeEventListener(e,n,"passive"in i&&l?i:i.capture)};var u=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",u,!0)};function h(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}n.suppressClick=function(){t.window.addEventListener("click",u,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",u,!0)}),0)},n.mousePos=function(e,n){var i=e.getBoundingClientRect();return new t.Point(n.clientX-i.left-e.clientLeft,n.clientY-i.top-e.clientTop)},n.touchPos=function(e,n){for(var i=e.getBoundingClientRect(),r=[],o=0;o<n.length;o++)r.push(new t.Point(n[o].clientX-i.left-e.clientLeft,n[o].clientY-i.top-e.clientTop));return r},n.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},n.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var d=function(e){function n(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.isLoaded=function(){return this.loaded},n.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,n=this.requestors;e<n.length;e+=1){var i=n[e];this._notify(i.ids,i.callback)}this.requestors=[]}},n.prototype.getImage=function(t){return this.images[t]},n.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},n.prototype._validate=function(e,n){var i=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),i=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),i=!1),this._validateContent(n.content,n)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),i=!1),i},n.prototype._validateStretch=function(t,e){if(!t)return!0;for(var n=0,i=0,r=t;i<r.length;i+=1){var o=r[i];if(o[0]<n||o[1]<o[0]||e<o[1])return!1;n=o[1]}return!0},n.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},n.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},n.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},n.prototype.listImages=function(){return Object.keys(this.images)},n.prototype.getImages=function(t,e){var n=!0;if(!this.isLoaded())for(var i=0,r=t;i<r.length;i+=1)this.images[r[i]]||(n=!1);this.isLoaded()||n?this._notify(t,e):this.requestors.push({ids:t,callback:e})},n.prototype._notify=function(e,n){for(var i={},r=0,o=e;r<o.length;r+=1){var s=o[r];this.images[s]||this.fire(new t.Event("styleimagemissing",{id:s}));var a=this.images[s];a?i[s]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf,version:a.version,stretchX:a.stretchX,stretchY:a.stretchY,content:a.content,hasRenderCallback:Boolean(a.userImage&&a.userImage.render)}:t.warnOnce('Image "'+s+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}n(null,i)},n.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},n.prototype.getPattern=function(e){var n=this.patterns[e],i=this.getImage(e);if(!i)return null;if(n&&n.position.version===i.version)return n.position;if(n)n.position.version=i.version;else{var r={w:i.data.width+2,h:i.data.height+2,x:0,y:0},o=new t.ImagePosition(r,i);this.patterns[e]={bin:r,position:o}}return this._updatePatternAtlas(),this.patterns[e].position},n.prototype.bind=function(e){var n=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)},n.prototype._updatePatternAtlas=function(){var e=[];for(var n in this.patterns)e.push(this.patterns[n].bin);var i=t.potpack(e),r=i.w,o=i.h,s=this.atlasImage;for(var a in s.resize({width:r||1,height:o||1}),this.patterns){var l=this.patterns[a].bin,c=l.x+1,u=l.y+1,h=this.images[a].data,d=h.width,f=h.height;t.RGBAImage.copy(h,s,{x:0,y:0},{x:c,y:u},{width:d,height:f}),t.RGBAImage.copy(h,s,{x:0,y:f-1},{x:c,y:u-1},{width:d,height:1}),t.RGBAImage.copy(h,s,{x:0,y:0},{x:c,y:u+f},{width:d,height:1}),t.RGBAImage.copy(h,s,{x:d-1,y:0},{x:c-1,y:u},{width:1,height:f}),t.RGBAImage.copy(h,s,{x:0,y:0},{x:c+d,y:u},{width:1,height:f})}this.dirty=!0},n.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},n.prototype.dispatchRenderCallbacks=function(t){for(var e=0,n=t;e<n.length;e+=1){var i=n[e];if(!this.callbackDispatchedThisFrame[i]){this.callbackDispatchedThisFrame[i]=!0;var r=this.images[i];h(r)&&this.updateImage(i,r)}}},n}(t.Evented),f=g,A=g,p=1e20;function g(t,e,n,i,r,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=o||"normal",this.radius=n||8;var s=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=s,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.d=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Int16Array(s),this.middle=Math.round(s/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function m(t,e,n,i,r,o,s){for(var a=0;a<e;a++){for(var l=0;l<n;l++)i[l]=t[l*e+a];for(y(i,r,o,s,n),l=0;l<n;l++)t[l*e+a]=r[l]}for(l=0;l<n;l++){for(a=0;a<e;a++)i[a]=t[l*e+a];for(y(i,r,o,s,e),a=0;a<e;a++)t[l*e+a]=Math.sqrt(r[a])}}function y(t,e,n,i,r){n[0]=0,i[0]=-p,i[1]=+p;for(var o=1,s=0;o<r;o++){for(var a=(t[o]+o*o-(t[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(t[o]+o*o-(t[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);n[++s]=o,i[s]=a,i[s+1]=+p}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;e[o]=(o-n[s])*(o-n[s])+t[n[s]]}}g.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),i=0;i<this.size*this.size;i++){var r=e.data[4*i+3]/255;this.gridOuter[i]=1===r?0:0===r?p:Math.pow(Math.max(0,.5-r),2),this.gridInner[i]=1===r?p:0===r?0:Math.pow(Math.max(0,r-.5),2)}for(m(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),m(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),i=0;i<this.size*this.size;i++)n[i]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[i]-this.gridInner[i])/this.radius+this.cutoff))));return n},f.default=A;var v=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};v.prototype.setURL=function(t){this.url=t},v.prototype.getGlyphs=function(e,n){var i=this,r=[];for(var o in e)for(var s=0,a=e[o];s<a.length;s+=1)r.push({stack:o,id:a[s]});t.asyncAll(r,(function(t,e){var n=t.stack,r=t.id,o=i.entries[n];o||(o=i.entries[n]={glyphs:{},requests:{},ranges:{}});var s=o.glyphs[r];if(void 0===s){if(s=i._tinySDF(o,n,r))return o.glyphs[r]=s,void e(null,{stack:n,id:r,glyph:s});var a=Math.floor(r/256);if(256*a>65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[a])e(null,{stack:n,id:r,glyph:s});else{var l=o.requests[a];l||(l=o.requests[a]=[],v.loadGlyphRange(n,a,i.url,i.requestManager,(function(t,e){if(e){for(var n in e)i._doesCharSupportLocalGlyph(+n)||(o.glyphs[+n]=e[+n]);o.ranges[a]=!0}for(var r=0,s=l;r<s.length;r+=1)(0,s[r])(t,e);delete o.requests[a]}))),l.push((function(t,i){t?e(t):i&&e(null,{stack:n,id:r,glyph:i[r]||null})}))}}else e(null,{stack:n,id:r,glyph:s})}),(function(t,e){if(t)n(t);else if(e){for(var i={},r=0,o=e;r<o.length;r+=1){var s=o[r],a=s.stack,l=s.id,c=s.glyph;(i[a]||(i[a]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics}}n(null,i)}}))},v.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},v.prototype._tinySDF=function(e,n,i){var r=this.localIdeographFontFamily;if(r&&this._doesCharSupportLocalGlyph(i)){var o=e.tinySDF;if(!o){var s="400";/bold/i.test(n)?s="900":/medium/i.test(n)?s="500":/light/i.test(n)&&(s="200"),o=e.tinySDF=new v.TinySDF(24,3,8,.25,r,s)}return{id:i,bitmap:new t.AlphaImage({width:30,height:30},o.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},v.loadGlyphRange=function(e,n,i,r,o){var s=256*n,a=s+255,l=r.transformRequest(r.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",s+"-"+a),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,n){if(e)o(e);else if(n){for(var i={},r=0,s=t.parseGlyphPBF(n);r<s.length;r+=1){var a=s[r];i[a.id]=a}o(null,i)}}))},v.TinySDF=f;var _=function(){this.specification=t.styleSpec.light.position};_.prototype.possiblyEvaluate=function(e,n){return t.sphericalToCartesian(e.expression.evaluate(n))},_.prototype.interpolate=function(e,n,i){return{x:t.number(e.x,n.x,i),y:t.number(e.y,n.y,i),z:t.number(e.z,n.z,i)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new _,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),x=function(e){function n(n){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getLight=function(){return this._transitionable.serialize()},n.prototype.setLight=function(e,n){if(void 0===n&&(n={}),!this._validate(t.validateLight,e,n))for(var i in e){var r=e[i];t.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-11),r):this._transitionable.setValue(i,r)}},n.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},n.prototype.hasTransition=function(){return this._transitioning.hasTransition()},n.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},n.prototype._validate=function(e,n,i){return(!i||!1!==i.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},n}(t.Evented),w=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};w.prototype.getDash=function(t,e){var n=t.join(",")+String(e);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(t,e)),this.dashEntry[n]},w.prototype.getDashRanges=function(t,e,n){var i=[],r=t.length%2==1?-t[t.length-1]*n:0,o=t[0]*n,s=!0;i.push({left:r,right:o,isDash:s,zeroLength:0===t[0]});for(var a=t[0],l=1;l<t.length;l++){var c=t[l];i.push({left:r=a*n,right:o=(a+=c)*n,isDash:s=!s,zeroLength:0===c})}return i},w.prototype.addRoundDash=function(t,e,n){for(var i=e/2,r=-n;r<=n;r++)for(var o=this.width*(this.nextRow+n+r),s=0,a=t[s],l=0;l<this.width;l++){l/a.right>1&&(a=t[++s]);var c=Math.abs(l-a.left),u=Math.abs(l-a.right),h=Math.min(c,u),d=void 0,f=r/n*(i+1);if(a.isDash){var A=i-Math.abs(f);d=Math.sqrt(h*h+A*A)}else d=i-Math.sqrt(h*h+f*f);this.data[o+l]=Math.max(0,Math.min(255,d+128))}},w.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var n=t[e],i=t[e+1];n.zeroLength?t.splice(e,1):i&&i.isDash===n.isDash&&(i.left=n.left,t.splice(e,1))}var r=t[0],o=t[t.length-1];r.isDash===o.isDash&&(r.left=o.left-this.width,o.right=r.right+this.width);for(var s=this.width*this.nextRow,a=0,l=t[a],c=0;c<this.width;c++){c/l.right>1&&(l=t[++a]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),d=Math.min(u,h);this.data[s+c]=Math.max(0,Math.min(255,(l.isDash?d:-d)+128))}},w.prototype.addDash=function(e,n){var i=n?7:0,r=2*i+1;if(this.nextRow+r>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,s=0;s<e.length;s++)o+=e[s];if(0!==o){var a=this.width/o,l=this.getDashRanges(e,this.width,a);n?this.addRoundDash(l,a,i):this.addRegularDash(l)}var c={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:o};return this.nextRow+=r,this.dirty=!0,c},w.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))};var C=function e(n,i){this.workerPool=n,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var r=this.workerPool.acquire(this.id),o=0;o<r.length;o++){var s=new e.Actor(r[o],i,this.id);s.name="Worker "+o,this.actors.push(s)}};function B(e,n,i){var r=function(r,o){if(r)return i(r);if(o){var s=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);o.vector_layers&&(s.vectorLayers=o.vector_layers,s.vectorLayerIds=s.vectorLayers.map((function(t){return t.id}))),s.tiles=n.canonicalizeTileset(s,e.url),i(null,s)}};return e.url?t.getJSON(n.transformRequest(n.normalizeSourceURL(e.url),t.ResourceType.Source),r):t.browser.frame((function(){return r(null,e)}))}C.prototype.broadcast=function(e,n,i){t.asyncAll(this.actors,(function(t,i){t.send(e,n,i)}),i=i||function(){})},C.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},C.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},C.Actor=t.Actor;var E=function(e,n,i){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=n||0,this.maxzoom=i||24};E.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},E.prototype.contains=function(e){var n=Math.pow(2,e.z),i=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*n),r=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*n),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*n),s=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*n);return e.x>=i&&e.x<o&&e.y>=r&&e.y<s};var T=function(e){function n(n,i,r,o){if(e.call(this),this.id=n,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(i,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=B(this._options,this.map._requestManager,(function(n,i){e._tileJSONRequest=null,e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new E(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},n.prototype.setTiles=function(t){var e=this;return this.setSourceProperty((function(){e._options.tiles=t})),this},n.prototype.setUrl=function(t){var e=this;return this.setSourceProperty((function(){e.url=t,e._options.url=t})),this},n.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},n.prototype.serialize=function(){return t.extend({},this._options)},n.prototype.loadTile=function(e,n){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),r={request:this.map._requestManager.transformRequest(i,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function o(i,r){return delete e.request,e.aborted?n(null):i&&404!==i.status?n(i):(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),n(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}r.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=n:e.request=e.actor.send("reloadTile",r,o.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",r,o.bind(this)))},n.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},n.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},n.prototype.hasTransition=function(){return!1},n}(t.Evented),S=function(e){function n(n,i,r,o){e.call(this),this.id=n,this.dispatcher=r,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},i),t.extend(this,t.pick(i,["url","scheme","tileSize"]))}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=B(this._options,this.map._requestManager,(function(n,i){e._tileJSONRequest=null,e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new E(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},n.prototype.serialize=function(){return t.extend({},this._options)},n.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},n.prototype.loadTile=function(e,n){var i=this,r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(r,t.ResourceType.Tile),(function(r,o){if(delete e.request,e.aborted)e.state="unloaded",n(null);else if(r)e.state="errored",n(r);else if(o){i.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var s=i.map.painter.context,a=s.gl;e.texture=i.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.Texture(s,o,a.RGBA,{useMipmap:!0}),e.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),s.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,s.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,s.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(i.dispatcher),n(null)}}))},n.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},n.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},n.prototype.hasTransition=function(){return!1},n}(t.Evented),M=function(e){function n(n,i,r,o){e.call(this,n,i,r,o),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},n.prototype.loadTile=function(e,n){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function r(t,i){t&&(e.state="errored",n(t)),i&&(e.dem=i,e.needsHillshadePrepare=!0,e.state="loaded",n(null))}e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),function(i,o){if(delete e.request,e.aborted)e.state="unloaded",n(null);else if(i)e.state="errored",n(i);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var s=t.window.ImageBitmap&&o instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?o:t.browser.getImageData(o,1),a={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:s,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",a,r.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},n.prototype._getNeighboringTiles=function(e){var n=e.canonical,i=Math.pow(2,n.z),r=(n.x-1+i)%i,o=0===n.x?e.wrap-1:e.wrap,s=(n.x+1+i)%i,a=n.x+1===i?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,o,n.z,r,n.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,n.z,s,n.y).key]={backfilled:!1},n.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,o,n.z,r,n.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,n.z,s,n.y-1).key]={backfilled:!1}),n.y+1<i&&(l[new t.OverscaledTileID(e.overscaledZ,o,n.z,r,n.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,n.z,s,n.y+1).key]={backfilled:!1}),l},n.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},n}(S),I=function(e){function n(n,i,r,o){e.call(this),this.id=n,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=r.getActor(),this.setEventedParent(o),this._data=i.data,this._options=t.extend({},i),this._collectResourceTiming=i.collectResourceTiming,this._resourceTiming=[],void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;var s=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*s,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*s,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?Math.min(i.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:t.EXTENT,radius:(i.clusterRadius||50)*s,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(n){if(n)e.fire(new t.ErrorEvent(n));else{var i={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(i.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",i))}}))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setData=function(e){var n=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)n.fire(new t.ErrorEvent(e));else{var i={dataType:"source",sourceDataType:"content"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(i.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new t.Event("data",i))}})),this},n.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},n.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},n.prototype.getClusterLeaves=function(t,e,n,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:n},i),this},n.prototype._updateWorkerData=function(e){var n=this;this._loaded=!1;var i=t.extend({},this.workerOptions),r=this._data;"string"==typeof r?(i.request=this.map._requestManager.transformRequest(t.browser.resolveURL(r),t.ResourceType.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(r),this.actor.send(this.type+".loadData",i,(function(t,r){n._removed||r&&r.abandoned||(n._loaded=!0,r&&r.resourceTiming&&r.resourceTiming[n.id]&&(n._resourceTiming=r.resourceTiming[n.id].slice(0)),n.actor.send(n.type+".coalesce",{source:i.source},null),e(t))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.loadTile=function(e,n){var i=this,r=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(r,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?n(null):t?n(t):(e.loadVectorData(o,i.map.painter,"reloadTile"===r),n(null))}))},n.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},n.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},n.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},n.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},n.prototype.hasTransition=function(){return!1},n}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),D=function(e){function n(t,n,i,r){e.call(this),this.id=t,this.dispatcher=i,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=n}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(e,n){var i=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(r,o){i._loaded=!0,r?i.fire(new t.ErrorEvent(r)):o&&(i.image=o,e&&(i.coordinates=e),n&&n(),i._finishLoading())}))},n.prototype.loaded=function(){return this._loaded},n.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},n.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setCoordinates=function(e){var n=this;this.coordinates=e;var i=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var n=1/0,i=1/0,r=-1/0,o=-1/0,s=0,a=e;s<a.length;s+=1){var l=a[s];n=Math.min(n,l.x),i=Math.min(i,l.y),r=Math.max(r,l.x),o=Math.max(o,l.y)}var c=Math.max(r-n,o-i),u=Math.max(0,Math.floor(-Math.log(c)/Math.LN2)),h=Math.pow(2,u);return new t.CanonicalTileID(u,Math.floor((n+r)/2*h),Math.floor((i+o)/2*h))}(i),this.minzoom=this.maxzoom=this.tileID.z;var r=i.map((function(t){return n.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(r[0].x,r[0].y,0,0),this._boundsArray.emplaceBack(r[1].x,r[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(r[3].x,r[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(r[2].x,r[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},n.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,n=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[i];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}}},n.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},n.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return!1},n}(t.Evented),F=function(e){function n(t,n,i,r){e.call(this,t,n,i,r),this.roundZoom=!0,this.type="video",this.options=n}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){var e=this;this._loaded=!1;var n=this.options;this.urls=[];for(var i=0,r=n.urls;i<r.length;i+=1)this.urls.push(this.map._requestManager.transformRequest(r[i],t.ResourceType.Source).url);t.getVideo(this.urls,(function(n,i){e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):i&&(e.video=i,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},n.prototype.pause=function(){this.video&&this.video.pause()},n.prototype.play=function(){this.video&&this.video.play()},n.prototype.seek=function(e){if(this.video){var n=this.video.seekable;e<n.start(0)||e>n.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+n.start(0)+" and "+n.end(0)+"-second mark."))):this.video.currentTime=e}},n.prototype.getVideo=function(){return this.video},n.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},n.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,n=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[i];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this.video&&!this.video.paused},n}(D),L=function(e){function n(n,i,r,o){e.call(this,n,i,r,o),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},n.prototype.getCanvas=function(){return this.canvas},n.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},n.prototype.onRemove=function(){this.pause()},n.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var n=this.map.painter.context,i=n.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(n,this.canvas,i.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this._playing},n.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var n=e[t];if(isNaN(n)||n<=0)return!0}return!1},n}(D),O={vector:T,raster:S,"raster-dem":M,geojson:I,video:F,image:D,canvas:L};function R(e,n){var i=t.identity([]);return t.translate(i,i,[1,1,0]),t.scale(i,i,[.5*e.width,.5*e.height,1]),t.multiply(i,i,e.calculatePosMatrix(n.toUnwrapped()))}function k(t,e,n,i,r,o){var s=function(t,e,n){if(t)for(var i=0,r=t;i<r.length;i+=1){var o=e[r[i]];if(o&&o.source===n&&"fill-extrusion"===o.type)return!0}else for(var s in e){var a=e[s];if(a.source===n&&"fill-extrusion"===a.type)return!0}return!1}(r&&r.layers,e,t.id),a=o.maxPitchScaleFactor(),l=t.tilesIn(i,a,s);l.sort(U);for(var c=[],u=0,h=l;u<h.length;u+=1){var d=h[u];c.push({wrappedTileID:d.tileID.wrapped().key,queryResults:d.tile.queryRenderedFeatures(e,n,t._state,d.queryGeometry,d.cameraQueryGeometry,d.scale,r,o,a,R(t.transform,d.tileID))})}var f=function(t){for(var e={},n={},i=0,r=t;i<r.length;i+=1){var o=r[i],s=o.queryResults,a=o.wrappedTileID,l=n[a]=n[a]||{};for(var c in s)for(var u=s[c],h=l[c]=l[c]||{},d=e[c]=e[c]||[],f=0,A=u;f<A.length;f+=1){var p=A[f];h[p.featureIndex]||(h[p.featureIndex]=!0,d.push(p))}}return e}(c);for(var A in f)f[A].forEach((function(e){var n=e.feature,i=t.getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=i}));return f}function U(t,e){var n=t.tileID,i=e.tileID;return n.overscaledZ-i.overscaledZ||n.canonical.y-i.canonical.y||n.wrap-i.wrap||n.canonical.x-i.canonical.x}var z=function(t,e){this.max=t,this.onRemove=e,this.reset()};z.prototype.reset=function(){for(var t in this.data)for(var e=0,n=this.data[t];e<n.length;e+=1){var i=n[e];i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value)}return this.data={},this.order=[],this},z.prototype.add=function(t,e,n){var i=this,r=t.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);var o={value:e,timeout:void 0};if(void 0!==n&&(o.timeout=setTimeout((function(){i.remove(t,o)}),n)),this.data[r].push(o),this.order.push(r),this.order.length>this.max){var s=this._getAndRemoveByKey(this.order[0]);s&&this.onRemove(s)}return this},z.prototype.has=function(t){return t.wrapped().key in this.data},z.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},z.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},z.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},z.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},z.prototype.remove=function(t,e){if(!this.has(t))return this;var n=t.wrapped().key,i=void 0===e?0:this.data[n].indexOf(e),r=this.data[n][i];return this.data[n].splice(i,1),r.timeout&&clearTimeout(r.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(r.value),this.order.splice(this.order.indexOf(n),1),this},z.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},z.prototype.filter=function(t){var e=[];for(var n in this.data)for(var i=0,r=this.data[n];i<r.length;i+=1){var o=r[i];t(o.value)||e.push(o)}for(var s=0,a=e;s<a.length;s+=1){var l=a[s];this.remove(l.value.tileID,l)}};var G=function(t,e,n){this.context=t;var i=t.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(n),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};G.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},G.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},G.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var N={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Z=function(t,e,n,i){this.length=e.length,this.attributes=n,this.itemSize=e.bytesPerElement,this.dynamicDraw=i,this.context=t;var r=t.gl;this.buffer=r.createBuffer(),t.bindVertexBuffer.set(this.buffer),r.bufferData(r.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};Z.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Z.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},Z.prototype.enableAttributes=function(t,e){for(var n=0;n<this.attributes.length;n++){var i=e.attributes[this.attributes[n].name];void 0!==i&&t.enableVertexAttribArray(i)}},Z.prototype.setVertexAttribPointers=function(t,e,n){for(var i=0;i<this.attributes.length;i++){var r=this.attributes[i],o=e.attributes[r.name];void 0!==o&&t.vertexAttribPointer(o,r.components,t[N[r.type]],!1,this.itemSize,r.offset+this.itemSize*(n||0))}},Z.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var j=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};j.prototype.get=function(){return this.current},j.prototype.set=function(t){},j.prototype.getDefault=function(){return this.default},j.prototype.setDefault=function(){this.set(this.default)};var V=function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getDefault=function(){return t.Color.transparent},n.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},n}(j),H=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(j),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(j),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(j),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(j),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(j),q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(j),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(j),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(j),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(j),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(j),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(j),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(j),it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(j),rt=function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getDefault=function(){return t.Color.transparent},n.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},n}(j),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(j),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(j),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(j),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(j),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(j),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(j),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(j),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(j),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(j),At=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(j),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(j),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(j),mt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(j),yt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(j),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(j),_t=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(j),bt=function(t){function e(e,n){t.call(this,e),this.context=e,this.parent=n}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(j),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(bt),wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(bt),Ct=function(t,e,n,i){this.context=t,this.width=e,this.height=n;var r=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new xt(t,r),i&&(this.depthAttachment=new wt(t,r))};Ct.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var n=this.depthAttachment.get();n&&t.deleteRenderbuffer(n)}t.deleteFramebuffer(this.framebuffer)};var Bt=function(t,e,n){this.func=t,this.mask=e,this.range=n};Bt.ReadOnly=!1,Bt.ReadWrite=!0,Bt.disabled=new Bt(519,Bt.ReadOnly,[0,1]);var Et=function(t,e,n,i,r,o){this.test=t,this.ref=e,this.mask=n,this.fail=i,this.depthFail=r,this.pass=o};Et.disabled=new Et({func:519,mask:0},0,0,7680,7680,7680);var Tt=function(t,e,n){this.blendFunction=t,this.blendColor=e,this.mask=n};Tt.disabled=new Tt(Tt.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Tt.unblended=new Tt(Tt.Replace,t.Color.transparent,[!0,!0,!0,!0]),Tt.alphaBlended=new Tt([1,771],t.Color.transparent,[!0,!0,!0,!0]);var St=function(t,e,n){this.enable=t,this.mode=e,this.frontFace=n};St.disabled=new St(!1,1029,2305),St.backCCW=new St(!0,1029,2305);var Mt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new V(this),this.clearDepth=new H(this),this.clearStencil=new J(this),this.colorMask=new W(this),this.depthMask=new Q(this),this.stencilMask=new K(this),this.stencilFunc=new q(this),this.stencilOp=new X(this),this.stencilTest=new Y(this),this.depthRange=new $(this),this.depthTest=new tt(this),this.depthFunc=new et(this),this.blend=new nt(this),this.blendFunc=new it(this),this.blendColor=new rt(this),this.blendEquation=new ot(this),this.cullFace=new st(this),this.cullFaceSide=new at(this),this.frontFace=new lt(this),this.program=new ct(this),this.activeTexture=new ut(this),this.viewport=new ht(this),this.bindFramebuffer=new dt(this),this.bindRenderbuffer=new ft(this),this.bindTexture=new At(this),this.bindVertexBuffer=new pt(this),this.bindElementBuffer=new gt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new mt(this),this.pixelStoreUnpack=new yt(this),this.pixelStoreUnpackPremultiplyAlpha=new vt(this),this.pixelStoreUnpackFlipY=new _t(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)};Mt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Mt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Mt.prototype.createIndexBuffer=function(t,e){return new G(this,t,e)},Mt.prototype.createVertexBuffer=function(t,e,n){return new Z(this,t,e,n)},Mt.prototype.createRenderbuffer=function(t,e,n){var i=this.gl,r=i.createRenderbuffer();return this.bindRenderbuffer.set(r),i.renderbufferStorage(i.RENDERBUFFER,t,e,n),this.bindRenderbuffer.set(null),r},Mt.prototype.createFramebuffer=function(t,e,n){return new Ct(this,t,e,n)},Mt.prototype.clear=function(t){var e=t.color,n=t.depth,i=this.gl,r=0;e&&(r|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==n&&(r|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),i.clear(r)},Mt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Mt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Mt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Mt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Tt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Mt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var It=function(e){function n(n,i,r){var o=this;e.call(this),this.id=n,this.dispatcher=r,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(o._sourceLoaded=!0),o._sourceLoaded&&!o._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(o.reload(),o.transform&&o.update(o.transform))})),this.on("error",(function(){o._sourceErrored=!0})),this._source=function(e,n,i,r){var o=new O[n.type](e,n,i,r);if(o.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+o.id);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o}(n,i,r,this),this._tiles={},this._cache=new z(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},n.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},n.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},n.prototype.getSource=function(){return this._source},n.prototype.pause=function(){this._paused=!0},n.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},n.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},n.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},n.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},n.prototype.serialize=function(){return this._source.serialize()},n.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var n=this._tiles[e];n.upload(t),n.prepare(this.map.style.imageManager)}},n.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(Pt).map((function(t){return t.key}))},n.prototype.getRenderableIds=function(e){var n=this,i=[];for(var r in this._tiles)this._isIdRenderable(r,e)&&i.push(this._tiles[r]);return e?i.sort((function(e,i){var r=e.tileID,o=i.tileID,s=new t.Point(r.canonical.x,r.canonical.y)._rotate(n.transform.angle),a=new t.Point(o.canonical.x,o.canonical.y)._rotate(n.transform.angle);return r.overscaledZ-o.overscaledZ||a.y-s.y||a.x-s.x})).map((function(t){return t.tileID.key})):i.map((function(t){return t.tileID})).sort(Pt).map((function(t){return t.key}))},n.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},n.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},n.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},n.prototype._reloadTile=function(t,e){var n=this._tiles[t];n&&("loading"!==n.state&&(n.state=e),this._loadTile(n,this._tileLoaded.bind(this,n,t,e)))},n.prototype._tileLoaded=function(e,n,i,r){if(r)return e.state="errored",void(404!==r.status?this._source.fire(new t.ErrorEvent(r,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===i&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(n,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},n.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),n=0;n<e.length;n++){var i=e[n];if(t.neighboringTiles&&t.neighboringTiles[i]){var r=this.getTileByID(i);o(t,r),o(r,t)}}function o(t,e){t.needsHillshadePrepare=!0;var n=e.tileID.canonical.x-t.tileID.canonical.x,i=e.tileID.canonical.y-t.tileID.canonical.y,r=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===n&&0===i||Math.abs(i)>1||(Math.abs(n)>1&&(1===Math.abs(n+r)?n+=r:1===Math.abs(n-r)&&(n-=r)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,n,i),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},n.prototype.getTile=function(t){return this.getTileByID(t.key)},n.prototype.getTileByID=function(t){return this._tiles[t]},n.prototype._retainLoadedChildren=function(t,e,n,i){for(var r in this._tiles){var o=this._tiles[r];if(!(i[r]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>n)){for(var s=o.tileID;o&&o.tileID.overscaledZ>e+1;){var a=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[a.key])&&o.hasData()&&(s=a)}for(var l=s;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){i[s.key]=s;break}}}},n.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var n=this._loadedParentTiles[t.key];return n&&n.tileID.overscaledZ>=e?n:null}for(var i=t.overscaledZ-1;i>=e;i--){var r=t.scaledTo(i),o=this._getLoadedTile(r);if(o)return o}},n.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},n.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,i=Math.floor(e*n*5),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(r)},n.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var n={};for(var i in this._tiles){var r=this._tiles[i];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),n[r.tileID.key]=r}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles)this._setTileReloadTimer(s,this._tiles[s])}},n.prototype.update=function(e){var i=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var r;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?r=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(r=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(r=r.filter((function(t){return i._source.hasTile(t)})))):r=[];var o=e.coveringZoomLevel(this._source),s=Math.max(o-n.maxOverzooming,this._source.minzoom),a=Math.max(o+n.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(r,o);if(Dt(this._source.type)){for(var c={},u={},h=0,d=Object.keys(l);h<d.length;h+=1){var f=d[h],A=l[f],p=this._tiles[f];if(p&&!(p.fadeEndTime&&p.fadeEndTime<=t.browser.now())){var g=this.findLoadedParent(A,s);g&&(this._addTile(g.tileID),c[g.tileID.key]=g.tileID),u[f]=A}}for(var m in this._retainLoadedChildren(u,o,a,l),c)l[m]||(this._coveredTiles[m]=!0,l[m]=c[m])}for(var y in l)this._tiles[y].clearFadeHold();for(var v=0,_=t.keysDifference(this._tiles,l);v<_.length;v+=1){var b=_[v],x=this._tiles[b];x.hasSymbolBuckets&&!x.holdingForFade()?x.setHoldDuration(this.map._fadeDuration):x.hasSymbolBuckets&&!x.symbolFadeFinished()||this._removeTile(b)}this._updateLoadedParentTileCache()}},n.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},n.prototype._updateRetainedTiles=function(t,e){for(var i={},r={},o=Math.max(e-n.maxOverzooming,this._source.minzoom),s=Math.max(e+n.maxUnderzooming,this._source.minzoom),a={},l=0,c=t;l<c.length;l+=1){var u=c[l],h=this._addTile(u);i[u.key]=u,h.hasData()||e<this._source.maxzoom&&(a[u.key]=u)}this._retainLoadedChildren(a,e,s,i);for(var d=0,f=t;d<f.length;d+=1){var A=f[d],p=this._tiles[A.key];if(!p.hasData()){if(e+1>this._source.maxzoom){var g=A.children(this._source.maxzoom)[0],m=this.getTile(g);if(m&&m.hasData()){i[g.key]=g;continue}}else{var y=A.children(this._source.maxzoom);if(i[y[0].key]&&i[y[1].key]&&i[y[2].key]&&i[y[3].key])continue}for(var v=p.wasRequested(),_=A.overscaledZ-1;_>=o;--_){var b=A.scaledTo(_);if(r[b.key])break;if(r[b.key]=!0,!(p=this.getTile(b))&&v&&(p=this._addTile(b)),p&&(i[b.key]=b,v=p.wasRequested(),p.hasData()))break}}}return i},n.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],n=void 0,i=this._tiles[t].tileID;i.overscaledZ>0;){if(i.key in this._loadedParentTiles){n=this._loadedParentTiles[i.key];break}e.push(i.key);var r=i.scaledTo(i.overscaledZ-1);if(n=this._getLoadedTile(r))break;i=r}for(var o=0,s=e;o<s.length;o+=1)this._loadedParentTiles[s[o]]=n}},n.prototype._addTile=function(e){var n=this._tiles[e.key];if(n)return n;(n=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,n),n.tileID=e,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,n)));var i=Boolean(n);return i||(n=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,e.key,n.state))),n?(n.uses++,this._tiles[e.key]=n,i||this._source.fire(new t.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n):null},n.prototype._setTileReloadTimer=function(t,e){var n=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((function(){n._reloadTile(t,"expired"),delete n._timers[t]}),i))},n.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},n.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},n.prototype.tilesIn=function(e,n,i){var r=this,o=[],s=this.transform;if(!s)return o;for(var a=i?s.getCameraQueryGeometry(e):e,l=e.map((function(t){return s.pointCoordinate(t)})),c=a.map((function(t){return s.pointCoordinate(t)})),u=this.getIds(),h=1/0,d=1/0,f=-1/0,A=-1/0,p=0,g=c;p<g.length;p+=1){var m=g[p];h=Math.min(h,m.x),d=Math.min(d,m.y),f=Math.max(f,m.x),A=Math.max(A,m.y)}for(var y=function(e){var i=r._tiles[u[e]];if(!i.holdingForFade()){var a=i.tileID,p=Math.pow(2,s.zoom-i.tileID.overscaledZ),g=n*i.queryPadding*t.EXTENT/i.tileSize/p,m=[a.getTilePoint(new t.MercatorCoordinate(h,d)),a.getTilePoint(new t.MercatorCoordinate(f,A))];if(m[0].x-g<t.EXTENT&&m[0].y-g<t.EXTENT&&m[1].x+g>=0&&m[1].y+g>=0){var y=l.map((function(t){return a.getTilePoint(t)})),v=c.map((function(t){return a.getTilePoint(t)}));o.push({tile:i,tileID:a,queryGeometry:y,cameraQueryGeometry:v,scale:p})}}},v=0;v<u.length;v++)y(v);return o},n.prototype.getVisibleCoordinates=function(t){for(var e=this,n=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),i=0,r=n;i<r.length;i+=1){var o=r[i];o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped())}return n},n.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Dt(this._source.type))for(var e in this._tiles){var n=this._tiles[e];if(void 0!==n.fadeEndTime&&n.fadeEndTime>=t.browser.now())return!0}return!1},n.prototype.setFeatureState=function(t,e,n){this._state.updateState(t=t||"_geojsonTileLayer",e,n)},n.prototype.removeFeatureState=function(t,e,n){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,n)},n.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},n.prototype.setDependencies=function(t,e,n){var i=this._tiles[t];i&&i.setDependencies(e,n)},n.prototype.reloadTilesForDependencies=function(t,e){for(var n in this._tiles)this._tiles[n].hasDependency(t,e)&&this._reloadTile(n,"reloading");this._cache.filter((function(n){return!n.hasDependency(t,e)}))},n}(t.Evented);function Pt(t,e){var n=Math.abs(2*t.wrap)-+(t.wrap<0),i=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||i-n||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Dt(t){return"raster"===t||"image"===t||"video"===t}function Ft(){return new t.window.Worker(Kr.workerUrl)}It.maxOverzooming=10,It.maxUnderzooming=3;var Lt="mapboxgl_preloaded_worker_pool",Ot=function(){this.active={}};Ot.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Ot.workerCount;)this.workers.push(new Ft);return this.active[t]=!0,this.workers.slice()},Ot.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Ot.prototype.isPreloaded=function(){return!!this.active[Lt]},Ot.prototype.numActive=function(){return Object.keys(this.active).length};var Rt,kt=Math.floor(t.browser.hardwareConcurrency/2);function Ut(){return Rt||(Rt=new Ot),Rt}function zt(e,n){var i={};for(var r in e)"ref"!==r&&(i[r]=e[r]);return t.refProperties.forEach((function(t){t in n&&(i[t]=n[t])})),i}function Gt(t){t=t.slice();for(var e=Object.create(null),n=0;n<t.length;n++)e[t[n].id]=t[n];for(var i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=zt(t[i],e[t[i].ref]));return t}Ot.workerCount=Math.max(Math.min(kt,6),1);var Nt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Zt(t,e,n){n.push({command:Nt.addSource,args:[t,e[t]]})}function jt(t,e,n){e.push({command:Nt.removeSource,args:[t]}),n[t]=!0}function Vt(t,e,n,i){jt(t,n,i),Zt(t,e,n)}function Ht(e,n,i){var r;for(r in e[i])if(e[i].hasOwnProperty(r)&&"data"!==r&&!t.deepEqual(e[i][r],n[i][r]))return!1;for(r in n[i])if(n[i].hasOwnProperty(r)&&"data"!==r&&!t.deepEqual(e[i][r],n[i][r]))return!1;return!0}function Jt(e,n,i,r,o,s){var a;for(a in n=n||{},e=e||{})e.hasOwnProperty(a)&&(t.deepEqual(e[a],n[a])||i.push({command:s,args:[r,a,n[a],o]}));for(a in n)n.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&(t.deepEqual(e[a],n[a])||i.push({command:s,args:[r,a,n[a],o]}))}function Wt(t){return t.id}function Qt(t,e){return t[e.id]=e,t}var Kt=function(t,e){this.reset(t,e)};Kt.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Kt.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var n=1,i=this._distances[n],r=e*this.paddedLength+this.padding;i<r&&n<this._distances.length;)i=this._distances[++n];var o=n-1,s=this._distances[o],a=i-s,l=a>0?(r-s)/a:0;return this.points[o].mult(1-l).add(this.points[n].mult(l))};var qt=function(t,e,n){var i=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(t/n),this.yCellCount=Math.ceil(e/n);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.push([]),r.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Xt(e,n,i,r,o){var s=t.create();return n?(t.scale(s,s,[1/o,1/o,1]),i||t.rotateZ(s,s,r.angle)):t.multiply(s,r.labelPlaneMatrix,e),s}function Yt(e,n,i,r,o){if(n){var s=t.clone(e);return t.scale(s,s,[o,o,1]),i||t.rotateZ(s,s,-r.angle),s}return r.glCoordMatrix}function $t(e,n){var i=[e.x,e.y,0,1];ue(i,i,n);var r=i[3];return{point:new t.Point(i[0]/r,i[1]/r),signedDistanceFromCamera:r}}function te(t,e){return.5+t/e*.5}function ee(t,e){var n=t[0]/t[3],i=t[1]/t[3];return n>=-e[0]&&n<=e[0]&&i>=-e[1]&&i<=e[1]}function ne(e,n,i,r,o,s,a,l){var c=r?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,i.transform.zoom),h=[256/i.width*2+1,256/i.height*2+1],d=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;d.clear();for(var f=e.lineVertexArray,A=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,p=i.transform.width/i.transform.height,g=!1,m=0;m<A.length;m++){var y=A.get(m);if(y.hidden||y.writingMode===t.WritingMode.vertical&&!g)ce(y.numGlyphs,d);else{g=!1;var v=[y.anchorX,y.anchorY,0,1];if(t.transformMat4(v,v,n),ee(v,h)){var _=te(i.transform.cameraToCenterDistance,v[3]),b=t.evaluateSizeForFeature(c,u,y),x=a?b/_:b*_,w=new t.Point(y.anchorX,y.anchorY),C=$t(w,o).point,B={},E=oe(y,x,!1,l,n,o,s,e.glyphOffsetArray,f,d,C,w,B,p);g=E.useVertical,(E.notEnoughRoom||g||E.needsFlipping&&oe(y,x,!0,l,n,o,s,e.glyphOffsetArray,f,d,C,w,B,p).notEnoughRoom)&&ce(y.numGlyphs,d)}else ce(y.numGlyphs,d)}}r?e.text.dynamicLayoutVertexBuffer.updateData(d):e.icon.dynamicLayoutVertexBuffer.updateData(d)}function ie(t,e,n,i,r,o,s,a,l,c,u){var h=a.glyphStartIndex+a.numGlyphs,d=a.lineStartIndex,f=a.lineStartIndex+a.lineLength,A=e.getoffsetX(a.glyphStartIndex),p=e.getoffsetX(h-1),g=ae(t*A,n,i,r,o,s,a.segment,d,f,l,c,u);if(!g)return null;var m=ae(t*p,n,i,r,o,s,a.segment,d,f,l,c,u);return m?{first:g,last:m}:null}function re(e,n,i,r){return e===t.WritingMode.horizontal&&Math.abs(i.y-n.y)>Math.abs(i.x-n.x)*r?{useVertical:!0}:(e===t.WritingMode.vertical?n.y<i.y:n.x>i.x)?{needsFlipping:!0}:null}function oe(e,n,i,r,o,s,a,l,c,u,h,d,f,A){var p,g=n/24,m=e.lineOffsetX*g,y=e.lineOffsetY*g;if(e.numGlyphs>1){var v=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,x=ie(g,l,m,y,i,h,d,e,c,s,f);if(!x)return{notEnoughRoom:!0};var w=$t(x.first.point,a).point,C=$t(x.last.point,a).point;if(r&&!i){var B=re(e.writingMode,w,C,A);if(B)return B}p=[x.first];for(var E=e.glyphStartIndex+1;E<v-1;E++)p.push(ae(g*l.getoffsetX(E),m,y,i,h,d,e.segment,_,b,c,s,f));p.push(x.last)}else{if(r&&!i){var T=$t(d,o).point,S=e.lineStartIndex+e.segment+1,M=new t.Point(c.getx(S),c.gety(S)),I=$t(M,o),P=I.signedDistanceFromCamera>0?I.point:se(d,M,T,1,o),D=re(e.writingMode,T,P,A);if(D)return D}var F=ae(g*l.getoffsetX(e.glyphStartIndex),m,y,i,h,d,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,s,f);if(!F)return{notEnoughRoom:!0};p=[F]}for(var L=0,O=p;L<O.length;L+=1){var R=O[L];t.addDynamicAttributes(u,R.point,R.angle)}return{}}function se(t,e,n,i,r){var o=$t(t.add(t.sub(e)._unit()),r).point,s=n.sub(o);return n.add(s._mult(i/s.mag()))}function ae(e,n,i,r,o,s,a,l,c,u,h,d){var f=r?e-n:e+n,A=f>0?1:-1,p=0;r&&(A*=-1,p=Math.PI),A<0&&(p+=Math.PI);for(var g=A>0?l+a:l+a+1,m=o,y=o,v=0,_=0,b=Math.abs(f),x=[];v+_<=b;){if((g+=A)<l||g>=c)return null;if(y=m,x.push(m),void 0===(m=d[g])){var w=new t.Point(u.getx(g),u.gety(g)),C=$t(w,h);if(C.signedDistanceFromCamera>0)m=d[g]=C.point;else{var B=g-A;m=se(0===v?s:new t.Point(u.getx(B),u.gety(B)),w,y,b-v+1,h)}}v+=_,_=y.dist(m)}var E=(b-v)/_,T=m.sub(y),S=T.mult(E)._add(y);S._add(T._unit()._perp()._mult(i*A));var M=p+Math.atan2(m.y-y.y,m.x-y.x);return x.push(S),{point:S,angle:M,path:x}}qt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},qt.prototype.insert=function(t,e,n,i,r){this._forEachCell(e,n,i,r,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(r)},qt.prototype.insertCircle=function(t,e,n,i){this._forEachCell(e-i,n-i,e+i,n+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(n),this.circles.push(i)},qt.prototype._insertBoxCell=function(t,e,n,i,r,o){this.boxCells[r].push(o)},qt.prototype._insertCircleCell=function(t,e,n,i,r,o){this.circleCells[r].push(o)},qt.prototype._query=function(t,e,n,i,r,o){if(n<0||t>this.width||i<0||e>this.height)return!r&&[];var s=[];if(t<=0&&e<=0&&this.width<=n&&this.height<=i){if(r)return!0;for(var a=0;a<this.boxKeys.length;a++)s.push({key:this.boxKeys[a],x1:this.bboxes[4*a],y1:this.bboxes[4*a+1],x2:this.bboxes[4*a+2],y2:this.bboxes[4*a+3]});for(var l=0;l<this.circleKeys.length;l++){var c=this.circles[3*l],u=this.circles[3*l+1],h=this.circles[3*l+2];s.push({key:this.circleKeys[l],x1:c-h,y1:u-h,x2:c+h,y2:u+h})}return o?s.filter(o):s}return this._forEachCell(t,e,n,i,this._queryCell,s,{hitTest:r,seenUids:{box:{},circle:{}}},o),r?s.length>0:s},qt.prototype._queryCircle=function(t,e,n,i,r){var o=t-n,s=t+n,a=e-n,l=e+n;if(s<0||o>this.width||l<0||a>this.height)return!i&&[];var c=[];return this._forEachCell(o,a,s,l,this._queryCellCircle,c,{hitTest:i,circle:{x:t,y:e,radius:n},seenUids:{box:{},circle:{}}},r),i?c.length>0:c},qt.prototype.query=function(t,e,n,i,r){return this._query(t,e,n,i,!1,r)},qt.prototype.hitTest=function(t,e,n,i,r){return this._query(t,e,n,i,!0,r)},qt.prototype.hitTestCircle=function(t,e,n,i){return this._queryCircle(t,e,n,!0,i)},qt.prototype._queryCell=function(t,e,n,i,r,o,s,a){var l=s.seenUids,c=this.boxCells[r];if(null!==c)for(var u=this.bboxes,h=0,d=c;h<d.length;h+=1){var f=d[h];if(!l.box[f]){l.box[f]=!0;var A=4*f;if(t<=u[A+2]&&e<=u[A+3]&&n>=u[A+0]&&i>=u[A+1]&&(!a||a(this.boxKeys[f]))){if(s.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:u[A],y1:u[A+1],x2:u[A+2],y2:u[A+3]})}}}var p=this.circleCells[r];if(null!==p)for(var g=this.circles,m=0,y=p;m<y.length;m+=1){var v=y[m];if(!l.circle[v]){l.circle[v]=!0;var _=3*v;if(this._circleAndRectCollide(g[_],g[_+1],g[_+2],t,e,n,i)&&(!a||a(this.circleKeys[v]))){if(s.hitTest)return o.push(!0),!0;var b=g[_],x=g[_+1],w=g[_+2];o.push({key:this.circleKeys[v],x1:b-w,y1:x-w,x2:b+w,y2:x+w})}}}},qt.prototype._queryCellCircle=function(t,e,n,i,r,o,s,a){var l=s.circle,c=s.seenUids,u=this.boxCells[r];if(null!==u)for(var h=this.bboxes,d=0,f=u;d<f.length;d+=1){var A=f[d];if(!c.box[A]){c.box[A]=!0;var p=4*A;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[p+0],h[p+1],h[p+2],h[p+3])&&(!a||a(this.boxKeys[A])))return o.push(!0),!0}}var g=this.circleCells[r];if(null!==g)for(var m=this.circles,y=0,v=g;y<v.length;y+=1){var _=v[y];if(!c.circle[_]){c.circle[_]=!0;var b=3*_;if(this._circlesCollide(m[b],m[b+1],m[b+2],l.x,l.y,l.radius)&&(!a||a(this.circleKeys[_])))return o.push(!0),!0}}},qt.prototype._forEachCell=function(t,e,n,i,r,o,s,a){for(var l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(n),h=this._convertToYCellCoord(i),d=l;d<=u;d++)for(var f=c;f<=h;f++)if(r.call(this,t,e,n,i,this.xCellCount*f+d,o,s,a))return},qt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},qt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},qt.prototype._circlesCollide=function(t,e,n,i,r,o){var s=i-t,a=r-e,l=n+o;return l*l>s*s+a*a},qt.prototype._circleAndRectCollide=function(t,e,n,i,r,o,s){var a=(o-i)/2,l=Math.abs(t-(i+a));if(l>a+n)return!1;var c=(s-r)/2,u=Math.abs(e-(r+c));if(u>c+n)return!1;if(l<=a||u<=c)return!0;var h=l-a,d=u-c;return h*h+d*d<=n*n};var le=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ce(t,e){for(var n=0;n<t;n++){var i=e.length;e.resize(i+4),e.float32.set(le,3*i)}}function ue(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t[3]=n[3]*i+n[7]*r+n[15],t}var he=function(t,e,n){void 0===e&&(e=new qt(t.width+200,t.height+200,25)),void 0===n&&(n=new qt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=n,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function de(e,n,i){return n*(t.EXTENT/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ)))}he.prototype.placeCollisionBox=function(t,e,n,i,r){var o=this.projectAndGetPerspectiveRatio(i,t.anchorPointX,t.anchorPointY),s=n*o.perspectiveRatio,a=t.x1*s+o.point.x,l=t.y1*s+o.point.y,c=t.x2*s+o.point.x,u=t.y2*s+o.point.y;return!this.isInsideGrid(a,l,c,u)||!e&&this.grid.hitTest(a,l,c,u,r)?{box:[],offscreen:!1}:{box:[a,l,c,u],offscreen:this.isOffscreen(a,l,c,u)}},he.prototype.placeCollisionCircles=function(e,n,i,r,o,s,a,l,c,u,h,d,f){var A=[],p=new t.Point(n.anchorX,n.anchorY),g=$t(p,s),m=te(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),y=(u?o/m:o*m)/t.ONE_EM,v=$t(p,a).point,_=ie(y,r,n.lineOffsetX*y,n.lineOffsetY*y,!1,v,p,n,i,a,{}),b=!1,x=!1,w=!0;if(_){for(var C=.5*d*m+f,B=new t.Point(-100,-100),E=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),T=new Kt,S=_.first,M=_.last,I=[],P=S.path.length-1;P>=1;P--)I.push(S.path[P]);for(var D=1;D<M.path.length;D++)I.push(M.path[D]);var F=2.5*C;if(l){var L=I.map((function(t){return $t(t,l)}));I=L.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:L.map((function(t){return t.point}))}var O=[];if(I.length>0){for(var R=I[0].clone(),k=I[0].clone(),U=1;U<I.length;U++)R.x=Math.min(R.x,I[U].x),R.y=Math.min(R.y,I[U].y),k.x=Math.max(k.x,I[U].x),k.y=Math.max(k.y,I[U].y);O=R.x>=B.x&&k.x<=E.x&&R.y>=B.y&&k.y<=E.y?[I]:k.x<B.x||R.x>E.x||k.y<B.y||R.y>E.y?[]:t.clipLine([I],B.x,B.y,E.x,E.y)}for(var z=0,G=O;z<G.length;z+=1){var N;T.reset(G[z],.25*C),N=T.length<=.5*C?1:Math.ceil(T.paddedLength/F)+1;for(var Z=0;Z<N;Z++){var j=Z/Math.max(N-1,1),V=T.lerp(j),H=V.x+100,J=V.y+100;A.push(H,J,C,0);var W=H-C,Q=J-C,K=H+C,q=J+C;if(w=w&&this.isOffscreen(W,Q,K,q),x=x||this.isInsideGrid(W,Q,K,q),!e&&this.grid.hitTestCircle(H,J,C,h)&&(b=!0,!c))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!c&&b||!x?[]:A,offscreen:w,collisionDetected:b}},he.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var n=[],i=1/0,r=1/0,o=-1/0,s=-1/0,a=0,l=e;a<l.length;a+=1){var c=l[a],u=new t.Point(c.x+100,c.y+100);i=Math.min(i,u.x),r=Math.min(r,u.y),o=Math.max(o,u.x),s=Math.max(s,u.y),n.push(u)}for(var h={},d={},f=0,A=this.grid.query(i,r,o,s).concat(this.ignoredGrid.query(i,r,o,s));f<A.length;f+=1){var p=A[f],g=p.key;if(void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]={}),!h[g.bucketInstanceId][g.featureIndex]){var m=[new t.Point(p.x1,p.y1),new t.Point(p.x2,p.y1),new t.Point(p.x2,p.y2),new t.Point(p.x1,p.y2)];t.polygonIntersectsPolygon(n,m)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===d[g.bucketInstanceId]&&(d[g.bucketInstanceId]=[]),d[g.bucketInstanceId].push(g.featureIndex))}}return d},he.prototype.insertCollisionBox=function(t,e,n,i,r){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:r},t[0],t[1],t[2],t[3])},he.prototype.insertCollisionCircles=function(t,e,n,i,r){for(var o=e?this.ignoredGrid:this.grid,s={bucketInstanceId:n,featureIndex:i,collisionGroupID:r},a=0;a<t.length;a+=4)o.insertCircle(s,t[a],t[a+1],t[a+2])},he.prototype.projectAndGetPerspectiveRatio=function(e,n,i){var r=[n,i,0,1];return ue(r,r,e),{point:new t.Point((r[0]/r[3]+1)/2*this.transform.width+100,(-r[1]/r[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5}},he.prototype.isOffscreen=function(t,e,n,i){return n<100||t>=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,n,i){return n>=0&&t<this.gridRightBoundary&&i>=0&&e<this.gridBottomBoundary},he.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e};var fe=function(t,e,n,i){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):i&&n?1:0,this.placed=n};fe.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var Ae=function(t,e,n,i,r){this.text=new fe(t?t.text:null,e,n,r),this.icon=new fe(t?t.icon:null,e,i,r)};Ae.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var pe=function(t,e,n){this.text=t,this.icon=e,this.skipFade=n},ge=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},me=function(t,e,n,i,r){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=n,this.bucketIndex=i,this.tileID=r},ye=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function ve(e,n,i,r,o){var s=t.getAnchorAlignment(e),a=-(s.horizontalAlign-.5)*n,l=-(s.verticalAlign-.5)*i,c=t.evaluateVariableOffset(e,r);return new t.Point(a+c[0]*o,l+c[1]*o)}function _e(e,n,i,r,o,s){var a=e.x1,l=e.x2,c=e.y1,u=e.y2,h=e.anchorPointX,d=e.anchorPointY,f=new t.Point(n,i);return r&&f._rotate(o?s:-s),{x1:a+f.x,y1:c+f.y,x2:l+f.x,y2:u+f.y,anchorPointX:h,anchorPointY:d}}ye.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var be=function(t,e,n,i){this.transform=t.clone(),this.collisionIndex=new he(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new ye(n),this.collisionCircleArrays={},this.prevPlacement=i,i&&(i.prevPlacement=void 0),this.placedOrientations={}};function xe(t,e,n,i,r){t.emplaceBack(e?1:0,n?1:0,i||0,r||0),t.emplaceBack(e?1:0,n?1:0,i||0,r||0),t.emplaceBack(e?1:0,n?1:0,i||0,r||0),t.emplaceBack(e?1:0,n?1:0,i||0,r||0)}be.prototype.getBucketParts=function(e,n,i,r){var o=i.getBucket(n),s=i.latestFeatureIndex;if(o&&s&&n.id===o.layerIds[0]){var a=i.collisionBoxArray,l=o.layers[0].layout,c=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),u=i.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(i.tileID.toUnwrapped()),d="map"===l.get("text-pitch-alignment"),f="map"===l.get("text-rotation-alignment"),A=de(i,1,this.transform.zoom),p=Xt(h,d,f,this.transform,A),g=null;if(d){var m=Yt(h,d,f,this.transform,A);g=t.multiply([],this.transform.labelPlaneMatrix,m)}this.retainedQueryData[o.bucketInstanceId]=new me(o.bucketInstanceId,s,o.sourceLayerIndex,o.index,i.tileID);var y={bucket:o,layout:l,posMatrix:h,textLabelPlaneMatrix:p,labelToScreenMatrix:g,scale:c,textPixelRatio:u,holdingForFade:i.holdingForFade(),collisionBoxArray:a,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(r)for(var v=0,_=o.sortKeyRanges;v<_.length;v+=1){var b=_[v];e.push({sortKey:b.sortKey,symbolInstanceStart:b.symbolInstanceStart,symbolInstanceEnd:b.symbolInstanceEnd,parameters:y})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:y})}},be.prototype.attemptAnchorPlacement=function(t,e,n,i,r,o,s,a,l,c,u,h,d,f,A){var p,g=[h.textOffset0,h.textOffset1],m=ve(t,n,i,g,r),y=this.collisionIndex.placeCollisionBox(_e(e,m.x,m.y,o,s,this.transform.angle),u,a,l,c.predicate);if(!A||0!==this.collisionIndex.placeCollisionBox(_e(A,m.x,m.y,o,s,this.transform.angle),u,a,l,c.predicate).box.length)return y.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(p=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:n,height:i,anchor:t,textBoxScale:r,prevAnchor:p},this.markUsedJustification(d,t,h,f),d.allowVerticalPlacement&&(this.markUsedOrientation(d,f,h),this.placedOrientations[h.crossTileID]=f),{shift:m,placedGlyphBoxes:y}):void 0},be.prototype.placeLayerBucketPart=function(e,n,i){var r=this,o=e.parameters,s=o.bucket,a=o.layout,l=o.posMatrix,c=o.textLabelPlaneMatrix,u=o.labelToScreenMatrix,h=o.textPixelRatio,d=o.holdingForFade,f=o.collisionBoxArray,A=o.partiallyEvaluatedTextSize,p=o.collisionGroup,g=a.get("text-optional"),m=a.get("icon-optional"),y=a.get("text-allow-overlap"),v=a.get("icon-allow-overlap"),_="map"===a.get("text-rotation-alignment"),b="map"===a.get("text-pitch-alignment"),x="none"!==a.get("icon-text-fit"),w="viewport-y"===a.get("symbol-z-order"),C=y&&(v||!s.hasIconData()||m),B=v&&(y||!s.hasTextData()||g);!s.collisionArrays&&f&&s.deserializeCollisionBoxes(f);var E=function(e,o){if(!n[e.crossTileID])if(d)r.placements[e.crossTileID]=new pe(!1,!1,!1);else{var f,w=!1,E=!1,T=!0,S=null,M={box:null,offscreen:null},I={box:null,offscreen:null},P=null,D=null,F=0,L=0,O=0;o.textFeatureIndex?F=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(F=e.featureIndex),o.verticalTextFeatureIndex&&(L=o.verticalTextFeatureIndex);var R=o.textBox;if(R){var k=function(n){var i=t.WritingMode.horizontal;if(s.allowVerticalPlacement&&!n&&r.prevPlacement){var o=r.prevPlacement.placedOrientations[e.crossTileID];o&&(r.placedOrientations[e.crossTileID]=o,r.markUsedOrientation(s,i=o,e))}return i},U=function(n,i){if(s.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var r=0,a=s.writingModes;r<a.length&&(a[r]===t.WritingMode.vertical?(M=i(),I=M):M=n(),!(M&&M.box&&M.box.length));r+=1);else M=n()};if(a.get("text-variable-anchor")){var z=a.get("text-variable-anchor");if(r.prevPlacement&&r.prevPlacement.variableOffsets[e.crossTileID]){var G=r.prevPlacement.variableOffsets[e.crossTileID];z.indexOf(G.anchor)>0&&(z=z.filter((function(t){return t!==G.anchor}))).unshift(G.anchor)}var N=function(t,n,i){for(var o=t.x2-t.x1,a=t.y2-t.y1,c=e.textBoxScale,u=x&&!v?n:null,d={box:[],offscreen:!1},f=y?2*z.length:z.length,A=0;A<f;++A){var g=r.attemptAnchorPlacement(z[A%z.length],t,o,a,c,_,b,h,l,p,A>=z.length,e,s,i,u);if(g&&(d=g.placedGlyphBoxes)&&d.box&&d.box.length){w=!0,S=g.shift;break}}return d};U((function(){return N(R,o.iconBox,t.WritingMode.horizontal)}),(function(){var n=o.verticalTextBox;return s.allowVerticalPlacement&&!(M&&M.box&&M.box.length)&&e.numVerticalGlyphVertices>0&&n?N(n,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),M&&(w=M.box,T=M.offscreen);var Z=k(M&&M.box);if(!w&&r.prevPlacement){var j=r.prevPlacement.variableOffsets[e.crossTileID];j&&(r.variableOffsets[e.crossTileID]=j,r.markUsedJustification(s,j.anchor,e,Z))}}else{var V=function(t,n){var i=r.collisionIndex.placeCollisionBox(t,y,h,l,p.predicate);return i&&i.box&&i.box.length&&(r.markUsedOrientation(s,n,e),r.placedOrientations[e.crossTileID]=n),i};U((function(){return V(R,t.WritingMode.horizontal)}),(function(){var n=o.verticalTextBox;return s.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n?V(n,t.WritingMode.vertical):{box:null,offscreen:null}})),k(M&&M.box&&M.box.length)}}if(w=(f=M)&&f.box&&f.box.length>0,T=f&&f.offscreen,e.useRuntimeCollisionCircles){var H=s.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),J=t.evaluateSizeForFeature(s.textSizeData,A,H),W=a.get("text-padding");P=r.collisionIndex.placeCollisionCircles(y,H,s.lineVertexArray,s.glyphOffsetArray,J,l,c,u,i,b,p.predicate,e.collisionCircleDiameter,W),w=y||P.circles.length>0&&!P.collisionDetected,T=T&&P.offscreen}if(o.iconFeatureIndex&&(O=o.iconFeatureIndex),o.iconBox){var Q=function(t){var e=x&&S?_e(t,S.x,S.y,_,b,r.transform.angle):t;return r.collisionIndex.placeCollisionBox(e,v,h,l,p.predicate)};E=I&&I.box&&I.box.length&&o.verticalIconBox?(D=Q(o.verticalIconBox)).box.length>0:(D=Q(o.iconBox)).box.length>0,T=T&&D.offscreen}var K=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,q=m||0===e.numIconVertices;if(K||q?q?K||(E=E&&w):w=E&&w:E=w=E&&w,w&&f&&f.box&&r.collisionIndex.insertCollisionBox(f.box,a.get("text-ignore-placement"),s.bucketInstanceId,I&&I.box&&L?L:F,p.ID),E&&D&&r.collisionIndex.insertCollisionBox(D.box,a.get("icon-ignore-placement"),s.bucketInstanceId,O,p.ID),P&&(w&&r.collisionIndex.insertCollisionCircles(P.circles,a.get("text-ignore-placement"),s.bucketInstanceId,F,p.ID),i)){var X=s.bucketInstanceId,Y=r.collisionCircleArrays[X];void 0===Y&&(Y=r.collisionCircleArrays[X]=new ge);for(var $=0;$<P.circles.length;$+=4)Y.circles.push(P.circles[$+0]),Y.circles.push(P.circles[$+1]),Y.circles.push(P.circles[$+2]),Y.circles.push(P.collisionDetected?1:0)}r.placements[e.crossTileID]=new pe(w||C,E||B,T||s.justReloaded),n[e.crossTileID]=!0}};if(w)for(var T=s.getSortedSymbolIndexes(this.transform.angle),S=T.length-1;S>=0;--S){var M=T[S];E(s.symbolInstances.get(M),s.collisionArrays[M])}else for(var I=e.symbolInstanceStart;I<e.symbolInstanceEnd;I++)E(s.symbolInstances.get(I),s.collisionArrays[I]);if(i&&s.bucketInstanceId in this.collisionCircleArrays){var P=this.collisionCircleArrays[s.bucketInstanceId];t.invert(P.invProjMatrix,l),P.viewportMatrix=this.collisionIndex.getViewportMatrix()}s.justReloaded=!1},be.prototype.markUsedJustification=function(e,n,i,r){var o;o=r===t.WritingMode.vertical?i.verticalPlacedTextSymbolIndex:{left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(n)];for(var s=0,a=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];s<a.length;s+=1){var l=a[s];l>=0&&(e.text.placedSymbolArray.get(l).crossTileID=o>=0&&l!==o?0:i.crossTileID)}},be.prototype.markUsedOrientation=function(e,n,i){for(var r=n===t.WritingMode.horizontal||n===t.WritingMode.horizontalOnly?n:0,o=n===t.WritingMode.vertical?n:0,s=0,a=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];s<a.length;s+=1)e.text.placedSymbolArray.get(a[s]).placedOrientation=r;i.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=o)},be.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,n=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var i=e?e.symbolFadeChange(t):1,r=e?e.opacities:{},o=e?e.variableOffsets:{},s=e?e.placedOrientations:{};for(var a in this.placements){var l=this.placements[a],c=r[a];c?(this.opacities[a]=new Ae(c,i,l.text,l.icon),n=n||l.text!==c.text.placed||l.icon!==c.icon.placed):(this.opacities[a]=new Ae(null,i,l.text,l.icon,l.skipFade),n=n||l.text||l.icon)}for(var u in r){var h=r[u];if(!this.opacities[u]){var d=new Ae(h,i,!1,!1);d.isHidden()||(this.opacities[u]=d,n=n||h.text.placed||h.icon.placed)}}for(var f in o)this.variableOffsets[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.variableOffsets[f]=o[f]);for(var A in s)this.placedOrientations[A]||!this.opacities[A]||this.opacities[A].isHidden()||(this.placedOrientations[A]=s[A]);n?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},be.prototype.updateLayerOpacities=function(t,e){for(var n={},i=0,r=e;i<r.length;i+=1){var o=r[i],s=o.getBucket(t);s&&o.latestFeatureIndex&&t.id===s.layerIds[0]&&this.updateBucketOpacities(s,n,o.collisionBoxArray)}},be.prototype.updateBucketOpacities=function(e,n,i){var r=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();var o=e.layers[0].layout,s=new Ae(null,0,!1,!1,!0),a=o.get("text-allow-overlap"),l=o.get("icon-allow-overlap"),c=o.get("text-variable-anchor"),u="map"===o.get("text-rotation-alignment"),h="map"===o.get("text-pitch-alignment"),d="none"!==o.get("icon-text-fit"),f=new Ae(null,0,a&&(l||!e.hasIconData()||o.get("icon-optional")),l&&(a||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);for(var A=function(t,e,n){for(var i=0;i<e/4;i++)t.opacityVertexArray.emplaceBack(n)},p=function(i){var o=e.symbolInstances.get(i),a=o.numHorizontalGlyphVertices,l=o.numVerticalGlyphVertices,p=o.crossTileID,g=r.opacities[p];n[p]?g=s:g||(r.opacities[p]=g=f),n[p]=!0;var m=o.numIconVertices>0,y=r.placedOrientations[o.crossTileID],v=y===t.WritingMode.vertical,_=y===t.WritingMode.horizontal||y===t.WritingMode.horizontalOnly;if(a>0||l>0){var b=Ie(g.text);A(e.text,a,v?Pe:b),A(e.text,l,_?Pe:b);var x=g.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=x||v?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=x||_?1:0);var w=r.variableOffsets[o.crossTileID];w&&r.markUsedJustification(e,w.anchor,o,y);var C=r.placedOrientations[o.crossTileID];C&&(r.markUsedJustification(e,"left",o,C),r.markUsedOrientation(e,C,o))}if(m){var B=Ie(g.icon),E=!(d&&o.verticalPlacedIconSymbolIndex&&v);o.placedIconSymbolIndex>=0&&(A(e.icon,o.numIconVertices,E?B:Pe),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=g.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(A(e.icon,o.numVerticalIconVertices,E?Pe:B),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var T=e.collisionArrays[i];if(T){var S=new t.Point(0,0);if(T.textBox||T.verticalTextBox){var M=!0;if(c){var I=r.variableOffsets[p];I?(S=ve(I.anchor,I.width,I.height,I.textOffset,I.textBoxScale),u&&S._rotate(h?r.transform.angle:-r.transform.angle)):M=!1}T.textBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!M||v,S.x,S.y),T.verticalTextBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!M||_,S.x,S.y)}var P=Boolean(!_&&T.verticalIconBox);T.iconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,P,d?S.x:0,d?S.y:0),T.verticalIconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!P,d?S.x:0,d?S.y:0)}}},g=0;g<e.symbolInstances.length;g++)p(g);if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){var m=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=m.invProjMatrix,e.placementViewportMatrix=m.viewportMatrix,e.collisionCircleArray=m.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}},be.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},be.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},be.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},be.prototype.stillRecent=function(t,e){var n=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*n>t},be.prototype.setStale=function(){this.stale=!0};var we=Math.pow(2,25),Ce=Math.pow(2,24),Be=Math.pow(2,17),Ee=Math.pow(2,16),Te=Math.pow(2,9),Se=Math.pow(2,8),Me=Math.pow(2,1);function Ie(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,n=Math.floor(127*t.opacity);return n*we+e*Ce+n*Be+e*Ee+n*Te+e*Se+n*Me+e}var Pe=0,De=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};De.prototype.continuePlacement=function(t,e,n,i,r){for(var o=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(o,i,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,r())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,r())return!0;return!1};var Fe=function(t,e,n,i,r,o,s){this.placement=new be(t,r,o,s),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=i,this._done=!1};Fe.prototype.isDone=function(){return this._done},Fe.prototype.continuePlacement=function(e,n,i){for(var r=this,o=t.browser.now(),s=function(){var e=t.browser.now()-o;return!r._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var a=n[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===a.type&&(!a.minzoom||a.minzoom<=l)&&(!a.maxzoom||a.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new De(a)),this._inProgressLayer.continuePlacement(i[a.source],this.placement,this._showCollisionBoxes,a,s))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Fe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Le=512/t.EXTENT/2,Oe=function(t,e,n){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var i=0;i<e.length;i++){var r=e.get(i),o=r.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:r.crossTileID,coord:this.getScaledCoordinates(r,t)})}};Oe.prototype.getScaledCoordinates=function(e,n){var i=Le/Math.pow(2,n.canonical.z-this.tileID.canonical.z);return{x:Math.floor((n.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((n.canonical.y*t.EXTENT+e.anchorY)*i)}},Oe.prototype.findMatches=function(t,e,n){for(var i=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),r=0;r<t.length;r++){var o=t.get(r);if(!o.crossTileID){var s=this.indexedSymbolInstances[o.key];if(s)for(var a=this.getScaledCoordinates(o,e),l=0,c=s;l<c.length;l+=1){var u=c[l];if(Math.abs(u.coord.x-a.x)<=i&&Math.abs(u.coord.y-a.y)<=i&&!n[u.crossTileID]){n[u.crossTileID]=!0,o.crossTileID=u.crossTileID;break}}}}};var Re=function(){this.maxCrossTileID=0};Re.prototype.generate=function(){return++this.maxCrossTileID};var ke=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};ke.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var n in this.indexes){var i=this.indexes[n],r={};for(var o in i){var s=i[o];s.tileID=s.tileID.unwrapTo(s.tileID.wrap+e),r[s.tileID.key]=s}this.indexes[n]=r}this.lng=t},ke.prototype.addBucket=function(t,e,n){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var i=0;i<e.symbolInstances.length;i++)e.symbolInstances.get(i).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var r=this.usedCrossTileIDs[t.overscaledZ];for(var o in this.indexes){var s=this.indexes[o];if(Number(o)>t.overscaledZ)for(var a in s){var l=s[a];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,r)}else{var c=s[t.scaledTo(Number(o)).key];c&&c.findMatches(e.symbolInstances,t,r)}}for(var u=0;u<e.symbolInstances.length;u++){var h=e.symbolInstances.get(u);h.crossTileID||(h.crossTileID=n.generate(),r[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Oe(t,e.symbolInstances,e.bucketInstanceId),!0},ke.prototype.removeBucketCrossTileIDs=function(t,e){for(var n in e.indexedSymbolInstances)for(var i=0,r=e.indexedSymbolInstances[n];i<r.length;i+=1)delete this.usedCrossTileIDs[t][r[i].crossTileID]},ke.prototype.removeStaleBuckets=function(t){var e=!1;for(var n in this.indexes){var i=this.indexes[n];for(var r in i)t[i[r].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,i[r]),delete i[r],e=!0)}return e};var Ue=function(){this.layerIndexes={},this.crossTileIDs=new Re,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Ue.prototype.addLayer=function(t,e,n){var i=this.layerIndexes[t.id];void 0===i&&(i=this.layerIndexes[t.id]=new ke);var r=!1,o={};i.handleWrapJump(n);for(var s=0,a=e;s<a.length;s+=1){var l=a[s],c=l.getBucket(t);c&&t.id===c.layerIds[0]&&(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(l.tileID,c,this.crossTileIDs)&&(r=!0),o[c.bucketInstanceId]=!0)}return i.removeStaleBuckets(o)&&(r=!0),r},Ue.prototype.pruneUnusedLayers=function(t){var e={};for(var n in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[n]||delete this.layerIndexes[n]};var ze=function(e,n){return t.emitValidationErrors(e,n&&n.filter((function(t){return"source.canvas"!==t.identifier})))},Ge=t.pick(Nt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ne=t.pick(Nt,["setCenter","setZoom","setBearing","setPitch"]),Ze=function(){var e={},n=t.styleSpec.$version;for(var i in t.styleSpec.$root){var r,o=t.styleSpec.$root[i];o.required&&null!=(r="version"===i?n:"array"===o.type?[]:{})&&(e[i]=r)}return e}(),je=function(e){function n(i,r){var o=this;void 0===r&&(r={}),e.call(this),this.map=i,this.dispatcher=new C(Ut(),this),this.imageManager=new d,this.imageManager.setEventedParent(this),this.glyphManager=new v(i._requestManager,r.localIdeographFontFamily),this.lineAtlas=new w(256,512),this.crossTileSymbolIndex=new Ue,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var s=this;this._rtlTextPluginCallback=n.registerForPluginStateChange((function(e){s.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,n){if(t.triggerPluginCompletionEvent(e),n&&n.every((function(t){return t})))for(var i in s.sourceCaches)s.sourceCaches[i].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=o.sourceCaches[t.sourceId];if(e){var n=e.getSource();if(n&&n.vectorLayerIds)for(var i in o._layers){var r=o._layers[i];r.source===n.id&&o._validateLayer(r)}}}}))}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.loadURL=function(e,n){var i=this;void 0===n&&(n={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var r="boolean"==typeof n.validate?n.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,n.accessToken);var o=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(o,(function(e,n){i._request=null,e?i.fire(new t.ErrorEvent(e)):n&&i._load(n,r)}))},n.prototype.loadJSON=function(e,n){var i=this;void 0===n&&(n={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){i._request=null,i._load(e,!1!==n.validate)}))},n.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ze,!1)},n.prototype._load=function(e,n){if(!n||!ze(this,t.validateStyle(e))){for(var i in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(i,e.sources[i],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var r=Gt(this.stylesheet.layers);this._order=r.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var o=0,s=r;o<s.length;o+=1){var a=s[o];(a=t.createStyleLayer(a)).setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=a,this._serializedLayers[a.id]=a.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new x(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},n.prototype._loadSprite=function(e){var n=this;this._spriteRequest=function(e,n,i){var r,o,s,a=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(n.transformRequest(n.normalizeSpriteURL(e,a,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,s||(s=t,r=e,u())})),c=t.getImage(n.transformRequest(n.normalizeSpriteURL(e,a,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,s||(s=t,o=e,u())}));function u(){if(s)i(s);else if(r&&o){var e=t.browser.getImageData(o),n={};for(var a in r){var l=r[a],c=l.width,u=l.height,h=l.x,d=l.y,f=l.sdf,A=l.pixelRatio,p=l.stretchX,g=l.stretchY,m=l.content,y=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,y,{x:h,y:d},{x:0,y:0},{width:c,height:u}),n[a]={data:y,pixelRatio:A,sdf:f,stretchX:p,stretchY:g,content:m}}i(null,n)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,i){if(n._spriteRequest=null,e)n.fire(new t.ErrorEvent(e));else if(i)for(var r in i)n.imageManager.addImage(r,i[r]);n.imageManager.setLoaded(!0),n._availableImages=n.imageManager.listImages(),n.dispatcher.broadcast("setImages",n._availableImages),n.fire(new t.Event("data",{dataType:"style"}))}))},n.prototype._validateLayer=function(e){var n=this.sourceCaches[e.source];if(n){var i=e.sourceLayer;if(i){var r=n.getSource();("geojson"===r.type||r.vectorLayerIds&&-1===r.vectorLayerIds.indexOf(i))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+i+'" does not exist on source "'+r.id+'" as specified by style layer "'+e.id+'"')))}}},n.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},n.prototype._serializeLayers=function(t){for(var e=[],n=0,i=t;n<i.length;n+=1){var r=this._layers[i[n]];"custom"!==r.type&&e.push(r.serialize())}return e},n.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},n.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},n.prototype.update=function(e){if(this._loaded){var n=this._changed;if(this._changed){var i=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);for(var o in(i.length||r.length)&&this._updateWorkerLayers(i,r),this._updatedSources){var s=this._updatedSources[o];"reload"===s?this._reloadSource(o):"clear"===s&&this._clearSource(o)}for(var a in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[a].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}var l={};for(var c in this.sourceCaches){var u=this.sourceCaches[c];l[c]=u.used,u.used=!1}for(var h=0,d=this._order;h<d.length;h+=1){var f=this._layers[d[h]];f.recalculate(e,this._availableImages),!f.isHidden(e.zoom)&&f.source&&(this.sourceCaches[f.source].used=!0)}for(var A in l){var p=this.sourceCaches[A];l[A]!==p.used&&p.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:A}))}this.light.recalculate(e),this.z=e.zoom,n&&this.fire(new t.Event("data",{dataType:"style"}))}},n.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},n.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},n.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},n.prototype.setState=function(e){var n=this;if(this._checkLoaded(),ze(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Gt(e.layers);var i=function(e,n){if(!e)return[{command:Nt.setStyle,args:[n]}];var i=[];try{if(!t.deepEqual(e.version,n.version))return[{command:Nt.setStyle,args:[n]}];t.deepEqual(e.center,n.center)||i.push({command:Nt.setCenter,args:[n.center]}),t.deepEqual(e.zoom,n.zoom)||i.push({command:Nt.setZoom,args:[n.zoom]}),t.deepEqual(e.bearing,n.bearing)||i.push({command:Nt.setBearing,args:[n.bearing]}),t.deepEqual(e.pitch,n.pitch)||i.push({command:Nt.setPitch,args:[n.pitch]}),t.deepEqual(e.sprite,n.sprite)||i.push({command:Nt.setSprite,args:[n.sprite]}),t.deepEqual(e.glyphs,n.glyphs)||i.push({command:Nt.setGlyphs,args:[n.glyphs]}),t.deepEqual(e.transition,n.transition)||i.push({command:Nt.setTransition,args:[n.transition]}),t.deepEqual(e.light,n.light)||i.push({command:Nt.setLight,args:[n.light]});var r={},o=[];!function(e,n,i,r){var o;for(o in n=n||{},e=e||{})e.hasOwnProperty(o)&&(n.hasOwnProperty(o)||jt(o,i,r));for(o in n)n.hasOwnProperty(o)&&(e.hasOwnProperty(o)?t.deepEqual(e[o],n[o])||("geojson"===e[o].type&&"geojson"===n[o].type&&Ht(e,n,o)?i.push({command:Nt.setGeoJSONSourceData,args:[o,n[o].data]}):Vt(o,n,i,r)):Zt(o,n,i))}(e.sources,n.sources,o,r);var s=[];e.layers&&e.layers.forEach((function(t){r[t.source]?i.push({command:Nt.removeLayer,args:[t.id]}):s.push(t)})),i=i.concat(o),function(e,n,i){n=n||[];var r,o,s,a,l,c,u,h=(e=e||[]).map(Wt),d=n.map(Wt),f=e.reduce(Qt,{}),A=n.reduce(Qt,{}),p=h.slice(),g=Object.create(null);for(r=0,o=0;r<h.length;r++)A.hasOwnProperty(s=h[r])?o++:(i.push({command:Nt.removeLayer,args:[s]}),p.splice(p.indexOf(s,o),1));for(r=0,o=0;r<d.length;r++)p[p.length-1-r]!==(s=d[d.length-1-r])&&(f.hasOwnProperty(s)?(i.push({command:Nt.removeLayer,args:[s]}),p.splice(p.lastIndexOf(s,p.length-o),1)):o++,i.push({command:Nt.addLayer,args:[A[s],c=p[p.length-r]]}),p.splice(p.length-r,0,s),g[s]=!0);for(r=0;r<d.length;r++)if(a=f[s=d[r]],l=A[s],!g[s]&&!t.deepEqual(a,l))if(t.deepEqual(a.source,l.source)&&t.deepEqual(a["source-layer"],l["source-layer"])&&t.deepEqual(a.type,l.type)){for(u in Jt(a.layout,l.layout,i,s,null,Nt.setLayoutProperty),Jt(a.paint,l.paint,i,s,null,Nt.setPaintProperty),t.deepEqual(a.filter,l.filter)||i.push({command:Nt.setFilter,args:[s,l.filter]}),t.deepEqual(a.minzoom,l.minzoom)&&t.deepEqual(a.maxzoom,l.maxzoom)||i.push({command:Nt.setLayerZoomRange,args:[s,l.minzoom,l.maxzoom]}),a)a.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?Jt(a[u],l[u],i,s,u.slice(6),Nt.setPaintProperty):t.deepEqual(a[u],l[u])||i.push({command:Nt.setLayerProperty,args:[s,u,l[u]]}));for(u in l)l.hasOwnProperty(u)&&!a.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?Jt(a[u],l[u],i,s,u.slice(6),Nt.setPaintProperty):t.deepEqual(a[u],l[u])||i.push({command:Nt.setLayerProperty,args:[s,u,l[u]]}))}else i.push({command:Nt.removeLayer,args:[s]}),c=p[p.lastIndexOf(s)+1],i.push({command:Nt.addLayer,args:[l,c]})}(s,n.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:Nt.setStyle,args:[n]}]}return i}(this.serialize(),e).filter((function(t){return!(t.command in Ne)}));if(0===i.length)return!1;var r=i.filter((function(t){return!(t.command in Ge)}));if(r.length>0)throw new Error("Unimplemented: "+r.map((function(t){return t.command})).join(", ")+".");return i.forEach((function(t){"setTransition"!==t.command&&n[t.command].apply(n,t.args)})),this.stylesheet=e,!0},n.prototype.addImage=function(e,n){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,n),this._afterImageUpdated(e)},n.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},n.prototype.getImage=function(t){return this.imageManager.getImage(t)},n.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},n.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},n.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},n.prototype.addSource=function(e,n,i){var r=this;if(void 0===i&&(i={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!n.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(n).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,n,null,i))){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);var o=this.sourceCaches[e]=new It(e,n,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:r.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},n.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var n in this._layers)if(this._layers[n].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+n+'" is using it.')));var i=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],i.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0},n.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},n.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},n.prototype.addLayer=function(e,n,i){void 0===i&&(i={}),this._checkLoaded();var r=e.id;if(this.getLayer(r))this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" already exists on this map')));else{var o;if("custom"===e.type){if(ze(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(r,e.source),e=t.clone$1(e),e=t.extend(e,{source:r})),this._validate(t.validateStyle.layer,"layers."+r,e,{arrayIndex:-1},i))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:r}}),this._serializedLayers[o.id]=o.serialize()}var s=n?this._order.indexOf(n):this._order.length;if(n&&-1===s)this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.')));else{if(this._order.splice(s,0,r),this._layerOrderChanged=!0,this._layers[r]=o,this._removedLayers[r]&&o.source&&"custom"!==o.type){var a=this._removedLayers[r];delete this._removedLayers[r],a.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},n.prototype.moveLayer=function(e,n){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==n){var i=this._order.indexOf(e);this._order.splice(i,1);var r=n?this._order.indexOf(n):this._order.length;n&&-1===r?this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.'))):(this._order.splice(r,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},n.prototype.removeLayer=function(e){this._checkLoaded();var n=this._layers[e];if(n){n.setEventedParent(null);var i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},n.prototype.getLayer=function(t){return this._layers[t]},n.prototype.hasLayer=function(t){return t in this._layers},n.prototype.setLayerZoomRange=function(e,n,i){this._checkLoaded();var r=this.getLayer(e);r?r.minzoom===n&&r.maxzoom===i||(null!=n&&(r.minzoom=n),null!=i&&(r.maxzoom=i),this._updateLayer(r)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},n.prototype.setFilter=function(e,n,i){void 0===i&&(i={}),this._checkLoaded();var r=this.getLayer(e);if(r){if(!t.deepEqual(r.filter,n))return null==n?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(t.validateStyle.filter,"layers."+r.id+".filter",n,null,i)||(r.filter=t.clone$1(n),this._updateLayer(r)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},n.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},n.prototype.setLayoutProperty=function(e,n,i,r){void 0===r&&(r={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(n),i)||(o.setLayoutProperty(n,i,r),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getLayoutProperty=function(e,n){var i=this.getLayer(e);if(i)return i.getLayoutProperty(n);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},n.prototype.setPaintProperty=function(e,n,i,r){void 0===r&&(r={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(n),i)||(o.setPaintProperty(n,i,r)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},n.prototype.setFeatureState=function(e,n){this._checkLoaded();var i=e.source,r=e.sourceLayer,o=this.sourceCaches[i];if(void 0!==o){var s=o.getSource().type;"geojson"===s&&r?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||r?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(r,e.id,n)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},n.prototype.removeFeatureState=function(e,n){this._checkLoaded();var i=e.source,r=this.sourceCaches[i];if(void 0!==r){var o=r.getSource().type,s="vector"===o?e.sourceLayer:void 0;"vector"!==o||s?n&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):r.removeFeatureState(s,e.id,n):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},n.prototype.getFeatureState=function(e){this._checkLoaded();var n=e.source,i=e.sourceLayer,r=this.sourceCaches[n];if(void 0!==r){if("vector"!==r.getSource().type||i)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),r.getFeatureState(i,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},n.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},n.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},n.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},n.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,n=function(t){return"fill-extrusion"===e._layers[t].type},i={},r=[],o=this._order.length-1;o>=0;o--){var s=this._order[o];if(n(s)){i[s]=o;for(var a=0,l=t;a<l.length;a+=1){var c=l[a][s];if(c)for(var u=0,h=c;u<h.length;u+=1)r.push(h[u])}}}r.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var d=[],f=this._order.length-1;f>=0;f--){var A=this._order[f];if(n(A))for(var p=r.length-1;p>=0;p--){var g=r[p].feature;if(i[g.layer.id]<f)break;d.push(g),r.pop()}else for(var m=0,y=t;m<y.length;m+=1){var v=y[m][A];if(v)for(var _=0,b=v;_<b.length;_+=1)d.push(b[_].feature)}}return d},n.prototype.queryRenderedFeatures=function(e,n,i){n&&n.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",n.filter,null,n);var r={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,s=n.layers;o<s.length;o+=1){var a=s[o],l=this._layers[a];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+a+"' does not exist in the map's style and cannot be queried for features."))),[];r[l.source]=!0}}var c=[];for(var u in n.availableImages=this._availableImages,this.sourceCaches)n.layers&&!r[u]||c.push(k(this.sourceCaches[u],this._layers,this._serializedLayers,e,n,i));return this.placement&&c.push(function(t,e,n,i,r,o,s){for(var a={},l=o.queryRenderedSymbols(i),c=[],u=0,h=Object.keys(l).map(Number);u<h.length;u+=1)c.push(s[h[u]]);c.sort(U);for(var d=function(){var n=A[f],i=n.featureIndex.lookupSymbolFeatures(l[n.bucketInstanceId],e,n.bucketIndex,n.sourceLayerIndex,r.filter,r.layers,r.availableImages,t);for(var o in i){var s=a[o]=a[o]||[],c=i[o];c.sort((function(t,e){var i=n.featureSortOrder;if(i){var r=i.indexOf(t.featureIndex);return i.indexOf(e.featureIndex)-r}return e.featureIndex-t.featureIndex}));for(var u=0,h=c;u<h.length;u+=1)s.push(h[u])}},f=0,A=c;f<A.length;f+=1)d();var p=function(e){a[e].forEach((function(i){var r=i.feature,o=n[t[e].source].getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=o}))};for(var g in a)p(g);return a}(this._layers,this._serializedLayers,this.sourceCaches,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},n.prototype.querySourceFeatures=function(e,n){n&&n.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);var i=this.sourceCaches[e];return i?function(t,e){for(var n=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),i=[],r={},o=0;o<n.length;o++){var s=n[o],a=s.tileID.canonical.key;r[a]||(r[a]=!0,s.querySourceFeatures(i,e))}return i}(i,n):[]},n.prototype.addSourceType=function(t,e,i){return n.getSourceType(t)?i(new Error('A source type called "'+t+'" already exists.')):(n.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},i):i(null,null))},n.prototype.getLight=function(){return this.light.getLight()},n.prototype.setLight=function(e,n){void 0===n&&(n={}),this._checkLoaded();var i=this.light.getLight(),r=!1;for(var o in e)if(!t.deepEqual(e[o],i[o])){r=!0;break}if(r){var s={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,n),this.light.updateTransitions(s)}},n.prototype._validate=function(e,n,i,r,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&ze(this,e.call(t.validateStyle,t.extend({key:n,style:this.serialize(),value:i,styleSpec:t.styleSpec},r)))},n.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var n in this.sourceCaches)this.sourceCaches[n].clearTiles(),this.sourceCaches[n].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},n.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},n.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},n.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},n.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},n.prototype._updatePlacement=function(e,n,i,r,o){void 0===o&&(o=!1);for(var s=!1,a=!1,l={},c=0,u=this._order;c<u.length;c+=1){var h=this._layers[u[c]];if("symbol"===h.type){if(!l[h.source]){var d=this.sourceCaches[h.source];l[h.source]=d.getRenderableIds(!0).map((function(t){return d.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var f=this.crossTileSymbolIndex.addLayer(h,l[h.source],e.center.lng);s=s||f}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Fe(e,this._order,o,n,i,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),a=!0),s&&this.pauseablePlacement.placement.setStale()),a||s)for(var A=0,p=this._order;A<p.length;A+=1){var g=this._layers[p[A]];"symbol"===g.type&&this.placement.updateLayerOpacities(g,l[g.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},n.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},n.prototype.getImages=function(t,e,n){this.imageManager.getImages(e.icons,n),this._updateTilesForChangedImages();var i=this.sourceCaches[e.source];i&&i.setDependencies(e.tileID.key,e.type,e.icons)},n.prototype.getGlyphs=function(t,e,n){this.glyphManager.getGlyphs(e.stacks,n)},n.prototype.getResource=function(e,n,i){return t.makeRequest(n,i)},n}(t.Evented);je.getSourceType=function(t){return O[t]},je.setSourceType=function(t,e){O[t]=e},je.registerForPluginStateChange=t.registerForPluginStateChange;var Ve=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),He=yn("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),Je=yn("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),We=yn("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Qe=yn("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Ke=yn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),qe=yn("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),Xe=yn("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),Ye=yn("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),$e=yn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tn=yn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),en=yn("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),nn=yn("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),rn=yn("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),on=yn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),sn=yn("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),an=yn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),ln=yn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),cn=yn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),un=yn("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hn=yn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),dn=yn("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),fn=yn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),An=yn("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),pn=yn("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),gn=yn("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),mn=yn("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yn(t,e){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=e.match(/attribute ([\w]+) ([\w]+)/g),r=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),s=o?o.concat(r):r,a={};return{fragmentSource:t=t.replace(n,(function(t,e,n,i,r){return a[r]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nvarying "+n+" "+i+" "+r+";\n#else\nuniform "+n+" "+i+" u_"+r+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+r+"\n    "+n+" "+i+" "+r+" = u_"+r+";\n#endif\n"})),vertexSource:e=e.replace(n,(function(t,e,n,i,r){var o="float"===i?"vec2":"vec4",s=r.match(/color/)?"color":o;return a[r]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float u_"+r+"_t;\nattribute "+n+" "+o+" a_"+r+";\nvarying "+n+" "+i+" "+r+";\n#else\nuniform "+n+" "+i+" u_"+r+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+r+"\n    "+r+" = a_"+r+";\n#else\n    "+n+" "+i+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n    "+r+" = unpack_mix_"+s+"(a_"+r+", u_"+r+"_t);\n#else\n    "+n+" "+i+" "+r+" = u_"+r+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float u_"+r+"_t;\nattribute "+n+" "+o+" a_"+r+";\n#else\nuniform "+n+" "+i+" u_"+r+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+r+"\n    "+n+" "+i+" "+r+" = a_"+r+";\n#else\n    "+n+" "+i+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n    "+n+" "+i+" "+r+" = unpack_mix_"+s+"(a_"+r+", u_"+r+"_t);\n#else\n    "+n+" "+i+" "+r+" = u_"+r+";\n#endif\n"})),staticAttributes:i,staticUniforms:s}}var vn=Object.freeze({__proto__:null,prelude:He,background:Je,backgroundPattern:We,circle:Qe,clippingMask:Ke,heatmap:qe,heatmapTexture:Xe,collisionBox:Ye,collisionCircle:$e,debug:tn,fill:en,fillOutline:nn,fillOutlinePattern:rn,fillPattern:on,fillExtrusion:sn,fillExtrusionPattern:an,hillshadePrepare:ln,hillshade:cn,line:un,lineGradient:hn,linePattern:dn,lineSDF:fn,raster:An,symbolIcon:pn,symbolSDF:gn,symbolTextAndIcon:mn}),_n=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function bn(t){for(var e=[],n=0;n<t.length;n++)if(null!==t[n]){var i=t[n].split(" ");e.push(i.pop())}return e}_n.prototype.bind=function(t,e,n,i,r,o,s,a){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==i.length,c=0;!l&&c<i.length;c++)this.boundPaintVertexBuffers[c]!==i[c]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===n&&!l&&this.boundIndexBuffer===r&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===s&&this.boundDynamicVertexBuffer2===a?(t.bindVertexArrayOES.set(this.vao),s&&s.bind(),r&&r.dynamicDraw&&r.bind(),a&&a.bind()):this.freshBind(e,n,i,r,o,s,a)},_n.prototype.freshBind=function(t,e,n,i,r,o,s){var a,l=t.numAttributes,c=this.context,u=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),a=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=i,this.boundVertexOffset=r,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=s;else{a=c.currentNumAttributes||0;for(var h=l;h<a;h++)u.disableVertexAttribArray(h)}e.enableAttributes(u,t);for(var d=0,f=n;d<f.length;d+=1)f[d].enableAttributes(u,t);o&&o.enableAttributes(u,t),s&&s.enableAttributes(u,t),e.bind(),e.setVertexAttribPointers(u,t,r);for(var A=0,p=n;A<p.length;A+=1){var g=p[A];g.bind(),g.setVertexAttribPointers(u,t,r)}o&&(o.bind(),o.setVertexAttribPointers(u,t,r)),i&&i.bind(),s&&(s.bind(),s.setVertexAttribPointers(u,t,r)),c.currentNumAttributes=l},_n.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var xn=function(t,e,n,i,r,o){var s=t.gl;this.program=s.createProgram();for(var a=bn(n.staticAttributes),l=i?i.getBinderAttributes():[],c=a.concat(l),u=n.staticUniforms?bn(n.staticUniforms):[],h=i?i.getBinderUniforms():[],d=[],f=0,A=u.concat(h);f<A.length;f+=1){var p=A[f];d.indexOf(p)<0&&d.push(p)}var g=i?i.defines():[];o&&g.push("#define OVERDRAW_INSPECTOR;");var m=g.concat(He.fragmentSource,n.fragmentSource).join("\n"),y=g.concat(He.vertexSource,n.vertexSource).join("\n"),v=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())this.failedToCreate=!0;else{s.shaderSource(v,m),s.compileShader(v),s.attachShader(this.program,v);var _=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())this.failedToCreate=!0;else{s.shaderSource(_,y),s.compileShader(_),s.attachShader(this.program,_),this.attributes={};var b={};this.numAttributes=c.length;for(var x=0;x<this.numAttributes;x++)c[x]&&(s.bindAttribLocation(this.program,x,c[x]),this.attributes[c[x]]=x);s.linkProgram(this.program),s.deleteShader(_),s.deleteShader(v);for(var w=0;w<d.length;w++){var C=d[w];if(C&&!b[C]){var B=s.getUniformLocation(this.program,C);B&&(b[C]=B)}}this.fixedUniforms=r(t,b),this.binderUniforms=i?i.getUniforms(t,b):[]}}};function wn(t,e,n){var i=1/de(n,1,e.transform.tileZoom),r=Math.pow(2,n.tileID.overscaledZ),o=n.tileSize*Math.pow(2,e.transform.tileZoom)/r,s=o*(n.tileID.canonical.x+n.tileID.wrap*r),a=o*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[i,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[s>>16,a>>16],u_pixel_coord_lower:[65535&s,65535&a]}}xn.prototype.draw=function(t,e,n,i,r,o,s,a,l,c,u,h,d,f,A,p){var g,m=t.gl;if(!this.failedToCreate){for(var y in t.program.set(this.program),t.setDepthMode(n),t.setStencilMode(i),t.setColorMode(r),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[y].set(s[y]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:d});for(var v=(g={},g[m.LINES]=2,g[m.TRIANGLES]=3,g[m.LINE_STRIP]=1,g)[e],_=0,b=u.get();_<b.length;_+=1){var x=b[_],w=x.vaos||(x.vaos={});(w[a]||(w[a]=new _n)).bind(t,this,l,f?f.getPaintVertexBuffers():[],c,x.vertexOffset,A,p),m.drawElements(e,x.primitiveLength*v,m.UNSIGNED_SHORT,x.primitiveOffset*v*2)}}};var Cn=function(e,n,i,r){var o=n.style.light,s=o.properties.get("position"),a=[s.x,s.y,s.z],l=t.create$1();"viewport"===o.properties.get("anchor")&&t.fromRotation(l,-n.transform.angle),t.transformMat3(a,a,l);var c=o.properties.get("color");return{u_matrix:e,u_lightpos:a,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+i,u_opacity:r}},Bn=function(e,n,i,r,o,s,a){return t.extend(Cn(e,n,i,r),wn(s,n,a),{u_height_factor:-Math.pow(2,o.overscaledZ)/a.tileSize/8})},En=function(t){return{u_matrix:t}},Tn=function(e,n,i,r){return t.extend(En(e),wn(i,n,r))},Sn=function(t,e){return{u_matrix:t,u_world:e}},Mn=function(e,n,i,r,o){return t.extend(Tn(e,n,i,r),{u_world:o})},In=function(e,n,i,r){var o,s,a=e.transform;if("map"===r.paint.get("circle-pitch-alignment")){var l=de(i,1,a.zoom);o=!0,s=[l,l]}else o=!1,s=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(n.posMatrix,i,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:s}},Pn=function(t,e,n){var i=de(n,1,e.zoom),r=Math.pow(2,e.zoom-n.tileID.overscaledZ),o=n.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:i,u_extrude_scale:[e.pixelsToGLUnits[0]/(i*r),e.pixelsToGLUnits[1]/(i*r)],u_overscale_factor:o}},Dn=function(t,e,n){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},Fn=function(t,e,n){return void 0===n&&(n=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:n}},Ln=function(t){return{u_matrix:t}},On=function(t,e,n,i){return{u_matrix:t,u_extrude_scale:de(e,1,n),u_intensity:i}},Rn=function(e,n,i){var r=e.transform;return{u_matrix:Nn(e,n,i),u_ratio:1/de(n,1,r.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/r.pixelsToGLUnits[0],1/r.pixelsToGLUnits[1]]}},kn=function(e,n,i,r){return t.extend(Rn(e,n,i),{u_image:0,u_image_height:r})},Un=function(e,n,i,r){var o=e.transform,s=Gn(n,o);return{u_matrix:Nn(e,n,i),u_texsize:n.imageAtlasTexture.size,u_ratio:1/de(n,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[s,r.fromScale,r.toScale],u_fade:r.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},zn=function(e,n,i,r,o){var s=e.lineAtlas,a=Gn(n,e.transform),l="round"===i.layout.get("line-cap"),c=s.getDash(r.from,l),u=s.getDash(r.to,l),h=c.width*o.fromScale,d=u.width*o.toScale;return t.extend(Rn(e,n,i),{u_patternscale_a:[a/h,-c.height/2],u_patternscale_b:[a/d,-u.height/2],u_sdfgamma:s.width/(256*Math.min(h,d)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:u.y,u_mix:o.t})};function Gn(t,e){return 1/de(t,1,e.tileZoom)}function Nn(t,e,n){return t.translatePosMatrix(e.tileID.posMatrix,e,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var Zn=function(t,e,n,i,r){return{u_matrix:t,u_tl_parent:e,u_scale_parent:n,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(s=r.paint.get("raster-saturation"),s>0?1-1/(1.001-s):-s),u_contrast_factor:(o=r.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:jn(r.paint.get("raster-hue-rotate"))};var o,s};function jn(t){t*=Math.PI/180;var e=Math.sin(t),n=Math.cos(t);return[(2*n+1)/3,(-Math.sqrt(3)*e-n+1)/3,(Math.sqrt(3)*e-n+1)/3]}var Vn,Hn=function(t,e,n,i,r,o,s,a,l,c){var u=r.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:u.width/u.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:s,u_coord_matrix:a,u_is_text:+l,u_pitch_with_map:+i,u_texsize:c,u_texture:0}},Jn=function(e,n,i,r,o,s,a,l,c,u,h){var d=o.transform;return t.extend(Hn(e,n,i,r,o,s,a,l,c,u),{u_gamma_scale:r?Math.cos(d._pitch)*d.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Wn=function(e,n,i,r,o,s,a,l,c,u){return t.extend(Jn(e,n,i,r,o,s,a,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Qn=function(t,e,n){return{u_matrix:t,u_opacity:e,u_color:n}},Kn=function(e,n,i,r,o,s){return t.extend(function(t,e,n,i){var r=n.imageManager.getPattern(t.from.toString()),o=n.imageManager.getPattern(t.to.toString()),s=n.imageManager.getPixelSize(),a=s.width,l=s.height,c=Math.pow(2,i.tileID.overscaledZ),u=i.tileSize*Math.pow(2,n.transform.tileZoom)/c,h=u*(i.tileID.canonical.x+i.tileID.wrap*c),d=u*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:r.tl,u_pattern_br_a:r.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[a,l],u_mix:e.t,u_pattern_size_a:r.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/de(i,1,n.transform.tileZoom),u_pixel_coord_upper:[h>>16,d>>16],u_pixel_coord_lower:[65535&h,65535&d]}}(r,s,i,o),{u_matrix:e,u_opacity:n})},qn={fillExtrusion:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient),u_opacity:new t.Uniform1f(e,n.u_opacity)}},fillExtrusionPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,n.u_height_factor),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade),u_opacity:new t.Uniform1f(e,n.u_opacity)}},fill:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},fillPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},fillOutline:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world)}},fillOutlinePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},circle:function(e,n){return{u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,n.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,n.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},collisionBox:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,n.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,n.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,n.u_overscale_factor)}},collisionCircle:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,n.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,n.u_viewport_size)}},debug:function(e,n){return{u_color:new t.UniformColor(e,n.u_color),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_overlay:new t.Uniform1i(e,n.u_overlay),u_overlay_scale:new t.Uniform1f(e,n.u_overlay_scale)}},clippingMask:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmap:function(e,n){return{u_extrude_scale:new t.Uniform1f(e,n.u_extrude_scale),u_intensity:new t.Uniform1f(e,n.u_intensity),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmapTexture:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_color_ramp:new t.Uniform1i(e,n.u_color_ramp),u_opacity:new t.Uniform1f(e,n.u_opacity)}},hillshade:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_latrange:new t.Uniform2f(e,n.u_latrange),u_light:new t.Uniform2f(e,n.u_light),u_shadow:new t.UniformColor(e,n.u_shadow),u_highlight:new t.UniformColor(e,n.u_highlight),u_accent:new t.UniformColor(e,n.u_accent)}},hillshadePrepare:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_dimension:new t.Uniform2f(e,n.u_dimension),u_zoom:new t.Uniform1f(e,n.u_zoom),u_unpack:new t.Uniform4f(e,n.u_unpack)}},line:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels)}},lineGradient:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_image:new t.Uniform1i(e,n.u_image),u_image_height:new t.Uniform1f(e,n.u_image_height)}},linePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_texsize:new t.Uniform2f(e,n.u_texsize),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_image:new t.Uniform1i(e,n.u_image),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},lineSDF:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,n.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,n.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,n.u_sdfgamma),u_image:new t.Uniform1i(e,n.u_image),u_tex_y_a:new t.Uniform1f(e,n.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,n.u_tex_y_b),u_mix:new t.Uniform1f(e,n.u_mix)}},raster:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_tl_parent:new t.Uniform2f(e,n.u_tl_parent),u_scale_parent:new t.Uniform1f(e,n.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,n.u_buffer_scale),u_fade_t:new t.Uniform1f(e,n.u_fade_t),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image0:new t.Uniform1i(e,n.u_image0),u_image1:new t.Uniform1i(e,n.u_image1),u_brightness_low:new t.Uniform1f(e,n.u_brightness_low),u_brightness_high:new t.Uniform1f(e,n.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,n.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,n.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,n.u_spin_weights)}},symbolIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture)}},symbolSDF:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture),u_gamma_scale:new t.Uniform1f(e,n.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,n.u_is_halo)}},symbolTextAndIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texsize_icon:new t.Uniform2f(e,n.u_texsize_icon),u_texture:new t.Uniform1i(e,n.u_texture),u_texture_icon:new t.Uniform1i(e,n.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,n.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,n.u_is_halo)}},background:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_color:new t.UniformColor(e,n.u_color)}},backgroundPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image:new t.Uniform1i(e,n.u_image),u_pattern_tl_a:new t.Uniform2f(e,n.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,n.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,n.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,n.u_pattern_br_b),u_texsize:new t.Uniform2f(e,n.u_texsize),u_mix:new t.Uniform1f(e,n.u_mix),u_pattern_size_a:new t.Uniform2f(e,n.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,n.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,n.u_scale_a),u_scale_b:new t.Uniform1f(e,n.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,n.u_tile_units_to_pixels)}}};function Xn(e,n,i,r,o,s,a){for(var l=e.context,c=l.gl,u=e.useProgram("collisionBox"),h=[],d=0,f=0,A=0;A<r.length;A++){var p=r[A],g=n.getTile(p),m=g.getBucket(i);if(m){var y=p.posMatrix;0===o[0]&&0===o[1]||(y=e.translatePosMatrix(p.posMatrix,g,o,s));var v=a?m.textCollisionBox:m.iconCollisionBox,_=m.collisionCircleArray;if(_.length>0){var b=t.create(),x=y;t.mul(b,m.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,m.placementViewportMatrix),h.push({circleArray:_,circleOffset:f,transform:x,invTransform:b}),f=d+=_.length/4}v&&u.draw(l,c.LINES,Bt.disabled,Et.disabled,e.colorModeForRenderPass(),St.disabled,Pn(y,e.transform,g),i.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,null,e.transform.zoom,null,null,v.collisionVertexBuffer)}}if(a&&h.length){var w=e.useProgram("collisionCircle"),C=new t.StructArrayLayout2f1f2i16;C.resize(4*d),C._trim();for(var B=0,E=0,T=h;E<T.length;E+=1)for(var S=T[E],M=0;M<S.circleArray.length/4;M++){var I=4*M,P=S.circleArray[I+0],D=S.circleArray[I+1],F=S.circleArray[I+2],L=S.circleArray[I+3];C.emplace(B++,P,D,F,L,0),C.emplace(B++,P,D,F,L,1),C.emplace(B++,P,D,F,L,2),C.emplace(B++,P,D,F,L,3)}(!Vn||Vn.length<2*d)&&(Vn=function(e){var n=2*e,i=new t.StructArrayLayout3ui6;i.resize(n),i._trim();for(var r=0;r<n;r++){var o=6*r;i.uint16[o+0]=4*r+0,i.uint16[o+1]=4*r+1,i.uint16[o+2]=4*r+2,i.uint16[o+3]=4*r+2,i.uint16[o+4]=4*r+3,i.uint16[o+5]=4*r+0}return i}(d));for(var O=l.createIndexBuffer(Vn,!0),R=l.createVertexBuffer(C,t.collisionCircleLayout.members,!0),k=0,U=h;k<U.length;k+=1){var z=U[k],G=Dn(z.transform,z.invTransform,e.transform);w.draw(l,c.TRIANGLES,Bt.disabled,Et.disabled,e.colorModeForRenderPass(),St.disabled,G,i.id,R,O,t.SegmentVector.simpleSegment(0,2*z.circleOffset,z.circleArray.length,z.circleArray.length/2),null,e.transform.zoom,null,null,null)}R.destroy(),O.destroy()}}var Yn=t.identity(new Float32Array(16));function $n(e,n,i,r,o,s){var a=t.getAnchorAlignment(e),l=-(a.horizontalAlign-.5)*n,c=-(a.verticalAlign-.5)*i,u=t.evaluateVariableOffset(e,r);return new t.Point((l/o+u[0])*s,(c/o+u[1])*s)}function ti(e,n,i,r,o,s,a,l,c,u,h){var d=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,A=e.icon.dynamicLayoutVertexArray,p={};f.clear();for(var g=0;g<d.length;g++){var m=d.get(g),y=m.hidden||!m.crossTileID||e.allowVerticalPlacement&&!m.placedOrientation?null:r[m.crossTileID];if(y){var v=new t.Point(m.anchorX,m.anchorY),_=$t(v,i?l:a),b=te(s.cameraToCenterDistance,_.signedDistanceFromCamera),x=o.evaluateSizeForFeature(e.textSizeData,u,m)*b/t.ONE_EM;i&&(x*=e.tilePixelRatio/c);for(var w=$n(y.anchor,y.width,y.height,y.textOffset,y.textBoxScale,x),C=i?$t(v.add(w),a).point:_.point.add(n?w.rotate(-s.angle):w),B=e.allowVerticalPlacement&&m.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,E=0;E<m.numGlyphs;E++)t.addDynamicAttributes(f,C,B);h&&m.associatedIconIndex>=0&&(p[m.associatedIconIndex]={shiftedAnchor:C,angle:B})}else ce(m.numGlyphs,f)}if(h){A.clear();for(var T=e.icon.placedSymbolArray,S=0;S<T.length;S++){var M=T.get(S);if(M.hidden)ce(M.numGlyphs,A);else{var I=p[S];if(I)for(var P=0;P<M.numGlyphs;P++)t.addDynamicAttributes(A,I.shiftedAnchor,I.angle);else ce(M.numGlyphs,A)}}e.icon.dynamicLayoutVertexBuffer.updateData(A)}e.text.dynamicLayoutVertexBuffer.updateData(f)}function ei(t,e,n){return n.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function ni(e,n,i,r,o,s,a,l,c,u,h,d){for(var f=e.context,A=f.gl,p=e.transform,g="map"===l,m="map"===c,y=g&&"point"!==i.layout.get("symbol-placement"),v=g&&!m&&!y,_=void 0!==i.layout.get("symbol-sort-key").constantOr(1),b=!1,x=e.depthModeForSublayer(0,Bt.ReadOnly),w=i.layout.get("text-variable-anchor"),C=[],B=0,E=r;B<E.length;B+=1){var T=E[B],S=n.getTile(T),M=S.getBucket(i);if(M){var I=o?M.text:M.icon;if(I&&I.segments.get().length){var P=I.programConfigurations.get(i.id),D=o||M.sdfIcons,F=o?M.textSizeData:M.iconSizeData,L=m||0!==p.pitch,O=e.useProgram(ei(D,o,M),P),R=t.evaluateSizeForZoom(F,p.zoom),k=void 0,U=[0,0],z=void 0,G=void 0,N=null,Z=void 0;if(o)z=S.glyphAtlasTexture,G=A.LINEAR,k=S.glyphAtlasTexture.size,M.iconsInText&&(U=S.imageAtlasTexture.size,N=S.imageAtlasTexture,Z=L||e.options.rotating||e.options.zooming||"composite"===F.kind||"camera"===F.kind?A.LINEAR:A.NEAREST);else{var j=1!==i.layout.get("icon-size").constantOr(0)||M.iconsNeedLinear;z=S.imageAtlasTexture,G=D||e.options.rotating||e.options.zooming||j||L?A.LINEAR:A.NEAREST,k=S.imageAtlasTexture.size}var V=de(S,1,e.transform.zoom),H=Xt(T.posMatrix,m,g,e.transform,V),J=Yt(T.posMatrix,m,g,e.transform,V),W=w&&M.hasTextData(),Q="none"!==i.layout.get("icon-text-fit")&&W&&M.hasIconData();y&&ne(M,T.posMatrix,e,o,H,J,m,u);var K=e.translatePosMatrix(T.posMatrix,S,s,a),q=y||o&&w||Q?Yn:H,X=e.translatePosMatrix(J,S,s,a,!0),Y=D&&0!==i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),$={program:O,buffers:I,uniformValues:D?M.iconsInText?Wn(F.kind,R,v,m,e,K,q,X,k,U):Jn(F.kind,R,v,m,e,K,q,X,o,k,!0):Hn(F.kind,R,v,m,e,K,q,X,o,k),atlasTexture:z,atlasTextureIcon:N,atlasInterpolation:G,atlasInterpolationIcon:Z,isSDF:D,hasHalo:Y};if(_&&M.canOverlap){b=!0;for(var tt=0,et=I.segments.get();tt<et.length;tt+=1){var nt=et[tt];C.push({segments:new t.SegmentVector([nt]),sortKey:nt.sortKey,state:$})}}else C.push({segments:I.segments,sortKey:0,state:$})}}}b&&C.sort((function(t,e){return t.sortKey-e.sortKey}));for(var it=0,rt=C;it<rt.length;it+=1){var ot=rt[it],st=ot.state;if(f.activeTexture.set(A.TEXTURE0),st.atlasTexture.bind(st.atlasInterpolation,A.CLAMP_TO_EDGE),st.atlasTextureIcon&&(f.activeTexture.set(A.TEXTURE1),st.atlasTextureIcon&&st.atlasTextureIcon.bind(st.atlasInterpolationIcon,A.CLAMP_TO_EDGE)),st.isSDF){var at=st.uniformValues;st.hasHalo&&(at.u_is_halo=1,ii(st.buffers,ot.segments,i,e,st.program,x,h,d,at)),at.u_is_halo=0}ii(st.buffers,ot.segments,i,e,st.program,x,h,d,st.uniformValues)}}function ii(t,e,n,i,r,o,s,a,l){var c=i.context;r.draw(c,c.gl.TRIANGLES,o,s,a,St.disabled,l,n.id,t.layoutVertexBuffer,t.indexBuffer,e,n.paint,i.transform.zoom,t.programConfigurations.get(n.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function ri(t,e,n,i,r,o,s){var a,l,c,u,h,d=t.context.gl,f=n.paint.get("fill-pattern"),A=f&&f.constantOr(1),p=n.getCrossfadeParameters();s?(l=A&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",a=d.LINES):(l=A?"fillPattern":"fill",a=d.TRIANGLES);for(var g=0,m=i;g<m.length;g+=1){var y=m[g],v=e.getTile(y);if(!A||v.patternsLoaded()){var _=v.getBucket(n);if(_){var b=_.programConfigurations.get(n.id),x=t.useProgram(l,b);A&&(t.context.activeTexture.set(d.TEXTURE0),v.imageAtlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE),b.updatePaintBuffers(p));var w=f.constantOr(null);if(w&&v.imageAtlas){var C=v.imageAtlas,B=C.patternPositions[w.to.toString()],E=C.patternPositions[w.from.toString()];B&&E&&b.setConstantPatternPositions(B,E)}var T=t.translatePosMatrix(y.posMatrix,v,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(s){u=_.indexBuffer2,h=_.segments2;var S=[d.drawingBufferWidth,d.drawingBufferHeight];c="fillOutlinePattern"===l&&A?Mn(T,t,p,v,S):Sn(T,S)}else u=_.indexBuffer,h=_.segments,c=A?Tn(T,t,p,v):En(T);x.draw(t.context,a,r,t.stencilModeForClipping(y),o,St.disabled,c,n.id,_.layoutVertexBuffer,u,h,n.paint,t.transform.zoom,b)}}}}function oi(t,e,n,i,r,o,s){for(var a=t.context,l=a.gl,c=n.paint.get("fill-extrusion-pattern"),u=c.constantOr(1),h=n.getCrossfadeParameters(),d=n.paint.get("fill-extrusion-opacity"),f=0,A=i;f<A.length;f+=1){var p=A[f],g=e.getTile(p),m=g.getBucket(n);if(m){var y=m.programConfigurations.get(n.id),v=t.useProgram(u?"fillExtrusionPattern":"fillExtrusion",y);u&&(t.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(h));var _=c.constantOr(null);if(_&&g.imageAtlas){var b=g.imageAtlas,x=b.patternPositions[_.to.toString()],w=b.patternPositions[_.from.toString()];x&&w&&y.setConstantPatternPositions(x,w)}var C=t.translatePosMatrix(p.posMatrix,g,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),B=n.paint.get("fill-extrusion-vertical-gradient"),E=u?Bn(C,t,B,d,p,h,g):Cn(C,t,B,d);v.draw(a,a.gl.TRIANGLES,r,o,s,St.backCCW,E,n.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,n.paint,t.transform.zoom,y)}}}function si(e,n,i,r,o,s){var a=e.context,l=a.gl,c=n.fbo;if(c){var u=e.useProgram("hillshade");a.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get());var h=function(e,n,i){var r=i.paint.get("hillshade-shadow-color"),o=i.paint.get("hillshade-highlight-color"),s=i.paint.get("hillshade-accent-color"),a=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(a-=e.transform.angle);var l,c,u,h=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(n.tileID.toUnwrapped(),h),u_image:0,u_latrange:(l=n.tileID,c=Math.pow(2,l.canonical.z),u=l.canonical.y,[new t.MercatorCoordinate(0,u/c).toLngLat().lat,new t.MercatorCoordinate(0,(u+1)/c).toLngLat().lat]),u_light:[i.paint.get("hillshade-exaggeration"),a],u_shadow:r,u_highlight:o,u_accent:s}}(e,n,i);u.draw(a,l.TRIANGLES,r,o,s,St.disabled,h,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function ai(e,n,i,r,o,s){var a=e.context,l=a.gl,c=n.dem;if(c&&c.data){var u=c.dim,h=c.stride,d=c.getPixels();if(a.activeTexture.set(l.TEXTURE1),a.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||e.getTileTexture(h),n.demTexture){var f=n.demTexture;f.update(d,{premultiply:!1}),f.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else n.demTexture=new t.Texture(a,d,l.RGBA,{premultiply:!1}),n.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);a.activeTexture.set(l.TEXTURE0);var A=n.fbo;if(!A){var p=new t.Texture(a,{width:u,height:u,data:null},l.RGBA);p.bind(l.LINEAR,l.CLAMP_TO_EDGE),(A=n.fbo=a.createFramebuffer(u,u,!0)).colorAttachment.set(p.texture)}a.bindFramebuffer.set(A.framebuffer),a.viewport.set([0,0,u,u]),e.useProgram("hillshadePrepare").draw(a,l.TRIANGLES,r,o,s,St.disabled,function(e,n){var i=n.stride,r=t.create();return t.ortho(r,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(r,r,[0,-t.EXTENT,0]),{u_matrix:r,u_image:1,u_dimension:[i,i],u_zoom:e.overscaledZ,u_unpack:n.getUnpackVector()}}(n.tileID,c),i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),n.needsHillshadePrepare=!1}}function li(e,n,i,r,o){var s=r.paint.get("raster-fade-duration");if(s>0){var a=t.browser.now(),l=(a-e.timeAdded)/s,c=n?(a-n.timeAdded)/s:-1,u=i.getSource(),h=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),d=!n||Math.abs(n.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=d&&e.refreshedUponExpiration?1:t.clamp(d?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),n?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var ci=new t.Color(1,0,0,1),ui=new t.Color(0,1,0,1),hi=new t.Color(0,0,1,1),di=new t.Color(1,0,1,1),fi=new t.Color(0,1,1,1);function Ai(t,e,n,i){gi(t,0,e+n/2,t.transform.width,n,i)}function pi(t,e,n,i){gi(t,e-n/2,0,n,t.transform.height,i)}function gi(e,n,i,r,o,s){var a=e.context,l=a.gl;l.enable(l.SCISSOR_TEST),l.scissor(n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),a.clear({color:s}),l.disable(l.SCISSOR_TEST)}function mi(e,n,i){var r=e.context,o=r.gl,s=i.posMatrix,a=e.useProgram("debug"),l=Bt.disabled,c=Et.disabled,u=e.colorModeForRenderPass();r.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),a.draw(r,o.LINE_STRIP,l,c,u,St.disabled,Fn(s,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=n.getTileByID(i.key).latestRawTileData,d=Math.floor((h&&h.byteLength||0)/1024),f=n.getTile(i).tileSize,A=512/Math.min(f,512)*(i.overscaledZ/e.transform.zoom)*.5,p=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(p+=" => "+i.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var n=t.debugOverlayCanvas,i=t.context.gl,r=t.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,n.width,n.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(e,5,5),r.strokeText(e,5,5),t.debugOverlayTexture.update(n),t.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(e,p+" "+d+"kb"),a.draw(r,o.TRIANGLES,l,c,Tt.alphaBlended,St.disabled,Fn(s,t.Color.transparent,A),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var yi={symbol:function(e,n,i,r,o){if("translucent"===e.renderPass){var s=Et.disabled,a=e.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(e,n,i,r,o,s,a){for(var l=n.transform,c="map"===o,u="map"===s,h=0,d=e;h<d.length;h+=1){var f=d[h],A=r.getTile(f),p=A.getBucket(i);if(p&&p.text&&p.text.segments.get().length){var g=t.evaluateSizeForZoom(p.textSizeData,l.zoom),m=de(A,1,n.transform.zoom),y=Xt(f.posMatrix,u,c,n.transform,m),v="none"!==i.layout.get("icon-text-fit")&&p.hasIconData();if(g){var _=Math.pow(2,l.zoom-A.tileID.overscaledZ);ti(p,c,u,a,t.symbolSize,l,y,f.posMatrix,_,g,v)}}}}(r,e,i,n,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),o),0!==i.paint.get("icon-opacity").constantOr(1)&&ni(e,n,i,r,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),s,a),0!==i.paint.get("text-opacity").constantOr(1)&&ni(e,n,i,r,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),s,a),n.map.showCollisionBoxes&&(Xn(e,n,i,r,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),Xn(e,n,i,r,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1))}},circle:function(e,n,i,r){if("translucent"===e.renderPass){var o=i.paint.get("circle-opacity"),s=i.paint.get("circle-stroke-width"),a=i.paint.get("circle-stroke-opacity"),l=void 0!==i.layout.get("circle-sort-key").constantOr(1);if(0!==o.constantOr(1)||0!==s.constantOr(1)&&0!==a.constantOr(1)){for(var c=e.context,u=c.gl,h=e.depthModeForSublayer(0,Bt.ReadOnly),d=Et.disabled,f=e.colorModeForRenderPass(),A=[],p=0;p<r.length;p++){var g=r[p],m=n.getTile(g),y=m.getBucket(i);if(y){var v=y.programConfigurations.get(i.id),_={programConfiguration:v,program:e.useProgram("circle",v),layoutVertexBuffer:y.layoutVertexBuffer,indexBuffer:y.indexBuffer,uniformValues:In(e,g,m,i)};if(l)for(var b=0,x=y.segments.get();b<x.length;b+=1){var w=x[b];A.push({segments:new t.SegmentVector([w]),sortKey:w.sortKey,state:_})}else A.push({segments:y.segments,sortKey:0,state:_})}}l&&A.sort((function(t,e){return t.sortKey-e.sortKey}));for(var C=0,B=A;C<B.length;C+=1){var E=B[C],T=E.state;T.program.draw(c,u.TRIANGLES,h,d,f,St.disabled,T.uniformValues,i.id,T.layoutVertexBuffer,T.indexBuffer,E.segments,i.paint,e.transform.zoom,T.programConfiguration)}}}},heatmap:function(e,n,i,r){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,s=o.gl,a=Et.disabled,l=new Tt([s.ONE,s.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,n){var i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var r=n.heatmapFbo;if(r)i.bindTexture(i.TEXTURE_2D,r.colorAttachment.get()),t.bindFramebuffer.set(r.framebuffer);else{var o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),r=n.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,n,i){var r=t.gl;r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.width/4,e.height/4,0,r.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:r.UNSIGNED_BYTE,null),i.colorAttachment.set(n)}(t,e,o,r)}}(o,e,i),o.clear({color:t.Color.transparent});for(var c=0;c<r.length;c++){var u=r[c];if(!n.hasRenderableParent(u)){var h=n.getTile(u),d=h.getBucket(i);if(d){var f=d.programConfigurations.get(i.id);e.useProgram("heatmap",f).draw(o,s.TRIANGLES,Bt.disabled,a,l,St.disabled,On(u.posMatrix,h,e.transform.zoom,i.paint.get("heatmap-intensity")),i.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,i.paint,e.transform.zoom,f)}}}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,n){var i=e.context,r=i.gl,o=n.heatmapFbo;if(o){i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),i.activeTexture.set(r.TEXTURE1);var s=n.colorRampTexture;s||(s=n.colorRampTexture=new t.Texture(i,n.colorRamp,r.RGBA)),s.bind(r.LINEAR,r.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(i,r.TRIANGLES,Bt.disabled,Et.disabled,e.colorModeForRenderPass(),St.disabled,function(e,n,i,r){var o=t.create();t.ortho(o,0,e.width,e.height,0,0,1);var s=e.context.gl;return{u_matrix:o,u_world:[s.drawingBufferWidth,s.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:n.paint.get("heatmap-opacity")}}(e,n),n.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,n.paint,e.transform.zoom)}}(e,i))},line:function(e,n,i,r){if("translucent"===e.renderPass){var o=i.paint.get("line-opacity"),s=i.paint.get("line-width");if(0!==o.constantOr(1)&&0!==s.constantOr(1))for(var a=e.depthModeForSublayer(0,Bt.ReadOnly),l=e.colorModeForRenderPass(),c=i.paint.get("line-dasharray"),u=i.paint.get("line-pattern"),h=u.constantOr(1),d=i.paint.get("line-gradient"),f=i.getCrossfadeParameters(),A=h?"linePattern":c?"lineSDF":d?"lineGradient":"line",p=e.context,g=p.gl,m=!0,y=0,v=r;y<v.length;y+=1){var _=v[y],b=n.getTile(_);if(!h||b.patternsLoaded()){var x=b.getBucket(i);if(x){var w=x.programConfigurations.get(i.id),C=e.context.program.get(),B=e.useProgram(A,w),E=m||B.program!==C,T=u.constantOr(null);if(T&&b.imageAtlas){var S=b.imageAtlas,M=S.patternPositions[T.to.toString()],I=S.patternPositions[T.from.toString()];M&&I&&w.setConstantPatternPositions(M,I)}var P=h?Un(e,b,i,f):c?zn(e,b,i,c,f):d?kn(e,b,i,x.lineClipsArray.length):Rn(e,b,i);if(h)p.activeTexture.set(g.TEXTURE0),b.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),w.updatePaintBuffers(f);else if(c&&(E||e.lineAtlas.dirty))p.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(p);else if(d){var D=x.gradients[i.id],F=D.texture;if(i.gradientVersion!==D.version){var L=256;if(i.stepInterpolant){var O=n.getSource().maxzoom,R=_.canonical.z===O?Math.ceil(1<<e.transform.maxZoom-_.canonical.z):1;L=t.clamp(t.nextPowerOfTwo(x.maxLineLength/t.EXTENT*1024*R),256,p.maxTextureSize)}D.gradient=t.renderColorRamp({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:L,image:D.gradient||void 0,clips:x.lineClipsArray}),D.texture?D.texture.update(D.gradient):D.texture=new t.Texture(p,D.gradient,g.RGBA),D.version=i.gradientVersion,F=D.texture}p.activeTexture.set(g.TEXTURE0),F.bind(i.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}B.draw(p,g.TRIANGLES,a,e.stencilModeForClipping(_),l,St.disabled,P,i.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,i.paint,e.transform.zoom,w,x.layoutVertexBuffer2),m=!1}}}}},fill:function(e,n,i,r){var o=i.paint.get("fill-color"),s=i.paint.get("fill-opacity");if(0!==s.constantOr(1)){var a=e.colorModeForRenderPass(),l=i.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){var u=e.depthModeForSublayer(1,"opaque"===e.renderPass?Bt.ReadWrite:Bt.ReadOnly);ri(e,n,i,r,u,a,!1)}if("translucent"===e.renderPass&&i.paint.get("fill-antialias")){var h=e.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,Bt.ReadOnly);ri(e,n,i,r,h,a,!0)}}},"fill-extrusion":function(t,e,n,i){var r=n.paint.get("fill-extrusion-opacity");if(0!==r&&"translucent"===t.renderPass){var o=new Bt(t.context.gl.LEQUAL,Bt.ReadWrite,t.depthRangeFor3D);if(1!==r||n.paint.get("fill-extrusion-pattern").constantOr(1))oi(t,e,n,i,o,Et.disabled,Tt.disabled),oi(t,e,n,i,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var s=t.colorModeForRenderPass();oi(t,e,n,i,o,Et.disabled,s)}}},hillshade:function(t,e,n,i){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var r=t.context,o=t.depthModeForSublayer(0,Bt.ReadOnly),s=t.colorModeForRenderPass(),a="translucent"===t.renderPass?t.stencilConfigForOverlap(i):[{},i],l=a[0],c=0,u=a[1];c<u.length;c+=1){var h=u[c],d=e.getTile(h);d.needsHillshadePrepare&&"offscreen"===t.renderPass?ai(t,d,n,o,Et.disabled,s):"translucent"===t.renderPass&&si(t,d,n,o,l[h.overscaledZ],s)}r.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,n,i){if("translucent"===t.renderPass&&0!==n.paint.get("raster-opacity")&&i.length)for(var r=t.context,o=r.gl,s=e.getSource(),a=t.useProgram("raster"),l=t.colorModeForRenderPass(),c=s instanceof D?[{},i]:t.stencilConfigForOverlap(i),u=c[0],h=c[1],d=h[h.length-1].overscaledZ,f=!t.options.moving,A=0,p=h;A<p.length;A+=1){var g=p[A],m=t.depthModeForSublayer(g.overscaledZ-d,1===n.paint.get("raster-opacity")?Bt.ReadWrite:Bt.ReadOnly,o.LESS),y=e.getTile(g),v=t.transform.calculatePosMatrix(g.toUnwrapped(),f);y.registerFadeDuration(n.paint.get("raster-fade-duration"));var _=e.findLoadedParent(g,0),b=li(y,_,e,n,t.transform),x=void 0,w=void 0,C="nearest"===n.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;r.activeTexture.set(o.TEXTURE0),y.texture.bind(C,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),r.activeTexture.set(o.TEXTURE1),_?(_.texture.bind(C,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),x=Math.pow(2,_.tileID.overscaledZ-y.tileID.overscaledZ),w=[y.tileID.canonical.x*x%1,y.tileID.canonical.y*x%1]):y.texture.bind(C,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var B=Zn(v,w||[0,0],x||1,b,n);s instanceof D?a.draw(r,o.TRIANGLES,m,Et.disabled,l,St.disabled,B,n.id,s.boundsBuffer,t.quadTriangleIndexBuffer,s.boundsSegments):a.draw(r,o.TRIANGLES,m,u[g.overscaledZ],l,St.disabled,B,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,n){var i=n.paint.get("background-color"),r=n.paint.get("background-opacity");if(0!==r){var o=t.context,s=o.gl,a=t.transform,l=a.tileSize,c=n.paint.get("background-pattern");if(!t.isPatternMissing(c)){var u=!c&&1===i.a&&1===r&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===u){var h=Et.disabled,d=t.depthModeForSublayer(0,"opaque"===u?Bt.ReadWrite:Bt.ReadOnly),f=t.colorModeForRenderPass(),A=t.useProgram(c?"backgroundPattern":"background"),p=a.coveringTiles({tileSize:l});c&&(o.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));for(var g=n.getCrossfadeParameters(),m=0,y=p;m<y.length;m+=1){var v=y[m],_=t.transform.calculatePosMatrix(v.toUnwrapped()),b=c?Kn(_,r,t,c,{tileID:v,tileSize:l},g):Qn(_,r,i);A.draw(o,s.TRIANGLES,d,h,f,St.disabled,b,n.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,n){for(var i=0;i<n.length;i++)mi(t,e,n[i])},custom:function(t,e,n){var i=t.context,r=n.implementation;if("offscreen"===t.renderPass){var o=r.prerender;o&&(t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),o.call(r,i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),i.setColorMode(t.colorModeForRenderPass()),i.setStencilMode(Et.disabled);var s="3d"===r.renderingMode?new Bt(t.context.gl.LEQUAL,Bt.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Bt.ReadOnly);i.setDepthMode(s),r.render(i.gl,t.transform.customLayerMatrix()),i.setDirty(),t.setBaseState(),i.bindFramebuffer.set(null)}}},vi=function(t,e){this.context=new Mt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=It.maxUnderzooming+It.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ue,this.gpuTimers={}};vi.prototype.resize=function(e,n){if(this.width=e*t.browser.devicePixelRatio,this.height=n*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,r=this.style._order;i<r.length;i+=1)this.style._layers[r[i]].resize()},vi.prototype.setup=function(){var e=this.context,n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(n,Ve.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(i,Ve.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var r=new t.StructArrayLayout4i8;r.emplaceBack(0,0,0,0),r.emplaceBack(t.EXTENT,0,t.EXTENT,0),r.emplaceBack(0,t.EXTENT,0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(r,P.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,Ve.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var s=new t.StructArrayLayout1ui2;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(s);var a=new t.StructArrayLayout3ui6;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(a),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new Et({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},vi.prototype.clearStencil=function(){var e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var i=t.create();t.ortho(i,0,this.width,this.height,0,0,1),t.scale(i,i,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,n.TRIANGLES,Bt.disabled,this.stencilClearMode,Tt.disabled,St.disabled,Ln(i),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},vi.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var n=this.context,i=n.gl;this.nextStencilID+e.length>256&&this.clearStencil(),n.setColorMode(Tt.disabled),n.setDepthMode(Bt.disabled);var r=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,s=e;o<s.length;o+=1){var a=s[o],l=this._tileClippingMaskIDs[a.key]=this.nextStencilID++;r.draw(n,i.TRIANGLES,Bt.disabled,new Et({func:i.ALWAYS,mask:0},l,255,i.KEEP,i.KEEP,i.REPLACE),Tt.disabled,St.disabled,Ln(a.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},vi.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Et({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},vi.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Et({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},vi.prototype.stencilConfigForOverlap=function(t){var e,n=this.context.gl,i=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),r=i[i.length-1].overscaledZ,o=i[0].overscaledZ-r+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var s={},a=0;a<o;a++)s[a+r]=new Et({func:n.GEQUAL,mask:255},a+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=o,[s,i]}return[(e={},e[r]=Et.disabled,e),i]},vi.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Tt([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Tt.unblended:Tt.alphaBlended},vi.prototype.depthModeForSublayer=function(t,e,n){if(!this.opaquePassEnabledForLayer())return Bt.disabled;var i=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Bt(n||this.context.gl.LEQUAL,e,[i,i])},vi.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},vi.prototype.render=function(e,n){var i=this;this.style=e,this.options=n,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var r=this.style._order,o=this.style.sourceCaches;for(var s in o){var a=o[s];a.used&&a.prepare(this.context)}var l,c,u={},h={},d={};for(var f in o){var A=o[f];u[f]=A.getVisibleCoordinates(),h[f]=u[f].slice().reverse(),d[f]=A.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var p=0;p<r.length;p++)if(this.style._layers[r[p]].is3D()){this.opaquePassCutoff=p;break}this.renderPass="offscreen";for(var g=0,m=r;g<m.length;g+=1){var y=this.style._layers[m[g]];if(y.hasOffscreenPass()&&!y.isHidden(this.transform.zoom)){var v=h[y.source];("custom"===y.type||v.length)&&this.renderLayer(this,o[y.source],y,v)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){var _=this.style._layers[r[this.currentLayer]],b=o[_.source],x=u[_.source];this._renderTileClippingMasks(_,x),this.renderLayer(this,b,_,x)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){var w=this.style._layers[r[this.currentLayer]],C=o[w.source],B=("symbol"===w.type?d:h)[w.source];this._renderTileClippingMasks(w,u[w.source]),this.renderLayer(this,C,w,B)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(i.transform.zoom)&&(t.source!==(c&&c.id)&&(c=i.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<c.getSource().maxzoom)&&(l=c))})),l&&yi.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;Ai(t,t.transform.height-(e.top||0),3,ci),Ai(t,e.bottom||0,3,ui),pi(t,e.left||0,3,hi),pi(t,t.transform.width-(e.right||0),3,di);var n=t.transform.centerPoint;!function(t,e,n,i){gi(t,e-1,n-10,2,20,i),gi(t,e-10,n-1,20,2,i)}(t,n.x,t.transform.height-n.y,fi)}(this),this.context.setDefault()},vi.prototype.renderLayer=function(t,e,n,i){n.isHidden(this.transform.zoom)||("background"===n.type||"custom"===n.type||i.length)&&(this.id=n.id,this.gpuTimingStart(n),yi[n.type](t,e,n,i,this.style.placement.variableOffsets),this.gpuTimingEnd())},vi.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,n=this.gpuTimers[t.id];n||(n=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),n.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,n.query)}},vi.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},vi.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},vi.prototype.queryGpuTimers=function(t){var e={};for(var n in t){var i=t[n],r=this.context.extTimerQuery,o=r.getQueryObjectEXT(i.query,r.QUERY_RESULT_EXT)/1e6;r.deleteQueryEXT(i.query),e[n]=o}return e},vi.prototype.translatePosMatrix=function(e,n,i,r,o){if(!i[0]&&!i[1])return e;var s=o?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(s){var a=Math.sin(s),l=Math.cos(s);i=[i[0]*l-i[1]*a,i[0]*a+i[1]*l]}var c=[o?i[0]:de(n,i[0],this.transform.zoom),o?i[1]:de(n,i[1],this.transform.zoom),0],u=new Float32Array(16);return t.translate(u,e,c),u},vi.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},vi.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},vi.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),n=this.imageManager.getPattern(t.to.toString());return!e||!n},vi.prototype.useProgram=function(t,e){this.cache=this.cache||{};var n=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new xn(this.context,t,vn[t],e,qn[t],this._showOverdrawInspector)),this.cache[n]},vi.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},vi.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},vi.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},vi.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var _i=function(t,e){this.points=t,this.planes=e};_i.fromInvProjectionMatrix=function(e,n,i){var r=Math.pow(2,i),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(n){return t.transformMat4([],n,e)})).map((function(e){return t.scale$1([],e,1/e[3]/n*r)})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var n=t.sub([],o[e[0]],o[e[1]]),i=t.sub([],o[e[2]],o[e[1]]),r=t.normalize([],t.cross([],n,i)),s=-t.dot(r,o[e[1]]);return r.concat(s)}));return new _i(o,s)};var bi=function(e,n){this.min=e,this.max=n,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};bi.prototype.quadrant=function(e){for(var n=[e%2==0,e<2],i=t.clone$2(this.min),r=t.clone$2(this.max),o=0;o<n.length;o++)i[o]=n[o]?this.min[o]:this.center[o],r[o]=n[o]?this.center[o]:this.max[o];return r[2]=this.max[2],new bi(i,r)},bi.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},bi.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},bi.prototype.intersects=function(e){for(var n=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],i=!0,r=0;r<e.planes.length;r++){for(var o=e.planes[r],s=0,a=0;a<n.length;a++)s+=t.dot$1(o,n[a])>=0;if(0===s)return 0;s!==n.length&&(i=!1)}if(i)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;h<e.points.length;h++){var d=e.points[h][l]-this.min[l];c=Math.min(c,d),u=Math.max(u,d)}if(u<0||c>this.max[l]-this.min[l])return 0}return 1};var xi=function(t,e,n,i){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(n)||n<0||isNaN(i)||i<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=n,this.right=i};xi.prototype.interpolate=function(e,n,i){return null!=n.top&&null!=e.top&&(this.top=t.number(e.top,n.top,i)),null!=n.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,n.bottom,i)),null!=n.left&&null!=e.left&&(this.left=t.number(e.left,n.left,i)),null!=n.right&&null!=e.right&&(this.right=t.number(e.right,n.right,i)),this},xi.prototype.getCenter=function(e,n){var i=t.clamp((this.left+e-this.right)/2,0,e),r=t.clamp((this.top+n-this.bottom)/2,0,n);return new t.Point(i,r)},xi.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},xi.prototype.clone=function(){return new xi(this.top,this.bottom,this.left,this.right)},xi.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var wi=function(e,n,i,r,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=null==i?0:i,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new xi,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ci={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};wi.prototype.clone=function(){var t=new wi(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Ci.minZoom.get=function(){return this._minZoom},Ci.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Ci.maxZoom.get=function(){return this._maxZoom},Ci.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Ci.minPitch.get=function(){return this._minPitch},Ci.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Ci.maxPitch.get=function(){return this._maxPitch},Ci.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Ci.renderWorldCopies.get=function(){return this._renderWorldCopies},Ci.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Ci.worldSize.get=function(){return this.tileSize*this.scale},Ci.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ci.size.get=function(){return new t.Point(this.width,this.height)},Ci.bearing.get=function(){return-this.angle/Math.PI*180},Ci.bearing.set=function(e){var n=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ci.pitch.get=function(){return this._pitch/Math.PI*180},Ci.pitch.set=function(e){var n=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())},Ci.fov.get=function(){return this._fov/Math.PI*180},Ci.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Ci.zoom.get=function(){return this._zoom},Ci.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Ci.center.get=function(){return this._center},Ci.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Ci.padding.get=function(){return this._edgeInsets.toJSON()},Ci.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Ci.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},wi.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},wi.prototype.interpolatePadding=function(t,e,n){this._unmodified=!1,this._edgeInsets.interpolate(t,e,n),this._constrain(),this._calcMatrices()},wi.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},wi.prototype.getVisibleUnwrappedCoordinates=function(e){var n=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new t.Point(0,0)),r=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),s=this.pointCoordinate(new t.Point(0,this.height)),a=Math.floor(Math.min(i.x,r.x,o.x,s.x)),l=Math.floor(Math.max(i.x,r.x,o.x,s.x)),c=a-1;c<=l+1;c++)0!==c&&n.push(new t.UnwrappedTileID(c,e));return n},wi.prototype.coveringTiles=function(e){var n=this.coveringZoomLevel(e),i=n;if(void 0!==e.minzoom&&n<e.minzoom)return[];void 0!==e.maxzoom&&n>e.maxzoom&&(n=e.maxzoom);var r=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,n),s=[o*r.x,o*r.y,0],a=_i.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=n);var c=function(t){return{aabb:new bi([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],h=[],d=n,f=e.reparseOverscaled?i:n;if(this._renderWorldCopies)for(var A=1;A<=3;A++)u.push(c(-A)),u.push(c(A));for(u.push(c(0));u.length>0;){var p=u.pop(),g=p.x,m=p.y,y=p.fullyVisible;if(!y){var v=p.aabb.intersects(a);if(0===v)continue;y=2===v}var _=p.aabb.distanceX(s),b=p.aabb.distanceY(s),x=Math.max(Math.abs(_),Math.abs(b));if(p.zoom===d||x>3+(1<<d-p.zoom)-2&&p.zoom>=l)h.push({tileID:new t.OverscaledTileID(p.zoom===d?f:p.zoom,p.wrap,p.zoom,g,m),distanceSq:t.sqrLen([s[0]-.5-g,s[1]-.5-m])});else for(var w=0;w<4;w++){var C=(g<<1)+w%2,B=(m<<1)+(w>>1);u.push({aabb:p.aabb.quadrant(w),zoom:p.zoom+1,x:C,y:B,wrap:p.wrap,fullyVisible:y})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},wi.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Ci.unmodified.get=function(){return this._unmodified},wi.prototype.zoomScale=function(t){return Math.pow(2,t)},wi.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},wi.prototype.project=function(e){var n=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(n)*this.worldSize)},wi.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Ci.point.get=function(){return this.project(this.center)},wi.prototype.setLocationAtPoint=function(e,n){var i=this.pointCoordinate(n),r=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),s=new t.MercatorCoordinate(o.x-(i.x-r.x),o.y-(i.y-r.y));this.center=this.coordinateLocation(s),this._renderWorldCopies&&(this.center=this.center.wrap())},wi.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},wi.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},wi.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},wi.prototype.coordinateLocation=function(t){return t.toLngLat()},wi.prototype.pointCoordinate=function(e){var n=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.transformMat4(n,n,this.pixelMatrixInverse),t.transformMat4(i,i,this.pixelMatrixInverse);var r=n[3],o=i[3],s=n[1]/r,a=i[1]/o,l=n[2]/r,c=i[2]/o,u=l===c?0:(0-l)/(c-l);return new t.MercatorCoordinate(t.number(n[0]/r,i[0]/o,u)/this.worldSize,t.number(s,a,u)/this.worldSize)},wi.prototype.coordinatePoint=function(e){var n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(n,n,this.pixelMatrix),new t.Point(n[0]/n[3],n[1]/n[3])},wi.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},wi.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},wi.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},wi.prototype.calculatePosMatrix=function(e,n){void 0===n&&(n=!1);var i=e.key,r=n?this._alignedPosMatrixCache:this._posMatrixCache;if(r[i])return r[i];var o=e.canonical,s=this.worldSize/this.zoomScale(o.z),a=o.x+Math.pow(2,o.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[a*s,o.y*s,0]),t.scale(l,l,[s/t.EXTENT,s/t.EXTENT,1]),t.multiply(l,n?this.alignedProjMatrix:this.projMatrix,l),r[i]=new Float32Array(l),r[i]},wi.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},wi.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,n,i,r,o=-90,s=90,a=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(s=t.mercatorYfromLat(h[0])*this.worldSize)-o<c.y?c.y/(s-o):0}if(this.lngRange){var d=this.lngRange;a=t.mercatorXfromLng(d[0])*this.worldSize,n=(l=t.mercatorXfromLng(d[1])*this.worldSize)-a<c.x?c.x/(l-a):0}var f=this.point,A=Math.max(n||0,e||0);if(A)return this.center=this.unproject(new t.Point(n?(l+a)/2:f.x,e?(s+o)/2:f.y)),this.zoom+=this.scaleZoom(A),this._unmodified=u,void(this._constraining=!1);if(this.latRange){var p=f.y,g=c.y/2;p-g<o&&(r=o+g),p+g>s&&(r=s-g)}if(this.lngRange){var m=f.x,y=c.x/2;m-y<a&&(i=a+y),m+y>l&&(i=l-y)}void 0===i&&void 0===r||(this.center=this.unproject(new t.Point(void 0!==i?i:f.x,void 0!==r?r:f.y))),this._unmodified=u,this._constraining=!1}},wi.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+e.y/this.height),r=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,a=o.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),c=this.height/50,u=new Float64Array(16);t.perspective(u,this._fov,this.width/this.height,c,l),u[8]=2*-e.x/this.width,u[9]=2*e.y/this.height,t.scale(u,u,[1,-1,1]),t.translate(u,u,[0,0,-this.cameraToCenterDistance]),t.rotateX(u,u,this._pitch),t.rotateZ(u,u,this.angle),t.translate(u,u,[-s,-a,0]),this.mercatorMatrix=t.scale([],u,[this.worldSize,this.worldSize,this.worldSize]),t.scale(u,u,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=u,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,d=this.height%2/2,f=Math.cos(this.angle),A=Math.sin(this.angle),p=s-Math.round(s)+f*h+A*d,g=a-Math.round(a)+f*d+A*h,m=new Float64Array(u);if(t.translate(m,m,[p>.5?p-1:p,g>.5?g-1:g,0]),this.alignedProjMatrix=m,u=t.create(),t.scale(u,u,[this.width/2,-this.height/2,1]),t.translate(u,u,[1,-1,0]),this.labelPlaneMatrix=u,u=t.create(),t.scale(u,u,[1,-1,1]),t.translate(u,u,[-1,-1,0]),t.scale(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(u=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=u,this._posMatrixCache={},this._alignedPosMatrixCache={}}},wi.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance},wi.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},wi.prototype.getCameraQueryGeometry=function(e){var n=this.getCameraPoint();if(1===e.length)return[e[0],n];for(var i=n.x,r=n.y,o=n.x,s=n.y,a=0,l=e;a<l.length;a+=1){var c=l[a];i=Math.min(i,c.x),r=Math.min(r,c.y),o=Math.max(o,c.x),s=Math.max(s,c.y)}return[new t.Point(i,r),new t.Point(o,r),new t.Point(o,s),new t.Point(i,s),new t.Point(i,r)]},Object.defineProperties(wi.prototype,Ci);var Bi=function(e){var n,i,r,o;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(n=this._updateHashUnthrottled.bind(this),i=!1,r=null,o=function(){r=null,i&&(n(),r=setTimeout(o,300),i=!1)},function(){return i=!0,r||o(),r})};Bi.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Bi.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Bi.prototype.getHashString=function(e){var n=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,r),s=Math.round(n.lng*o)/o,a=Math.round(n.lat*o)/o,l=this._map.getBearing(),c=this._map.getPitch(),u="";if(u+=e?"/"+s+"/"+a+"/"+i:i+"/"+a+"/"+s,(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+="/"+Math.round(c)),this._hashName){var h=this._hashName,d=!1,f=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===h?(d=!0,e+"="+u):t})).filter((function(t){return t}));return d||f.push(h+"="+u),"#"+f.join("&")}return"#"+u},Bi.prototype._getCurrentHash=function(){var e,n=this,i=t.window.location.hash.replace("#","");return this._hashName?(i.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===n._hashName&&(e=t)})),(e&&e[1]||"").split("/")):i.split("/")},Bi.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Bi.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Ei={linearity:.3,easing:t.bezier(0,0,.3,1)},Ti=t.extend({deceleration:2500,maxSpeed:1400},Ei),Si=t.extend({deceleration:20,maxSpeed:1400},Ei),Mi=t.extend({deceleration:1e3,maxSpeed:360},Ei),Ii=t.extend({deceleration:1e3,maxSpeed:90},Ei),Pi=function(t){this._map=t,this.clear()};function Di(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Fi(e,n,i){var r=i.maxSpeed,o=i.linearity,s=i.deceleration,a=t.clamp(e*o/(n/1e3),-r,r),l=Math.abs(a)/(s*o);return{easing:i.easing,duration:1e3*l,amount:a*(l/2)}}Pi.prototype.clear=function(){this._inertiaBuffer=[]},Pi.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Pi.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,n=t.browser.now();e.length>0&&n-e[0].time>160;)e.shift()},Pi.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var n={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},i=0,r=this._inertiaBuffer;i<r.length;i+=1){var o=r[i].settings;n.zoom+=o.zoomDelta||0,n.bearing+=o.bearingDelta||0,n.pitch+=o.pitchDelta||0,o.panDelta&&n.pan._add(o.panDelta),o.around&&(n.around=o.around),o.pinchAround&&(n.pinchAround=o.pinchAround)}var s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,a={};if(n.pan.mag()){var l=Fi(n.pan.mag(),s,t.extend({},Ti,e||{}));a.offset=n.pan.mult(l.amount/n.pan.mag()),a.center=this._map.transform.center,Di(a,l)}if(n.zoom){var c=Fi(n.zoom,s,Si);a.zoom=this._map.transform.zoom+c.amount,Di(a,c)}if(n.bearing){var u=Fi(n.bearing,s,Mi);a.bearing=this._map.transform.bearing+t.clamp(u.amount,-179,179),Di(a,u)}if(n.pitch){var h=Fi(n.pitch,s,Ii);a.pitch=this._map.transform.pitch+h.amount,Di(a,h)}if(a.zoom||a.bearing){var d=void 0===n.pinchAround?n.around:n.pinchAround;a.around=d?this._map.unproject(d):this._map.getCenter()}return this.clear(),t.extend(a,{noMoveStart:!0})}};var Li=function(e){function i(i,r,o,s){void 0===s&&(s={});var a=n.mousePos(r.getCanvasContainer(),o),l=r.unproject(a);e.call(this,i,t.extend({point:a,lngLat:l,originalEvent:o},s)),this._defaultPrevented=!1,this.target=r}e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i;var r={defaultPrevented:{configurable:!0}};return i.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,r),i}(t.Event),Oi=function(e){function i(i,r,o){var s="touchend"===i?o.changedTouches:o.touches,a=n.touchPos(r.getCanvasContainer(),s),l=a.map((function(t){return r.unproject(t)})),c=a.reduce((function(t,e,n,i){return t.add(e.div(i.length))}),new t.Point(0,0)),u=r.unproject(c);e.call(this,i,{points:a,point:c,lngLats:l,lngLat:u,originalEvent:o}),this._defaultPrevented=!1}e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i;var r={defaultPrevented:{configurable:!0}};return i.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,r),i}(t.Event),Ri=function(t){function e(e,n,i){t.call(this,e,{originalEvent:i}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,n),e}(t.Event),ki=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};ki.prototype.reset=function(){delete this._mousedownPos},ki.prototype.wheel=function(t){return this._firePreventable(new Ri(t.type,this._map,t))},ki.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new Li(t.type,this._map,t))},ki.prototype.mouseup=function(t){this._map.fire(new Li(t.type,this._map,t))},ki.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Li(t.type,this._map,t))},ki.prototype.dblclick=function(t){return this._firePreventable(new Li(t.type,this._map,t))},ki.prototype.mouseover=function(t){this._map.fire(new Li(t.type,this._map,t))},ki.prototype.mouseout=function(t){this._map.fire(new Li(t.type,this._map,t))},ki.prototype.touchstart=function(t){return this._firePreventable(new Oi(t.type,this._map,t))},ki.prototype.touchmove=function(t){this._map.fire(new Oi(t.type,this._map,t))},ki.prototype.touchend=function(t){this._map.fire(new Oi(t.type,this._map,t))},ki.prototype.touchcancel=function(t){this._map.fire(new Oi(t.type,this._map,t))},ki.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},ki.prototype.isEnabled=function(){return!0},ki.prototype.isActive=function(){return!1},ki.prototype.enable=function(){},ki.prototype.disable=function(){};var Ui=function(t){this._map=t};Ui.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Ui.prototype.mousemove=function(t){this._map.fire(new Li(t.type,this._map,t))},Ui.prototype.mousedown=function(){this._delayContextMenu=!0},Ui.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Li("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Ui.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Li(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Ui.prototype.isEnabled=function(){return!0},Ui.prototype.isActive=function(){return!1},Ui.prototype.enable=function(){},Ui.prototype.disable=function(){};var zi=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Gi(t,e){for(var n={},i=0;i<t.length;i++)n[t[i].identifier]=e[i];return n}zi.prototype.isEnabled=function(){return!!this._enabled},zi.prototype.isActive=function(){return!!this._active},zi.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},zi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},zi.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(n.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},zi.prototype.mousemoveWindow=function(t,e){if(this._active){var i=e;if(!(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)){var r=this._startPos;this._lastPos=i,this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var o=Math.min(r.x,i.x),s=Math.max(r.x,i.x),a=Math.min(r.y,i.y),l=Math.max(r.y,i.y);n.setTransform(this._box,"translate("+o+"px,"+a+"px)"),this._box.style.width=s-o+"px",this._box.style.height=l-a+"px"}}},zi.prototype.mouseupWindow=function(e,i){var r=this;if(this._active&&0===e.button){var o=this._startPos,s=i;if(this.reset(),n.suppressClick(),o.x!==s.x||o.y!==s.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(o,s,r._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},zi.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},zi.prototype.blur=function(){this.reset()},zi.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag(),delete this._startPos,delete this._lastPos},zi.prototype._fireEvent=function(e,n){return this._map.fire(new t.Event(e,{originalEvent:n}))};var Ni=function(t){this.reset(),this.numTouches=t.numTouches};Ni.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Ni.prototype.touchstart=function(e,n,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=function(e){for(var n=new t.Point(0,0),i=0,r=e;i<r.length;i+=1)n._add(r[i]);return n.div(e.length)}(n),this.touches=Gi(i,n)))},Ni.prototype.touchmove=function(t,e,n){if(!this.aborted&&this.centroid){var i=Gi(n,e);for(var r in this.touches){var o=i[r];(!o||o.dist(this.touches[r])>30)&&(this.aborted=!0)}}},Ni.prototype.touchend=function(t,e,n){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){var i=!this.aborted&&this.centroid;if(this.reset(),i)return i}};var Zi=function(t){this.singleTap=new Ni(t),this.numTaps=t.numTaps,this.reset()};Zi.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Zi.prototype.touchstart=function(t,e,n){this.singleTap.touchstart(t,e,n)},Zi.prototype.touchmove=function(t,e,n){this.singleTap.touchmove(t,e,n)},Zi.prototype.touchend=function(t,e,n){var i=this.singleTap.touchend(t,e,n);if(i){var r=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(i)<30;if(r&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}};var ji=function(){this._zoomIn=new Zi({numTouches:1,numTaps:2}),this._zoomOut=new Zi({numTouches:2,numTaps:1}),this.reset()};ji.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},ji.prototype.touchstart=function(t,e,n){this._zoomIn.touchstart(t,e,n),this._zoomOut.touchstart(t,e,n)},ji.prototype.touchmove=function(t,e,n){this._zoomIn.touchmove(t,e,n),this._zoomOut.touchmove(t,e,n)},ji.prototype.touchend=function(t,e,n){var i=this,r=this._zoomIn.touchend(t,e,n),o=this._zoomOut.touchend(t,e,n);return r?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(r)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},ji.prototype.touchcancel=function(){this.reset()},ji.prototype.enable=function(){this._enabled=!0},ji.prototype.disable=function(){this._enabled=!1,this.reset()},ji.prototype.isEnabled=function(){return this._enabled},ji.prototype.isActive=function(){return this._active};var Vi={0:1,2:2},Hi=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Hi.prototype.blur=function(){this.reset()},Hi.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Hi.prototype._correctButton=function(t,e){return!1},Hi.prototype._move=function(t,e){return{}},Hi.prototype.mousedown=function(t,e){if(!this._lastPoint){var i=n.mouseButton(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i)}},Hi.prototype.mousemoveWindow=function(t,e){var n=this._lastPoint;if(n)if(t.preventDefault(),function(t,e){var n=Vi[e];return void 0===t.buttons||(t.buttons&n)!==n}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(n,e)},Hi.prototype.mouseupWindow=function(t){this._lastPoint&&n.mouseButton(t)===this._eventButton&&(this._moved&&n.suppressClick(),this.reset())},Hi.prototype.enable=function(){this._enabled=!0},Hi.prototype.disable=function(){this._enabled=!1,this.reset()},Hi.prototype.isEnabled=function(){return this._enabled},Hi.prototype.isActive=function(){return this._active};var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.mousedown=function(e,n){t.prototype.mousedown.call(this,e,n),this._lastPoint&&(this._active=!0)},e.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},e.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},e}(Hi),Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var n=.8*(e.x-t.x);if(n)return this._active=!0,{bearingDelta:n}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Hi),Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var n=-.5*(e.y-t.y);if(n)return this._active=!0,{pitchDelta:n}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Hi),Ki=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};Ki.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},Ki.prototype.touchstart=function(t,e,n){return this._calculateTransform(t,e,n)},Ki.prototype.touchmove=function(t,e,n){if(this._active&&!(n.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,n)},Ki.prototype.touchend=function(t,e,n){this._calculateTransform(t,e,n),this._active&&n.length<this._minTouches&&this.reset()},Ki.prototype.touchcancel=function(){this.reset()},Ki.prototype._calculateTransform=function(e,n,i){i.length>0&&(this._active=!0);var r=Gi(i,n),o=new t.Point(0,0),s=new t.Point(0,0),a=0;for(var l in r){var c=r[l],u=this._touches[l];u&&(o._add(c),s._add(c.sub(u)),a++,r[l]=c)}if(this._touches=r,!(a<this._minTouches)&&s.mag()){var h=s.div(a);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return{around:o.div(a),panDelta:h}}},Ki.prototype.enable=function(){this._enabled=!0},Ki.prototype.disable=function(){this._enabled=!1,this.reset()},Ki.prototype.isEnabled=function(){return this._enabled},Ki.prototype.isActive=function(){return this._active};var qi=function(){this.reset()};function Xi(t,e,n){for(var i=0;i<t.length;i++)if(t[i].identifier===n)return e[i]}function Yi(t,e){return Math.log(t/e)/Math.LN2}qi.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},qi.prototype._start=function(t){},qi.prototype._move=function(t,e,n){return{}},qi.prototype.touchstart=function(t,e,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([e[0],e[1]]))},qi.prototype.touchmove=function(t,e,n){if(this._firstTwoTouches){t.preventDefault();var i=this._firstTwoTouches,r=i[1],o=Xi(n,e,i[0]),s=Xi(n,e,r);if(o&&s){var a=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],a,t)}}},qi.prototype.touchend=function(t,e,i){if(this._firstTwoTouches){var r=this._firstTwoTouches,o=r[1],s=Xi(i,e,r[0]),a=Xi(i,e,o);s&&a||(this._active&&n.suppressClick(),this.reset())}},qi.prototype.touchcancel=function(){this.reset()},qi.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},qi.prototype.disable=function(){this._enabled=!1,this.reset()},qi.prototype.isEnabled=function(){return this._enabled},qi.prototype.isActive=function(){return this._active};var $i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._distance,delete this._startDistance},e.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},e.prototype._move=function(t,e){var n=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Yi(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Yi(this._distance,n),pinchAround:e}},e}(qi);function tr(t,e){return 180*t.angleWith(e)/Math.PI}var er=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},e.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},e.prototype._move=function(t,e){var n=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:tr(this._vector,n),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,n=tr(t,this._startVector);return Math.abs(n)<e},e}(qi);function nr(t){return Math.abs(t.y)>Math.abs(t.x)}var ir=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,nr(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,n){var i=t[0].sub(this._lastPoints[0]),r=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(i,r,n.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(i.y+r.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,n){if(void 0!==this._valid)return this._valid;var i=t.mag()>=2,r=e.mag()>=2;if(i||r){if(!i||!r)return void 0===this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return nr(t)&&nr(e)&&o}},e}(qi),rr={panStep:100,bearingStep:15,pitchStep:10},or=function(){var t=rr;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function sr(t){return t*(2-t)}or.prototype.blur=function(){this.reset()},or.prototype.reset=function(){this._active=!1},or.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var n=0,i=0,r=0,o=0,s=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),s=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:function(a){var l=a.getZoom();a.easeTo({duration:300,easeId:"keyboardHandler",easing:sr,zoom:n?Math.round(l)+n*(t.shiftKey?2:1):l,bearing:a.getBearing()+i*e._bearingStep,pitch:a.getPitch()+r*e._pitchStep,offset:[-o*e._panStep,-s*e._panStep],center:a.getCenter()},{originalEvent:t})}}}},or.prototype.enable=function(){this._enabled=!0},or.prototype.disable=function(){this._enabled=!1,this.reset()},or.prototype.isEnabled=function(){return this._enabled},or.prototype.isActive=function(){return this._active},or.prototype.disableRotation=function(){this._rotationDisabled=!0},or.prototype.enableRotation=function(){this._rotationDisabled=!1};var ar=function(e,n){this._map=e,this._el=e.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};ar.prototype.setZoomRate=function(t){this._defaultZoomRate=t},ar.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},ar.prototype.isEnabled=function(){return!!this._enabled},ar.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},ar.prototype.isZooming=function(){return!!this._zooming},ar.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},ar.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ar.prototype.wheel=function(e){if(this.isEnabled()){var n=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,i=t.browser.now(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),e.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=e,this._delta-=n,this._active||this._start(e)),e.preventDefault()}},ar.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},ar.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var i=n.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(i)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ar.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var n=this._map.transform;if(0!==this._delta){var i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==r&&(r=1/r);var o="number"==typeof this._targetZoom?n.zoomScale(this._targetZoom):n.scale;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(o*r))),"wheel"===this._type&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var s,a="number"==typeof this._targetZoom?this._targetZoom:n.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),d=c(h);s=t.number(l,a,d),h<1?this._frameId||(this._frameId=!0):u=!0}else s=a,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:s-n.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ar.prototype._smoothOutEasing=function(e){var n=t.ease;if(this._prevEase){var i=this._prevEase,r=(t.browser.now()-i.start)/i.duration,o=i.easing(r+.01)-i.easing(r),s=.27/Math.sqrt(o*o+1e-4)*.01,a=Math.sqrt(.0729-s*s);n=t.bezier(s,a,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:n},n},ar.prototype.blur=function(){this.reset()},ar.prototype.reset=function(){this._active=!1};var lr=function(t,e){this._clickZoom=t,this._tapZoom=e};lr.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},lr.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},lr.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},lr.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var cr=function(){this.reset()};cr.prototype.reset=function(){this._active=!1},cr.prototype.blur=function(){this.reset()},cr.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(t.shiftKey?-1:1),around:n.unproject(e)},{originalEvent:t})}}},cr.prototype.enable=function(){this._enabled=!0},cr.prototype.disable=function(){this._enabled=!1,this.reset()},cr.prototype.isEnabled=function(){return this._enabled},cr.prototype.isActive=function(){return this._active};var ur=function(){this._tap=new Zi({numTouches:1,numTaps:1}),this.reset()};ur.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ur.prototype.touchstart=function(t,e,n){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=e[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(t,e,n))},ur.prototype.touchmove=function(t,e,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var i=e[0],r=i.y-this._swipePoint.y;return this._swipePoint=i,t.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(t,e,n)},ur.prototype.touchend=function(t,e,n){this._tapTime?this._swipePoint&&0===n.length&&this.reset():this._tap.touchend(t,e,n)&&(this._tapTime=t.timeStamp)},ur.prototype.touchcancel=function(){this.reset()},ur.prototype.enable=function(){this._enabled=!0},ur.prototype.disable=function(){this._enabled=!1,this.reset()},ur.prototype.isEnabled=function(){return this._enabled},ur.prototype.isActive=function(){return this._active};var hr=function(t,e,n){this._el=t,this._mousePan=e,this._touchPan=n};hr.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hr.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hr.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hr.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var dr=function(t,e,n){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=n};dr.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},dr.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},dr.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},dr.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var fr=function(t,e,n,i){this._el=t,this._touchZoom=e,this._touchRotate=n,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0};fr.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},fr.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},fr.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},fr.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},fr.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},fr.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ar=function(t){return t.zoom||t.drag||t.pitch||t.rotate},pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function gr(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var mr=function(e,i){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Pi(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i),t.bindAll(["handleEvent","handleWindowEvent"],this);var r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,s=this._listeners;o<s.length;o+=1){var a=s[o],l=a[0];n.addEventListener(l,a[1],l===t.window.document?this.handleWindowEvent:this.handleEvent,a[2])}};mr.prototype.destroy=function(){for(var e=0,i=this._listeners;e<i.length;e+=1){var r=i[e],o=r[0];n.removeEventListener(o,r[1],o===t.window.document?this.handleWindowEvent:this.handleEvent,r[2])}},mr.prototype._addDefaultHandlers=function(t){var e=this._map,n=e.getCanvasContainer();this._add("mapEvent",new ki(e,t));var i=e.boxZoom=new zi(e,t);this._add("boxZoom",i);var r=new ji,o=new cr;e.doubleClickZoom=new lr(o,r),this._add("tapZoom",r),this._add("clickZoom",o);var s=new ur;this._add("tapDragZoom",s);var a=e.touchPitch=new ir;this._add("touchPitch",a);var l=new Wi(t),c=new Qi(t);e.dragRotate=new dr(t,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);var u=new Ji(t),h=new Ki(t);e.dragPan=new hr(n,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);var d=new er,f=new $i;e.touchZoomRotate=new fr(n,f,d,s),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]);var A=e.scrollZoom=new ar(e,this);this._add("scrollZoom",A,["mousePan"]);var p=e.keyboard=new or;this._add("keyboard",p),this._add("blockableMapEvent",new Ui(e));for(var g=0,m=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<m.length;g+=1){var y=m[g];t.interactive&&t[y]&&e[y].enable(t[y])}},mr.prototype._add=function(t,e,n){this._handlers.push({handlerName:t,handler:e,allowed:n}),this._handlersById[t]=e},mr.prototype.stop=function(t){if(!this._updatingCamera){for(var e=0,n=this._handlers;e<n.length;e+=1)n[e].handler.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}},mr.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},mr.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},mr.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},mr.prototype.isMoving=function(){return Boolean(Ar(this._eventsInProgress))||this.isZooming()},mr.prototype._blockedByActive=function(t,e,n){for(var i in t)if(i!==n&&(!e||e.indexOf(i)<0))return!0;return!1},mr.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},mr.prototype._getMapTouches=function(t){for(var e=[],n=0,i=t;n<i.length;n+=1){var r=i[n];this._el.contains(r.target)&&e.push(r)}return e},mr.prototype.handleEvent=function(t,e){this._updatingCamera=!0;for(var i="renderFrame"===t.type?void 0:t,r={needsRenderFrame:!1},o={},s={},a=t.touches?this._getMapTouches(t.touches):void 0,l=a?n.touchPos(this._el,a):n.mousePos(this._el,t),c=0,u=this._handlers;c<u.length;c+=1){var h=u[c],d=h.handlerName,f=h.handler,A=h.allowed;if(f.isEnabled()){var p=void 0;this._blockedByActive(s,A,d)?f.reset():f[e||t.type]&&(p=f[e||t.type](t,l,a),this.mergeHandlerResult(r,o,p,d,i),p&&p.needsRenderFrame&&this._triggerRenderFrame()),(p||f.isActive())&&(s[d]=f)}}var g={};for(var m in this._previousActiveHandlers)s[m]||(g[m]=i);this._previousActiveHandlers=s,(Object.keys(g).length||gr(r))&&(this._changes.push([r,o,g]),this._triggerRenderFrame()),(Object.keys(s).length||gr(r))&&this._map._stop(!0),this._updatingCamera=!1;var y=r.cameraAnimation;y&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],y(this._map))},mr.prototype.mergeHandlerResult=function(e,n,i,r,o){if(i){t.extend(e,i);var s={handlerName:r,originalEvent:i.originalEvent||o};void 0!==i.zoomDelta&&(n.zoom=s),void 0!==i.panDelta&&(n.drag=s),void 0!==i.pitchDelta&&(n.pitch=s),void 0!==i.bearingDelta&&(n.rotate=s)}},mr.prototype._applyChanges=function(){for(var e={},n={},i={},r=0,o=this._changes;r<o.length;r+=1){var s=o[r],a=s[0],l=s[1],c=s[2];a.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(a.panDelta)),a.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+a.zoomDelta),a.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+a.bearingDelta),a.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+a.pitchDelta),void 0!==a.around&&(e.around=a.around),void 0!==a.pinchAround&&(e.pinchAround=a.pinchAround),a.noInertia&&(e.noInertia=a.noInertia),t.extend(n,l),t.extend(i,c)}this._updateMapTransform(e,n,i),this._changes=[]},mr.prototype._updateMapTransform=function(t,e,n){var i=this._map,r=i.transform;if(!gr(t))return this._fireEvents(e,n,!0);var o=t.panDelta,s=t.zoomDelta,a=t.bearingDelta,l=t.pitchDelta,c=t.around,u=t.pinchAround;void 0!==u&&(c=u),i._stop(!0),c=c||i.transform.centerPoint;var h=r.pointLocation(o?c.sub(o):c);a&&(r.bearing+=a),l&&(r.pitch+=l),s&&(r.zoom+=s),r.setLocationAtPoint(h,c),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,n,!0)},mr.prototype._fireEvents=function(e,n,i){var r=this,o=Ar(this._eventsInProgress),s=Ar(e),a={};for(var l in e)this._eventsInProgress[l]||(a[l+"start"]=e[l].originalEvent),this._eventsInProgress[l]=e[l];for(var c in!o&&s&&this._fireEvent("movestart",s.originalEvent),a)this._fireEvent(c,a[c]);for(var u in s&&this._fireEvent("move",s.originalEvent),e)this._fireEvent(u,e[u].originalEvent);var h,d={};for(var f in this._eventsInProgress){var A=this._eventsInProgress[f],p=A.handlerName,g=A.originalEvent;this._handlersById[p].isActive()||(delete this._eventsInProgress[f],d[f+"end"]=h=n[p]||g)}for(var m in d)this._fireEvent(m,d[m]);var y=Ar(this._eventsInProgress);if(i&&(o||s)&&!y){this._updatingCamera=!0;var v=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),_=function(t){return 0!==t&&-r._bearingSnap<t&&t<r._bearingSnap};v?(_(v.bearing||this._map.getBearing())&&(v.bearing=0),this._map.easeTo(v,{originalEvent:h})):(this._map.fire(new t.Event("moveend",{originalEvent:h})),_(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},mr.prototype._fireEvent=function(e,n){this._map.fire(new t.Event(e,n?{originalEvent:n}:{}))},mr.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new pr("renderFrame",{timeStamp:e})),t._applyChanges()}))},mr.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var yr=function(e){function n(n,i){e.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=i.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},n.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},n.prototype.panBy=function(e,n,i){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},n),i)},n.prototype.panTo=function(e,n,i){return this.easeTo(t.extend({center:e},n),i)},n.prototype.getZoom=function(){return this.transform.zoom},n.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},n.prototype.zoomTo=function(e,n,i){return this.easeTo(t.extend({zoom:e},n),i)},n.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},n.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},n.prototype.getBearing=function(){return this.transform.bearing},n.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},n.prototype.getPadding=function(){return this.transform.padding},n.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},n.prototype.rotateTo=function(e,n,i){return this.easeTo(t.extend({bearing:e},n),i)},n.prototype.resetNorth=function(e,n){return this.rotateTo(0,t.extend({duration:1e3},e),n),this},n.prototype.resetNorthPitch=function(e,n){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),n),this},n.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},n.prototype.getPitch=function(){return this.transform.pitch},n.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},n.prototype.cameraForBounds=function(e,n){e=t.LngLatBounds.convert(e);var i=n&&n.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),i,n)},n.prototype._cameraForBoxAndBearing=function(e,n,i,r){var o={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=t.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){var s=r.padding;r.padding={top:s,bottom:s,right:s,left:s}}r.padding=t.extend(o,r.padding);var a=this.transform,l=a.padding,c=a.project(t.LngLat.convert(e)),u=a.project(t.LngLat.convert(n)),h=c.rotate(-i*Math.PI/180),d=u.rotate(-i*Math.PI/180),f=new t.Point(Math.max(h.x,d.x),Math.max(h.y,d.y)),A=new t.Point(Math.min(h.x,d.x),Math.min(h.y,d.y)),p=f.sub(A),g=(a.width-(l.left+l.right+r.padding.left+r.padding.right))/p.x,m=(a.height-(l.top+l.bottom+r.padding.top+r.padding.bottom))/p.y;if(!(m<0||g<0)){var y=Math.min(a.scaleZoom(a.scale*Math.min(g,m)),r.maxZoom),v="number"==typeof r.offset.x?new t.Point(r.offset.x,r.offset.y):t.Point.convert(r.offset),_=new t.Point((r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2).rotate(i*Math.PI/180),b=v.add(_).mult(a.scale/a.zoomScale(y));return{center:a.unproject(c.add(u).div(2).sub(b)),zoom:y,bearing:i}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},n.prototype.fitBounds=function(t,e,n){return this._fitInternal(this.cameraForBounds(t,e),e,n)},n.prototype.fitScreenCoordinates=function(e,n,i,r,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(n)),i,r),r,o)},n.prototype._fitInternal=function(e,n,i){return e?(delete(n=t.extend(e,n)).padding,n.linear?this.easeTo(n,i):this.flyTo(n,i)):this},n.prototype.jumpTo=function(e,n){this.stop();var i=this.transform,r=!1,o=!1,s=!1;return"zoom"in e&&i.zoom!==+e.zoom&&(r=!0,i.zoom=+e.zoom),void 0!==e.center&&(i.center=t.LngLat.convert(e.center)),"bearing"in e&&i.bearing!==+e.bearing&&(o=!0,i.bearing=+e.bearing),"pitch"in e&&i.pitch!==+e.pitch&&(s=!0,i.pitch=+e.pitch),null==e.padding||i.isPaddingEqual(e.padding)||(i.padding=e.padding),this.fire(new t.Event("movestart",n)).fire(new t.Event("move",n)),r&&this.fire(new t.Event("zoomstart",n)).fire(new t.Event("zoom",n)).fire(new t.Event("zoomend",n)),o&&this.fire(new t.Event("rotatestart",n)).fire(new t.Event("rotate",n)).fire(new t.Event("rotateend",n)),s&&this.fire(new t.Event("pitchstart",n)).fire(new t.Event("pitch",n)).fire(new t.Event("pitchend",n)),this.fire(new t.Event("moveend",n))},n.prototype.easeTo=function(e,n){var i=this;this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var r=this.transform,o=this.getZoom(),s=this.getBearing(),a=this.getPitch(),l=this.getPadding(),c="zoom"in e?+e.zoom:o,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:a,d="padding"in e?e.padding:r.padding,f=t.Point.convert(e.offset),A=r.centerPoint.add(f),p=r.pointLocation(A),g=t.LngLat.convert(e.center||p);this._normalizeCenter(g);var m,y,v=r.project(p),_=r.project(g).sub(v),b=r.zoomScale(c-o);e.around&&(m=t.LngLat.convert(e.around),y=r.locationPoint(m));var x={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||c!==o,this._rotating=this._rotating||s!==u,this._pitching=this._pitching||h!==a,this._padding=!r.isPaddingEqual(d),this._easeId=e.easeId,this._prepareEase(n,e.noMoveStart,x),this._ease((function(e){if(i._zooming&&(r.zoom=t.number(o,c,e)),i._rotating&&(r.bearing=t.number(s,u,e)),i._pitching&&(r.pitch=t.number(a,h,e)),i._padding&&(r.interpolatePadding(l,d,e),A=r.centerPoint.add(f)),m)r.setLocationAtPoint(m,y);else{var p=r.zoomScale(r.zoom-o),g=c>o?Math.min(2,b):Math.max(.5,b),x=Math.pow(g,1-e),w=r.unproject(v.add(_.mult(e*x)).mult(p));r.setLocationAtPoint(r.renderWorldCopies?w.wrap():w,A)}i._fireMoveEvents(n)}),(function(t){i._afterEase(n,t)}),e),this},n.prototype._prepareEase=function(e,n,i){void 0===i&&(i={}),this._moving=!0,n||i.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!i.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new t.Event("pitchstart",e))},n.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},n.prototype._afterEase=function(e,n){if(!this._easeId||!n||this._easeId!==n){delete this._easeId;var i=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},n.prototype.flyTo=function(e,n){var i=this;if(!e.essential&&t.browser.prefersReducedMotion){var r=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(r,n)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,s=this.getZoom(),a=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):s,h="bearing"in e?this._normalizeBearing(e.bearing,a):a,d="pitch"in e?+e.pitch:l,f="padding"in e?e.padding:o.padding,A=o.zoomScale(u-s),p=t.Point.convert(e.offset),g=o.centerPoint.add(p),m=o.pointLocation(g),y=t.LngLat.convert(e.center||m);this._normalizeCenter(y);var v=o.project(m),_=o.project(y).sub(v),b=e.curve,x=Math.max(o.width,o.height),w=x/A,C=_.mag();if("minZoom"in e){var B=t.clamp(Math.min(e.minZoom,s,u),o.minZoom,o.maxZoom),E=x/o.zoomScale(B-s);b=Math.sqrt(E/C*2)}var T=b*b;function S(t){var e=(w*w-x*x+(t?-1:1)*T*T*C*C)/(2*(t?w:x)*T*C);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}var P=S(0),D=function(t){return I(P)/I(P+b*t)},F=function(t){return x*((I(P)*(M(e=P+b*t)/I(e))-M(P))/T)/C;var e},L=(S(1)-P)/b;if(Math.abs(C)<1e-6||!isFinite(L)){if(Math.abs(x-w)<1e-6)return this.easeTo(e,n);var O=w<x?-1:1;L=Math.abs(Math.log(w/x))/b,F=function(){return 0},D=function(t){return Math.exp(O*b*t)}}return e.duration="duration"in e?+e.duration:1e3*L/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=a!==h,this._pitching=d!==l,this._padding=!o.isPaddingEqual(f),this._prepareEase(n,!1),this._ease((function(e){var r=e*L,A=1/D(r);o.zoom=1===e?u:s+o.scaleZoom(A),i._rotating&&(o.bearing=t.number(a,h,e)),i._pitching&&(o.pitch=t.number(l,d,e)),i._padding&&(o.interpolatePadding(c,f,e),g=o.centerPoint.add(p));var m=1===e?y:o.unproject(v.add(_.mult(F(r))).mult(A));o.setLocationAtPoint(o.renderWorldCopies?m.wrap():m,g),i._fireMoveEvents(n)}),(function(){return i._afterEase(n)}),e),this},n.prototype.isEasing=function(){return!!this._easeFrameId},n.prototype.stop=function(){return this._stop()},n.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var n=this._onEaseEnd;delete this._onEaseEnd,n.call(this,e)}if(!t){var i=this.handlers;i&&i.stop(!1)}return this},n.prototype._ease=function(e,n,i){!1===i.animate||0===i.duration?(e(1),n()):(this._easeStart=t.browser.now(),this._easeOptions=i,this._onEaseFrame=e,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},n.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},n.prototype._normalizeBearing=function(e,n){e=t.wrap(e,-180,180);var i=Math.abs(e-n);return Math.abs(e-360-n)<i&&(e-=360),Math.abs(e+360-n)<i&&(e+=360),e},n.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var n=t.lng-e.center.lng;t.lng+=n>180?-360:n<-180?360:0}},n}(t.Evented),vr=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};vr.prototype.getDefaultPosition=function(){return"bottom-right"},vr.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=n.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=n.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},vr.prototype.onRemove=function(){n.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},vr.prototype._setElementTitle=function(t,e){var n=this._map._getUIString("AttributionControl."+e);t.title=n,t.setAttribute("aria-label",n)},vr.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},vr.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var n=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var i=n.reduce((function(t,e,i){return e.value&&(t+=e.key+"="+e.value+(i<n.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+i+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow",this._setElementTitle(e,"MapFeedback")}},vr.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},vr.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var n=this._map.style.sourceCaches;for(var i in n){var r=n[i];if(r.used){var o=r.getSource();o.attribution&&t.indexOf(o.attribution)<0&&t.push(o.attribution)}}t.sort((function(t,e){return t.length-e.length}));var s=(t=t.filter((function(e,n){for(var i=n+1;i<t.length;i++)if(t[i].indexOf(e)>=0)return!1;return!0}))).join(" | ");s!==this._attribHTML&&(this._attribHTML=s,t.length?(this._innerContainer.innerHTML=s,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},vr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var _r=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};_r.prototype.onAdd=function(t){this._map=t,this._container=n.create("div","mapboxgl-ctrl");var e=n.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},_r.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},_r.prototype.getDefaultPosition=function(){return"bottom-left"},_r.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},_r.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},_r.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var br=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};br.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},br.prototype.remove=function(t){for(var e=this._currentlyRunning,n=0,i=e?this._queue.concat(e):this._queue;n<i.length;n+=1){var r=i[n];if(r.id===t)return void(r.cancelled=!0)}},br.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,i=e;n<i.length;n+=1){var r=i[n];if(!r.cancelled&&(r.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},br.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var xr={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},wr=t.window.HTMLImageElement,Cr=t.window.HTMLElement,Br=t.window.ImageBitmap,Er={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Tr=function(i){function r(e){var n=this;if(null!=(e=t.extend({},Er,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var r=new wi(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(i.call(this,r,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new br,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},xr,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Cr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return n._update(!1)})),this.on("moveend",(function(){return n._update(!1)})),this.on("zoom",(function(){return n._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new mr(this,e),this._hash=e.hash&&new Bi("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new vr({customAttribution:e.customAttribution})),this.addControl(new _r,e.logoPosition),this.on("style.load",(function(){n.transform.unmodified&&n.jumpTo(n.style.stylesheet)})),this.on("data",(function(e){n._update("style"===e.dataType),n.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){n.fire(new t.Event(e.dataType+"dataloading",e))}))}i&&(r.__proto__=i),(r.prototype=Object.create(i&&i.prototype)).constructor=r;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return r.prototype._getMapId=function(){return this._mapId},r.prototype.addControl=function(e,n){if(void 0===n&&(n=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var i=e.onAdd(this);this._controls.push(e);var r=this._controlPositions[n];return-1!==n.indexOf("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this},r.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var n=this._controls.indexOf(e);return n>-1&&this._controls.splice(n,1),e.onRemove(this),this},r.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},r.prototype.resize=function(e){var n=this._containerDimensions(),i=n[0],r=n[1];if(i===this.transform.width&&r===this.transform.height)return this;this._resizeCanvas(i,r),this.transform.resize(i,r),this.painter.resize(i,r);var o=!this._moving;return o&&this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},r.prototype.getBounds=function(){return this.transform.getBounds()},r.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},r.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},r.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},r.prototype.getMinZoom=function(){return this.transform.minZoom},r.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},r.prototype.getMaxZoom=function(){return this.transform.maxZoom},r.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},r.prototype.getMinPitch=function(){return this.transform.minPitch},r.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},r.prototype.getMaxPitch=function(){return this.transform.maxPitch},r.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},r.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},r.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},r.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},r.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},r.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},r.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},r.prototype._createDelegatedListener=function(t,e,n){var i,r=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:n,delegates:{mousemove:function(i){var s=r.getLayer(e)?r.queryRenderedFeatures(i.point,{layers:[e]}):[];s.length?o||(o=!0,n.call(r,new Li(t,r,i.originalEvent,{features:s}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var s=!1;return{layer:e,listener:n,delegates:{mousemove:function(i){(r.getLayer(e)?r.queryRenderedFeatures(i.point,{layers:[e]}):[]).length?s=!0:s&&(s=!1,n.call(r,new Li(t,r,i.originalEvent)))},mouseout:function(e){s&&(s=!1,n.call(r,new Li(t,r,e.originalEvent)))}}}}return{layer:e,listener:n,delegates:(i={},i[t]=function(t){var i=r.getLayer(e)?r.queryRenderedFeatures(t.point,{layers:[e]}):[];i.length&&(t.features=i,n.call(r,t),delete t.features)},i)}},r.prototype.on=function(t,e,n){if(void 0===n)return i.prototype.on.call(this,t,e);var r=this._createDelegatedListener(t,e,n);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(r),r.delegates)this.on(o,r.delegates[o]);return this},r.prototype.once=function(t,e,n){if(void 0===n)return i.prototype.once.call(this,t,e);var r=this._createDelegatedListener(t,e,n);for(var o in r.delegates)this.once(o,r.delegates[o]);return this},r.prototype.off=function(t,e,n){var r=this;return void 0===n?i.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(i){for(var o=i[t],s=0;s<o.length;s++){var a=o[s];if(a.layer===e&&a.listener===n){for(var l in a.delegates)r.off(l,a.delegates[l]);return o.splice(s,1),r}}}(this._delegatedListeners),this)},r.prototype.queryRenderedFeatures=function(e,n){if(!this.style)return[];var i;if(void 0!==n||void 0===e||e instanceof t.Point||Array.isArray(e)||(n=e,e=void 0),n=n||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])i=[t.Point.convert(e)];else{var r=t.Point.convert(e[0]),o=t.Point.convert(e[1]);i=[r,new t.Point(o.x,r.y),o,new t.Point(r.x,o.y),r]}return this.style.queryRenderedFeatures(i,n,this.transform)},r.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},r.prototype.setStyle=function(e,n){return!1!==(n=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},n)).diff&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(e,n))},r.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},r.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new je(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},r.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new je(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},r.prototype._diffStyle=function(e,n){var i=this;if("string"==typeof e){var r=this._requestManager.normalizeStyleURL(e),o=this._requestManager.transformRequest(r,t.ResourceType.Style);t.getJSON(o,(function(e,r){e?i.fire(new t.ErrorEvent(e)):r&&i._updateDiff(r,n)}))}else"object"==typeof e&&this._updateDiff(e,n)},r.prototype._updateDiff=function(e,n){try{this.style.setState(e)&&this._update(!0)}catch(i){t.warnOnce("Unable to perform style diff: "+(i.message||i.error||i)+".  Rebuilding the style from scratch."),this._updateStyle(e,n)}},r.prototype.getStyle=function(){if(this.style)return this.style.serialize()},r.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},r.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},r.prototype.isSourceLoaded=function(e){var n=this.style&&this.style.sourceCaches[e];if(void 0!==n)return n.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},r.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var n=t[e]._tiles;for(var i in n){var r=n[i];if("loaded"!==r.state&&"errored"!==r.state)return!1}}return!0},r.prototype.addSourceType=function(t,e,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,n)},r.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},r.prototype.getSource=function(t){return this.style.getSource(t)},r.prototype.addImage=function(e,n,i){void 0===i&&(i={});var r=i.pixelRatio;void 0===r&&(r=1);var o=i.sdf;void 0===o&&(o=!1);var s=i.stretchX,a=i.stretchY,l=i.content;if(this._lazyInitEmptyStyle(),n instanceof wr||Br&&n instanceof Br){var c=t.browser.getImageData(n);this.style.addImage(e,{data:new t.RGBAImage({width:c.width,height:c.height},c.data),pixelRatio:r,stretchX:s,stretchY:a,content:l,sdf:o,version:0})}else{if(void 0===n.width||void 0===n.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var u=n;this.style.addImage(e,{data:new t.RGBAImage({width:n.width,height:n.height},new Uint8Array(n.data)),pixelRatio:r,stretchX:s,stretchY:a,content:l,sdf:o,version:0,userImage:u}),u.onAdd&&u.onAdd(this,e)}},r.prototype.updateImage=function(e,n){var i=this.style.getImage(e);if(!i)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var r=n instanceof wr||Br&&n instanceof Br?t.browser.getImageData(n):n,o=r.width,s=r.height,a=r.data;return void 0===o||void 0===s?this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):o!==i.data.width||s!==i.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(i.data.replace(a,!(n instanceof wr||Br&&n instanceof Br)),void this.style.updateImage(e,i))},r.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},r.prototype.removeImage=function(t){this.style.removeImage(t)},r.prototype.loadImage=function(e,n){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),n)},r.prototype.listImages=function(){return this.style.listImages()},r.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},r.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},r.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},r.prototype.getLayer=function(t){return this.style.getLayer(t)},r.prototype.setLayerZoomRange=function(t,e,n){return this.style.setLayerZoomRange(t,e,n),this._update(!0)},r.prototype.setFilter=function(t,e,n){return void 0===n&&(n={}),this.style.setFilter(t,e,n),this._update(!0)},r.prototype.getFilter=function(t){return this.style.getFilter(t)},r.prototype.setPaintProperty=function(t,e,n,i){return void 0===i&&(i={}),this.style.setPaintProperty(t,e,n,i),this._update(!0)},r.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},r.prototype.setLayoutProperty=function(t,e,n,i){return void 0===i&&(i={}),this.style.setLayoutProperty(t,e,n,i),this._update(!0)},r.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},r.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},r.prototype.getLight=function(){return this.style.getLight()},r.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},r.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},r.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},r.prototype.getContainer=function(){return this._container},r.prototype.getCanvasContainer=function(){return this._canvasContainer},r.prototype.getCanvas=function(){return this._canvas},r.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},r.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},r.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=n.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=n.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=n.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var i=this._containerDimensions();this._resizeCanvas(i[0],i[1]);var r=this._controlContainer=n.create("div","mapboxgl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){o[t]=n.create("div","mapboxgl-ctrl-"+t,r)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},r.prototype._resizeCanvas=function(e,n){var i=t.browser.devicePixelRatio||1;this._canvas.width=i*e,this._canvas.height=i*n,this._canvas.style.width=e+"px",this._canvas.style.height=n+"px"},r.prototype._setupPainter=function(){var n=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl",n)||this._canvas.getContext("experimental-webgl",n);i?(this.painter=new vi(i,this.transform),t.webpSupported.testSupport(i)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},r.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},r.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},r.prototype._onMapScroll=function(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},r.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},r.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},r.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},r.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},r.prototype._render=function(e){var n,i=this,r=0,o=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(n=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,n),r=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var s=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var a=this.transform.zoom,l=t.browser.now();this.style.zoomHistory.update(a,l);var c=new t.EvaluationParameters(a,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=c.crossFadingFactor();1===u&&u===this._crossFadingFactor||(s=!0,this._crossFadingFactor=u),this.style.update(c)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||s)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-r;o.endQueryEXT(o.TIME_ELAPSED_EXT,n),setTimeout((function(){var e=o.getQueryObjectEXT(n,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(n),i.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:e}))}),50)}if(this.listens("gpu-timing-layer")){var d=this.painter.collectGpuTimers();setTimeout((function(){var e=i.painter.queryGpuTimers(d);i.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}var f=this._sourcesDirty||this._styleDirty||this._placementDirty;return f||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||f||(this._fullyLoaded=!0),this}},r.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,n=this._controls;e<n.length;e+=1)n[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var i=this.painter.context.gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),Sr(this._canvasContainer),Sr(this._controlContainer),Sr(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},r.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render(t)})))},r.prototype._onWindowOnline=function(){this._update()},r.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},o.showTileBoundaries.get=function(){return!!this._showTileBoundaries},o.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},o.showPadding.get=function(){return!!this._showPadding},o.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},o.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},o.vertices.get=function(){return!!this._vertices},o.vertices.set=function(t){this._vertices=t,this._update()},r.prototype._setCacheLimits=function(e,n){t.setCacheLimits(e,n)},o.version.get=function(){return t.version},Object.defineProperties(r.prototype,o),r}(yr);function Sr(t){t.parentNode&&t.parentNode.removeChild(t)}var Mr={showCompass:!0,showZoom:!0,visualizePitch:!1},Ir=function(e){var i=this;this.options=t.extend({},Mr,e),this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return i._map.zoomIn({},{originalEvent:t})})),n.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return i._map.zoomOut({},{originalEvent:t})})),n.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){i.options.visualizePitch?i._map.resetNorthPitch({},{originalEvent:t}):i._map.resetNorth({},{originalEvent:t})})),this._compassIcon=n.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Ir.prototype._updateZoomButtons=function(){var t=this._map.getZoom(),e=t===this._map.getMaxZoom(),n=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},Ir.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t},Ir.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Pr(this._map,this._compass,this.options.visualizePitch)),this._container},Ir.prototype.onRemove=function(){n.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Ir.prototype._createButton=function(t,e){var i=n.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i},Ir.prototype._setButtonTitle=function(t,e){var n=this._map._getUIString("NavigationControl."+e);t.title=n,t.setAttribute("aria-label",n)};var Pr=function(e,i,r){void 0===r&&(r=!1),this._clickTolerance=10,this.element=i,this.mouseRotate=new Wi({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,r&&(this.mousePitch=new Qi({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),n.addEventListener(i,"mousedown",this.mousedown),n.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),n.addEventListener(i,"touchmove",this.touchmove),n.addEventListener(i,"touchend",this.touchend),n.addEventListener(i,"touchcancel",this.reset)};function Dr(e,n,i){if(e=new t.LngLat(e.lng,e.lat),n){var r=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),s=i.locationPoint(e).distSqr(n);i.locationPoint(r).distSqr(n)<s?e=r:i.locationPoint(o).distSqr(n)<s&&(e=o)}for(;Math.abs(e.lng-i.center.lng)>180;){var a=i.locationPoint(e);if(a.x>=0&&a.y>=0&&a.x<=i.width&&a.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}return e}Pr.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),n.disableDrag()},Pr.prototype.move=function(t,e){var n=this.map,i=this.mouseRotate.mousemoveWindow(t,e);if(i&&i.bearingDelta&&n.setBearing(n.getBearing()+i.bearingDelta),this.mousePitch){var r=this.mousePitch.mousemoveWindow(t,e);r&&r.pitchDelta&&n.setPitch(n.getPitch()+r.pitchDelta)}},Pr.prototype.off=function(){var t=this.element;n.removeEventListener(t,"mousedown",this.mousedown),n.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),n.removeEventListener(t,"touchmove",this.touchmove),n.removeEventListener(t,"touchend",this.touchend),n.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Pr.prototype.offTemp=function(){n.enableDrag(),n.removeEventListener(t.window,"mousemove",this.mousemove),n.removeEventListener(t.window,"mouseup",this.mouseup)},Pr.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),n.mousePos(this.element,e)),n.addEventListener(t.window,"mousemove",this.mousemove),n.addEventListener(t.window,"mouseup",this.mouseup)},Pr.prototype.mousemove=function(t){this.move(t,n.mousePos(this.element,t))},Pr.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Pr.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=n.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Pr.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=n.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Pr.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Pr.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Fr={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Lr(t,e,n){var i=t.classList;for(var r in Fr)i.remove("mapboxgl-"+n+"-anchor-"+r);i.add("mapboxgl-"+n+"-anchor-"+e)}var Or,Rr=function(e){function i(i,r){if(e.call(this),(i instanceof t.window.HTMLElement||r)&&(i=t.extend({element:i},r)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=i&&i.anchor||"center",this._color=i&&i.color||"#3FB1CE",this._scale=i&&i.scale||1,this._draggable=i&&i.draggable||!1,this._clickTolerance=i&&i.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=i&&i.rotation||0,this._rotationAlignment=i&&i.rotationAlignment||"auto",this._pitchAlignment=i&&i.pitchAlignment&&"auto"!==i.pitchAlignment?i.pitchAlignment:this._rotationAlignment,i&&i.element)this._element=i.element,this._offset=t.Point.convert(i&&i.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div"),this._element.setAttribute("aria-label","Map marker");var o=n.createNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","41px"),o.setAttributeNS(null,"width","27px"),o.setAttributeNS(null,"viewBox","0 0 27 41");var s=n.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var a=n.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill-rule","nonzero");var l=n.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var c=0,u=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];c<u.length;c+=1){var h=u[c],d=n.createNS("http://www.w3.org/2000/svg","ellipse");d.setAttributeNS(null,"opacity","0.04"),d.setAttributeNS(null,"cx","10.5"),d.setAttributeNS(null,"cy","5.80029008"),d.setAttributeNS(null,"rx",h.rx),d.setAttributeNS(null,"ry",h.ry),l.appendChild(d)}var f=n.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill",this._color);var A=n.createNS("http://www.w3.org/2000/svg","path");A.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),f.appendChild(A);var p=n.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"opacity","0.25"),p.setAttributeNS(null,"fill","#000000");var g=n.createNS("http://www.w3.org/2000/svg","path");g.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),p.appendChild(g);var m=n.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(6.0, 7.0)"),m.setAttributeNS(null,"fill","#FFFFFF");var y=n.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(8.0, 8.0)");var v=n.createNS("http://www.w3.org/2000/svg","circle");v.setAttributeNS(null,"fill","#000000"),v.setAttributeNS(null,"opacity","0.25"),v.setAttributeNS(null,"cx","5.5"),v.setAttributeNS(null,"cy","5.5"),v.setAttributeNS(null,"r","5.4999962");var _=n.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#FFFFFF"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962"),y.appendChild(v),y.appendChild(_),a.appendChild(l),a.appendChild(f),a.appendChild(p),a.appendChild(m),a.appendChild(y),o.appendChild(a),o.setAttributeNS(null,"height",41*this._scale+"px"),o.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(o),this._offset=t.Point.convert(i&&i.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),Lr(this._element,this._anchor,"marker"),this._popup=null}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},i.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),n.remove(this._element),this._popup&&this._popup.remove(),this},i.prototype.getLngLat=function(){return this._lngLat},i.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},i.prototype.getElement=function(){return this._element},i.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},i.prototype._onKeyPress=function(t){var e=t.code,n=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==n&&13!==n||this.togglePopup()},i.prototype._onMapClick=function(t){var e=t.originalEvent.target,n=this._element;this._popup&&(e===n||n.contains(e))&&this.togglePopup()},i.prototype.getPopup=function(){return this._popup},i.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},i.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Dr(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),n.setTransform(this._element,Fr[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+i+" "+e)}},i.prototype.getOffset=function(){return this._offset},i.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},i.prototype._onMove=function(e){if(!this._isDragging){var n=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=n}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},i.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},i.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},i.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},i.prototype.isDraggable=function(){return this._draggable},i.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},i.prototype.getRotation=function(){return this._rotation},i.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},i.prototype.getRotationAlignment=function(){return this._rotationAlignment},i.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},i.prototype.getPitchAlignment=function(){return this._pitchAlignment},i}(t.Evented),kr={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Ur=0,zr=!1,Gr=function(e){function i(n){e.call(this),this.options=t.extend({},kr,n),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.onAdd=function(e){var i;return this._map=e,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),i=this._setupUI,void 0!==Or?i(Or):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){i(Or="denied"!==t.state)})):i(Or=!!t.window.navigator.geolocation),this._container},i.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),n.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Ur=0,zr=!1},i.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),n=t.coords;return e&&(n.longitude<e.getWest()||n.longitude>e.getEast()||n.latitude<e.getSouth()||n.latitude>e.getNorth())},i.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},i.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},i.prototype._updateCamera=function(e){var n=new t.LngLat(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy,r=this._map.getBearing(),o=t.extend({bearing:r},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(i),o,{geolocateSource:!0})},i.prototype._updateMarker=function(e){if(e){var n=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},i.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),n=this._map.unproject([1,t]),i=e.distanceTo(n),r=Math.ceil(2*this._accuracy/i);this._circleElement.style.width=r+"px",this._circleElement.style.height=r+"px"},i.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},i.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&zr)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},i.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},i.prototype._setupUI=function(e){var i=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=n.create("button","mapboxgl-ctrl-geolocate",this._container),n.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Rr(this._dotElement),this._circleElement=n.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Rr({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==i._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(i._watchState="BACKGROUND",i._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),i._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),i.fire(new t.Event("trackuserlocationend")))}))},i.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ur--,zr=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Ur>1?(e={maximumAge:6e5,timeout:0},zr=!0):(e=this.options.positionOptions,zr=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},i.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},i}(t.Evented),Nr={maxWidth:100,unit:"metric"},Zr=function(e){this.options=t.extend({},Nr,e),t.bindAll(["_onMove","setUnit"],this)};function jr(t,e,n){var i=n&&n.maxWidth||100,r=t._container.clientHeight/2,o=t.unproject([0,r]),s=t.unproject([i,r]),a=o.distanceTo(s);if(n&&"imperial"===n.unit){var l=3.2808*a;l>5280?Vr(e,i,l/5280,t._getUIString("ScaleControl.Miles")):Vr(e,i,l,t._getUIString("ScaleControl.Feet"))}else n&&"nautical"===n.unit?Vr(e,i,a/1852,t._getUIString("ScaleControl.NauticalMiles")):a>=1e3?Vr(e,i,a/1e3,t._getUIString("ScaleControl.Kilometers")):Vr(e,i,a,t._getUIString("ScaleControl.Meters"))}function Vr(t,e,n,i){var r,o,s,a=(r=n,(o=Math.pow(10,(""+Math.floor(r)).length-1))*(s=(s=r/o)>=10?10:s>=5?5:s>=3?3:s>=2?2:s>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(s)));t.style.width=e*(a/n)+"px",t.innerHTML=a+"&nbsp;"+i}Zr.prototype.getDefaultPosition=function(){return"bottom-left"},Zr.prototype._onMove=function(){jr(this._map,this._container,this.options)},Zr.prototype.onAdd=function(t){return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Zr.prototype.onRemove=function(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Zr.prototype.setUnit=function(t){this.options.unit=t,jr(this._map,this._container,this.options)};var Hr=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Hr.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Hr.prototype.onRemove=function(){n.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Hr.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Hr.prototype._setupUI=function(){var e=this._fullscreenButton=n.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);n.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Hr.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Hr.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Hr.prototype._isFullscreen=function(){return this._fullscreen},Hr.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Hr.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Jr={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Wr=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Qr=function(e){function i(n){e.call(this),this.options=t.extend(Object.create(Jr),n),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},i.prototype.isOpen=function(){return!!this._map},i.prototype.remove=function(){return this._content&&n.remove(this._content),this._container&&(n.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},i.prototype.getLngLat=function(){return this._lngLat},i.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},i.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},i.prototype.getElement=function(){return this._container},i.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},i.prototype.setHTML=function(e){var n,i=t.window.document.createDocumentFragment(),r=t.window.document.createElement("body");for(r.innerHTML=e;n=r.firstChild;)i.appendChild(n);return this.setDOMContent(i)},i.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},i.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},i.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},i.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},i.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},i.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},i.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},i.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=n.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},i.prototype._onMouseUp=function(t){this._update(t.point)},i.prototype._onMouseMove=function(t){this._update(t.point)},i.prototype._onDrag=function(t){this._update(t.point)},i.prototype._update=function(e){var i=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=n.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=n.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return i._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Dr(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var r=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,s=function e(n){if(n){if("number"==typeof n){var i=Math.round(Math.sqrt(.5*Math.pow(n,2)));return{center:new t.Point(0,0),top:new t.Point(0,n),"top-left":new t.Point(i,i),"top-right":new t.Point(-i,i),bottom:new t.Point(0,-n),"bottom-left":new t.Point(i,-i),"bottom-right":new t.Point(-i,-i),left:new t.Point(n,0),right:new t.Point(-n,0)}}if(n instanceof t.Point||Array.isArray(n)){var r=t.Point.convert(n);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:t.Point.convert(n.center||[0,0]),top:t.Point.convert(n.top||[0,0]),"top-left":t.Point.convert(n["top-left"]||[0,0]),"top-right":t.Point.convert(n["top-right"]||[0,0]),bottom:t.Point.convert(n.bottom||[0,0]),"bottom-left":t.Point.convert(n["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(n["bottom-right"]||[0,0]),left:t.Point.convert(n.left||[0,0]),right:t.Point.convert(n.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var a,l=this._container.offsetWidth,c=this._container.offsetHeight;a=r.y+s.bottom.y<c?["top"]:r.y>this._map.transform.height-c?["bottom"]:[],r.x<l/2?a.push("left"):r.x>this._map.transform.width-l/2&&a.push("right"),o=0===a.length?"bottom":a.join("-")}var u=r.add(s[o]).round();n.setTransform(this._container,Fr[o]+" translate("+u.x+"px,"+u.y+"px)"),Lr(this._container,o,"popup")}},i.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Wr);t&&t.focus()}},i.prototype._onClose=function(){this.remove()},i}(t.Evented),Kr={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Tr,NavigationControl:Ir,GeolocateControl:Gr,AttributionControl:vr,ScaleControl:Zr,FullscreenControl:Hr,Popup:Qr,Marker:Rr,Style:je,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Ut().acquire(Lt)},clearPrewarmedResources:function(){var t=Rt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Lt),Rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ot.workerCount},set workerCount(t){Ot.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Kr})),n}()},48331:(t,e,n)=>{"use strict";n.d(e,{Q:()=>Z});var i=n(37659);const r={mousedown:1,mousemove:2,mouseup:4};!function(t){const e=t.prototype.handler;t.prototype.handler=function(t){const n=this.store;t.button>0&&"pointerdown"===t.type&&(function(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return!0;return!1}(n,(e=>e.pointerId===t.pointerId))||n.push(t)),e.call(this,t)}}(i.PointerEventInput),i.MouseInput.prototype.handler=function(t){let e=r[t.type];1&e&&t.button>=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))};const o=i.Manager,s=i;class a{constructor(t,e,n){this.element=t,this.callback=e,this.options={enable:!0,...n}}}const l=s?[[s.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[s.Rotate,{enable:!1}],[s.Pinch,{enable:!1}],[s.Swipe,{enable:!1}],[s.Pan,{threshold:0,enable:!1}],[s.Press,{enable:!1}],[s.Tap,{event:"doubletap",taps:2,enable:!1}],[s.Tap,{event:"anytap",enable:!1}],[s.Tap,{enable:!1}]]:null,c={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},u={doubletap:["tap"]},h={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},d={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},f={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},A={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},p="undefined"!==typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",g="undefined"!==typeof window?window:n.g;"undefined"!==typeof n.g?n.g:window,"undefined"!==typeof document&&document;let m=!1;try{const t={get passive(){return m=!0,!0}};g.addEventListener("test",null,t),g.removeEventListener("test",null)}catch(j){m=!1}const y=-1!==p.indexOf("firefox"),{WHEEL_EVENTS:v}=d,_="wheel",b=4.000244140625;class x extends a{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{if(!this.options.enable)return;let e=t.deltaY;g.WheelEvent&&(y&&t.deltaMode===g.WheelEvent.DOM_DELTA_PIXEL&&(e/=g.devicePixelRatio),t.deltaMode===g.WheelEvent.DOM_DELTA_LINE&&(e*=40)),0!==e&&e%b===0&&(e=Math.floor(e/b)),t.shiftKey&&e&&(e*=.25),this.callback({type:_,center:{x:t.clientX,y:t.clientY},delta:-e,srcEvent:t,pointerType:"mouse",target:t.target})},this.events=(this.options.events||[]).concat(v),this.events.forEach((e=>t.addEventListener(e,this.handleEvent,!!m&&{passive:!1})))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===_&&(this.options.enable=e)}}const{MOUSE_EVENTS:w}=d,C="pointermove",B="pointerover",E="pointerout",T="pointerenter",S="pointerleave";class M extends a{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{this.handleOverEvent(t),this.handleOutEvent(t),this.handleEnterEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)},this.pressed=!1;const{enable:i}=this.options;this.enableMoveEvent=i,this.enableLeaveEvent=i,this.enableEnterEvent=i,this.enableOutEvent=i,this.enableOverEvent=i,this.events=(this.options.events||[]).concat(w),this.events.forEach((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===C&&(this.enableMoveEvent=e),t===B&&(this.enableOverEvent=e),t===E&&(this.enableOutEvent=e),t===T&&(this.enableEnterEvent=e),t===S&&(this.enableLeaveEvent=e)}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this._emit(B,t)}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this._emit(E,t)}handleEnterEvent(t){this.enableEnterEvent&&"mouseenter"===t.type&&this._emit(T,t)}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this._emit(S,t)}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this._emit(C,t);break;case"mouseup":this.pressed=!1}}_emit(t,e){this.callback({type:t,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const{KEY_EVENTS:I}=d,P="keydown",D="keyup";class F extends a{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:P,srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:D,srcEvent:t,key:t.key,target:t.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=(this.options.events||[]).concat(I),t.tabIndex=this.options.tabIndex||0,t.style.outline="none",this.events.forEach((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===P&&(this.enableDownEvent=e),t===D&&(this.enableUpEvent=e)}}const L="contextmenu";class O extends a{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{this.options.enable&&this.callback({type:L,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})},t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,e){t===L&&(this.options.enable=e)}}const R={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};function k(t){const e=R[t.srcEvent.type];if(!e)return null;const{buttons:n,button:i,which:r}=t.srcEvent;let o=!1,s=!1,a=!1;return 4===e||2===e&&!Number.isFinite(n)?(o=1===r,s=2===r,a=3===r):2===e?(o=Boolean(1&n),s=Boolean(4&n),a=Boolean(2&n)):1===e&&(o=0===i,s=1===i,a=2===i),{leftButton:o,middleButton:s,rightButton:a}}function U(t,e){const n=t.center;if(!n)return null;const i=e.getBoundingClientRect(),r=i.width/e.offsetWidth||1,o=i.height/e.offsetHeight||1;return{center:n,offsetCenter:{x:(n.x-i.left-e.clientLeft)/r,y:(n.y-i.top-e.clientTop)/o}}}const z={srcElement:"root",priority:0};class G{constructor(t){this.handleEvent=t=>{if(this.isEmpty())return;const e=this._normalizeEvent(t);let n=t.srcEvent.target;for(;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")},this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const{handlers:o,handlersByElement:s}=this;let a=z;"string"===typeof n||n&&n.addEventListener?a={...z,srcElement:n}:n&&(a={...z,...n});let l=s.get(a.srcElement);l||(l=[],s.set(a.srcElement,l));const c={type:t,handler:e,srcElement:a.srcElement,priority:a.priority};i&&(c.once=!0),r&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+1,0,c)}remove(t,e){const{handlers:n,handlersByElement:i}=this;for(let r=n.length-1;r>=0;r--){const o=n[r];if(o.type===t&&o.handler===e){n.splice(r,1);const t=i.get(o.srcElement);t.splice(t.indexOf(o),1),0===t.length&&i.delete(o.srcElement)}}this._active=n.some((t=>!t.passive))}_emit(t,e){const n=this.handlersByElement.get(e);if(n){let e=!1;const i=()=>{t.handled=!0},r=()=>{t.handled=!0,e=!0},o=[];for(let s=0;s<n.length;s++){const{type:a,handler:l,once:c}=n[s];if(l({...t,type:a,stopPropagation:i,stopImmediatePropagation:r}),c&&o.push(n[s]),e)break}for(let t=0;t<o.length;t++){const{type:e,handler:n}=o[t];this.remove(e,n)}}}_normalizeEvent(t){const e=this.eventManager.getElement();return{...t,...k(t),...U(t,e),preventDefault:()=>{t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:e}}}const N={events:null,recognizers:null,recognizerOptions:{},Manager:o,touchAction:"none",tabIndex:0};class Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0;this._onBasicInput=t=>{const{srcEvent:e}=t,n=h[e.type];n&&this.manager.emit(n,t)},this._onOtherEvent=t=>{this.manager.emit(t.type,t)},this.options={...N,...e},this.events=new Map,this.setElement(t);const{events:n}=this.options;n&&this.on(n)}getElement(){return this.element}setElement(t){if(this.element&&this.destroy(),this.element=t,!t)return;const{options:e}=this,n=e.Manager;this.manager=new n(t,{touchAction:e.touchAction,recognizers:e.recognizers||l}).on("hammer.input",this._onBasicInput),e.recognizers||Object.keys(c).forEach((t=>{const e=this.manager.get(t);e&&c[t].forEach((t=>{e.recognizeWith(t)}))}));for(const i in e.recognizerOptions){const t=this.manager.get(i);if(t){const n=e.recognizerOptions[i];delete n.enable,t.set(n)}}this.wheelInput=new x(t,this._onOtherEvent,{enable:!1}),this.moveInput=new M(t,this._onOtherEvent,{enable:!1}),this.keyInput=new F(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new O(t,this._onOtherEvent,{enable:!1});for(const[i,r]of this.events)r.isEmpty()||(this._toggleRecognizer(r.recognizerName,!0),this.manager.on(i,r.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(t,e,n){this._addEventHandler(t,e,n,!1)}once(t,e,n){this._addEventHandler(t,e,n,!0)}watch(t,e,n){this._addEventHandler(t,e,n,!1,!0)}off(t,e){this._removeEventHandler(t,e)}_toggleRecognizer(t,e){const{manager:n}=this;if(!n)return;const i=n.get(t);if(i&&i.options.enable!==e){i.set({enable:e});const r=u[t];r&&!this.options.recognizers&&r.forEach((r=>{const o=n.get(r);e?(o.requireFailure(t),i.dropRequireFailure(r)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}_addEventHandler(t,e,n,i,r){if("string"!==typeof t){n=e;for(const e in t)this._addEventHandler(e,t[e],n,i,r);return}const{manager:o,events:s}=this,a=A[t]||t;let l=s.get(a);l||(l=new G(this),s.set(a,l),l.recognizerName=f[a]||a,o&&o.on(a,l.handleEvent)),l.add(t,e,n,i,r),l.isEmpty()||this._toggleRecognizer(l.recognizerName,!0)}_removeEventHandler(t,e){if("string"!==typeof t){for(const e in t)this._removeEventHandler(e,t[e]);return}const{events:n}=this,i=A[t]||t,r=n.get(i);if(r&&(r.remove(t,e),r.isEmpty())){const{recognizerName:t}=r;let e=!1;for(const i of n.values())if(i.recognizerName===t&&!i.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}}},32408:(t,e,n)=>{"use strict";t.exports=r;var i=n(70356);function r(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}r.Varint=0,r.Fixed64=1,r.Bytes=2,r.Fixed32=5;var o=4294967296,s=1/o,a="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===r.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(t,e,n){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(i);for(var r=n.pos-1;r>=t;r--)n.buf[r+i]=n.buf[r]}function h(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function d(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function f(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function A(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function p(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function g(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function m(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function y(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function v(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function _(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function b(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}r.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var i=this.readVarint(),r=i>>3,o=this.pos;this.type=7&i,t(r,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=_(this.buf,this.pos)+_(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=_(this.buf,this.pos)+x(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=i.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=i.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,i=this.buf;return e=127&(n=i[this.pos++]),n<128?e:(e|=(127&(n=i[this.pos++]))<<7,n<128?e:(e|=(127&(n=i[this.pos++]))<<14,n<128?e:(e|=(127&(n=i[this.pos++]))<<21,n<128?e:function(t,e,n){var i,r,o=n.buf;if(r=o[n.pos++],i=(112&r)>>4,r<128)return c(t,i,e);if(r=o[n.pos++],i|=(127&r)<<3,r<128)return c(t,i,e);if(r=o[n.pos++],i|=(127&r)<<10,r<128)return c(t,i,e);if(r=o[n.pos++],i|=(127&r)<<17,r<128)return c(t,i,e);if(r=o[n.pos++],i|=(127&r)<<24,r<128)return c(t,i,e);if(r=o[n.pos++],i|=(1&r)<<31,r<128)return c(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&a?function(t,e,n){return a.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var i="",r=e;for(;r<n;){var o,s,a,l=t[r],c=null,u=l>239?4:l>223?3:l>191?2:1;if(r+u>n)break;1===u?l<128&&(c=l):2===u?128===(192&(o=t[r+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(o=t[r+1],s=t[r+2],128===(192&o)&&128===(192&s)&&((c=(15&l)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=t[r+1],s=t[r+2],a=t[r+3],128===(192&o)&&128===(192&s)&&128===(192&a)&&((c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,i+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),i+=String.fromCharCode(c),r+=u}return i}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==r.Bytes)return t.push(this.readVarint(e));var n=l(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==r.Bytes)return t.push(this.readSVarint());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==r.Bytes)return t.push(this.readBoolean());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==r.Bytes)return t.push(this.readFloat());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==r.Bytes)return t.push(this.readDouble());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==r.Bytes)return t.push(this.readFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==r.Bytes)return t.push(this.readSFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==r.Bytes)return t.push(this.readFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==r.Bytes)return t.push(this.readSFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===r.Varint)for(;this.buf[this.pos++]>127;);else if(e===r.Bytes)this.pos=this.readVarint()+this.pos;else if(e===r.Fixed32)this.pos+=4;else{if(e!==r.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),b(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),b(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),b(this.buf,-1&t,this.pos),b(this.buf,Math.floor(t*s),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),b(this.buf,-1&t,this.pos),b(this.buf,Math.floor(t*s),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,i;t>=0?(n=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,i=i+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var i,r,o=0;o<e.length;o++){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){i>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):r=i;continue}if(i<56320){t[n++]=239,t[n++]=191,t[n++]=189,r=i;continue}i=r-55296<<10|i-56320|65536,r=null}else r&&(t[n++]=239,t[n++]=191,t[n++]=189,r=null);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:(i<65536?t[n++]=i>>12|224:(t[n++]=i>>18|240,t[n++]=i>>12&63|128),t[n++]=i>>6&63|128),t[n++]=63&i|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&u(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),i.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),i.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var i=this.pos-n;i>=128&&u(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,n){this.writeTag(t,r.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,A,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writeBytesField:function(t,e){this.writeTag(t,r.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,r.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,r.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,r.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,r.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,r.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,r.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,r.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,r.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,r.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},3717:(t,e,n)=>{"use strict";n.d(e,{X$:()=>ct,Pv:()=>On,Z3:()=>_t});var i=n(25773),r=n(30126),o=n(64649),s=n(66845),a=n(8984),l=n(65809),c=n(75818),u=function(){if("undefined"!==typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,i){return t[0]===e&&(n=i,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),i=this.__entries__[n];return i&&i[1]},e.prototype.set=function(e,n){var i=t(this.__entries__,e);~i?this.__entries__[i][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,i=t(n,e);~i&&n.splice(i,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,i=this.__entries__;n<i.length;n++){var r=i[n];t.call(e,r[1],r[0])}},e}()}(),h="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,d="undefined"!==typeof n.g&&n.g.Math===Math?n.g:"undefined"!==typeof self&&self.Math===Math?self:"undefined"!==typeof window&&window.Math===Math?window:Function("return this")(),f="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(d):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var A=["top","right","bottom","left","width","height","size","weight"],p="undefined"!==typeof MutationObserver,g=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,i=!1,r=0;function o(){n&&(n=!1,t()),i&&a()}function s(){f(o)}function a(){var t=Date.now();if(n){if(t-r<2)return;i=!0}else n=!0,i=!1,setTimeout(s,e);r=t}return a}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){h&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),p?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){h&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;A.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),m=function(t,e){for(var n=0,i=Object.keys(e);n<i.length;n++){var r=i[n];Object.defineProperty(t,r,{value:e[r],enumerable:!1,writable:!1,configurable:!0})}return t},y=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||d},v=B(0,0,0,0);function _(t){return parseFloat(t)||0}function b(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce((function(e,n){return e+_(t["border-"+n+"-width"])}),0)}function x(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return v;var i=y(t).getComputedStyle(t),r=function(t){for(var e={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var r=i[n],o=t["padding-"+r];e[r]=_(o)}return e}(i),o=r.left+r.right,s=r.top+r.bottom,a=_(i.width),l=_(i.height);if("border-box"===i.boxSizing&&(Math.round(a+o)!==e&&(a-=b(i,"left","right")+o),Math.round(l+s)!==n&&(l-=b(i,"top","bottom")+s)),!function(t){return t===y(t).document.documentElement}(t)){var c=Math.round(a+o)-e,u=Math.round(l+s)-n;1!==Math.abs(c)&&(a-=c),1!==Math.abs(u)&&(l-=u)}return B(r.left,r.top,a,l)}var w="undefined"!==typeof SVGGraphicsElement?function(t){return t instanceof y(t).SVGGraphicsElement}:function(t){return t instanceof y(t).SVGElement&&"function"===typeof t.getBBox};function C(t){return h?w(t)?function(t){var e=t.getBBox();return B(0,0,e.width,e.height)}(t):x(t):v}function B(t,e,n,i){return{x:t,y:e,width:n,height:i}}var E=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=B(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=C(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),T=function(t,e){var n=function(t){var e=t.x,n=t.y,i=t.width,r=t.height,o="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(o.prototype);return m(s,{x:e,y:n,width:i,height:r,top:n,right:e+i,bottom:r+n,left:e}),s}(e);m(this,{target:t,contentRect:n})},S=function(){function t(t,e,n){if(this.activeObservations_=[],this.observations_=new u,"function"!==typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=n}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(t instanceof y(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new E(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(t instanceof y(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new T(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),M="undefined"!==typeof WeakMap?new WeakMap:new u,I=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=g.getInstance(),i=new S(e,n,this);M.set(this,i)};["observe","unobserve","disconnect"].forEach((function(t){I.prototype[t]=function(){var e;return(e=M.get(this))[t].apply(e,arguments)}}));const P="undefined"!==typeof d.ResizeObserver?d.ResizeObserver:I;var D=n(22951),F=n(91976),L=("undefined"!==typeof window?window:n.g,"undefined"!==typeof n.g?n.g:window,"undefined"!==typeof document?document:{});function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function R(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function k(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return U(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var z=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function G(t){if(!t)return null;if("string"===typeof t)return t;t.toJS&&(t=t.toJS());var e,n={},i=k(t.layers);try{for(i.s();!(e=i.n()).done;){var r=e.value;n[r.id]=r}}catch(s){i.e(s)}finally{i.f()}var o=t.layers.map((function(t){var e=n[t.ref],i=null;if("interactive"in t&&delete(i=R({},t)).interactive,e){delete(i=i||R({},t)).ref;var r,o=k(z);try{for(o.s();!(r=o.n()).done;){var a=r.value;a in e&&(i[a]=e[a])}}catch(s){o.e(s)}finally{o.f()}}return i||t}));return R(R({},t),{},{layers:o})}var N={container:a.object,gl:a.object,mapboxApiAccessToken:a.string,mapboxApiUrl:a.string,attributionControl:a.bool,preserveDrawingBuffer:a.bool,reuseMaps:a.bool,transformRequest:a.func,mapOptions:a.object,mapStyle:a.oneOfType([a.string,a.object]),preventStyleDiffing:a.bool,visible:a.bool,asyncRender:a.bool,onLoad:a.func,onError:a.func,width:a.number,height:a.number,viewState:a.object,longitude:a.number,latitude:a.number,zoom:a.number,bearing:a.number,pitch:a.number,altitude:a.number},Z={container:L.body,mapboxApiAccessToken:function(){var t=null;if("undefined"!==typeof window&&window.location){var e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||"undefined"===typeof process||(t=t||{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.MapboxAccessToken||{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),mapboxApiUrl:"https://api.mapbox.com",preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",preventStyleDiffing:!1,visible:!0,asyncRender:!1,onLoad:function(){},onError:function(t){t&&console.error(t.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0,altitude:1.5};function j(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"component";t.debug&&a.checkPropTypes(N,t,"prop",e)}var V=function(){function t(e){var n=this;if((0,D.Z)(this,t),(0,o.Z)(this,"props",Z),(0,o.Z)(this,"width",0),(0,o.Z)(this,"height",0),(0,o.Z)(this,"_fireLoadEvent",(function(){n.props.onLoad({type:"load",target:n._map})})),(0,o.Z)(this,"_handleError",(function(t){n.props.onError(t)})),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,t.initialized||(t.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}return(0,F.Z)(t,[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(t){return this._update(this.props,t),this}},{key:"redraw",value:function(){var t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}},{key:"getMap",value:function(){return this._map}},{key:"_reuse",value:function(e){this._map=t.savedMap;var n=this._map.getContainer(),i=e.container;for(i.classList.add("mapboxgl-map");n.childNodes.length>0;)i.appendChild(n.childNodes[0]);this._map._container=i,t.savedMap=null,e.mapStyle&&this._map.setStyle(G(e.mapStyle),{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}},{key:"_create",value:function(e){if(e.reuseMaps&&t.savedMap)this._reuse(e);else{if(e.gl){var n=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=n,e.gl}}var i={container:e.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:G(e.mapStyle),interactive:!1,trackResize:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(i.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},i,e.mapOptions)),this._map.once("load",this._fireLoadEvent),this._map.on("error",this._handleError)}return this}},{key:"_destroy",value:function(){this._map&&(this.props.reuseMaps&&!t.savedMap?(t.savedMap=this._map,this._map.off("load",this._fireLoadEvent),this._map.off("error",this._handleError),this._map.off("styledata",this._fireLoadEvent)):this._map.remove(),this._map=null)}},{key:"_initialize",value:function(t){var e=this;j(t=Object.assign({},Z,t),"Mapbox"),this.mapboxgl.accessToken=t.mapboxApiAccessToken||Z.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=t.mapboxApiUrl,this._create(t);var n=t.container;Object.defineProperty(n,"offsetWidth",{configurable:!0,get:function(){return e.width}}),Object.defineProperty(n,"clientWidth",{configurable:!0,get:function(){return e.width}}),Object.defineProperty(n,"offsetHeight",{configurable:!0,get:function(){return e.height}}),Object.defineProperty(n,"clientHeight",{configurable:!0,get:function(){return e.height}});var i=this._map.getCanvas();i&&(i.style.outline="none"),this._updateMapViewport({},t),this._updateMapSize({},t),this.props=t}},{key:"_update",value:function(t,e){if(this._map){j(e=Object.assign({},this.props,e),"Mapbox");var n=this._updateMapViewport(t,e),i=this._updateMapSize(t,e);this._updateMapStyle(t,e),e.asyncRender||!n&&!i||this.redraw(),this.props=e}}},{key:"_updateMapStyle",value:function(t,e){t.mapStyle!==e.mapStyle&&this._map.setStyle(G(e.mapStyle),{diff:!e.preventStyleDiffing})}},{key:"_updateMapSize",value:function(t,e){var n=t.width!==e.width||t.height!==e.height;return n&&(this.width=e.width,this.height=e.height,this._map.resize()),n}},{key:"_updateMapViewport",value:function(t,e){var n=this._getViewState(t),i=this._getViewState(e),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}},{key:"_getViewState",value:function(t){var e=t.viewState||t,n=e.longitude,i=e.latitude,r=e.zoom,o=e.pitch,s=void 0===o?0:o,a=e.bearing,l=void 0===a?0:a,c=e.altitude;return{longitude:n,latitude:i,zoom:r,pitch:s,bearing:l,altitude:void 0===c?1.5:c}}},{key:"_checkStyleSheet",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.47.0";if("undefined"!==typeof L)try{var e=L.createElement("div");if(e.className="mapboxgl-map",e.style.display="none",L.body.appendChild(e),!("static"!==window.getComputedStyle(e).position)){var n=L.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(t,"/mapbox-gl.css")),L.head.appendChild(n)}}catch(i){}}},{key:"_viewStateToMapboxProps",value:function(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}}}]),t}();(0,o.Z)(V,"initialized",!1),(0,o.Z)(V,"propTypes",N),(0,o.Z)(V,"defaultProps",Z),(0,o.Z)(V,"savedMap",null);var H=n(9794),J=n.n(H);function W(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function Q(t,e){if(t===e)return!0;if(W(t)&&W(e)){if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!Q(t[n],e[n]))return!1;return!0}return Math.abs(t-e)<=1e-7}function K(t,e,n){return Math.max(e,Math.min(n,t))}function q(t,e,n){return W(t)?t.map((function(t,i){return q(t,e[i],n)})):n*e+(1-n)*t}function X(t,e){if(!t)throw new Error(e||"react-map-gl: assertion failed.")}function Y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function $(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var tt={minZoom:0,maxZoom:24,minPitch:0,maxPitch:60},et=0,nt=0,it=1.5,rt=function(){function t(e){var n=e.width,i=e.height,r=e.latitude,o=e.longitude,s=e.zoom,a=e.bearing,l=void 0===a?nt:a,c=e.pitch,u=void 0===c?et:c,h=e.altitude,d=void 0===h?it:h,f=e.maxZoom,A=void 0===f?tt.maxZoom:f,p=e.minZoom,g=void 0===p?tt.minZoom:p,m=e.maxPitch,y=void 0===m?tt.maxPitch:m,v=e.minPitch,_=void 0===v?tt.minPitch:v,b=e.transitionDuration,x=e.transitionEasing,w=e.transitionInterpolator,C=e.transitionInterruption,B=e.startPanLngLat,E=e.startZoomLngLat,T=e.startRotatePos,S=e.startBearing,M=e.startPitch,I=e.startZoom;(0,D.Z)(this,t),X(Number.isFinite(n),"`width` must be supplied"),X(Number.isFinite(i),"`height` must be supplied"),X(Number.isFinite(o),"`longitude` must be supplied"),X(Number.isFinite(r),"`latitude` must be supplied"),X(Number.isFinite(s),"`zoom` must be supplied"),this._viewportProps=this._applyConstraints({width:n,height:i,latitude:r,longitude:o,zoom:s,bearing:l,pitch:u,altitude:d,maxZoom:A,minZoom:g,maxPitch:y,minPitch:_,transitionDuration:b,transitionEasing:x,transitionInterpolator:w,transitionInterruption:C}),this._state={startPanLngLat:B,startZoomLngLat:E,startRotatePos:T,startBearing:S,startPitch:M,startZoom:I}}return(0,F.Z)(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getState",value:function(){return this._state}},{key:"panStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startPanLngLat:this._unproject(e)})}},{key:"pan",value:function(t){var e=t.pos,n=t.startPos,i=this._state.startPanLngLat||this._unproject(n);if(!i)return this;var r=this._calculateNewLngLat({startPanLngLat:i,pos:e}),o=(0,l.Z)(r,2),s=o[0],a=o[1];return this._getUpdatedMapState({longitude:s,latitude:a})}},{key:"panEnd",value:function(){return this._getUpdatedMapState({startPanLngLat:null})}},{key:"rotateStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(t){var e,n=t.pos,i=t.deltaAngleX,r=void 0===i?0:i,o=t.deltaAngleY,s=void 0===o?0:o,a=this._state,l=a.startRotatePos,c=a.startBearing,u=a.startPitch;return Number.isFinite(c)&&Number.isFinite(u)?(e=n?this._calculateNewPitchAndBearing($($({},this._getRotationParams(n,l)),{},{startBearing:c,startPitch:u})):{bearing:c+r,pitch:u+s},this._getUpdatedMapState(e)):this}},{key:"rotateEnd",value:function(){return this._getUpdatedMapState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.pos,n=t.startPos,i=t.scale;X(i>0,"`scale` must be a positive number");var r=this._state,o=r.startZoom,s=r.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(e)),X(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var a=this._calculateNewZoom({scale:i,startZoom:o||0}),u=new c.DW(Object.assign({},this._viewportProps,{zoom:a})).getMapCenterByLngLatPosition({lngLat:s,pos:e}),h=(0,l.Z)(u,2),d=h[0],f=h[1];return this._getUpdatedMapState({zoom:a,longitude:d,latitude:f})}},{key:"zoomEnd",value:function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})}},{key:"_getUpdatedMapState",value:function(e){return new t(Object.assign({},this._viewportProps,this._state,e))}},{key:"_applyConstraints",value:function(t){var e=t.maxZoom,n=t.minZoom,i=t.zoom;t.zoom=K(i,n,e);var r=t.maxPitch,o=t.minPitch,s=t.pitch;return t.pitch=K(s,o,r),Object.assign(t,(0,c.QA)(t)),t}},{key:"_unproject",value:function(t){var e=new c.DW(this._viewportProps);return t&&e.unproject(t)}},{key:"_calculateNewLngLat",value:function(t){var e=t.startPanLngLat,n=t.pos;return new c.DW(this._viewportProps).getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,n=t.startZoom,i=this._viewportProps,r=i.maxZoom,o=i.minZoom;return K(n+Math.log2(e),o,r)}},{key:"_calculateNewPitchAndBearing",value:function(t){var e=t.deltaScaleX,n=t.deltaScaleY,i=t.startBearing,r=t.startPitch;n=K(n,-1,1);var o=this._viewportProps,s=o.minPitch,a=o.maxPitch,l=r;return n>0?l=r+n*(a-r):n<0&&(l=r-n*(s-r)),{pitch:l,bearing:i+180*e}}},{key:"_getRotationParams",value:function(t,e){var n=t[0]-e[0],i=t[1]-e[1],r=t[1],o=e[1],s=this._viewportProps,a=s.width,l=s.height,c=n/a,u=0;return i>0?Math.abs(l-o)>5&&(u=i/(o-l)*1.2):i<0&&o>5&&(u=1-r/o),{deltaScaleX:c,deltaScaleY:u=Math.min(1,Math.max(-1,u))}}}]),t}();function ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function st(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var at=(0,s.createContext)({viewport:null,map:null,container:null,onViewportChange:null,onViewStateChange:null,eventManager:null}),lt=at.Provider;at.Provider=function(t){var e=t.value,n=t.children,i=(0,s.useState)(null),r=(0,l.Z)(i,2),o=r[0],a=r[1],c=(0,s.useContext)(at);return e=st(st({setMap:a},c),{},{map:c&&c.map||o},e),s.createElement(lt,{value:e},n)};const ct=at;const ut="undefined"!==typeof window?s.useLayoutEffect:s.useEffect;function ht(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function dt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ht(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ht(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ft="A valid API access token is required to use Mapbox data";function At(t){var e=t.props,n=t.width,i=t.height;return new c.DW(dt(dt(dt({},e),e.viewState),{},{width:n,height:i}))}var pt={position:"absolute",width:"100%",height:"100%",overflow:"hidden"},gt=Object.assign({},V.propTypes,{width:a.oneOfType([a.number,a.string]),height:a.oneOfType([a.number,a.string]),onResize:a.func,disableTokenWarning:a.bool,visible:a.bool,className:a.string,style:a.object,visibilityConstraints:a.object}),mt=Object.assign({},V.defaultProps,{disableTokenWarning:!1,visible:!0,onResize:function(){},className:"",style:null,visibilityConstraints:tt});function yt(){return s.createElement("div",{key:"warning",id:"no-token-warning",style:{position:"absolute",left:0,top:0}},s.createElement("h3",{key:"header"},ft),s.createElement("div",{key:"text"},"For information on setting up your basemap, read"),s.createElement("a",{key:"link",href:"https://visgl.github.io/react-map-gl/docs/get-started/mapbox-tokens"},"Note on Map Tokens"))}var vt=(0,s.forwardRef)((function(t,e){var n=(0,s.useState)(!0),i=(0,l.Z)(n,2),r=i[0],o=i[1],a=(0,s.useState)({width:0,height:0}),c=(0,l.Z)(a,2),u=c[0],h=c[1],d=(0,s.useRef)(null),f=(0,s.useRef)(null),A=(0,s.useRef)(null),p=(0,s.useRef)(null),g=(0,s.useContext)(ct);ut((function(){if(vt.supported()){var e=new V(dt(dt(dt({},t),u),{},{mapboxgl:J(),container:f.current,onError:function(e){401===(e.error&&e.error.status||e.status)&&r&&(console.error(ft),o(!1)),t.onError(e)}}));d.current=e,g&&g.setMap&&g.setMap(e.getMap());var n=new P((function(e){if(e[0].contentRect){var n=e[0].contentRect,i=n.width,r=n.height;h({width:i,height:r}),t.onResize({width:i,height:r})}}));return n.observe(A.current),function(){e.finalize(),d.current=null,n.disconnect()}}}),[]),ut((function(){d.current&&d.current.setProps(dt(dt({},t),u))}));var m=d.current&&d.current.getMap();(0,s.useImperativeHandle)(e,(function(){return function(t){return{getMap:function(){return t.current&&t.current.getMap()},queryRenderedFeatures:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.current&&t.current.getMap();return i&&i.queryRenderedFeatures(e,n)}}}(d)}),[]);var y=(0,s.useCallback)((function(t){var e=t.target;e===p.current&&e.scrollTo(0,0)}),[]),v=m&&s.createElement(lt,{value:dt(dt({},g),{},{viewport:g.viewport||At(dt({map:m,props:t},u)),map:m,container:g.container||A.current})},s.createElement("div",{key:"map-overlays",className:"overlays",ref:p,style:pt,onScroll:y},t.children)),_=t.className,b=t.width,x=t.height,w=t.style,C=t.visibilityConstraints,B=Object.assign({position:"relative"},w,{width:b,height:x}),E=t.visible&&function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tt;for(var i in n){var r=i.slice(0,3),o=(e=i.slice(3))[0].toLowerCase()+e.slice(1);if("min"===r&&t[o]<n[i])return!1;if("max"===r&&t[o]>n[i])return!1}return!0}(t.viewState||t,C),T=Object.assign({},pt,{visibility:E?"inherit":"hidden"});return s.createElement("div",{key:"map-container",ref:A,style:B},s.createElement("div",{key:"map-mapbox",ref:f,style:T,className:_}),v,!r&&!t.disableTokenWarning&&s.createElement(yt,null))}));vt.supported=function(){return J()&&J().supported()},vt.propTypes=gt,vt.defaultProps=mt;const _t=vt;function bt(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return xt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xt(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var wt=function(){function t(){(0,D.Z)(this,t),(0,o.Z)(this,"propNames",[])}return(0,F.Z)(t,[{key:"arePropsEqual",value:function(t,e){var n,i=bt(this.propNames||[]);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(!Q(t[r],e[r]))return!1}}catch(o){i.e(o)}finally{i.f()}return!0}},{key:"initializeProps",value:function(t,e){return{start:t,end:e}}},{key:"interpolateProps",value:function(t,e,n){X(!1,"interpolateProps is not implemented")}},{key:"getDuration",value:function(t,e){return e.transitionDuration}}]),t}(),Ct=n(47169),Bt=n(67591),Et=n(99492),Tt=n(27597),St={longitude:1,bearing:1};function Mt(t){return Number.isFinite(t)||Array.isArray(t)}function It(t,e,n){return function(t){return t in St}(t)&&Math.abs(n-e)>180&&(n=n<0?n+360:n-360),n}function Pt(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return Dt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dt(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Ft(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=(0,Tt.Z)(t);if(e){var r=(0,Tt.Z)(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return(0,Et.Z)(this,n)}}var Lt=["longitude","latitude","zoom","bearing","pitch"],Ot=["latitude","longitude","zoom","width","height"],Rt=["bearing","pitch"],kt={speed:1.2,curve:1.414};!function(t){(0,Bt.Z)(n,t);var e=Ft(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,D.Z)(this,n),t=e.call(this),(0,o.Z)((0,Ct.Z)(t),"propNames",Lt),t.props=Object.assign({},kt,i),t}(0,F.Z)(n,[{key:"initializeProps",value:function(t,e){var n,i={},r={},o=Pt(Ot);try{for(o.s();!(n=o.n()).done;){var s=n.value,a=t[s],l=e[s];X(Mt(a)&&Mt(l),"".concat(s," must be supplied for transition")),i[s]=a,r[s]=It(s,a,l)}}catch(A){o.e(A)}finally{o.f()}var c,u=Pt(Rt);try{for(u.s();!(c=u.n()).done;){var h=c.value,d=t[h]||0,f=e[h]||0;i[h]=d,r[h]=It(h,d,f)}}catch(A){u.e(A)}finally{u.f()}return{start:i,end:r}}},{key:"interpolateProps",value:function(t,e,n){var i,r=(0,c.if)(t,e,n,this.props),o=Pt(Rt);try{for(o.s();!(i=o.n()).done;){var s=i.value;r[s]=q(t[s],e[s],n)}}catch(a){o.e(a)}finally{o.f()}return r}},{key:"getDuration",value:function(t,e){var n=e.transitionDuration;return"auto"===n&&(n=(0,c.up)(t,e,this.props)),n}}])}(wt);function Ut(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return zt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zt(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function zt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Gt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=(0,Tt.Z)(t);if(e){var r=(0,Tt.Z)(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return(0,Et.Z)(this,n)}}var Nt=["longitude","latitude","zoom","bearing","pitch"],Zt=function(t){(0,Bt.Z)(n,t);var e=Gt(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,D.Z)(this,n),t=e.call(this),Array.isArray(i)&&(i={transitionProps:i}),t.propNames=i.transitionProps||Nt,i.around&&(t.around=i.around),t}return(0,F.Z)(n,[{key:"initializeProps",value:function(t,e){var n={},i={};if(this.around){n.around=this.around;var r=new c.DW(t).unproject(this.around);Object.assign(i,e,{around:new c.DW(e).project(r),aroundLngLat:r})}var o,s=Ut(this.propNames);try{for(s.s();!(o=s.n()).done;){var a=o.value,l=t[a],u=e[a];X(Mt(l)&&Mt(u),"".concat(a," must be supplied for transition")),n[a]=l,i[a]=It(a,l,u)}}catch(h){s.e(h)}finally{s.f()}return{start:n,end:i}}},{key:"interpolateProps",value:function(t,e,n){var i,r={},o=Ut(this.propNames);try{for(o.s();!(i=o.n()).done;){var s=i.value;r[s]=q(t[s],e[s],n)}}catch(f){o.e(f)}finally{o.f()}if(e.around){var a=new c.DW(Object.assign({},e,r)).getMapCenterByLngLatPosition({lngLat:e.aroundLngLat,pos:q(t.around,e.around,n)}),u=(0,l.Z)(a,2),h=u[0],d=u[1];r.longitude=h,r.latitude=d}return r}}]),n}(wt),jt=function(){};var Vt=1,Ht=2,Jt=3,Wt=4,Qt={transitionDuration:0,transitionEasing:function(t){return t},transitionInterpolator:new Zt,transitionInterruption:Vt,onTransitionStart:jt,onTransitionInterrupt:jt,onTransitionEnd:jt},Kt=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,D.Z)(this,t),(0,o.Z)(this,"_animationFrame",null),(0,o.Z)(this,"_onTransitionFrame",(function(){e._animationFrame=requestAnimationFrame(e._onTransitionFrame),e._updateViewport()})),this.props=null,this.onViewportChange=n.onViewportChange||jt,this.onStateChange=n.onStateChange||jt,this.time=n.getTime||Date.now}return(0,F.Z)(t,[{key:"getViewportInTransition",value:function(){return this._animationFrame?this.state.propsInTransition:null}},{key:"processViewportChange",value:function(t){var e=this.props;if(this.props=t,!e||this._shouldIgnoreViewportChange(e,t))return!1;if(this._isTransitionEnabled(t)){var n=Object.assign({},e),i=Object.assign({},t);if(this._isTransitionInProgress()&&(e.onTransitionInterrupt(),this.state.interruption===Ht?Object.assign(n,this.state.endProps):Object.assign(n,this.state.propsInTransition),this.state.interruption===Wt)){var r=this.time(),o=(r-this.state.startTime)/this.state.duration;i.transitionDuration=this.state.duration-(r-this.state.startTime),i.transitionEasing=function(t,e){var n=t(e);return function(i){return 1/(1-n)*(t(i*(1-e)+e)-n)}}(this.state.easing,o),i.transitionInterpolator=n.transitionInterpolator}return i.onTransitionStart(),this._triggerTransition(n,i),!0}return this._isTransitionInProgress()&&(e.onTransitionInterrupt(),this._endTransition()),!1}},{key:"_isTransitionInProgress",value:function(){return Boolean(this._animationFrame)}},{key:"_isTransitionEnabled",value:function(t){var e=t.transitionDuration,n=t.transitionInterpolator;return(e>0||"auto"===e)&&Boolean(n)}},{key:"_isUpdateDueToCurrentTransition",value:function(t){return!!this.state.propsInTransition&&this.state.interpolator.arePropsEqual(t,this.state.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(t,e){return!t||(this._isTransitionInProgress()?this.state.interruption===Jt||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e))}},{key:"_triggerTransition",value:function(t,e){X(this._isTransitionEnabled(e)),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var n=e.transitionInterpolator,i=n.getDuration?n.getDuration(t,e):e.transitionDuration;if(0!==i){var r=e.transitionInterpolator.initializeProps(t,e),o={inTransition:!0,isZooming:t.zoom!==e.zoom,isPanning:t.longitude!==e.longitude||t.latitude!==e.latitude,isRotating:t.bearing!==e.bearing||t.pitch!==e.pitch};this.state={duration:i,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startTime:this.time(),startProps:r.start,endProps:r.end,animation:null,propsInTransition:{}},this._onTransitionFrame(),this.onStateChange(o)}}},{key:"_endTransition",value:function(){this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=null),this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})}},{key:"_updateViewport",value:function(){var t=this.time(),e=this.state,n=e.startTime,i=e.duration,r=e.easing,o=e.interpolator,s=e.startProps,a=e.endProps,l=!1,c=(t-n)/i;c>=1&&(c=1,l=!0),c=r(c);var u=o.interpolateProps(s,a,c),h=new rt(Object.assign({},this.props,u));this.state.propsInTransition=h.getViewportProps(),this.onViewportChange(this.state.propsInTransition,this.props),l&&(this._endTransition(),this.props.onTransitionEnd())}}]),t}();(0,o.Z)(Kt,"defaultProps",Qt);var qt=n(48331);function Xt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Yt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xt(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var $t={transitionDuration:0},te={transitionDuration:300,transitionEasing:function(t){return t},transitionInterpolator:new Zt,transitionInterruption:Vt},ee=300,ne=function(t){return 1-(1-t)*(1-t)},ie=["wheel"],re=["panstart","panmove","panend"],oe=["pinchstart","pinchmove","pinchend"],se=["tripanstart","tripanmove","tripanend"],ae=["doubletap"],le=["keydown"],ce=function(){function t(){var e=this;(0,D.Z)(this,t),(0,o.Z)(this,"events",[]),(0,o.Z)(this,"scrollZoom",!0),(0,o.Z)(this,"dragPan",!0),(0,o.Z)(this,"dragRotate",!0),(0,o.Z)(this,"doubleClickZoom",!0),(0,o.Z)(this,"touchZoom",!0),(0,o.Z)(this,"touchRotate",!1),(0,o.Z)(this,"keyboard",!0),(0,o.Z)(this,"_interactionState",{isDragging:!1}),(0,o.Z)(this,"_events",{}),(0,o.Z)(this,"_setInteractionState",(function(t){Object.assign(e._interactionState,t),e.onStateChange&&e.onStateChange(e._interactionState)})),(0,o.Z)(this,"_onTransition",(function(t,n){e.onViewportChange(t,e._interactionState,n)})),this.handleEvent=this.handleEvent.bind(this),this._transitionManager=new Kt({onViewportChange:this._onTransition,onStateChange:this._setInteractionState})}return(0,F.Z)(t,[{key:"handleEvent",value:function(t){this.mapState=this.getMapState();var e=this._eventStartBlocked;switch(t.type){case"panstart":return!e&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!e&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!e&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}},{key:"getCenter",value:function(t){var e=t.offsetCenter;return[e.x,e.y]}},{key:"isFunctionKeyPressed",value:function(t){var e=t.srcEvent;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}},{key:"blockEvents",value:function(t){var e=this,n=setTimeout((function(){e._eventStartBlocked===n&&(e._eventStartBlocked=null)}),t);this._eventStartBlocked=n}},{key:"updateViewport",value:function(t,e,n){var i=this.mapState instanceof rt?this.mapState.getViewportProps():this.mapState,r=Yt(Yt({},t.getViewportProps()),e),o=Object.keys(r).some((function(t){return i[t]!==r[t]}));this._state=t.getState(),this._setInteractionState(n),o&&this.onViewportChange(r,this._interactionState,i)}},{key:"getMapState",value:function(t){return new rt(Yt(Yt(Yt({},this.mapStateProps),this._state),t))}},{key:"isDragging",value:function(){return this._interactionState.isDragging}},{key:"setOptions",value:function(t){var e=t.onViewportChange,n=t.onStateChange,i=t.eventManager,r=void 0===i?this.eventManager:i,o=t.isInteractive,s=void 0===o||o,a=t.scrollZoom,l=void 0===a?this.scrollZoom:a,c=t.dragPan,u=void 0===c?this.dragPan:c,h=t.dragRotate,d=void 0===h?this.dragRotate:h,f=t.doubleClickZoom,A=void 0===f?this.doubleClickZoom:f,p=t.touchZoom,g=void 0===p?this.touchZoom:p,m=t.touchRotate,y=void 0===m?this.touchRotate:m,v=t.keyboard,_=void 0===v?this.keyboard:v;this.onViewportChange=e,this.onStateChange=n;var b=this.mapStateProps||{},x=b.height!==t.height||b.width!==t.width;this.mapStateProps=t,x&&(this.mapState=b,this.updateViewport(new rt(t))),this._transitionManager.processViewportChange(t),this.eventManager!==r&&(this.eventManager=r,this._events={},this.toggleEvents(this.events,!0)),this.toggleEvents(ie,s&&Boolean(l)),this.toggleEvents(re,s&&Boolean(u||d)),this.toggleEvents(oe,s&&Boolean(g||y)),this.toggleEvents(se,s&&Boolean(y)),this.toggleEvents(ae,s&&Boolean(A)),this.toggleEvents(le,s&&Boolean(_)),this.scrollZoom=l,this.dragPan=u,this.dragRotate=d,this.doubleClickZoom=A,this.touchZoom=g,this.touchRotate=y,this.keyboard=_}},{key:"toggleEvents",value:function(t,e){var n=this;this.eventManager&&t.forEach((function(t){n._events[t]!==e&&(n._events[t]=e,e?n.eventManager.on(t,n.handleEvent):n.eventManager.off(t,n.handleEvent))}))}},{key:"_onPanStart",value:function(t){var e=this.getCenter(t);this._panRotate=this.isFunctionKeyPressed(t)||t.rightButton;var n=this._panRotate?this.mapState.rotateStart({pos:e}):this.mapState.panStart({pos:e});return this.updateViewport(n,$t,{isDragging:!0}),!0}},{key:"_onPan",value:function(t){return!!this.isDragging()&&(this._panRotate?this._onPanRotate(t):this._onPanMove(t))}},{key:"_onPanEnd",value:function(t){return!!this.isDragging()&&(this._panRotate?this._onPanRotateEnd(t):this._onPanMoveEnd(t))}},{key:"_onPanMove",value:function(t){if(!this.dragPan)return!1;var e=this.getCenter(t),n=this.mapState.pan({pos:e});return this.updateViewport(n,$t,{isPanning:!0}),!0}},{key:"_onPanMoveEnd",value:function(t){if(this.dragPan){var e=this.dragPan.inertia,n=void 0===e?ee:e;if(n&&t.velocity){var i=this.getCenter(t),r=[i[0]+t.velocityX*n/2,i[1]+t.velocityY*n/2],o=this.mapState.pan({pos:r}).panEnd();return this.updateViewport(o,Yt(Yt({},te),{},{transitionDuration:n,transitionEasing:ne}),{isDragging:!1,isPanning:!0}),!0}}var s=this.mapState.panEnd();return this.updateViewport(s,null,{isDragging:!1,isPanning:!1}),!0}},{key:"_onPanRotate",value:function(t){if(!this.dragRotate)return!1;var e=this.getCenter(t),n=this.mapState.rotate({pos:e});return this.updateViewport(n,$t,{isRotating:!0}),!0}},{key:"_onPanRotateEnd",value:function(t){if(this.dragRotate){var e=this.dragRotate.inertia,n=void 0===e?ee:e;if(n&&t.velocity){var i=this.getCenter(t),r=[i[0]+t.velocityX*n/2,i[1]+t.velocityY*n/2],o=this.mapState.rotate({pos:r}).rotateEnd();return this.updateViewport(o,Yt(Yt({},te),{},{transitionDuration:n,transitionEasing:ne}),{isDragging:!1,isRotating:!0}),!0}}var s=this.mapState.panEnd();return this.updateViewport(s,null,{isDragging:!1,isRotating:!1}),!0}},{key:"_onWheel",value:function(t){if(!this.scrollZoom)return!1;var e=this.scrollZoom,n=e.speed,i=void 0===n?.01:n,r=e.smooth,o=void 0!==r&&r;t.preventDefault();var s=this.getCenter(t),a=t.delta,l=2/(1+Math.exp(-Math.abs(a*i)));a<0&&0!==l&&(l=1/l);var c=this.mapState.zoom({pos:s,scale:l});return c.getViewportProps().zoom!==this.mapStateProps.zoom&&(this.updateViewport(c,Yt(Yt({},te),{},{transitionInterpolator:new Zt({around:s}),transitionDuration:o?250:1}),{isPanning:!0,isZooming:!0}),!0)}},{key:"_onPinchStart",value:function(t){var e=this.getCenter(t),n=this.mapState.zoomStart({pos:e}).rotateStart({pos:e});return this._startPinchRotation=t.rotation,this._lastPinchEvent=t,this.updateViewport(n,$t,{isDragging:!0}),!0}},{key:"_onPinch",value:function(t){if(!this.isDragging())return!1;if(!this.touchZoom&&!this.touchRotate)return!1;var e=this.mapState;if(this.touchZoom){var n=t.scale,i=this.getCenter(t);e=e.zoom({pos:i,scale:n})}if(this.touchRotate){var r=t.rotation;e=e.rotate({deltaAngleX:this._startPinchRotation-r})}return this.updateViewport(e,$t,{isDragging:!0,isPanning:Boolean(this.touchZoom),isZooming:Boolean(this.touchZoom),isRotating:Boolean(this.touchRotate)}),this._lastPinchEvent=t,!0}},{key:"_onPinchEnd",value:function(t){if(!this.isDragging())return!1;if(this.touchZoom){var e=this.touchZoom.inertia,n=void 0===e?ee:e,i=this._lastPinchEvent;if(n&&i&&t.scale!==i.scale){var r=this.getCenter(t),o=this.mapState.rotateEnd(),s=Math.log2(t.scale),a=(s-Math.log2(i.scale))/(t.deltaTime-i.deltaTime),l=Math.pow(2,s+a*n/2);return o=o.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(o,Yt(Yt({},te),{},{transitionInterpolator:new Zt({around:r}),transitionDuration:n,transitionEasing:ne}),{isDragging:!1,isPanning:Boolean(this.touchZoom),isZooming:Boolean(this.touchZoom),isRotating:!1}),this.blockEvents(n),!0}}var c=this.mapState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(c,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),this._startPinchRotation=null,this._lastPinchEvent=null,!0}},{key:"_onTriplePanStart",value:function(t){var e=this.getCenter(t),n=this.mapState.rotateStart({pos:e});return this.updateViewport(n,$t,{isDragging:!0}),!0}},{key:"_onTriplePan",value:function(t){if(!this.isDragging())return!1;if(!this.touchRotate)return!1;var e=this.getCenter(t);e[0]-=t.deltaX;var n=this.mapState.rotate({pos:e});return this.updateViewport(n,$t,{isRotating:!0}),!0}},{key:"_onTriplePanEnd",value:function(t){if(!this.isDragging())return!1;if(this.touchRotate){var e=this.touchRotate.inertia,n=void 0===e?ee:e;if(n&&t.velocityY){var i=this.getCenter(t),r=[i[0],i[1]+=t.velocityY*n/2],o=this.mapState.rotate({pos:r});return this.updateViewport(o,Yt(Yt({},te),{},{transitionDuration:n,transitionEasing:ne}),{isDragging:!1,isRotating:!0}),this.blockEvents(n),!1}}var s=this.mapState.rotateEnd();return this.updateViewport(s,null,{isDragging:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(t){if(!this.doubleClickZoom)return!1;var e=this.getCenter(t),n=this.isFunctionKeyPressed(t),i=this.mapState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(i,Object.assign({},te,{transitionInterpolator:new Zt({around:e})}),{isZooming:!0}),!0}},{key:"_onKeyDown",value:function(t){if(!this.keyboard)return!1;var e,n=this.isFunctionKeyPressed(t),i=this.keyboard,r=i.zoomSpeed,o=void 0===r?2:r,s=i.moveSpeed,a=void 0===s?100:s,l=i.rotateSpeedX,c=void 0===l?15:l,u=i.rotateSpeedY,h=void 0===u?10:u,d=this.mapStateProps;switch(t.srcEvent.keyCode){case 189:e=n?this.getMapState({zoom:d.zoom-Math.log2(o)-1}):this.getMapState({zoom:d.zoom-Math.log2(o)});break;case 187:e=n?this.getMapState({zoom:d.zoom+Math.log2(o)+1}):this.getMapState({zoom:d.zoom+Math.log2(o)});break;case 37:e=n?this.getMapState({bearing:d.bearing-c}):this.mapState.pan({pos:[a,0],startPos:[0,0]});break;case 39:e=n?this.getMapState({bearing:d.bearing+c}):this.mapState.pan({pos:[-a,0],startPos:[0,0]});break;case 38:e=n?this.getMapState({pitch:d.pitch+h}):this.mapState.pan({pos:[0,a],startPos:[0,0]});break;case 40:e=n?this.getMapState({pitch:d.pitch-h}):this.mapState.pan({pos:[0,-a],startPos:[0,0]});break;default:return!1}return this.updateViewport(e,te)}}]),t}();function ue(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function he(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ue(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var de=Object.assign({},_t.propTypes,{maxZoom:a.number,minZoom:a.number,maxPitch:a.number,minPitch:a.number,onViewStateChange:a.func,onViewportChange:a.func,onInteractionStateChange:a.func,transitionDuration:a.oneOfType([a.number,a.string]),transitionInterpolator:a.object,transitionInterruption:a.number,transitionEasing:a.func,onTransitionStart:a.func,onTransitionInterrupt:a.func,onTransitionEnd:a.func,scrollZoom:a.oneOfType([a.bool,a.object]),dragPan:a.oneOfType([a.bool,a.object]),dragRotate:a.oneOfType([a.bool,a.object]),doubleClickZoom:a.bool,touchZoom:a.oneOfType([a.bool,a.object]),touchRotate:a.oneOfType([a.bool,a.object]),keyboard:a.oneOfType([a.bool,a.object]),onHover:a.func,onClick:a.func,onDblClick:a.func,onContextMenu:a.func,onMouseDown:a.func,onMouseMove:a.func,onMouseUp:a.func,onTouchStart:a.func,onTouchMove:a.func,onTouchEnd:a.func,onMouseEnter:a.func,onMouseLeave:a.func,onMouseOut:a.func,onWheel:a.func,touchAction:a.string,eventRecognizerOptions:a.object,clickRadius:a.number,interactiveLayerIds:a.array,getCursor:a.func,controller:a.instanceOf(ce)}),fe=Object.assign({},_t.defaultProps,tt,Kt.defaultProps,{onViewStateChange:null,onViewportChange:null,onClick:null,onNativeClick:null,onHover:null,onContextMenu:function(t){return t.preventDefault()},scrollZoom:!0,dragPan:!0,dragRotate:!0,doubleClickZoom:!0,touchZoom:!0,touchRotate:!1,keyboard:!0,touchAction:"none",eventRecognizerOptions:{},clickRadius:0,getCursor:function(t){var e=t.isDragging,n=t.isHovering;return e?"grabbing":n?"pointer":"grab"}});function Ae(t){if(t.lngLat||!t.offsetCenter)return t;var e=t.offsetCenter,n=e.x,i=e.y;if(!Number.isFinite(n)||!Number.isFinite(i))return t;var r=[n,i];return t.point=r,t.lngLat=this.viewport.unproject(r),t}function pe(t){var e=this.map;if(!e||!t)return null;var n={},i=this.props.clickRadius;this.props.interactiveLayerIds&&(n.layers=this.props.interactiveLayerIds);try{return e.queryRenderedFeatures(i?[[t[0]-i,t[1]+i],[t[0]+i,t[1]-i]]:t,n)}catch(r){return null}}function ge(t,e){var n=this.props[t];n&&n(Ae.call(this,e))}function me(t){ge.call(this,"touch"===t.pointerType?"onTouchStart":"onMouseDown",t)}function ye(t){ge.call(this,"touch"===t.pointerType?"onTouchEnd":"onMouseUp",t)}function ve(t){if(ge.call(this,"touch"===t.pointerType?"onTouchMove":"onMouseMove",t),!this.state.isDragging){var e,n=this.props,i=n.onHover,r=n.interactiveLayerIds;t=Ae.call(this,t),(r||i)&&(e=pe.call(this,t.point));var o=Boolean(r&&e&&e.length>0),s=o&&!this.state.isHovering,a=!o&&this.state.isHovering;(i||s)&&(t.features=e,i&&i(t)),s&&ge.call(this,"onMouseEnter",t),a&&ge.call(this,"onMouseLeave",t),(s||a)&&this.setState({isHovering:o})}}function _e(t){var e=this.props,n=e.onClick,i=e.onNativeClick,r=e.onDblClick,o=e.doubleClickZoom,s=[],a=r||o;switch(t.type){case"anyclick":s.push(i),a||s.push(n);break;case"click":a&&s.push(n)}(s=s.filter(Boolean)).length&&((t=Ae.call(this,t)).features=pe.call(this,t.point),s.forEach((function(e){return e(t)})))}var be=(0,s.forwardRef)((function(t,e){var n=(0,s.useContext)(ct),o=(0,s.useMemo)((function(){return t.controller||new ce}),[]),a=(0,s.useMemo)((function(){return new qt.Q(null,{touchAction:t.touchAction,recognizerOptions:t.eventRecognizerOptions})}),[]),l=(0,s.useRef)(null),c=(0,s.useRef)(null),u=(0,s.useRef)({width:0,height:0,state:{isHovering:!1,isDragging:!1}}).current;u.props=t,u.map=c.current&&c.current.getMap(),u.setState=function(e){u.state=he(he({},u.state),e),l.current.style.cursor=t.getCursor(u.state)};var h,d,f=!0,A=function(t,e,n){if(f)h=[t,e,n];else{var i=u.props,r=i.onViewStateChange,o=i.onViewportChange;r&&r({viewState:t,interactionState:e,oldViewState:n}),o&&o(t,e,n)}};(0,s.useImperativeHandle)(e,(function(){return function(t){return{getMap:t.current&&t.current.getMap,queryRenderedFeatures:t.current&&t.current.queryRenderedFeatures}}(c)}),[]);var p=(0,s.useMemo)((function(){return he(he({},n),{},{eventManager:a,container:n.container||l.current})}),[n,l.current]);p.onViewportChange=A,p.viewport=n.viewport||At(u),u.viewport=p.viewport;var g=function(t){var e=t.isDragging,n=void 0!==e&&e;if(n!==u.state.isDragging&&u.setState({isDragging:n}),f)d=t;else{var i=u.props.onInteractionStateChange;i&&i(t)}},m=function(){u.width&&u.height&&o.setOptions(he(he(he({},u.props),u.props.viewState),{},{isInteractive:Boolean(u.props.onViewStateChange||u.props.onViewportChange),onViewportChange:A,onStateChange:g,eventManager:a,width:u.width,height:u.height}))};(0,s.useEffect)((function(){return a.setElement(l.current),a.on({pointerdown:me.bind(u),pointermove:ve.bind(u),pointerup:ye.bind(u),pointerleave:ge.bind(u,"onMouseOut"),click:_e.bind(u),anyclick:_e.bind(u),dblclick:ge.bind(u,"onDblClick"),wheel:ge.bind(u,"onWheel"),contextmenu:ge.bind(u,"onContextMenu")}),function(){a.destroy()}}),[]),ut((function(){h&&A.apply(void 0,(0,r.Z)(h)),d&&g(d)})),m();var y=t.width,v=t.height,_=t.style,b=t.getCursor,x=(0,s.useMemo)((function(){return he(he({position:"relative"},_),{},{width:y,height:v,cursor:b(u.state)})}),[_,y,v,b,u.state]);return h&&u._child||(u._child=s.createElement(lt,{value:p},s.createElement("div",{key:"event-canvas",ref:l,style:x},s.createElement(_t,(0,i.Z)({},t,{width:"100%",height:"100%",style:null,onResize:function(t){var e=t.width,n=t.height;u.width=e,u.height=n,m(),u.props.onResize({width:e,height:n})},ref:c}))))),f=!1,u._child}));be.supported=_t.supported,be.propTypes=de,be.defaultProps=fe;var xe=n(33940);function we(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!we(t[n],e[n]))return!1;return!0}if(Array.isArray(e))return!1;if("object"===(0,xe.Z)(t)&&"object"===(0,xe.Z)(e)){var i=Object.keys(t),r=Object.keys(e);if(i.length!==r.length)return!1;for(var o=0,s=i;o<s.length;o++){var a=s[o];if(!e.hasOwnProperty(a))return!1;if(!we(t[a],e[a]))return!1}return!0}return!1}function Ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var Be={type:a.string.isRequired,id:a.string},Ee=0;function Te(t,e,n){if(t&&t.style&&t.style._loaded){var i=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ce(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},n);return delete i.id,delete i.children,t.addSource(e,i),t.getSource(e)}return null}function Se(t){var e=(0,s.useContext)(ct),n=(0,s.useRef)({id:t.id,type:t.type}),i=(0,s.useState)(0),r=(0,l.Z)(i,2)[1],o=(0,s.useMemo)((function(){return t.id||"jsx-source-".concat(Ee++)}),[]),a=e.map;(0,s.useEffect)((function(){if(a){var t=function(){return r((function(t){return t+1}))};return a.on("styledata",t),function(){a.off("styledata",t),requestAnimationFrame((function(){a.style&&a.style._loaded&&a.getSource(o)&&a.removeSource(o)}))}}}),[a,o]);var c=a&&a.style&&a.getSource(o);return c?function(t,e,n){X(e.id===n.id,"source id changed"),X(e.type===n.type,"source type changed");var i="",r=0;for(var o in e)"children"===o||"id"===o||we(n[o],e[o])||(i=o,r++);if(r){var s=e.type;if("geojson"===s)t.setData(e.data);else if("image"===s)t.updateImage({url:e.url,coordinates:e.coordinates});else if("canvas"!==s&&"video"!==s||1!==r||"coordinates"!==i)if("vector"===s&&t.setUrl)switch(i){case"url":t.setUrl(e.url);break;case"tiles":t.setTiles(e.tiles)}else console.warn("Unable to update <Source> prop: ".concat(i));else t.setCoordinates(e.coordinates)}}(c,t,n.current):c=Te(a,o,t),n.current=t,c&&s.Children.map(t.children,(function(t){return t&&(0,s.cloneElement)(t,{source:o})}))||null}Se.propTypes=Be;var Me=n(53782);function Ie(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Pe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ie(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var De={type:a.oneOf(["fill","line","symbol","circle","fill-extrusion","raster","background","heatmap","hillshade"]).isRequired,id:a.string,source:a.string,beforeId:a.string};function Fe(t,e,n,i){X(n.id===i.id,"layer id changed"),X(n.type===i.type,"layer type changed");try{!function(t,e,n,i){var r=n.layout,o=void 0===r?{}:r,s=n.paint,a=void 0===s?{}:s,l=n.filter,c=n.minzoom,u=n.maxzoom,h=n.beforeId,d=(0,Me.Z)(n,["layout","paint","filter","minzoom","maxzoom","beforeId"]);if(h!==i.beforeId&&t.moveLayer(e,h),o!==i.layout){var f=i.layout||{};for(var A in o)we(o[A],f[A])||t.setLayoutProperty(e,A,o[A]);for(var p in f)o.hasOwnProperty(p)||t.setLayoutProperty(e,p,void 0)}if(a!==i.paint){var g=i.paint||{};for(var m in a)we(a[m],g[m])||t.setPaintProperty(e,m,a[m]);for(var y in g)a.hasOwnProperty(y)||t.setPaintProperty(e,y,void 0)}for(var v in we(l,i.filter)||t.setFilter(e,l),c===i.minzoom&&u===i.maxzoom||t.setLayerZoomRange(e,c,u),d)we(d[v],i[v])||t.setLayerProperty(e,v,d[v])}(t,e,n,i)}catch(r){console.warn(r)}}var Le=0;function Oe(t){var e=(0,s.useContext)(ct),n=(0,s.useRef)({id:t.id,type:t.type}),i=(0,s.useState)(0),r=(0,l.Z)(i,2)[1],o=(0,s.useMemo)((function(){return t.id||"jsx-layer-".concat(Le++)}),[]),a=e.map;return(0,s.useEffect)((function(){if(a){var t=function(){return r((function(t){return t+1}))};return a.on("styledata",t),function(){a.off("styledata",t),a.style&&a.style._loaded&&a.removeLayer(o)}}}),[a]),a&&a.style&&a.getLayer(o)?Fe(a,o,t,n.current):function(t,e,n){if(t.style&&t.style._loaded){var i=Pe(Pe({},n),{},{id:e});delete i.beforeId,t.addLayer(i,n.beforeId)}}(a,o,t),n.current=t,null}Oe.propTypes=De;var Re={captureScroll:!1,captureDrag:!0,captureClick:!0,captureDoubleClick:!0,capturePointerMove:!1},ke={captureScroll:a.bool,captureDrag:a.bool,captureClick:a.bool,captureDoubleClick:a.bool,capturePointerMove:a.bool};function Ue(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,s.useContext)(ct),n=(0,s.useRef)(null),i=(0,s.useRef)({props:t,state:{},context:e,containerRef:n}).current;return i.props=t,i.context=e,(0,s.useEffect)((function(){return function(t){var e=t.containerRef.current,n=t.context.eventManager;if(e&&n){var i={wheel:function(e){var n=t.props;n.captureScroll&&e.stopPropagation(),n.onScroll&&n.onScroll(e,t)},panstart:function(e){var n=t.props;n.captureDrag&&e.stopPropagation(),n.onDragStart&&n.onDragStart(e,t)},anyclick:function(e){var n=t.props;n.captureClick&&e.stopPropagation(),n.onNativeClick&&n.onNativeClick(e,t)},click:function(e){var n=t.props;n.captureClick&&e.stopPropagation(),n.onClick&&n.onClick(e,t)},dblclick:function(e){var n=t.props;n.captureDoubleClick&&e.stopPropagation(),n.onDoubleClick&&n.onDoubleClick(e,t)},pointermove:function(e){var n=t.props;n.capturePointerMove&&e.stopPropagation(),n.onPointerMove&&n.onPointerMove(e,t)}};return n.watch(i,e),function(){n.off(i)}}}(i)}),[e.eventManager]),i}function ze(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=(0,Tt.Z)(t);if(e){var r=(0,Tt.Z)(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return(0,Et.Z)(this,n)}}function Ge(t){var e=t.instance,n=Ue(t),i=n.context,r=n.containerRef;return e._context=i,e._containerRef=r,e._render()}var Ne=function(t){(0,Bt.Z)(n,t);var e=ze(n);function n(){var t;(0,D.Z)(this,n);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return t=e.call.apply(e,[this].concat(r)),(0,o.Z)((0,Ct.Z)(t),"_context",{}),(0,o.Z)((0,Ct.Z)(t),"_containerRef",(0,s.createRef)()),(0,o.Z)((0,Ct.Z)(t),"_onScroll",(function(t){})),(0,o.Z)((0,Ct.Z)(t),"_onDragStart",(function(t){})),(0,o.Z)((0,Ct.Z)(t),"_onDblClick",(function(t){})),(0,o.Z)((0,Ct.Z)(t),"_onClick",(function(t){})),(0,o.Z)((0,Ct.Z)(t),"_onPointerMove",(function(t){})),t}return(0,F.Z)(n,[{key:"_render",value:function(){throw new Error("_render() not implemented")}},{key:"render",value:function(){return s.createElement(Ge,(0,i.Z)({instance:this},this.props,{onScroll:this._onScroll,onDragStart:this._onDragStart,onDblClick:this._onDblClick,onClick:this._onClick,onPointerMove:this._onPointerMove}))}}]),n}(s.PureComponent);function Ze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function je(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ze(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}(0,o.Z)(Ne,"propTypes",ke),(0,o.Z)(Ne,"defaultProps",Re);var Ve=Object.assign({},ke,{draggable:a.bool,onDrag:a.func,onDragEnd:a.func,onDragStart:a.func,offsetLeft:a.number,offsetTop:a.number}),He=Object.assign({},Re,{draggable:!1,offsetLeft:0,offsetTop:0});function Je(t){var e=t.offsetCenter;return[e.x,e.y]}function We(t,e,n,i){var r=t[0]+e[0]-n.offsetLeft,o=t[1]+e[1]-n.offsetTop;return i.viewport.unproject([r,o])}function Qe(t,e){var n=e.props,i=e.callbacks,r=e.state,o=e.context,s=e.containerRef;if(n.draggable){t.stopPropagation();var a=Je(t),l=function(t,e){var n=t.center,i=n.x,r=n.y;if(e){var o=e.getBoundingClientRect();return[o.left-i,o.top-r]}return null}(t,s.current);if(r.setDragPos(a),r.setDragOffset(l),i.onDragStart&&l){var c=Object.assign({},t);c.lngLat=We(a,l,n,o),i.onDragStart(c)}}}function Ke(t){var e=t.context.eventManager;if(e&&t.state.dragPos){var n={panmove:function(e){return function(t,e){var n=e.props,i=e.callbacks,r=e.state,o=e.context;t.stopPropagation();var s=Je(t);r.setDragPos(s);var a=r.dragOffset;if(i.onDrag&&a){var l=Object.assign({},t);l.lngLat=We(s,a,n,o),i.onDrag(l)}}(e,t)},panend:function(e){return function(t,e){var n=e.props,i=e.callbacks,r=e.state,o=e.context;t.stopPropagation();var s=r.dragPos,a=r.dragOffset;if(r.setDragPos(null),r.setDragOffset(null),i.onDragEnd&&s&&a){var l=Object.assign({},t);l.lngLat=We(s,a,n,o),i.onDragEnd(l)}}(e,t)},pancancel:function(e){return function(t,e){var n=e.state;t.stopPropagation(),n.setDragPos(null),n.setDragOffset(null)}(e,t)}};return e.watch(n),function(){e.off(n)}}}var qe="undefined"!==typeof window&&window.devicePixelRatio||1,Xe=function(t){return Math.round(t*qe)/qe},Ye=function(t,e){if(null===t)return e;var n="x"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x")?t.offsetWidth:t.offsetHeight;return Xe(e/100*n)/n*100};function $e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var tn=Object.assign({},Ve,{className:a.string,longitude:a.number.isRequired,latitude:a.number.isRequired,style:a.object}),en=Object.assign({},He,{className:""});function nn(t){var e=function(t){var e=(0,s.useState)(null),n=(0,l.Z)(e,2),i=n[0],r=n[1],o=(0,s.useState)(null),a=(0,l.Z)(o,2),c=a[0],u=a[1],h=Ue(je(je({},t),{},{onDragStart:Qe}));return h.callbacks=t,h.state.dragPos=i,h.state.setDragPos=r,h.state.dragOffset=c,h.state.setDragOffset=u,(0,s.useEffect)((function(){return Ke(h)}),[h.context.eventManager,Boolean(i)]),h}(t),n=e.state,i=e.containerRef,r=t.children,a=t.className,c=t.draggable,u=t.style,h=n.dragPos,d=function(t){var e=t.props,n=t.state,i=t.context,r=e.longitude,o=e.latitude,s=e.offsetLeft,a=e.offsetTop,c=n.dragPos,u=n.dragOffset;if(c&&u)return[c[0]+u[0],c[1]+u[1]];var h=i.viewport.project([r,o]),d=(0,l.Z)(h,2),f=d[0],A=d[1];return[f+=s,A+=a]}(e),f=(0,l.Z)(d,2),A=f[0],p=f[1],g="translate(".concat(Xe(A),"px, ").concat(Xe(p),"px)"),m=c?h?"grabbing":"grab":"auto",y=(0,s.useMemo)((function(){var t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$e(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute",left:0,top:0,transform:g,cursor:m},u);return s.createElement("div",{className:"mapboxgl-marker ".concat(a),ref:e.containerRef,style:t},r)}),[r,a]),v=i.current;return v&&(v.style.transform=g,v.style.cursor=m),y}nn.defaultProps=en,nn.propTypes=tn;s.memo(nn);var rn={top:{x:.5,y:0},"top-left":{x:0,y:0},"top-right":{x:1,y:0},bottom:{x:.5,y:1},"bottom-left":{x:0,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5}},on=Object.keys(rn);var sn=Object.assign({},ke,{className:a.string,longitude:a.number.isRequired,latitude:a.number.isRequired,altitude:a.number,offsetLeft:a.number,offsetTop:a.number,tipSize:a.number,closeButton:a.bool,closeOnClick:a.bool,anchor:a.oneOf(Object.keys(rn)),dynamicPosition:a.bool,sortByDepth:a.bool,onClose:a.func}),an=Object.assign({},Re,{className:"",altitude:0,offsetLeft:0,offsetTop:0,tipSize:10,anchor:"bottom",dynamicPosition:!0,sortByDepth:!1,closeButton:!0,closeOnClick:!0,onClose:function(){}});function ln(t,e,n,i){var r=(0,l.Z)(i,2),o=r[0],s=r[1],a=t.anchor,c=t.dynamicPosition,u=t.tipSize;return n&&c?function(t){var e=t.x,n=t.y,i=t.width,r=t.height,o=t.selfWidth,s=t.selfHeight,a=t.anchor,l=t.padding,c=void 0===l?0:l,u=rn[a],h=u.x,d=u.y,f=n-d*s,A=f+s,p=Math.max(0,c-f)+Math.max(0,A-r+c);if(p>0){var g=d,m=p;for(d=0;d<=1;d+=.5)A=(f=n-d*s)+s,(p=Math.max(0,c-f)+Math.max(0,A-r+c))<m&&(m=p,g=d);d=g}var y=.5;.5===d&&(h=Math.floor(h),y=1);var v=e-h*o,_=v+o,b=Math.max(0,c-v)+Math.max(0,_-i+c);if(b>0){var x=h,w=b;for(h=0;h<=1;h+=y)_=(v=e-h*o)+o,(b=Math.max(0,c-v)+Math.max(0,_-i+c))<w&&(w=b,x=h);h=x}return on.find((function(t){var e=rn[t];return e.x===h&&e.y===d}))||a}({x:o,y:s,anchor:a,padding:u,width:e.width,height:e.height,selfWidth:n.clientWidth,selfHeight:n.clientHeight}):a}function cn(t){var e=(0,s.useRef)(null),n=Ue(t),i=n.context,r=n.containerRef,o=(0,s.useState)(!1),a=(0,l.Z)(o,2)[1];(0,s.useEffect)((function(){a(!0)}),[e.current]),(0,s.useEffect)((function(){if(i.eventManager&&t.closeOnClick){var e=function(){return n.props.onClose()};return i.eventManager.on("anyclick",e),function(){i.eventManager.off("anyclick",e)}}}),[i.eventManager,t.closeOnClick]);var c=i.viewport,u=t.className,h=t.longitude,d=t.latitude,f=t.altitude,A=t.tipSize,p=t.closeButton,g=t.children,m=c.project([h,d,f]),y=ln(t,c,e.current,m),v=function(t,e,n,i,r){var o=(0,l.Z)(i,3),s=o[0],a=o[1],c=o[2],u=t.offsetLeft,h=t.offsetTop,d=t.sortByDepth,f=rn[r],A=s+u,p=a+h,g=Ye(n,100*-f.x),m=Ye(n,100*-f.y,"y"),y={position:"absolute",transform:"\n      translate(".concat(g,"%, ").concat(m,"%)\n      translate(").concat(Xe(A),"px, ").concat(Xe(p),"px)\n    "),display:void 0,zIndex:void 0};return d?(c>1||c<-1||s<0||s>e.width||a<0||a>e.height?y.display="none":y.zIndex=Math.floor((1-c)/2*1e5),y):y}(t,c,r.current,m,y),_=(0,s.useCallback)((function(t){n.props.onClose();var e=n.context.eventManager;e&&e.once("click",(function(t){return t.stopPropagation()}),t.target)}),[]);return s.createElement("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-".concat(y," ").concat(u),style:v,ref:r},s.createElement("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:A}}),s.createElement("div",{key:"content",ref:e,className:"mapboxgl-popup-content"},p&&s.createElement("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button",onClick:_},"\xd7"),g))}cn.propTypes=sn,cn.defaultProps=an;s.memo(cn);function un(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var hn=Object.assign({},ke,{toggleLabel:a.string,className:a.string,style:a.object,compact:a.bool,customAttribution:a.oneOfType([a.string,a.arrayOf(a.string)])}),dn=Object.assign({},Re,{className:"",toggleLabel:"Toggle Attribution"});function fn(t){var e=Ue(t),n=e.context,i=e.containerRef,r=(0,s.useRef)(null),a=(0,s.useState)(!1),c=(0,l.Z)(a,2),u=c[0],h=c[1];(0,s.useEffect)((function(){var e;return n.map&&(e=function(t,e,n,i){var r=new(J().AttributionControl)(t);return r._map=e,r._container=n,r._innerContainer=i,r._updateAttributions(),r._updateEditLink(),e.on("styledata",r._updateData),e.on("sourcedata",r._updateData),r}({customAttribution:t.customAttribution},n.map,i.current,r.current)),function(){return e&&function(t){t._map.off("styledata",t._updateData),t._map.off("sourcedata",t._updateData)}(e)}}),[n.map]);var d=void 0===t.compact?n.viewport.width<=640:t.compact;(0,s.useEffect)((function(){!d&&u&&h(!1)}),[d]);var f=(0,s.useCallback)((function(){return h((function(t){return!t}))}),[]),A=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?un(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):un(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:A,className:t.className},s.createElement("div",{ref:i,"aria-pressed":u,className:"mapboxgl-ctrl mapboxgl-ctrl-attrib ".concat(d?"mapboxgl-compact":""," ").concat(u?"mapboxgl-compact-show":"")},s.createElement("button",{type:"button",className:"mapboxgl-ctrl-attrib-button",title:t.toggleLabel,onClick:f}),s.createElement("div",{ref:r,className:"mapboxgl-ctrl-attrib-inner",role:"list"})))}fn.propTypes=hn,fn.defaultProps=dn;s.memo(fn);function An(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var pn=Object.assign({},ke,{className:a.string,style:a.object,container:a.object,label:a.string}),gn=Object.assign({},Re,{className:"",container:null,label:"Toggle fullscreen"});function mn(t){var e=Ue(t),n=e.context,i=e.containerRef,r=(0,s.useState)(!1),a=(0,l.Z)(r,2),c=a[0],u=a[1],h=(0,s.useState)(!1),d=(0,l.Z)(h,2),f=d[0],A=d[1],p=(0,s.useState)(null),g=(0,l.Z)(p,2),m=g[0],y=g[1];(0,s.useEffect)((function(){var t=new(J().FullscreenControl);y(t),A(t._checkFullscreenSupport());var e=function(){var e=!t._fullscreen;t._fullscreen=e,u(e)};return L.addEventListener(t._fullscreenchange,e),function(){L.removeEventListener(t._fullscreenchange,e)}}),[]);var v=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?An(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);if(!f)return null;var _=t.className,b=t.label,x=c?"shrink":"fullscreen";return s.createElement("div",{style:v,className:_},s.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:i},s.createElement("button",{key:x,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(x),type:"button",title:b,onClick:function(){m&&(m._container=t.container||n.container,m._onClickFullscreen())}},s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))))}mn.propTypes=pn,mn.defaultProps=gn;s.memo(mn);var yn;function vn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var _n=function(){},bn=Object.assign({},ke,{className:a.string,style:a.object,label:a.string,disabledLabel:a.string,auto:a.bool,positionOptions:a.object,fitBoundsOptions:a.object,trackUserLocation:a.bool,showUserLocation:a.bool,showAccuracyCircle:a.bool,showUserHeading:a.bool,onViewStateChange:a.func,onViewportChange:a.func,onGeolocate:a.func}),xn=Object.assign({},Re,{className:"",label:"Find My Location",disabledLabel:"Location Not Available",auto:!1,positionOptions:{enableHighAccuracy:!1,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0,showUserHeading:!1,showAccuracyCircle:!0,onGeolocate:function(){}});function wn(t,e){var n=e.context,i=e.props,r=function(t){var e=new(J().LngLat)(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=e.toBounds(n);return[[i._ne.lng,i._ne.lat],[i._sw.lng,i._sw.lat]]}(t),o=n.viewport.fitBounds(r,i.fitBoundsOptions),s=o.longitude,a=o.latitude,l=o.zoom,c=Object.assign({},n.viewport,{longitude:s,latitude:a,zoom:l}),u=new rt(c),h=Object.assign({},u.getViewportProps(),te),d=i.onViewportChange||n.onViewportChange||_n;(i.onViewStateChange||n.onViewStateChange||_n)({viewState:h}),d(h)}function Cn(t){var e=Ue(t),n=e.context,i=e.containerRef,r=(0,s.useRef)(null),a=(0,s.useState)(null),c=(0,l.Z)(a,2),u=c[0],h=c[1],d=(0,s.useState)(!1),f=(0,l.Z)(d,2),A=f[0],p=f[1];(0,s.useEffect)((function(){var i;return n.map&&(void 0!==yn?Promise.resolve(yn):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then((function(t){return yn="denied"!==t.state})):(yn=Boolean(window.navigator.geolocation),Promise.resolve(yn))).then((function(o){p(o),r.current&&(i=function(t,e,n){var i=new(J().GeolocateControl)(e);i._container=L.createElement("div"),i._map={on:function(){},_getUIString:function(){return""}},i._setupUI(!0),i._map=t.map,i._geolocateButton=n;var r=t.eventManager;return i.options.trackUserLocation&&r&&r.on("panstart",(function(){"ACTIVE_LOCK"===i._watchState&&(i._watchState="BACKGROUND",n.classList.add("mapboxgl-ctrl-geolocate-background"),n.classList.remove("mapboxgl-ctrl-geolocate-active"))})),i.on("geolocate",e.onGeolocate),i}(n,t,r.current),i._updateCamera=function(t){return wn(t,e)},h(i))})),function(){i&&i._clearWatch()}}),[n.map]);var g=(0,s.useCallback)((function(){u&&(u.options=e.props,u.trigger())}),[u]);(0,s.useEffect)((function(){t.auto&&g()}),[u,t.auto]),(0,s.useEffect)((function(){u&&u._onZoom()}),[n.viewport.zoom]);var m=t.className,y=t.label,v=t.disabledLabel,_=t.trackUserLocation,b=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vn(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:b,className:m},s.createElement("div",{key:"geolocate-control",className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:i},s.createElement("button",{key:"geolocate",className:"mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",ref:r,disabled:!A,"aria-pressed":!_,type:"button",title:A?y:v,"aria-label":A?y:v,onClick:g},s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))))}Cn.propTypes=bn,Cn.defaultProps=xn;s.memo(Cn);function Bn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var En=function(){},Tn=Object.assign({},ke,{className:a.string,style:a.object,onViewStateChange:a.func,onViewportChange:a.func,showCompass:a.bool,showZoom:a.bool,zoomInLabel:a.string,zoomOutLabel:a.string,compassLabel:a.string}),Sn=Object.assign({},Re,{className:"",showCompass:!0,showZoom:!0,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",compassLabel:"Reset North"}),Mn=1,In=2;function Pn(t){return function(t,e){for(var n=(t||"").split(".").map(Number),i=(e||"").split(".").map(Number),r=0;r<3;r++){var o=n[r]||0,s=i[r]||0;if(o<s)return-1;if(o>s)return 1}return 0}(t,"1.6.0")>=0?In:Mn}function Dn(t,e,n){var i=t.viewport,r=new rt(Object.assign({},i,n)),o=Object.assign({},r.getViewportProps(),te),s=e.onViewportChange||t.onViewportChange||En;(e.onViewStateChange||t.onViewStateChange||En)({viewState:o}),s(o)}function Fn(t,e,n,i){return s.createElement("button",{key:t,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(t),type:"button",title:e,onClick:n},i||s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}function Ln(t){var e=Ue(t),n=e.context,i=e.containerRef,r=t.className,a=t.showCompass,l=t.showZoom,c=t.zoomInLabel,u=t.zoomOutLabel,h=t.compassLabel,d=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bn(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:d,className:r},s.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:i},l&&Fn("zoom-in",c,(function(){Dn(n,t,{zoom:n.viewport.zoom+1})})),l&&Fn("zoom-out",u,(function(){Dn(n,t,{zoom:n.viewport.zoom-1})})),a&&Fn("compass",h,(function(){Dn(n,t,{bearing:0,pitch:0})}),function(t){var e=(0,s.useMemo)((function(){return t.map?Pn(t.map.version):In}),[t.map]),n=t.viewport.bearing,i={transform:"rotate(".concat(-n,"deg)")};return e===In?s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true",style:i}):s.createElement("span",{className:"mapboxgl-ctrl-compass-arrow",style:i})}(n))))}Ln.propTypes=Tn,Ln.defaultProps=Sn;const On=s.memo(Ln);function Rn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var kn=Object.assign({},ke,{className:a.string,style:a.object,maxWidth:a.number,unit:a.oneOf(["imperial","metric","nautical"])}),Un=Object.assign({},Re,{className:"",maxWidth:100,unit:"metric"});function zn(t){var e=Ue(t),n=e.context,i=e.containerRef,r=(0,s.useState)(null),a=(0,l.Z)(r,2),c=a[0],u=a[1];(0,s.useEffect)((function(){if(n.map){var t=new(J().ScaleControl);t._map=n.map,t._container=i.current,u(t)}}),[n.map]),c&&(c.options=t,c._onMove&&c._onMove());var h=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rn(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:h,className:t.className},s.createElement("div",{ref:i,className:"mapboxgl-ctrl mapboxgl-ctrl-scale"}))}zn.propTypes=kn,zn.defaultProps=Un;s.memo(zn);var Gn="undefined"!==typeof window&&window.devicePixelRatio||1,Nn=Object.assign({},ke,{redraw:a.func.isRequired});function Zn(t){var e=Ue(t),n=e.context,i=e.containerRef,r=(0,s.useState)(null),o=(0,l.Z)(r,2),a=o[0],c=o[1];(0,s.useEffect)((function(){c(i.current.getContext("2d"))}),[]);var u=n.viewport,h=n.isDragging;return a&&(a.save(),a.scale(Gn,Gn),t.redraw({width:u.width,height:u.height,ctx:a,isDragging:h,project:u.project,unproject:u.unproject}),a.restore()),s.createElement("canvas",{ref:i,width:u.width*Gn,height:u.height*Gn,style:{width:"".concat(u.width,"px"),height:"".concat(u.height,"px"),position:"absolute",left:0,top:0}})}Zn.propTypes=Nn,Zn.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1};function jn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var Vn=Object.assign({},ke,{redraw:a.func.isRequired,style:a.object});function Hn(t){var e=Ue(t),n=e.context,i=e.containerRef,r=n.viewport,a=n.isDragging,l=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jn(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute",left:0,top:0,width:r.width,height:r.height},t.style);return s.createElement("div",{ref:i,style:l},t.redraw({width:r.width,height:r.height,isDragging:a,project:r.project,unproject:r.unproject}))}Hn.propTypes=Vn,Hn.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1};function Jn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var Wn=Object.assign({},ke,{redraw:a.func.isRequired,style:a.object});function Qn(t){var e=Ue(t),n=e.context,i=e.containerRef,r=n.viewport,a=n.isDragging,l=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jn(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute",left:0,top:0},t.style);return s.createElement("svg",{width:r.width,height:r.height,ref:i,style:l},t.redraw({width:r.width,height:r.height,isDragging:a,project:r.project,unproject:r.unproject}))}Qn.propTypes=Wn,Qn.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1};J()&&J().setRTLTextPlugin},99967:t=>{const e=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const i={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};t.exports=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r=Object.assign({},i,r),!t||"string"!==typeof t)return t;let o=t.trim();if(void 0!==r.skipLike&&r.skipLike.test(o))return t;if(r.hex&&e.test(o))return Number.parseInt(o,16);{const e=n.exec(o);if(e){const n=e[1],i=e[2];let s=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t;return t}(e[3]);const a=e[4]||e[6];if(!r.leadingZeros&&i.length>0&&n&&"."!==o[2])return t;if(!r.leadingZeros&&i.length>0&&!n&&"."!==o[1])return t;{const e=Number(o),l=""+e;return-1!==l.search(/[eE]/)||a?r.eNotation?e:t:-1!==o.indexOf(".")?"0"===l&&""===s||l===s||n&&l==="-"+s?e:t:i?s===l||n+s===l?e:t:o===l||o===n+l?e:t}}return t}}},47131:t=>{var e=Math.PI/180,n=180/Math.PI;function i(t){var e=r(t[0]+1,t[2]);return[r(t[0],t[2]),o(t[1]+1,t[2]),e,o(t[1],t[2])]}function r(t,e){return t/Math.pow(2,e)*360-180}function o(t,e){var i=Math.PI-2*Math.PI*t/Math.pow(2,e);return n*Math.atan(.5*(Math.exp(i)-Math.exp(-i)))}function s(t,e,n){var i=d(t,e,n);return i[0]=Math.floor(i[0]),i[1]=Math.floor(i[1]),i}function a(t){return[[2*t[0],2*t[1],t[2]+1],[2*t[0]+1,2*t[1],t[2]+1],[2*t[0]+1,2*t[1]+1,t[2]+1],[2*t[0],2*t[1]+1,t[2]+1]]}function l(t){return t[0]%2===0&&t[1]%2===0?[t[0]/2,t[1]/2,t[2]-1]:t[0]%2===0&&!t[1]%2===0?[t[0]/2,(t[1]-1)/2,t[2]-1]:!t[0]%2===0&&t[1]%2===0?[(t[0]-1)/2,t[1]/2,t[2]-1]:[(t[0]-1)/2,(t[1]-1)/2,t[2]-1]}function c(t){return a(l(t))}function u(t,e){for(var n=0;n<t.length;n++)if(h(t[n],e))return!0;return!1}function h(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function d(t,n,i){var r=Math.sin(n*e),o=Math.pow(2,i);return[o*(t/360+.5),o*(.5-.25*Math.log((1+r)/(1-r))/Math.PI),i]}t.exports={tileToGeoJSON:function(t){var e=i(t);return{type:"Polygon",coordinates:[[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]],[e[0],e[1]]]]}},tileToBBOX:i,getChildren:a,getParent:l,getSiblings:c,hasTile:u,hasSiblings:function(t,e){for(var n=c(t),i=0;i<n.length;i++)if(!u(e,n[i]))return!1;return!0},tilesEqual:h,tileToQuadkey:function(t){for(var e="",n=t[2];n>0;n--){var i=0,r=1<<n-1;0!==(t[0]&r)&&i++,0!==(t[1]&r)&&(i+=2),e+=i.toString()}return e},quadkeyToTile:function(t){for(var e=0,n=0,i=t.length,r=i;r>0;r--){var o=1<<r-1;switch(t[i-r]){case"0":break;case"1":e|=o;break;case"2":n|=o;break;case"3":e|=o,n|=o}}return[e,n,i]},pointToTile:s,bboxToTile:function(t){var e=s(t[0],t[1],32),n=s(t[2],t[3],32),i=[e[0],e[1],n[0],n[1]],r=function(t){for(var e=28,n=0;n<e;n++){var i=1<<32-(n+1);if((t[0]&i)!=(t[2]&i)||(t[1]&i)!=(t[3]&i))return n}return e}(i);return 0===r?[0,0,0]:[i[0]>>>32-r,i[1]>>>32-r,r]},pointToTileFraction:d}},79259:()=>{},22951:(t,e,n)=>{"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,{Z:()=>i})},91976:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var i=n(55217);function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(0,i.Z)(r.key),r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}},27597:(t,e,n)=>{"use strict";function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}n.d(e,{Z:()=>i})},67591:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var i=n(6983);function r(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&(0,i.Z)(t,e)}},99492:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var i=n(33940),r=n(47169);function o(t,e){if(e&&("object"===(0,i.Z)(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,r.Z)(t)}},65809:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var i=n(64013);function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(t,e)||(0,i.Z)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}}]);